00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __IMG_TileFile_H__
00022 #define __IMG_TileFile_H__
00023
00024 #include "IMG_API.h"
00025 #include <UT/UT_PtrArray.h>
00026 #include <UT/UT_IntArray.h>
00027 #include "IMG_TileDevice.h"
00028 #include "IMG_Stat.h"
00029
00030 class IMG_File;
00031
00032 class IMG_API IMG_TileFileMapEntry {
00033 public:
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 IMG_TileFileMapEntry() {}
00045 ~IMG_TileFileMapEntry() {}
00046
00047 int getSourceOffset() const { return mySourceOffset; }
00048 int getSourceSize() const { return mySourceSize; }
00049 int getDestFileIndex() const { return myDestFileIndex; }
00050 int getPlaneIndex() const { return myDestPlane; }
00051 IMG_File *getFile() const { return myDestFile; }
00052 void setupMap(int off, int size,
00053 IMG_File *fp, int findex, int plane)
00054 {
00055 mySourceOffset = off;
00056 mySourceSize = size;
00057 myDestFile = fp;
00058 myDestFileIndex = findex;
00059 myDestPlane = plane;
00060 }
00061
00062 private:
00063 IMG_File *myDestFile;
00064 int mySourceOffset;
00065 int mySourceSize;
00066 int myDestFileIndex;
00067 int myDestPlane;
00068 };
00069
00070 class IMG_API IMG_TileFile : public IMG_TileDevice {
00071 public:
00072 IMG_TileFile();
00073 virtual ~IMG_TileFile();
00074
00075
00076
00077 virtual int open(const IMG_TileOptions &finfo,
00078 int xres, int yres,
00079 int twidth, int theight,
00080 fpreal aspect);
00081 virtual int openMulti(IMG_TileOptionList &flist,
00082 int xres, int yres,
00083 int twidth, int theight,
00084 fpreal aspect);
00085
00086
00087
00088 virtual int writeTile(const void *data,
00089 unsigned x0, unsigned x1,
00090 unsigned y0, unsigned y1);
00091 virtual void checkpoint();
00092 virtual int close();
00093 private:
00094 void prepData();
00095 void growTile(int tx, int ty);
00096
00097 UT_PtrArray<IMG_File *> myFiles;
00098 UT_PtrArray<IMG_TileFileMapEntry *> myPlaneMap;
00099 void *myTile;
00100 int myBPP;
00101 int myTileSize;
00102 };
00103
00104 #endif