3 * Purpose: TIFF Image Class Loader and Writer
5 /* ==========================================================
6 * CxImageTIF (c) 07/Aug/2001 Davide Pizzolato - www.xdp.it
7 * For conditions of distribution and use, see copyright notice in ximage.h
9 * Special thanks to Troels Knakkergaard for new features, enhancements and bugfixes
11 * Special thanks to Abe <God(dot)bless(at)marihuana(dot)com> for MultiPageTIFF code.
14 * Copyright (c) 1988-1997 Sam Leffler
15 * Copyright (c) 1991-1997 Silicon Graphics, Inc.
16 * ==========================================================
19 #if !defined(__ximatif_h)
24 #if CXIMAGE_SUPPORT_TIF
26 #include "../tiff/tiffio.h"
28 class DLL_EXP CxImageTIF: public CxImage
31 CxImageTIF(): CxImage(CXIMAGE_FORMAT_TIF) {m_tif2=NULL; m_multipage=false; m_pages=0;}
34 TIFF* TIFFOpenEx(CxFile * hFile);
35 void TIFFCloseEx(TIFF* tif);
37 // bool Load(const TCHAR * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_TIF);}
38 // bool Save(const TCHAR * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_TIF);}
39 bool Decode(CxFile * hFile);
40 bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); }
42 #if CXIMAGE_SUPPORT_ENCODE
43 bool Encode(CxFile * hFile, bool bAppend=false);
44 bool Encode(CxFile * hFile, CxImage ** pImages, int pagecount);
45 bool Encode(FILE *hFile, bool bAppend=false) { CxIOFile file(hFile); return Encode(&file,bAppend); }
46 bool Encode(FILE *hFile, CxImage ** pImages, int pagecount)
47 { CxIOFile file(hFile); return Encode(&file, pImages, pagecount); }
48 #endif // CXIMAGE_SUPPORT_ENCODE
51 void TileToStrip(uint8* out, uint8* in, uint32 rows, uint32 cols, int outskew, int inskew);
52 bool EncodeBody(TIFF *m_tif, bool multipage=false, int page=0, int pagecount=0);
56 void MoveBits( BYTE* dest, BYTE* from, int count, int bpp );
57 void MoveBitsPal( BYTE* dest, BYTE*from, int count, int bpp, RGBQUAD* pal );