/* @(#) Basic image type for defining an image * in the Artiste project and compatibility with VIPS * uses all the VIPS defines for direct copying to an IMAGE * 4/12/00 - KM */ #ifdef __cplusplus extern "C" { #endif /*__cplusplus*/ /* Bits per Band */ #define BBBYTE 8 #define BBSHORT 16 #define BBINT 32 #define BBFLOAT 32 #define BBCOMPLEX 64 /* complex consisting of two floats */ #define BBDOUBLE 64 #define BBDPCOMPLEX 128 /* complex consisting of two doubles */ /* picture Type */ #define MULTIBAND 0 #define B_W 1 #define LUMINACE 2 #define XRAY 3 #define IR 4 #define YUV 5 #define RED_ONLY 6 /* red channel only */ #define GREEN_ONLY 7 /* green channel only */ #define BLUE_ONLY 8 /* blue channel only */ #define POWER_SPECTRUM 9 #define HISTOGRAM 10 /* Colour spaces. - defined in Type */ #define LUT 11 #define XYZ 12 #define LAB 13 #define CMC 14 #define CMYK 15 #define LABQ 16 #define RGB 17 #define UCS 18 #define LCH 19 #define LABS 21 #define sRGB 22 /* BandFmt - usually only use 0 or sometimes 5 and 8 */ #define FMTNOTSET -1 #define FMTUCHAR 0 /* pels interpreted as unsigned chars */ #define FMTCHAR 1 /* pels interpreted as signed chars */ #define FMTUSHORT 2 /* pels interpreted as unsigned shorts */ #define FMTSHORT 3 /* pels interpreted as signed shorts */ #define FMTUINT 4 /* pels interpreted as unsigned ints */ #define FMTINT 5 /* pels interpreted as signed ints */ #define FMTFLOAT 6 /* pels interpreted as floats */ #define FMTCOMPLEX 7 /* pels interpreted as complex (2 float each) */ #define FMTDOUBLE 8 /* pels interpreted as unsigned double */ #define FMTDPCOMPLEX 9 /* pels interpreted as complex (2 double each)*/ /* Coding type - usually 0 */ #define NOCODING 0 #define COLQUANT 1 #define LABPACK 2 #define LABPACK_COMPRESSED 3 #define RGB_COMPRESSED 4 #define LUM_COMPRESSED 5 /* Compression type - usually 0 */ #define NO_COMPRESSION 0 #define TCSF_COMPRESSION 1 #define JPEG_COMPRESSION 2 /* Types of image descriptor we may have. The type field is advisory only: it * does not imply that any fields in IMAGE have valid data. */ /* Image descriptor */ typedef struct { /* Fields describing the image */ int Xsize; int Ysize; int Bands; int Bbits; int BandFmt; int Coding; int Type; float Xres; /* in pels per mm */ float Yres; /* Derived fields that user probably shouldn't fiddle with. * except data points to the first image byte * data can be initialised by Artiste UDMs * filename and fd are empty for Artiste */ char *data; /* start of image data */ char *filename; /* pointer to copy of filename */ int fd; /* file descriptor */ } Image_type; /* Macros on IMAGEs. Use these to get line lengths etc in low-level code * esize() sizeof band element * psize() sizeof pel * lsize() sizeof scan line * niele() number of elements in scan line */ #define esize(I) ((I)->Bbits >> 3) #define psize(I) (esize(I)*(I)->Bands) #define lsize(I) (psize(I)*(I)->Xsize) #define niele(I) ((I)->Bands*(I)->Xsize) #ifdef __cplusplus } #endif /*__cplusplus*/