fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / FileIO / OSB / OSGOSBImageElement.h
blobc2e72a1503423dfeffffed4b412623012b6e1e83
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2007 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGOSBIMAGEELEMENT_H_
40 #define _OSGOSBIMAGEELEMENT_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGConfig.h"
46 #include "OSGFileIODef.h"
47 #include "OSGOSBCommonElement.h"
48 #include "OSGOSBElementFactoryHelper.h"
50 OSG_BEGIN_NAMESPACE
52 /*! \ingroup GrpFileIOOSB
53 \nohierarchy
56 class OSG_FILEIO_DLLMAPPING OSBImageElement : public OSBCommonElement
58 /*========================== PUBLIC =================================*/
59 public:
60 /*---------------------------------------------------------------------*/
61 /*! \name Types */
62 /*! \{ */
64 typedef OSBCommonElement Inherited;
65 typedef OSBImageElement Self;
67 /*! \} */
68 /*---------------------------------------------------------------------*/
69 /*! \name Constructor */
70 /*! \{ */
72 OSBImageElement(OSBRootElement *root);
74 /*! \} */
75 /*---------------------------------------------------------------------*/
76 /*! \name Destructor */
77 /*! \{ */
79 virtual ~OSBImageElement(void);
81 /*! \} */
82 /*---------------------------------------------------------------------*/
83 /*! \name Reading */
84 /*! \{ */
86 virtual void read (const std::string &typeName);
87 virtual void postRead( void );
89 /*! \} */
90 /*---------------------------------------------------------------------*/
91 /*! \name Writing */
92 /*! \{ */
94 virtual void preWrite(FieldContainer * const);
95 virtual void write (void );
97 /*! \} */
98 /*========================== PRIVATE ================================*/
99 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 */
107 /*! \{ */
109 void readCompressedPixelData(void);
111 /*! \} */
112 /*---------------------------------------------------------------------*/
113 /*! \name Writing Helper Functions */
114 /*! \{ */
116 void writeCompressedPixelData(void);
118 /*! \} */
119 /*---------------------------------------------------------------------*/
121 bool _hasJPEGSupport;
122 UInt16 _version;
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;
134 OSG_END_NAMESPACE
136 #endif /* _OSGOSBIMAGEELEMENT_H_ */