1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 #include <vcl/graph.hxx>
24 #include <vcl/bmpacc.hxx>
30 GLOBAL_HEADER_READING
,
47 class GIFLZWDecompressor
;
51 class GIFReader
: public GraphicReader
57 BitmapPalette aGPalette
;
58 BitmapPalette aLPalette
;
61 GIFLZWDecompressor
* pDecomp
;
62 BitmapWriteAccess
* pAcc8
;
63 BitmapWriteAccess
* pAcc1
;
66 sal_uInt32 nLogWidth100
;
67 sal_uInt32 nLogHeight100
;
69 sal_uInt16 nGlobalWidth
; // maximale Bildbreite aus Header
70 sal_uInt16 nGlobalHeight
; // maximale Bildhoehe aus Header
71 sal_uInt16 nImageWidth
; // maximale Bildbreite aus Header
72 sal_uInt16 nImageHeight
; // maximale Bildhoehe aus Header
73 sal_uInt16 nImagePosX
;
74 sal_uInt16 nImagePosY
;
75 sal_uInt16 nImageX
; // maximale Bildbreite aus Header
76 sal_uInt16 nImageY
; // maximale Bildhoehe aus Header
77 sal_uInt16 nLastImageY
;
78 sal_uInt16 nLastInterCount
;
82 sal_Bool bGCTransparent
; // Ob das Bild Transparent ist, wenn ja:
84 sal_Bool bOverreadBlock
;
85 sal_Bool bImGraphicReady
;
86 sal_Bool bGlobalPalette
;
87 sal_uInt8 nBackgroundColor
; // Hintergrundfarbe
88 sal_uInt8 nGCTransparentIndex
; // Pixel von diesem Index sind durchsichtig
89 sal_uInt8 nGCDisposalMethod
; // 'Disposal Method' (siehe GIF-Doku)
90 sal_uInt8 cTransIndex1
;
91 sal_uInt8 cNonTransIndex1
;
93 void ReadPaletteEntries( BitmapPalette
* pPal
, sal_uLong nCount
);
94 void ClearImageExtensions();
95 sal_Bool
CreateBitmaps( long nWidth
, long nHeight
, BitmapPalette
* pPal
, sal_Bool bWatchForBackgroundColor
);
96 sal_Bool
ReadGlobalHeader();
97 sal_Bool
ReadExtension();
98 sal_Bool
ReadLocalHeader();
99 sal_uLong
ReadNextBlock();
100 void FillImages( HPBYTE pBytes
, sal_uLong nCount
);
101 void CreateNewBitmaps();
102 sal_Bool
ProcessGIF();
106 ReadState
ReadGIF( Graphic
& rGraphic
);
107 const Graphic
& GetIntermediateGraphic();
109 GIFReader( SvStream
& rStm
);
110 virtual ~GIFReader();
113 #endif // _GIFPRIVATE
115 sal_Bool
ImportGIF( SvStream
& rStream
, Graphic
& rGraphic
);
117 #endif // _GIFREAD_HXX
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */