00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __IMG_TileRead__
00022 #define __IMG_TileRead__
00023
00024 #include "IMG_API.h"
00025 #include "IMG_Stat.h"
00026 class PXL_Raster;
00027
00028 class IMG_API IMG_TileRead
00029 {
00030 public:
00031
00032
00033 IMG_TileRead(int flip, bool keep_open);
00034 virtual ~IMG_TileRead();
00035
00036
00037
00038
00039 int readImage();
00040
00041 protected:
00042
00043
00044 virtual int readData(void *data, int size, int nelem) = 0;
00045
00046 virtual int openWrite() = 0;
00047 virtual int writeTile(int tx0, int tx1, int ty0, int ty1,
00048 const void *data, int plane = 0) = 0;
00049 virtual int closeWrite() = 0;
00050
00051
00052
00053
00054 virtual void error(const char *message);
00055
00056
00057 void writeTileToRaster(PXL_Raster &raster,
00058 int tx0, int tx1, int ty0, int ty1,
00059 const void *data, int plane);
00060
00061
00062
00063
00064 const IMG_Stat &getStat() const { return myStat; }
00065
00066 private:
00067 void setPlaneFormat(int format, int asize,
00068 IMG_DataType &dtype,
00069 IMG_ColorModel &cmodel);
00070 void growData(int bytes);
00071 void *myData;
00072 int myPoolSize;
00073 int mySwab;
00074 int myFlip;
00075 IMG_Stat myStat;
00076 bool myKeepOpen;
00077 };
00078
00079 #endif