1 // ---------------------------------------------------------------------------- 2 // 3 // This source code is the property of Live Picture, inc. 4 // 5 // MODULE : ToolkitIVUE 6 // LANGUAGE : C++ 7 // AUTHOR : Philippe BOSSUT 8 // DATE : Tuesday, November 23rd 1993 9 // DESCRIPTION : 10 // COMMENT : 11 // SCCSID : @(#)ri_libio.h 1.1 11:46:44 18 Dec 1996 12 // ---------------------------------------------------------------------------- 13 // Copyright (c) 1999 Digital Imaging Group, Inc. 14 // For conditions of distribution and use, see copyright notice 15 // in Flashpix.h 16 // ---------------------------------------------------------------------------- 17 // ---------------------------------------------------------------------------- 18 #ifndef IVUEToolkitIO_h 19 #define IVUEToolkitIO_h 20 // ---------------------------------------------------------------------------- 21 22 // Includes 23 // -------- 24 25 struct Pixel; 26 class PErrorsList; 27 class PSystemToolkit; 28 class PHierarchicalImage; 29 30 // Constants 31 // --------- 32 33 #define NOT_IMPLEMENTED -4 // Return value of a not implemented function 34 35 enum Typ_Unit { Unit_inch = 0, // Inches 36 Unit_m = 1, // Meters 37 Unit_cm = 2, // Centimeters 38 Unit_mm = 3}; // Millimeters 39 40 // Flag types used in IVUE : 41 42 enum Typ_Interleaving { Interleaving_Pixel = 0, // Color by pixel 43 Interleaving_Line = 1, // Color by line (not yet implemented) 44 Interleaving_Channel = 2}; // Color by channel (not yet implemented) 45 46 enum Typ_Antialias { Antialias_None = 0, // Nearest Neighbor subsampling 47 Antialias_Fine = 1, // Bilinear interpolation 48 Antialias_Extra = 2}; // no longer used 49 50 enum Typ_Convolution { Convolution_Standard = 0, // 4 neighboors average 51 Convolution_Gauss = 1, // 8 neighboors gaussian 52 Convolution_Other = 2, // 8 neighboors user defined (not yet implemented) 53 Convolution_Cross = 3}; // 5 neighboors weighted average -> default value 54 55 enum Typ_ColorCode { ColorCode_RGB = 0, // RGB color model 56 ColorCode_Other = 1, // Unknowed model (not yet implemented) 57 ColorCode_YIQ = 2, // NTSC YIQ model (not yet implemented) 58 ColorCode_YMCK = 3, // YMCK color model (not yet implemented) 59 ColorCode_YMC = 4, // YMC color model (not yet implemented) 60 ColorCode_CIE = 5, // CIE color model (not yet implemented) 61 ColorCode_HSV = 6, // HSV color model (not yet implemented) 62 ColorCode_HSL = 7}; // HSL color model (not yet implemented) 63 64 enum Typ_Compression { Compression_None = 0, // No compression 65 Compression_NeoTech5 = 5, // NeoTech Cards (no longer used) 66 Compression_NeoTech15 = 15, // NeoTech Cards (no longer used) 67 Compression_NeoTech25 = 25, // NeoTech Cards (no longer used) 68 Compression_QuickTime = 1, // QuickTime 69 Compression_32to24 = 2, // Raw 32 bits to 24 bits 70 Compression_Other = 3, // Unidentified compressor (not yet implemented) 71 Compression_SingleColor = 6, // FPX Single Color Compression 72 Compression_JPEG = 7, // FPX JPEG Compression 73 Compression_PNG = 16}; // FPX PNG: not used yet, could be cool for the web... 74 75 // Identifiers of known compressors 76 typedef enum { TLC_Aucun = 0, // No compressor 77 TLC_NeoTech5 = 5, // 3 time the same NeoTech card 78 TLC_NeoTech15 = 15, 79 TLC_NeoTech25 = 25, 80 TLC_QuickTime = 1, // QuickTime 81 TLC_32Vers24 = 2, // Raw 32 bits to 24 bits 82 TLC_Other = 3, // Unidentified compressor (not yet implemented) 83 TLC_SingleColor = 6, // FPX Single Color Compression 84 TLC_JPEG = 7, // FPX JPEG Compression 85 TLC_PNG = 16, // FPX PNG: not used yet, could be cool for the web... 86 TLC_INVALID = -1 // Invalid compression, no compressor for it 87 } TLC_IdCodec; 88 89 const int DERNIER_ID_COMPRESSION = TLC_NeoTech25; 90 91 92 #define ActiveChannel_All -1 // All Channels are Active 93 #define ActiveChannel_Alpha 0 // Only the Alpha channel is active 94 #define ActiveChannel_Red 1 // Only the Red channel is active 95 #define ActiveChannel_Green 2 // Only the Green channel is active 96 #define ActiveChannel_Blue 3 // Only the Blue channel is active 97 98 99 // POINTER TYPES TO USER DEFINED FUNCTIONS : 100 101 // Pointer to convolution function : (not yet implemented) 102 103 typedef void (* Typ_Filter) (Pixel* source1, Pixel* source2, Pixel* source3, 104 Pixel* target, long sourcePixelsNumber); 105 106 // Pointers to ModeltoRGB and RGBtoModel functions : (not yet implemented) 107 108 typedef void (* Typ_ModeltoRGB) (Pixel* sourceModel, Pixel* targetRGB, long pixelsNumber); 109 110 typedef void (* Typ_RGBtoModel) (Pixel* sourceRGB, Pixel* targetModel, long pixelsNumber); 111 112 113 // Pointers to compression and decompression functions : (not yet implemented) 114 115 typedef Boolean (* Typ_Compressor) (Pixel* data, short width, short height, 116 Pixel** compressedData, long* compressedSize, 117 void* compressionHandle); 118 119 typedef Boolean (* Typ_Decompressor) (Pixel* data, short width, short height, 120 Pixel* compressedData, long compressedSize, 121 void* compressionHandle); 122 123 // Pointer to Wait Function : (not yet implemented) 124 125 typedef Boolean (* Typ_WaitFunc) (long percent); 126 127 // Class declarations 128 // ------------------ 129 130 struct IVUE_FileName; 131 132 #ifdef __MWERKS__ 133 struct IVUE_FileName : __no_exception_count { 134 #else 135 struct IVUE_FileName { 136 #endif 137 #ifdef macintosh 138 Str63 name; 139 OSType type; 140 long directory; 141 short volume; 142 #else 143 char name[256]; 144 #endif 145 }; 146 147 // Path description : 148 #ifndef StdPath_h 149 #define StdPath_h 150 typedef struct { 151 unsigned char y[4]; // CAUTION : The vertical coordinate 152 unsigned char x[4]; // comes first in photoshop paths 153 } data_Point; 154 155 typedef struct { 156 unsigned short kind; // Knot & control points 157 union { 158 unsigned short length; 159 data_Point data[3]; 160 }; 161 } data_Record; 162 #endif 163 164 165 166 // IVUE Toolkit I/O Class Definitions 167 // ---------------------------------- 168 169 typedef PErrorsList ErrorsList; 170 typedef PSystemToolkit SystemIVUE; 171 #define IVUE PHierarchicalImage 172 173 // Class definitions 174 // ----------------- 175 176 // 'inline' Functions 177 // ----------------- 178 179 // 'extern' Functions 180 // ----------------- 181 182 183 // IVUE Toolkit I/O Functions Definitions 184 // -------------------------------------- 185 186 extern "C" { 187 // System management tools : setting options and obtaining global information 188 189 // System init and purge 190 void IVUE_InitSystem (); 191 long IVUE_InitSystemWithMemory (long* newMemorySize); 192 void IVUE_PurgeSystem (); 193 long IVUE_PurgeSystemWithAmount (long memoryToBePurged); 194 void IVUE_ClearSystem (); 195 196 // Memory management functions 197 long IVUE_SetAllowance (long newMemorySize); 198 long IVUE_GetAllowance (long* usedMemory); 199 long IVUE_GetAvailableMemory (long* availableMemory); 200 long IVUE_GetUsedMemory (long* usedMemory); 201 void IVUE_LockIVUE (IVUE* ivue); 202 203 // Version and release 204 long IVUE_GetToolkitVersion (long* version, long* release); 205 206 // Set global options 207 long IVUE_SetUnit (Typ_Unit newUnit); 208 long IVUE_SetInterleaving (Typ_Interleaving newInterleaving); 209 long IVUE_SetAntialias (Typ_Antialias newAntialias); 210 // long IVUE_SetConvolution (Typ_Convolution newConvolution, Typ_Filter newFilter); 211 long IVUE_SetConvolution (Typ_Convolution newConvolution); 212 long IVUE_NoJaggies(Boolean preserve); 213 long IVUE_SetBackgroundColor(Pixel color); 214 long IVUE_SetUserColorCode (Typ_ColorCode newUserColorCode); 215 long IVUE_SetFileColorCode (Typ_ColorCode newFileColorCode); 216 long IVUE_SetAlphaChannel (Boolean existAlphaChannel); 217 long IVUE_SetColorConversion (Typ_ColorCode colorCode, Typ_ModeltoRGB modeltoRGB,Typ_RGBtoModel RGBtoModel); 218 long IVUE_SetCompression (Typ_Compression newidCompressor, Typ_Compressor newCompressor, Typ_Decompressor newDecompressor); 219 long IVUE_SetCompressionHandle (void* newCompressionHandle, long newHandleSize); 220 long IVUE_SetActiveChannel (short newActiveChannel); 221 long IVUE_SetWaitFunc (Typ_WaitFunc newWaitFunc); 222 long IVUE_SetTileSize (long newTileSize); 223 } 224 225 extern "C" { 226 // Open and Close IVUE files tools using a file name path : 227 long IVUE_OpenWrite (IVUE** ivue, IVUE_FileName* filName, long width, long height, float resolution); 228 long IVUE_OpenRead (IVUE** ivue, IVUE_FileName* filName); 229 long IVUE_OpenModif (IVUE** ivue, IVUE_FileName* filName); 230 long IVUE_Close (IVUE* ivue); 231 232 // Open and Close IVUE files tools using a file descriptor : 233 long IVUE_OpenRefWrite (IVUE** ivue, int fd, long width, long height, float resolution); 234 long IVUE_OpenRefRead (IVUE** ivue, int fd); 235 long IVUE_OpenRefModif (IVUE** ivue, int fd); 236 long IVUE_RefClose (IVUE* ivue); 237 238 // Errors handling 239 ErrorsList* IVUE_GetErrorsList(); 240 void IVUE_DeleteErrorsList(); 241 242 // Basic access tools : 243 long IVUE_WriteLine (IVUE* ivue, Pixel* line); 244 long IVUE_WriteRectangle (IVUE* ivue, long x0, long y0, long x1, long y1, Pixel* rect); 245 long IVUE_ReadRectangle (IVUE* ivue, long x0, long y0, long x1, long y1, Pixel* rect); 246 long IVUE_ReadInaRectangle (IVUE* ivue, Pixel* rect, short width, short height, Boolean showAlphaChannel); 247 248 // Obtaining usefull information from IVUE file tools : 249 long IVUE_GetFileName (IVUE* ivue, IVUE_FileName* filName); 250 long IVUE_GetDimensions (IVUE* ivue, long* width, long* height); 251 long IVUE_GetResolution (IVUE* ivue, float* resol); 252 long IVUE_GetTileSize (IVUE* ivue, long* tileSize); 253 long IVUE_ExistAlphaChannel(IVUE* ivue, Boolean* existAlpha); 254 255 // Read and write paths 256 long IVUE_ReadPaths (IVUE* ivue, data_Record** path, long* nbRecords, long* clipPathNum); 257 long IVUE_WritePaths (IVUE* ivue, data_Record* path, long nbRecords, long clipPathNum); 258 long IVUE_ReleasePaths (IVUE* ivue); 259 } 260 261 262 // 'inline' Functions 263 // ------------------ 264 265 // ---------------------------------------------------------------------------- 266 #endif // IVUEToolkitIO_h 267 // ---------------------------------------------------------------------------- 268