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>
49 GLOBAL_HEADER_READING
,
59 // ------------------------------------------------------------------------
72 class GIFLZWDecompressor
;
76 class GIFReader
: public GraphicReader
82 BitmapPalette aGPalette
;
83 BitmapPalette aLPalette
;
87 GIFLZWDecompressor
* pDecomp
;
88 BitmapWriteAccess
* pAcc8
;
89 BitmapWriteAccess
* pAcc1
;
92 sal_uInt32 nLogWidth100
;
93 sal_uInt32 nLogHeight100
;
95 USHORT nGlobalWidth
; // maximale Bildbreite aus Header
96 USHORT nGlobalHeight
; // maximale Bildhoehe aus Header
97 USHORT nImageWidth
; // maximale Bildbreite aus Header
98 USHORT nImageHeight
; // maximale Bildhoehe aus Header
101 USHORT nImageX
; // maximale Bildbreite aus Header
102 USHORT nImageY
; // maximale Bildhoehe aus Header
104 USHORT nLastInterCount
;
106 GIFAction eActAction
;
108 BOOL bGCTransparent
; // Ob das Bild Transparent ist, wenn ja:
111 BOOL bImGraphicReady
;
113 BYTE nBackgroundColor
; // Hintergrundfarbe
114 BYTE nGCTransparentIndex
; // Pixel von diesem Index sind durchsichtig
115 BYTE nGCDisposalMethod
; // 'Disposal Method' (siehe GIF-Doku)
117 BYTE cNonTransIndex1
;
119 void ReadPaletteEntries( BitmapPalette
* pPal
, ULONG nCount
);
120 void ClearImageExtensions();
121 BOOL
CreateBitmaps( long nWidth
, long nHeight
, BitmapPalette
* pPal
, BOOL bWatchForBackgroundColor
);
122 BOOL
ReadGlobalHeader();
123 BOOL
ReadExtension();
124 BOOL
ReadLocalHeader();
125 ULONG
ReadNextBlock();
126 void FillImages( HPBYTE pBytes
, ULONG nCount
);
127 void CreateNewBitmaps();
132 ReadState
ReadGIF( Graphic
& rGraphic
);
133 const Graphic
& GetIntermediateGraphic();
135 GIFReader( SvStream
& rStm
);
136 virtual ~GIFReader();
139 #endif // _GIFPRIVATE
145 BOOL
ImportGIF( SvStream
& rStream
, Graphic
& rGraphic
);
147 #endif // _GIFREAD_HXX