1 /* copyright: Steve Dekorte, 2002
2 * All rights reserved. See _BSDLicense.txt.
4 * This is an object wrapper for libtiff.
6 * It's possible to use an external UArray for loading by calling
7 * TIFFImage_setExternalUArray_(), but be carefull not to use the
8 * TIFFImage instance after freeing it's external byte array.
11 #ifndef TIFFIMAGE_DEFINED
12 #define TIFFIMAGE_DEFINED 1
14 #include "IoImageApi.h"
24 unsigned char ownsBuffer
;
28 IOIMAGE_API TIFFImage
*TIFFImage_new(void);
29 IOIMAGE_API TIFFImage
*TIFFImage_newWithPath_(char *fname
);
30 IOIMAGE_API
void TIFFImage_free(TIFFImage
*self
);
32 IOIMAGE_API
void TIFFImage_path_(TIFFImage
*self
, const char *path
);
33 IOIMAGE_API
char *TIFFImage_path(TIFFImage
*self
);
35 IOIMAGE_API
void TIFFImage_error_(TIFFImage
*self
, const char *path
);
36 IOIMAGE_API
char *TIFFImage_error(TIFFImage
*self
);
38 IOIMAGE_API
void TIFFImage_load(TIFFImage
*self
);
39 IOIMAGE_API
void TIFFImage_save(TIFFImage
*self
);
41 IOIMAGE_API
int TIFFImage_width(TIFFImage
*self
);
42 IOIMAGE_API
int TIFFImage_height(TIFFImage
*self
);
44 IOIMAGE_API
void TIFFImage_width_(TIFFImage
*self
, int w
);
45 IOIMAGE_API
void TIFFImage_height_(TIFFImage
*self
, int h
);
46 IOIMAGE_API
void TIFFImage_components_(TIFFImage
*self
, int c
);
48 IOIMAGE_API
unsigned char TIFFImage_isRGB8(TIFFImage
*self
);
49 IOIMAGE_API
unsigned char TIFFImage_isRGBA8(TIFFImage
*self
);
50 IOIMAGE_API
unsigned char TIFFImage_isL8(TIFFImage
*self
);
51 IOIMAGE_API
unsigned char TIFFImage_isLA8(TIFFImage
*self
);
52 IOIMAGE_API
int TIFFImage_components(TIFFImage
*self
);
54 IOIMAGE_API UArray
*TIFFImage_byteArray(TIFFImage
*self
);
56 /* Whomever calls TIFFImage_setExternalUArray_ is responsible
57 * for freeing "ba" and for making sure that this
58 * TIFFImage is not still using it after it is freed.
60 IOIMAGE_API
void TIFFImage_setExternalUArray_(TIFFImage
*self
, UArray
*ba
);