1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: gifread.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
35 #include <vcl/graph.hxx>
38 #include <vcl/bmpacc.hxx>
54 GLOBAL_HEADER_READING
,
64 // ------------------------------------------------------------------------
77 class GIFLZWDecompressor
;
79 class GIFReader
: public GraphicReader
85 BitmapPalette aGPalette
;
86 BitmapPalette aLPalette
;
90 GIFLZWDecompressor
* pDecomp
;
91 BitmapWriteAccess
* pAcc8
;
92 BitmapWriteAccess
* pAcc1
;
95 sal_uInt32 nLogWidth100
;
96 sal_uInt32 nLogHeight100
;
98 USHORT nGlobalWidth
; // maximale Bildbreite aus Header
99 USHORT nGlobalHeight
; // maximale Bildhoehe aus Header
100 USHORT nImageWidth
; // maximale Bildbreite aus Header
101 USHORT nImageHeight
; // maximale Bildhoehe aus Header
104 USHORT nImageX
; // maximale Bildbreite aus Header
105 USHORT nImageY
; // maximale Bildhoehe aus Header
107 USHORT nLastInterCount
;
109 GIFAction eActAction
;
111 BOOL bGCTransparent
; // Ob das Bild Transparent ist, wenn ja:
114 BOOL bImGraphicReady
;
116 BYTE nBackgroundColor
; // Hintergrundfarbe
117 BYTE nGCTransparentIndex
; // Pixel von diesem Index sind durchsichtig
118 BYTE nGCDisposalMethod
; // 'Disposal Method' (siehe GIF-Doku)
120 BYTE cNonTransIndex1
;
122 void ReadPaletteEntries( BitmapPalette
* pPal
, ULONG nCount
);
123 void ClearImageExtensions();
124 BOOL
CreateBitmaps( long nWidth
, long nHeight
, BitmapPalette
* pPal
, BOOL bWatchForBackgroundColor
);
125 BOOL
ReadGlobalHeader();
126 BOOL
ReadExtension();
127 BOOL
ReadLocalHeader();
128 ULONG
ReadNextBlock();
129 void FillImages( HPBYTE pBytes
, ULONG nCount
);
130 void CreateNewBitmaps();
135 ReadState
ReadGIF( Graphic
& rGraphic
);
136 const Graphic
& GetIntermediateGraphic();
138 GIFReader( SvStream
& rStm
);
139 virtual ~GIFReader();
142 #endif // _GIFPRIVATE
148 BOOL
ImportGIF( SvStream
& rStream
, Graphic
& rGraphic
);
152 #endif // _GIFREAD_HXX