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 .
20 #ifndef INCLUDED_VCL_SOURCE_FILTER_IGIF_GIFREAD_HXX
21 #define INCLUDED_VCL_SOURCE_FILTER_IGIF_GIFREAD_HXX
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
; // maximum imagewidth from header
70 sal_uInt16 nGlobalHeight
; // maximum imageheight from header
71 sal_uInt16 nImageWidth
; // maximum screenwidth from header
72 sal_uInt16 nImageHeight
; // maximum screenheight from header
73 sal_uInt16 nImagePosX
;
74 sal_uInt16 nImagePosY
;
75 sal_uInt16 nImageX
; // maximum screenwidth from header
76 sal_uInt16 nImageY
; // maximum screenheight from header
77 sal_uInt16 nLastImageY
;
78 sal_uInt16 nLastInterCount
;
82 bool bGCTransparent
; // is the image transparant, if yes:
87 sal_uInt8 nBackgroundColor
; // backgroundcolour
88 sal_uInt8 nGCTransparentIndex
; // pixelx of this index are transparant
89 sal_uInt8 nGCDisposalMethod
; // 'Disposal Method' (see GIF docs)
90 sal_uInt8 cTransIndex1
;
91 sal_uInt8 cNonTransIndex1
;
93 void ReadPaletteEntries( BitmapPalette
* pPal
, sal_uLong nCount
);
94 void ClearImageExtensions();
95 bool CreateBitmaps( long nWidth
, long nHeight
, BitmapPalette
* pPal
, bool bWatchForBackgroundColor
);
96 bool ReadGlobalHeader();
98 bool ReadLocalHeader();
99 sal_uLong
ReadNextBlock();
100 void FillImages( HPBYTE pBytes
, sal_uLong nCount
);
101 void CreateNewBitmaps();
106 ReadState
ReadGIF( Graphic
& rGraphic
);
107 const Graphic
& GetIntermediateGraphic();
109 GIFReader( SvStream
& rStm
);
110 virtual ~GIFReader();
113 #endif // _GIFPRIVATE
115 bool ImportGIF( SvStream
& rStream
, Graphic
& rGraphic
);
117 #endif // INCLUDED_VCL_SOURCE_FILTER_IGIF_GIFREAD_HXX
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */