1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2007 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGOSBIMAGEELEMENT_H_
40 #define _OSGOSBIMAGEELEMENT_H_
45 #include "OSGConfig.h"
46 #include "OSGFileIODef.h"
47 #include "OSGOSBCommonElement.h"
48 #include "OSGOSBElementFactoryHelper.h"
52 /*! \ingroup GrpFileIOOSB
56 class OSG_FILEIO_DLLMAPPING OSBImageElement
: public OSBCommonElement
58 /*========================== PUBLIC =================================*/
60 /*---------------------------------------------------------------------*/
64 typedef OSBCommonElement Inherited
;
65 typedef OSBImageElement Self
;
68 /*---------------------------------------------------------------------*/
69 /*! \name Constructor */
72 OSBImageElement(OSBRootElement
*root
);
75 /*---------------------------------------------------------------------*/
76 /*! \name Destructor */
79 virtual ~OSBImageElement(void);
82 /*---------------------------------------------------------------------*/
86 virtual void read (const std::string
&typeName
);
87 virtual void postRead( void );
90 /*---------------------------------------------------------------------*/
94 virtual void preWrite(FieldContainer
* const);
95 virtual void write (void );
98 /*========================== PRIVATE ================================*/
100 /*!\brief prohibit default function (move to 'public' if needed) */
101 OSBImageElement(const OSBImageElement
&source
);
102 /*!\brief prohibit default function (move to 'public' if needed) */
103 void operator =(const OSBImageElement
&source
);
105 /*---------------------------------------------------------------------*/
106 /*! \name Reading Helper Functions */
109 void readCompressedPixelData(void);
112 /*---------------------------------------------------------------------*/
113 /*! \name Writing Helper Functions */
116 void writeCompressedPixelData(void);
119 /*---------------------------------------------------------------------*/
121 bool _hasJPEGSupport
;
124 /*---------------------------------------------------------------------*/
126 static OSBElementRegistrationHelper
<OSBImageElement
> _regHelper
;
128 static const UInt8 FlagPixelDataCompressedMask
= 0x01;
129 static const UInt8 FlagPixelDataCompressed
= 0x01;
130 static const UInt8 FlagPixelDataOutOfLineMask
= 0x02;
131 static const UInt8 FlagPixelDataOutOfLine
= 0x02;
136 #endif /* _OSGOSBIMAGEELEMENT_H_ */