11 #ifndef __TIL_Stitch__
12 #define __TIL_Stitch__
46 virtual const UT_DimRect &dataWindow()
const = 0;
48 virtual bool canRead(
const Scanline *scanline)
const = 0;
51 virtual bool open() = 0;
54 virtual bool readScanline(
int plane,
int xoff,
int scanline,
58 virtual bool close() = 0;
70 virtual const UT_DimRect &dataWindow()
const = 0;
78 virtual bool finishImage();
105 void allocate(
int width,
109 return myPlanes[plane].data(xoff);
113 return myPlanes[plane].data(xoff);
135 bool isValid()
const {
return myFilename !=
nullptr; }
138 const char *myFilename =
nullptr;
149 myOpen.myOptions = options;
150 myOpen.myFormat = fmt;
151 myOpen.myFormatList.
clear();
159 myOpen.myOptions = options;
160 myOpen.myFormat =
nullptr;
161 myOpen.myFormatList = formats;
165 const UT_DimRect &dataWindow()
const override;
166 bool open()
override;
167 bool canRead(
const Scanline *scanline)
const override;
168 bool readScanline(
int plane,
int xoff,
int scanline,
170 bool close()
override;
172 bool isValid()
const {
return myFile.get() !=
nullptr; }
179 virtual void error(
const char *msg)
const;
195 const UT_DimRect &dataWindow()
const override;
197 bool finishImage()
override;
203 virtual bool flushScanlines();
204 virtual void error(
const char *msg)
const;
205 virtual void warning(
const char *msg)
const;
Class to store scanline data.
bool setFile(const char *filename, const IMG_FileParms *options=nullptr, const IMG_Format *fmt=nullptr)
GT_API const UT_StringHolder filename
SYS_FORCE_INLINE void clear()
const uint8 * data(exint xoff) const
TIL_API bool stitch(StitchWriter &w, const UT_Span< TileReader * > &tiles, bool top_down)
Describes the format and layout of a single plane in an image The plane specifies the format and name...
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Convenience class to represent a raster scanline.
Class to read the tile data and write it to an output sink.
UT_Array< const IMG_Plane * > myPlanes
const uint8 * data(int plane, int xoff) const
UT_UniquePtr< uint8[]> myData
IMG_FilePtr stealStream()
UT_Array< IMGScanline > myScanBuffer
UT_Array< const IMG_Format * > myFormatList
uint8 * data(int plane, int xoff)
File options for manipulating image data on load or save. This class allows you to modify the incomin...
const IMG_Plane * plane(int i) const
bool setFile(const char *filename, const UT_Array< const IMG_Format * > &formats, const IMG_FileParms *options=nullptr)
bool process(T &func, UT_WorkBuffer &fullpath, exint fullpath_len, const UT_StringArray &paths, const UT_Array< FS_Stat > &stats)
Utility function to process the contents of the traverse() function.
TIL_API UT_DimRect unionDataWindow(const UT_Span< const TileReader * > &tiles)
GLubyte GLubyte GLubyte GLubyte w
GLenum GLenum GLsizei void * row
const char * getFilename() const
UT_UniquePtr< IMG_File > IMG_FilePtr