1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 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 _OSGGDALIMAGEFILETYPE_H_
40 #define _OSGGDALIMAGEFILETYPE_H_
45 #include "OSGImageFileIODef.h"
46 #include "OSGImageFileType.h"
48 #include "boost/shared_ptr.hpp"
51 #include "gdal_priv.h"
52 #include "ogr_srs_api.h"
57 class GDALImageFileType
;
59 /*! \ingroup GrpImageFileIOGDAL
60 \ingroup GrpLibOSGImageFileIO
63 class OSG_IMGFILEIO_DLLMAPPING GDALBlockAccessor
: public ImageBlockAccessor
66 /*========================== PUBLIC =================================*/
70 typedef ImageBlockAccessor Inherited
;
72 /*---------------------------------------------------------------------*/
73 /*! \name Destructor */
76 virtual ~GDALBlockAccessor(void);
79 /*---------------------------------------------------------------------*/
80 /*! \name Read/Write */
83 virtual bool isOpen(void);
86 /*---------------------------------------------------------------------*/
87 /*! \name Read/Write */
90 virtual bool readBlockA16(Vec2i vSampleOrigin
,
93 Int32 iTargetSizeBytes
);
95 virtual bool readBlockA16(Vec2i vSampleOrigin
,
98 Int32 iTargetSizeBytes
);
101 /*========================= PROTECTED ===============================*/
106 GDALDataset
*_pDataset
;
107 GDALRasterBand
*_pBand
;
110 std::vector
<Int16
> _vI16Buffer
;
112 /*---------------------------------------------------------------------*/
113 /*! \name Default Constructor */
116 GDALBlockAccessor(void);
119 /*---------------------------------------------------------------------*/
120 /*! \name Read/Write */
123 void open(const Char8
*szFilename
);
126 /*---------------------------------------------------------------------*/
127 /*! \name Read/Write */
131 /*========================== PRIVATE ================================*/
135 friend class GDALImageFileType
;
137 GDALBlockAccessor(const GDALBlockAccessor
&other
);
138 void operator =(const GDALBlockAccessor
&rhs
);
141 /*! \ingroup GrpImageFileIOGDAL
144 typedef boost::shared_ptr
<GDALBlockAccessor
> GDALBlockAccessorPtr
;
146 /*! \brief GDAL File Handler. Used to read/write TIFF files.
147 See \ref PageSystemImage for a detailed description.
149 \ingroup GrpImageFileIOGDAL
150 \ingroup GrpLibOSGImageFileIO
153 class OSG_IMGFILEIO_DLLMAPPING GDALImageFileType
: public ImageFileType
155 /*========================== PUBLIC =================================*/
159 /*---------------------------------------------------------------------*/
160 /*! \name Destructor */
163 virtual ~GDALImageFileType(void);
166 /*---------------------------------------------------------------------*/
167 /*! \name Read/Write */
170 virtual bool read ( Image
*pImage
,
171 const Char8
*fileName
) ;
173 virtual bool write (const Image
*pImage
,
174 const Char8
*fileName
) ;
176 virtual bool validateHeader(const Char8
*fileName
,
180 /*---------------------------------------------------------------------*/
185 virtual ImageBlockAccessorPtr
open(const Char8
*fileName
);
189 /*========================= PROTECTED ===============================*/
193 /*---------------------------------------------------------------------*/
194 /*! \name Default Constructor */
197 GDALImageFileType (const Char8
*mimeType
,
198 const Char8
*suffixArray
[],
199 UInt16 suffixByteCount
,
203 /*---------------------------------------------------------------------*/
207 GDALImageFileType (const GDALImageFileType
&obj
);
208 const GDALImageFileType
&operator =(const GDALImageFileType
&obj
);
211 /*========================== PRIVATE ================================*/
215 typedef ImageFileType Inherited
;
217 static GDALImageFileType _the
;
220 typedef GDALImageFileType
*GDALImageFileTypeP
;
224 #endif // _OSGGDALIMAGEFILETYPE_H_