00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #if !defined(SO_HDR_IMAGERW_H)
00026 #define SO_HDR_IMAGERW_H
00027
00028 #include <Inventor/image/SoRasterImageRW.h>
00029 #include <Inventor/threads/SbThreadMutex.h>
00030
00031
00053 class SoHDRImageRW : public SoRasterImageRW {
00054
00055 SO_IMAGE_RASTER_RW_HEADER()
00056
00057 public:
00058
00062 SoHDRImageRW();
00063
00067 virtual ~SoHDRImageRW();
00068
00072 virtual SbBool open(SoRasterImageIO* rasterImageIO, OpenMode openMode);
00073
00079 virtual SbBool write(SbRasterImage* rasterImage, unsigned int xPos = 0, unsigned int yPos = 0);
00080
00084 virtual SbBool writeFooter();
00085
00091 virtual SbBool read(SbRasterImage* rasterImage, SbBool infoOnly = FALSE);
00098 virtual SbBool isMultipleBufferInverted() const;
00099
00103 virtual SoRasterImageRW::WriteCapability getWriteCapability() const;
00104
00108 virtual SoRasterImageRW::ReadCapability getReadCapability() const;
00109
00110 private:
00111
00112 virtual void createSuffixList();
00113
00114 private:
00116 static SbThreadMutex s_mutex;
00117
00121 static SbBool readHDRIBuffer(FILE* file, unsigned char* scan, int xmax);
00122
00126 static SbBool checkHDRIHeader(FILE* file, int &ymax, int &xmax);
00127
00132 static SbBool writeData(FILE* file, SbRasterImage* rasterImage );
00133
00138 static SbBool writePixels(FILE* file, unsigned char* data, unsigned long size);
00139
00143 static SbBool writePixelsRLE(FILE* file, unsigned char* data, unsigned long size);
00144 };
00145
00146 #endif // SO_HDR_IMAGERW_H
00147