1 /*
2  *  FPXLib.h
3  *
4  *  FlashPix Library API
5  */
6 
7 /****************************************************************************/
8 #ifndef FPXLibAPI_h
9 #define FPXLibAPI_h
10 /****************************************************************************/
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 #include <inttypes.h>
15 #include <stddef.h>
16 
17   typedef struct IStream IStream;
18   typedef struct IStorage IStorage;
19 
20   typedef struct _XGUID
21   {
22     uint32_t	Data1;
23     uint16_t	Data2;
24     uint16_t	Data3;
25     uint8_t	Data4[8];
26   } XGUID, GUID, CLSID, IID;
27 
28   #ifndef FARSTRUCT
29     #define FARSTRUCT
30   #endif
31   #ifndef __RPC_FAR
32     #define __RPC_FAR
33   #endif
34 
35   typedef struct  tagCLIPDATA {
36     uint32_t	cbSize;
37     int32_t	ulClipFmt;
38     uint8_t	__RPC_FAR *pClipData;
39   } CLIPDATA;
40 
41 #if !defined(WCHAR) && !defined(__BORLANDC__)
42   typedef uint16_t	WCHAR;
43   typedef WCHAR	*LPWSTR;
44 #endif
45   typedef uint16_t	WORD;
46   typedef uint32_t	DWORD;
47 
48 /***************************************************************************
49    TOOLKIT HANDLE
50  ***************************************************************************/
51 #ifdef __cplusplus
52 typedef class PFlashPixImageView FPXImageHandle;
53 #else
54 typedef struct PFlashPixImageView FPXImageHandle;
55 #endif
56 
57 /****************************************************************************
58   BASIC TYPEDEFS
59  ****************************************************************************/
60 
61 typedef uint8_t	FPXbool;
62 
63 typedef struct {
64 	size_t	 length;        /* number of chars */
65 	uint8_t	*ptr;
66 } FPXStr;
67 
68 typedef struct {
69 	size_t	length;        /* number of shorts */
70 	uint16_t	*ptr;
71 } FPXShortArray;
72 
73 typedef struct FPXLongArray {
74 	size_t	length;        /* number of longs */
75 	uint32_t	*ptr;
76 } FPXLongArray;
77 
78 typedef struct {
79 	size_t	 length;        /* number of reals */
80 	float	*ptr;
81 } FPXRealArray;
82 
83 typedef struct FPXWideStr {
84 	size_t	 length;        /* length of string off ptr in bytes */
85 	uint16_t	*ptr;	/* Inside fpxlib wchar_t is 2-bytes XXX */
86 } FPXWideStr;
87 
88 typedef struct {
89 	size_t	 length;        /* number of strings */
90 	FPXStr	*ptr;
91 } FPXStrArray;
92 
93 typedef struct {
94 	size_t	length;        /* number of wide strings */
95 	FPXWideStr	*ptr;
96 } FPXWideStrArray;
97 
98 typedef struct {
99 	size_t	 length;        /* number of strings */
100 	CLSID	*ptr;
101 } FPXClsIDArray;
102 
103 #if !defined(WIN32)
104 typedef struct FARSTRUCT tagFILETIME
105 {
106 	DWORD dwLowDateTime;
107 	DWORD dwHighDateTime;
108 } FILETIME;
109 #endif
110 
111 #ifndef TRUE
112 #define TRUE 1
113 #endif
114 
115 #ifndef FALSE
116 #define FALSE 0
117 #endif
118 
119 typedef FILETIME FPXfiletime;	        /* cf. OLE FILETIME in compobj.h */
120 
121 #ifndef DATE
122 typedef  double DATE;
123 #endif
124 
125 /****************************************************************************
126   TOOLKIT ERROR CODES
127  ****************************************************************************/
128 
129 typedef enum {
130   FPX_OK = 0,
131   FPX_INVALID_FORMAT_ERROR = 1,
132   FPX_FILE_WRITE_ERROR = 2,
133   FPX_FILE_READ_ERROR = 3,
134   FPX_FILE_NOT_FOUND = 4,
135   FPX_COLOR_CONVERSION_ERROR = 5,
136   FPX_SEVER_INIT_ERROR = 6,
137   FPX_LOW_MEMORY_ERROR = 7,
138   FPX_IMAGE_TOO_BIG_ERROR = 8,
139   FPX_INVALID_COMPRESSION_ERROR = 9,
140   FPX_INVALID_RESOLUTION = 10,
141   FPX_INVALID_FPX_HANDLE = 11,
142   FPX_TOO_MANY_LINES = 12,
143   FPX_BAD_COORDINATES = 13,
144   FPX_FILE_SYSTEM_FULL = 14,
145   FPX_MISSING_TABLE = 15,
146   FPX_RETURN_PARAMETER_TOO_LARGE = 16,
147   FPX_NOT_A_VIEW = 17,
148   FPX_VIEW_IS_TRANFORMLESS = 18,
149   FPX_ERROR = 19,
150   FPX_UNIMPLEMENTED_FUNCTION = 20,
151   FPX_INVALID_IMAGE_DESC = 21,
152   FPX_INVALID_JPEG_TABLE = 22,
153   FPX_ILLEGAL_JPEG_ID = 23,
154   FPX_MEMORY_ALLOCATION_FAILED = 24,
155   FPX_NO_MEMORY_MANAGEMENT = 25,
156   FPX_OBJECT_CREATION_FAILED = 26,
157   FPX_EXTENSION_FAILED = 27,
158   FPX_FREE_NULL_PTR = 28,
159   FPX_INVALID_TILE = 29,
160   FPX_FILE_IN_USE = 30,
161   FPX_FILE_CREATE_ERROR = 31,
162   FPX_FILE_NOT_OPEN_ERROR = 32,
163   FPX_USER_ABORT = 33,
164   FPX_OLE_FILE_ERROR = 34,
165   FPX_INVALID_PIXEL_FORMAT = 35,
166   FPX_MAX_KNOWN_ERROR,	/* Insert subsequent codes above this one */
167 
168   // Numbers above 1000 are reserved for warnings. When returning a warning, the
169   // function did something (default behavior) and it's safe for the application
170   // to move on. It's up to the application to display a warning message to the user.
171   FPX_W_COORDINATES_OUT_OF_RANGE = 1000
172 } FPXStatus;
173 
174 FPXStatus FPX_GetErrorString (FPXStatus errorCode,
175 	                char *errorString,
176 	                unsigned short maxStrLen);
177 
178 /*
179  * Some C functions to ease the usage of these structures.
180  */
181  void FPXUpdateTime (FPXfiletime* theFPXTime);
182  void InitFPXStr            (FPXStr*          theFPXArray);
183  void InitFPXShortArray     (FPXShortArray*   theFPXArray);
184  void InitFPXLongArray      (FPXLongArray*    theFPXArray);
185  void InitFPXRealArray      (FPXRealArray*    theFPXArray);
186  void InitFPXWideStr        (FPXWideStr*      theFPXArray);
187  void InitFPXWideStrArray   (FPXWideStrArray* theFPXArray);
188  void InitFPXStrArray       (FPXStrArray*     theFPXArray);
189 
190  FPXStatus FPX_Strcpy     (FPXStr*     theFPXStr, const char* string);
191  FPXStatus FPX_WideStrcpy (FPXWideStr* theFPXStr, const char* string);
192  int       FPX_WideStrcmp (const FPXWideStr* fpxWStr1,  const FPXWideStr* fpxWStr2);
193 
194  size_t    FPX_LPWSTRlen  (const WCHAR * wideStr);
195 
196  FPXStatus FPX_DeleteFPXStr          (FPXStr*          theFPXArray);
197  FPXStatus FPX_DeleteFPXShortArray   (FPXShortArray*   theFPXArray);
198  FPXStatus FPX_DeleteFPXLongArray    (FPXLongArray*    theFPXArray);
199  FPXStatus FPX_DeleteFPXRealArray    (FPXRealArray*    theFPXArray);
200  FPXStatus FPX_DeleteFPXWideStr      (FPXWideStr*      theFPXArray);
201  FPXStatus FPX_DeleteFPXWideStrArray (FPXWideStrArray* theFPXArray);
202  FPXStatus FPX_DeleteFPXStrArray     (FPXStrArray*     theFPXArray);
203 
204  FPXStatus FPX_AllocFPXStr           (FPXStr*          theFPXArray, unsigned int nbElem);
205  FPXStatus FPX_AllocFPXShortArray    (FPXShortArray*   theFPXArray, unsigned int nbElem);
206  FPXStatus FPX_AllocFPXLongArray     (FPXLongArray*    theFPXArray, unsigned int nbElem);
207  FPXStatus FPX_AllocFPXRealArray     (FPXRealArray*    theFPXArray, unsigned int nbElem);
208  FPXStatus FPX_AllocFPXWideStr       (FPXWideStr*      theFPXArray, unsigned int nbElem);
209  FPXStatus FPX_AllocFPXWideStrArray  (FPXWideStrArray* theFPXArray, unsigned int nbElem);
210  FPXStatus FPX_AllocFPXStrArray      (FPXStrArray*     theFPXArray, unsigned int nbElem);
211 
212 /****************************************************************************
213    TOOLKIT COMPRESSION CONTROL
214  ***************************************************************************/
215 
216 /* Desired compression style	                                           */
217 typedef enum {
218 	NONE                = 0,    /* no compression used.                    */
219 	SINGLE_COLOR        = 1,    /* use single color compression            */
220 	JPEG_UNSPECIFIED    = 2,    /* let the toolkit pick the tables.        */
221 	JPEG_BY_QUALITY     = 3,    /* we will specify the quality.            */
222 	JPEG_BY_TABLE_GROUP = 4     /* we will specify the table group to use  */
223 } FPXCompressionOption;
224 
225 
226 /*  A JPEG quantizer table
227     XXX Is it bigendian or little endian? JPEG byte order or host machine?
228     Probably should be in JPEG format.
229     Rem: unsigned short quantizer is large enough for non-baseline JPEG.
230     (16bit lossless)
231 */
232 
233 typedef struct {
234     unsigned char *bits;
235     unsigned char *vals;
236     unsigned char hclass; /* 0: DC, 1: AC */
237     unsigned char ident;  /* 0,1,2,or 3 for extended JPEG systems */
238 	            /* 0, or 1 for baseline JPEG */
239 } FPXJPEGHUFFTable;
240 
241 typedef struct {
242     unsigned char *quantizer;   /* Table elements specified in zigzag order */
243     unsigned char ident;      /* 0,1,2,3 */
244 } FPXJPEGQuantTable;
245 
246 
247 /*  A JPEG abbreviated stream for table info.
248     XXX we will fill in the details later. It's basically a bunch of
249     overhead, bytes counts, Q tables, and H tables.
250  */
251 
252 #define FPX_MAX_TABLE_STREAM_SIZE   1400
253 
254 typedef struct {
255         unsigned short  theStreamSize;
256 	unsigned char   theStream[FPX_MAX_TABLE_STREAM_SIZE];
257 } FPXJPEGTableGroup;
258 
259 
260 /*  Make a FPXJPEGTableGroup from a bunch of Q and H tables.            */
261 /*  Not all tables need be supplied. A NULL indicates such an omission. */
262 
263 FPXStatus FPX_CreateJPEGTableGroup (
264 	FPXJPEGTableGroup*    theGroup,
265 	short         numOfQuanTable,
266 	unsigned char *   quanTableChanID,
267 	FPXJPEGQuantTable*    quanTable,
268 	short         numOfHuffTable,
269 	unsigned char *   huffDCTableChanID,
270 	unsigned char *   huffACTableChanID,
271 	FPXJPEGHUFFTable*     huffTable );
272 
273 /***************************************************************************
274    TOOLKIT RESOLUTION CONTROL
275  ***************************************************************************/
276 
277 /*  Number of levels in the pyramid and the compression used for each.
278  *  This allows user control of the compression/quality on a per resolution
279  *  basis during FPX file creation.
280  */
281 #define FPXMAXRESOLUTIONS 29    /* 8x8 pixel tiles, 2^32 x 2^32 image */
282 
283 /*  Control the compression on a per resolution basis. */
284 typedef struct {
285 	FPXCompressionOption compressOption;
286 	unsigned char        compressQuality;
287 	unsigned char        compressTableGroup;
288 } FPXPerResolutionControl;
289 
290 typedef struct {
291 	short                   numberOfResolutions;
292 	FPXPerResolutionControl compressionControl[FPXMAXRESOLUTIONS];
293 } FPXResolution;
294 
295 
296 
297 /***************************************************************************
298    TOOLKIT IMAGE COMPONENT COLORS/ORGANIZATIONS
299  ***************************************************************************/
300 
301 /*  Some FPX defined colors for components.
302  *
303  *  Whenever an alpha channel is seen, the other channels are assumed to
304  *  be premultiplied by it.  When an opacity of 0 (transparent) is seen
305  *  in the alpha channel, the toolkit will NOT automatically insert chroma
306  *  channels that are equal to the known background color, when either
307  *      reading or writing FPX images.  This work is left to the application and
308  *  is not considered a function of the toolkit.
309  */
310 typedef enum { PHOTO_YCC_Y,
311 	 PHOTO_YCC_C1,
312 	 PHOTO_YCC_C2,
313 	 NIFRGB_R,
314 	 NIFRGB_G,
315 	 NIFRGB_B,
316 	 ALPHA,
317 	 MONOCHROME
318 } FPXComponentColor;
319 
320 /*  Some FPX defined/allowed data types for components.	                   */
321 typedef enum { DATA_TYPE_UNSIGNED_BYTE,
322 	 DATA_TYPE_SIGNED_BYTE,
323 	 DATA_TYPE_UNSIGNED_SHORT,
324 	 DATA_TYPE_SIGNED_SHORT,
325 	 DATA_TYPE_FLOAT,
326 	 DATA_TYPE_DOUBLE
327 } FPXDataType;
328 
329 /*  Define the color/datatype of a component.	                              */
330 typedef struct {
331 	FPXComponentColor myColor;      /* Y, C1, C2, R, B, G, or ALPHA            */
332 	FPXDataType       myDataType;   /* unsigned byte, signed short, etc        */
333 } FPXComponentColorType;
334 
335 #define FPX_MAX_COMPONENTS 4
336 
337 /*  Specify a color space by a collection of color/datatype values.
338  *  NOTE: only certain combinations are allowed by the FPX spec.
339  */
340 typedef struct FPXColorspace {
341 	FPXbool               isUncalibrated;
342 	short             numberOfComponents;
343 	FPXComponentColorType theComponents[FPX_MAX_COMPONENTS];
344 } FPXColorspace;
345 
346 /***************************************************************************
347    TOOLKIT GLOBAL CONTROL
348  ***************************************************************************/
349 
350 /*  FPX_Delete() is needed in the special case that the calling program
351  *  has to delete objects created by the toolkit.  In this case
352  *  a crash will occur unless the TOOLKIT calls delete.
353  */
354 FPXStatus FPX_Delete(void *FPXObj);
355 
356 
357 /* Create an instance of the tool kit. The Tool kit can be used only if this
358  * function is called prior any other call.
359  */
360 FPXStatus FPX_InitSystem ();
361 
362 /* Delete the instance of the tool kit. The Tool kit cannot be used
363  * after a call to this function has been made.
364  */
365 FPXStatus FPX_ClearSystem ();
366 
367 /* Get tool kit name (here "Reference") and version number.
368  */
369 FPXStatus FPX_GetToolkitVersion (
370          char* versionName,
371          long* versionNumber);
372 
373 /* Global options
374  * --------------
375  */
376 
377 typedef enum {
378 	FPX_INCHES = 0,
379 	FPX_METERS,
380 	FPX_CENTIMETERS,
381 	FPX_MILLIMETERS
382 } FPXResolutionUnit;
383 
384 typedef enum {
385 	FPX_NEAREST_NEIGHBOR = 0,
386 	FPX_LINEAR_INTERPOLATION
387 } FPXResampleMethod;
388 
389 typedef enum {
390 	FPX_OVERWRITE_BACKGROUND = 0,
391 	FPX_PROTECT_BACKGROUND
392 } FPXComposeMethod;
393 
394 /*  Background colors are used for for background compression.
395  *  Values are in order of components of the color space specified
396  *  for the FPX image.
397  */
398 
399 typedef struct {
400 	signed int color1_value;
401 	signed int color2_value;
402 	signed int color3_value;
403 	signed int color4_value;
404 } FPXBackground;
405 
406 /* Set the unit used in resolution independent transactions
407  * in the viewing tools.
408  */
409 
410 FPXStatus FPX_SetUnit (
411         FPXResolutionUnit  newUnit);
412 
413 FPXStatus FPX_GetUnit (
414          FPXResolutionUnit* newUnit);
415 
416 /* Set the method used to compute an intermediate resolution.
417  * (formerly FPX_SetAntialias())
418  */
419 
420  FPXStatus FPX_SetResampleMethod (
421          FPXResampleMethod method);
422 
423 
424 /* Set the method used when composing images in the viewing tools.
425  * (formerly FPX_NoJaggies())
426  */
427  FPXStatus FPX_SetComposeMethod (
428          FPXComposeMethod method);
429 
430 
431 /* Set the default color used when composing images in the viewing tools.
432  * (formerly FPX_SetBackgroundColor())
433  */
434 
435  FPXStatus FPX_SetViewBackgroundColor (
436          FPXColorspace colorspace,
437          FPXBackground color);
438 
439 
440 /***************************************************************************
441    TOOLKIT MEMORY CONTROL
442  ***************************************************************************/
443 
444 /*  This function sets the amount of memory to be used by the FPX toolkit.
445  *  This value does NOT include the amount that could also be used
446  *  by the subordinate OLE layer. There is currently no way to limit
447  *  OLE memory usage.
448  *
449  *  0 means use unlimited available.
450  */
451 
452  FPXStatus FPX_SetToolkitMemoryLimit (
453 	size_t *    memoryLimit);
454 
455  FPXStatus FPX_GetToolkitMemoryLimit (
456      size_t *  memoryLimit);
457 
458  FPXStatus FPX_GetToolkitMemoryAvailable (
459      size_t *  availableMemory);
460 
461  FPXStatus FPX_GetToolkitMemoryUsed (
462      size_t *  usedMemory);
463 
464 // Memory management functions
465 // ---------------------------
466 
467 /* Purge the Toolkit memory (basically, the cached tiles).
468  * Return the amount of memory really purged
469  */
470 
471  size_t FPX_PurgeToolkitMemory (
472      size_t      memoryToBePurged);
473 
474 /* Lock a FPX image tiles to avoid having them purged
475  * during a FPX_PurgeToolkitMemory()
476  */
477 
478  FPXStatus FPX_LockFPXImage (
479      FPXImageHandle*  theFPX);
480 
481 
482 /***************************************************************************
483  *  FPX FILE CREATION
484  ***************************************************************************/
485 
486 /*  FPX_CreateImageByFilename() - create a new, empty, FPX image.
487  *
488  *  Input image must already be in output color space.
489  *  I.e. if you want a YCC FPX, feed us YCC!
490  */
491 FPXStatus FPX_CreateImageByFilename (
492 #ifdef macintosh
493 	const FSSpec&        fileSpecs,
494 #else
495 	const char*          fileName,
496 #endif
497 	unsigned int         width,
498 	unsigned int         height,
499 	unsigned int         tileWidth,
500 	unsigned int         tileHeight,
501 	FPXColorspace        colorspace,
502 	FPXBackground        backgroundColor,
503 	FPXCompressionOption compressOption,
504 	FPXImageHandle**     theFPX);
505 
506 /***************************************************************************
507     HIERARCHY GENERATION AND FLAT IMAGES HANDLING routines
508  ***************************************************************************/
509 
510 /* No automatic decimation will be done by the Toolkit if this function is
511  * called  and as long as the symetric function FPX_GenerateHierarchy()
512  * is not called.
513  * If a file is created, written and closed with this option set, the resulting
514  * file will be a flat image (no hierarchy).
515  */
516 
517  FPXStatus FPX_DoNotComputeHierarchy (
518 	FPXImageHandle*  theFPX);
519 
520 /* When this function is called, the hierarchy is recomputed from bottom up, using
521  * what is available from the high res up to the lowest res. This function unset
522  * the "no compute" flag, thus allowing automatic decimation to occur on a file
523  * when editing.
524  */
525 
526  FPXStatus FPX_GenerateHierarchy (
527 	FPXImageHandle*  theFPX);
528 
529 /***************************************************************************
530     TOOLKIT SET/GET routines
531  ***************************************************************************/
532 
533 /*  FPX_GetResolutionInfo() - return the resolution pyramid info from the image.
534  *
535  *  After creating a new, empty image, use this to
536  *  get info about the pyramid for later user (such as
537  *  controlling compression on a per level basis).
538  *  Error possible for NULL handle.
539  */
540  FPXStatus FPX_GetResolutionInfo (
541 	FPXImageHandle*  theFPX,
542 	FPXResolution*   theResolutionInfo);
543 
544 /*  For a given image, set the pyramid info.
545  *  Should only modify the compression option and quality/tablegroup for the
546  *  pyramid layers.
547  *
548  *  Or set the number of levels to 1 (flatten it for non-hierarchical FPX).
549  *  error return(for stuff that was diddled that shouldn't have been or bad
550  *  values.)
551  */
552  FPXStatus FPX_SetResolutionInfo (
553 	FPXImageHandle*  theFPX,
554 	FPXResolution*   theResolutionInfo);
555 
556 /***************************************************************************
557     TOOLKIT PROGRESS CALLBACK
558  ***************************************************************************/
559 
560 /*  Typedef for the progress function used by FPX function calls which may
561  *  take a while.  The two arguments passed to the progress function are
562  *  indications of how much work total is to be done by the toolkit function
563  *  call and how much of it is done at this  point.  The progress function
564  *  can abort the toolkit function by returning a non-zero value.
565  */
566 typedef short (* FPXProgressFunction) (int totalToDo, int amountDoneSoFar);
567 
568 /* Set the progressive function for the Toolkit. The function will be called
569  * automatically whenever it's necesary.
570  */
571 
572  FPXStatus FPX_SetProgressFunction (
573      FPXProgressFunction  theProgressive);
574 
575 /***************************************************************************
576     TOOLKIT FILE CLOSING
577  ***************************************************************************/
578 
579 /*  Close out a FlashPix image.
580  *  Finish creation of the image and writing to file.
581  *  May take a long time and so includes a progress callback.
582  *  May error for lots of reasons.
583  */
584 
585  FPXStatus FPX_CloseImage (
586 	FPXImageHandle*     theFPX);
587 
588 /***************************************************************************
589     TOOLKIT COLOR COMPONENTS
590  ***************************************************************************/
591 
592 /*  A struct to hold the component descriptor.
593  *  Holds the color/datatype,
594  *  subsampling factors,
595  *  column and line strides,
596  *  and pointer to the data.
597  */
598 typedef struct {
599 	FPXComponentColorType myColorType;           /* the color and datatype      */
600 	                                             /* of this component.          */
601 	unsigned int          horzSubSampFactor;     /* horizontal subsampling      */
602 	unsigned int          vertSubSampFactor;     /* vertical subsampling        */
603 	int                   columnStride;          /* items to next column on     */
604 	                                             /* this row.                   */
605 	int                   lineStride;            /* items to next line in       */
606 	                                             /* this column.                */
607 	unsigned char*        theData;               /* maybe void * XXX?           */
608 } FPXImageComponentDesc;
609 
610 
611 /*  A struct to hold the image descriptor.
612  *  Holds the number of components (channels) and
613  *  their descriptors. NOTE that the components implicitly
614  *  describe the colorspace.
615  */
616 typedef struct FPXImageDesc {
617 	unsigned int	numberOfComponents;
618 	FPXImageComponentDesc	components[FPX_MAX_COMPONENTS];
619 } FPXImageDesc;
620 
621 /* In Baseline, channels are premultiplied by the alpha channel.
622  *  However, using non premultiplied images is no big deal: just a
623  *  bit to set in the color subfield.
624  *  These functions allow the handling of FPX with or without
625  *  premultiplication.
626  *  CAUTION:
627  *     - if some tiles are already written, FPX_SetAlphaType
628  *     returns an error.
629  *     - these functions are not implemented in Baseline
630  */
631 typedef enum {
632   PREMULTIPLIED_CHANNELS,
633   INDEPENDENT_CHANNELS
634 } FPXPreComputedAlpha;
635 
636  FPXStatus FPX_SetAlphaType (
637 	FPXImageHandle*      theFPX,
638 	FPXPreComputedAlpha  theAlphaType);
639 
640  FPXStatus FPX_GetAlphaType (
641 	FPXImageHandle*      theFPX,
642 	FPXPreComputedAlpha* theAlphaType);
643 
644 /*  provide a table group and assign an ID number to it.
645  *  Provides user control over compression quality.
646  *  ERROR return for NULL table, illegal/already used ID.
647  */
648  FPXStatus FPX_SetJPEGTableGroup (
649 	FPXImageHandle*     theFPX,
650 	FPXJPEGTableGroup*  theGroup,
651 	unsigned char       theTableGroupID);
652 
653 
654 /*  Get a given table group from a FPX image.
655  *
656  *  ERROR return for ID not valid.
657  */
658  FPXStatus FPX_GetJPEGTableGroup (
659 	FPXImageHandle*     theFPX,
660 	FPXJPEGTableGroup*  theGroup,
661 	unsigned char       theTableGroupID);
662 
663 
664 /*  specify the quant_ID's to be used for compression
665  *
666  *  A table is specified for the entire image, all levels.
667  *  Error return if no such table.
668  */
669  FPXStatus FPX_SelectJPEGTableGroup (
670 	FPXImageHandle*  theFPX,
671 	unsigned char    theTableGroupID);
672 
673 
674 /*  Alternative JPEG table control:
675  *  builds tables according to value of compressionFactor (a la JFIF)
676  *  not allowed with other sets of huff or quant tables.
677  */
678  FPXStatus FPX_SetJPEGCompression (
679 	FPXImageHandle*  theFPX,
680 	unsigned short   theQualityFactor);    /* 0->100                              */
681 
682 /*  Resolution decimation quality control:
683  *
684  *  Tell the toolkit how large a kernel to use.
685  *  (Probably need to provide another call with the actual coefficients of
686  *   a separable NxN kernel.)
687  *
688  *  Errors on bad handle, bad kernel size.
689  */
690  FPXStatus FPX_SetDecimationQuality (
691 	FPXImageHandle*  theFPX,
692 	unsigned short   decimationQuality);        /* perhaps one dimension        */
693 	                                            /* of decimation kernel.        */
694 
695 /*  The following two calls are for writing rectangular regions
696  *
697  *  into the image. But this may be too general.
698  *  Perhaps we should only allow rectangles that multiples of the
699  *  tile size, or just one rectangle, or XXX ?
700  *  If we do allow general rectangles, we must verify that there is
701  *  no overlap!  XXX
702  */
703 
704 /*  Write a rectangle of data into the image.
705  *
706  *  Specify upper Left and Lower right pixel coords. of
707  *  full sized image. Subsampled components must be handled accordingly.
708  */
709  FPXStatus FPX_WriteImageRectangle (
710 	FPXImageHandle*     theFPX,
711 	unsigned int        X0,
712 	unsigned int        Y0,
713 	unsigned int        X1,
714 	unsigned int        Y1,
715 	FPXImageDesc*       theData);
716 
717 /*  Write a rectangle of background color.  */
718  FPXStatus FPX_WriteBackgroundRectangle (
719 	FPXImageHandle*     theFPX,
720 	unsigned int        X0,
721 	unsigned int        Y0,
722 	unsigned int        X1,
723 	unsigned int        Y1,
724 	FPXColorspace       theColorspace,
725 	FPXBackground       theColor);
726 
727 /*  Write a line of data into the image.
728  *  May NOT be mixed with writing of rectangles.
729  *
730  *  Opening of image effectively starts the "iterator" for line
731  *  writing at the top of the image.
732  *  LINE of input data is in an FPXImageDesc with is presumed to
733  *  be loaded with the line of data as the first (only?) line in the
734  *  data.
735  */
736  FPXStatus FPX_WriteImageLine (
737 	FPXImageHandle*     theFPX,
738 	FPXImageDesc*       theLine);
739 
740 /*  Write to specific resolution.
741  *
742  *  The caller will have decimated the image data external to the toolkit.
743  *  Resolution 0 is the lowest res. (smallest)
744  *  Resolution FPXResoltion.numberOfResolutions-1 is the highest
745  *  (largest).
746  *  Expected use is for the user to provide all data for the entire
747  *  resultion pyramid, one call at a time.
748  */
749  FPXStatus FPX_WriteImageResolution (
750 	FPXImageHandle*     theFPX,
751 	unsigned int        theResolution,
752 	FPXImageDesc*       theData);
753 
754 
755 /*  Flush modified tiles to the file.
756  *
757  *  After pixel content has been modified by an FPX_WriteXXXX() routine, the
758  *  changes may be cached in memory. This call ensures that the modified tiles
759  *  are written to the file. Failure to call this may result in stale pixel data
760  *  when lower resolutions are read.
761  */
762 FPXStatus FPX_FlushModifiedTiles (
763 	FPXImageHandle*     theFPX);
764 
765 /***************************************************************************
766     FPX FILE READING
767  ***************************************************************************/
768 
769 /*  A struct for the various amounts of info that describe the
770  *  compression of a tile.
771  */
772 typedef struct {
773 	FPXCompressionOption  compressOption;
774 	unsigned char         compressQuality;
775 	long                  compressSubtype;
776 } FPXTileCompressionInfo;
777 
778 /*  A compressed tile. Includes compression info as well as the
779  *  JPEG data.
780  */
781 typedef struct {
782 	FPXTileCompressionInfo compInfo;
783 	unsigned int       dataLength;
784 	void*          data;
785 } FPXTileDesc;
786 
787 FPXStatus FPX_OpenImageByFilename (
788 #ifdef macintosh
789 	const FSSpec&    fileSpecs,
790 #else
791 	const char*      fileName,
792 #endif
793 	const char*      storagePathInFile,
794 	unsigned int*   width,
795 	unsigned int*   height,
796 	unsigned int*   tileWidth,
797 	unsigned int*   tileHeight,
798 	FPXColorspace*   colorspace,
799 	FPXImageHandle** theFPX);
800 
801 // CHG_VIS_OUT - Added a file open call that supports specifying a visible output.
802 FPXStatus FPX_OpenIndexedImageByFilename (
803 	const char*      fileName,
804 	const char*      storagePathInFile,
805 	unsigned int     visibleOutputIndex,
806 	unsigned int*    width,
807 	unsigned int*    height,
808 	unsigned int*    tileWidth,
809 	unsigned int*    tileHeight,
810 	FPXColorspace*   colorspace,
811 	FPXImageHandle** theFPX);
812 
813 /* and an open from an IStorage. */
814 FPXStatus FPX_OpenImageByStorage (
815               IStorage* storagePointer,
816               const char*      storagePathInFile,
817               unsigned int*    width,
818               unsigned int*    height,
819               unsigned int*    tileWidth,
820               unsigned int*    tileHeight,
821               FPXColorspace*   colorspace,
822               FPXImageHandle** theFPX);
823 
824 /*  Read a rectangle of pixels from the transformed image.
825  *
826  *  The specified rectangle is read from the specified resolution
827  *  into the components provided. Color conversion and pixel shuffling
828  *  may occur in the process as well as cropping and rotation.
829  *  XXX ColorKnobs! ColorTwist! Sharpeness!
830  *
831  */
832  FPXStatus FPX_ReadImageTransformRectangle (
833 	FPXImageHandle*     theFPX,
834 	float               X0,
835 	float               Y0,
836 	float               X1,
837 	float               Y1,
838 	int                 rectWidth,
839 	int                 rectHeight,
840 	FPXImageDesc*       theRectangle);
841 
842 /*  Read a rectangle of pixels from a given resolution.
843  *
844  *  The specified rectangle is read from the specified resolution
845  *  into the components provided.
846  *  CAUTION : this is the symetric function to FPX_WriteImageRectangle() so
847  *  no viewing transform is applied to the data!
848  */
849  FPXStatus FPX_ReadImageRectangle (
850 	FPXImageHandle*     theFPX,
851 	unsigned int        X0,
852 	unsigned int        Y0,
853 	unsigned int        X1,
854 	unsigned int        Y1,
855 	unsigned int        theResolution,
856 	FPXImageDesc*       theImage);
857 
858 /*  Read a decompressed tile of pixels from a Resolution.
859  *  Read the specified tile and decompress it.
860  *  CAUTION : viewing parameters (and particularly geometric ones) cannot
861  *  be applied to a single tile of a particular resolution.
862  */
863  FPXStatus FPX_ReadImageTile (
864 	FPXImageHandle*     theFPX,
865 	unsigned int        whichTile,
866 	unsigned int        theResolution,
867 	FPXImageDesc*       theTile);
868 
869 /*  Read a compressed tile of pixels from a Resolution.
870  *
871  *  if tile was not compressed, it will still return successfully.
872  */
873  FPXStatus FPX_ReadImageCompressedTile (
874 	FPXImageHandle*     theFPX,
875 	unsigned int        whichTile,
876 	unsigned int        theResolution,
877 	FPXTileDesc*        theTile);
878 
879  FPXStatus FPX_WriteImageCompressedTile (
880 	FPXImageHandle*     theFPX,
881 	unsigned int        whichTile,
882 	unsigned int        theResolution,
883 	FPXTileDesc*        theTile);
884 
885 /***************************************************************************
886    IMAGES WITH VIEWS
887  ***************************************************************************/
888 
889 typedef struct {
890 	float left;        /* left edge                              */
891 	float top;         /* top edge                               */
892 	float width;       /* width                                  */
893 	float height;      /* height                                 */
894 } FPXROI;
895 
896 typedef float FPXFilteringValue;
897 
898 typedef struct {
899 	/* first row:                                                */
900 	float a11;
901 	float a12;
902 	float a13;
903 	float a14;
904 	/* second row:                                               */
905 	float a21;
906 	float a22;
907 	float a23;
908 	float a24;
909 	/* third row:                                                */
910 	float a31;
911 	float a32;
912 	float a33;
913 	float a34;
914 	/* fourth row:                                               */
915 	float a41;
916 	float a42;
917 	float a43;
918 	float a44;
919 
920 } FPXAffineMatrix;
921 
922 typedef float FPXResultAspectRatio;
923 
924 typedef struct FPXColorTwistMatrix {
925 	/* first row                                                 */
926 	float byy;
927 	float byc1;
928 	float byc2;
929 	float dummy1_zero;      /* nominally zero.                   */
930 	/* second row                                                */
931 	float bc1y;
932 	float bc1c1;
933 	float bc1c2;
934 	float dummy2_zero;      /* nominally zero.                   */
935 	/* third row                                                 */
936 	float bc2y;
937 	float bc2c1;
938 	float bc2c2;
939 	float dummy3_zero;      /* nominally zero.                   */
940 	/* fourth row                                                */
941 	float dummy4_zero;      /* nominally zero.                   */
942 	float dummy5_zero;      /* nominally zero.                   */
943 	float dummy6_zero;      /* nominally zero.                   */
944 	float dummy7_one;       /* nominally one.                    */
945 
946 } FPXColorTwistMatrix;
947 
948 typedef float FPXContrastAdjustment;
949 
950 /*  There is a desire to create images associated with views.
951  *  These are Image Views with embedded Images.
952  *  The View created may have no Transform (optionnal pointers set to NULL).
953  *  The PIW (for instance) may wish to create such beasts.
954  */
955 
956  FPXStatus FPX_CreateImageWithViewByFilename (
957 #ifdef macintosh
958 	const FSSpec&          fileSpecs,
959 #else
960 	const char*            fileName,
961 #endif
962 	unsigned int           width,
963 	unsigned int           height,
964 	unsigned int           tileWidth,
965 	unsigned int           tileHeight,
966 	FPXColorspace          colorspace,
967 	FPXBackground          backgroundColor,
968 	FPXCompressionOption   compressOption,
969 	FPXAffineMatrix*       affineMatrix,
970 	FPXContrastAdjustment* contrastValue,
971 	FPXColorTwistMatrix*   colorTwist,
972 	FPXFilteringValue*     filteringValue,
973 	FPXROI*                regionOfInterest,
974 	FPXResultAspectRatio*  resultAspectRatio,
975 	FPXImageHandle**       theFPX);
976 
977 /********************************************************************************
978    ICC PROFILE
979  *******************************************************************************/
980 
981 /*  The ICC profile is a data structure defined in the ICC spec.
982  *
983  *  Please visit ftp:sgigate.sgi.com/pub/icc for a copy of the spec which
984  *  defines this structure.  The format will not be addressed here.
985  *
986  *  FPX will allow you to obtain the structure if it is stored in the
987  *  file.
988  *
989  */
990 
991  FPXStatus FPX_SetICCProfile(
992 	FPXImageHandle *theFPX,
993 	FPXStr *        theProfile,
994 	unsigned short  profileIndex);
995 
996  FPXStatus FPX_GetICCProfile(
997 	FPXImageHandle *theFPX,
998 	FPXStr *        theProfile,
999 	unsigned short  profileIndex);
1000 
1001 /********************************************************************************
1002    PATH
1003  *******************************************************************************/
1004 
1005 /*  The Paths are vector informations stored along with a FPX Image.
1006  *  CAUTION:
1007  *     - these functions are not implemented in Baseline
1008  */
1009 
1010 typedef enum {  LINKED_POINT = 0,   // Smooth Bezier point
1011 	  FREE_POINT   = 1,   // Angular Bezier point
1012 	  LINE_LEFT    = 2,   // Line left, Bezier right
1013 	  LINE_RIGHT   = 3,   // Bezier left, line right
1014 	  LINE_POINT   = 4    // Angular polygon point
1015 } FPXPointType;
1016 
1017 typedef struct {
1018     float x;  // Horizontal coordinate
1019     float y;  // Vertical   coordinate
1020 } FPXCoordinate;
1021 
1022 typedef struct {
1023     FPXPointType  type;
1024     FPXCoordinate   directionLeft;
1025     FPXCoordinate   anchor;
1026     FPXCoordinate   directionRight;
1027 } FPXBezierPoint;
1028 
1029 typedef enum {  CLOSED_PATH = 0,   // Closed path
1030 	  OPEN_PATH   = 1    // Open path
1031 } FPXPathType;
1032 
1033 typedef struct {
1034     FPXPathType     type;
1035     unsigned int    numberOfPoints;
1036     FPXBezierPoint* points;
1037 } FPXPath;
1038 
1039  FPXStatus FPX_SetPath(
1040 	FPXImageHandle *theFPX,
1041 	unsigned short  thePathIndex,
1042 	FPXPath*        thePath);
1043 
1044  FPXStatus FPX_GetPath(
1045 	FPXImageHandle *theFPX,
1046 	unsigned short  thePathIndex,
1047 	FPXPath**       thePath);
1048 
1049 /********************************************************************************
1050    IMAGE WITH VIEW
1051  *******************************************************************************/
1052 
1053 /* the following are only valid for an Image With a View:	           */
1054 
1055 /* get/set the Image View transforms:
1056         ROI	                                                         */
1057 
1058 FPXStatus FPX_SetImageROI (
1059 	FPXImageHandle*  theFPX,
1060 	FPXROI*          theROI);
1061 
1062 FPXStatus FPX_GetImageROI (
1063 	FPXImageHandle*  theFPX,
1064 	FPXROI*          theROI);
1065 
1066 /* Filtering.	                                                        */
1067 
1068  FPXStatus FPX_SetImageFilteringValue (
1069 	FPXImageHandle*    theFPX,
1070 	FPXFilteringValue* theFiltering);
1071 
1072  FPXStatus FPX_GetImageFilteringValue (
1073 	FPXImageHandle*     theFPX,
1074 	FPXFilteringValue*  theFiltering);
1075 
1076 
1077 /* Spatial Orientation (matrix)	                                       */
1078 
1079  FPXStatus FPX_SetImageAffineMatrix (
1080 	FPXImageHandle*   theFPX,
1081 	FPXAffineMatrix*  theAffineMatrix);
1082 
1083  FPXStatus FPX_GetImageAffineMatrix (
1084 	FPXImageHandle*   theFPX,
1085 	FPXAffineMatrix*  theAffineMatrix);
1086 
1087 /* Result Aspect Ratio	                                                 */
1088 
1089  FPXStatus FPX_SetImageResultAspectRatio (
1090 	FPXImageHandle*       theFPX,
1091 	FPXResultAspectRatio* theAspectRatio);
1092 
1093  FPXStatus FPX_GetImageResultAspectRatio (
1094 	FPXImageHandle*        theFPX,
1095 	FPXResultAspectRatio*  theAspectRatio);
1096 
1097 /*
1098         ColorTwist Matrix	                                              */
1099 
1100  FPXStatus FPX_SetImageColorTwistMatrix (
1101 	FPXImageHandle*       theFPX,
1102 	FPXColorTwistMatrix*  theColorTwistMatrix);
1103 
1104  FPXStatus FPX_GetImageColorTwistMatrix (
1105 	FPXImageHandle*       theFPX,
1106 	FPXColorTwistMatrix*  theColorTwistMatrix);
1107 
1108 /*
1109  *      Contrast Adjustment
1110  */
1111  FPXStatus FPX_SetImageContrastAdjustment (
1112 	FPXImageHandle*        theFPX,
1113 	FPXContrastAdjustment* theContrastAdjustment);
1114 
1115  FPXStatus FPX_GetImageContrastAdjustment (
1116 	FPXImageHandle*         theFPX,
1117 	FPXContrastAdjustment*  theContrastAdjustment);
1118 
1119 
1120 typedef CLIPDATA  FPXThumbnail;
1121 
1122 typedef struct {
1123         FPXbool         title_valid;
1124         FPXStr          title;
1125 
1126         FPXbool         subject_valid;
1127         FPXStr          subject;
1128 
1129         FPXbool         author_valid;
1130         FPXStr          author;
1131 
1132         FPXbool         keywords_valid;
1133         FPXStr          keywords;
1134 
1135         FPXbool         comments_valid;
1136         FPXStr          comments;
1137 
1138         FPXbool         OLEtemplate_valid;
1139         FPXStr          OLEtemplate;
1140 
1141         FPXbool         last_author_valid;
1142         FPXStr          last_author;
1143 
1144         FPXbool         rev_number_valid;
1145         FPXStr          rev_number;
1146 
1147         FPXbool         edit_time_valid;
1148         FPXfiletime     edit_time;
1149 
1150         FPXbool         last_printed_valid;
1151         FPXfiletime     last_printed;
1152 
1153         FPXbool         create_dtm_valid;
1154         FPXfiletime     create_dtm;             /* We set, you only get! */
1155 
1156         FPXbool         last_save_dtm_valid;
1157         FPXfiletime     last_save_dtm;
1158 
1159         FPXbool         page_count_valid;
1160         unsigned int    page_count;
1161 
1162         FPXbool         word_count_valid;
1163         unsigned int    word_count;
1164 
1165         FPXbool         char_count_valid;
1166         unsigned int    char_count;
1167 
1168         FPXbool         thumbnail_valid;
1169         FPXThumbnail    thumbnail;
1170 
1171         FPXbool         appname_valid;
1172         FPXStr          appname;
1173 
1174         FPXbool         security_valid;
1175         unsigned long   security;
1176 } FPXSummaryInformation;
1177 
1178 FPXStatus FPX_SetSummaryInformation(
1179 	FPXImageHandle *        theFPX,
1180 	FPXSummaryInformation * theSummary);
1181 
1182 FPXStatus FPX_GetSummaryInformation(
1183 	FPXImageHandle *        theFPX,
1184 	FPXSummaryInformation * theSummary);
1185 
1186 // CHG_GBLINFO - added call to return a struct containing data from the Global
1187 //  Info property set
1188 typedef struct {
1189     FPXbool       visible_outputs_valid;
1190     FPXLongArray  visible_outputs;
1191 
1192     FPXbool       max_image_index_valid;
1193     unsigned int max_image_index;
1194 
1195     FPXbool       max_transform_index_valid;
1196     unsigned int max_transform_index;
1197 
1198     FPXbool       max_operation_index_valid;
1199     unsigned int max_operation_index;
1200 
1201 }FPXGlobalInformation;
1202 
1203 FPXStatus FPX_GetGlobalInformation(
1204 	FPXImageHandle *        theFPX,
1205 	FPXGlobalInformation *  theGlobalInfo);
1206 
1207 /***************************************************************************
1208    IMAGE INFO PROPERTY SET  A.K.A 'NON-IMAGE DATA'
1209  ***************************************************************************/
1210 
1211 /* Set/Get the Non-Image data ("Image Info" Property Set). This is a
1212  * very large collection of values of various sorts divided into several
1213  * groups of values. The interface will be through structs passed into the
1214  * set/get routines.  Passing a valid flag==TRUE will cause the associated
1215  * field to be adjusted when a set operation is performed.  After a get
1216  * operation finding the valid flag==TRUE means that the file produced a
1217  * value for the associated field.
1218  */
1219 
1220 typedef enum {
1221 	FPX_UNIDENTIFIED_SOURCE = 0,
1222 	FPX_FILM_SCANNER,
1223 	FPX_REFLECTION_PRINT_SCANNER,
1224 	FPX_DIGITAL_CAMERA,
1225 	FPX_STILL_FROM_VIDEO,
1226 	FPX_COMPUTER_GRAPHICS
1227 } FPXSource;
1228 
1229 typedef enum {
1230 	FPX_UNIDENTIFIED_SCENE = 0,
1231 	FPX_ORIGINAL_SCENE,
1232 	FPX_SECOND_GENERATION_SCENE,
1233 	FPX_DIGITAL_SCENE_GENERATION
1234 } FPXScene;
1235 
1236 /***************************************************************************/
1237 
1238 typedef struct {
1239 	FPXbool       file_source_valid;
1240 	FPXSource     file_source;
1241 
1242 	FPXbool       scene_type_valid;
1243 	FPXScene      scene_type;
1244 
1245 	FPXbool       creation_path_valid;
1246 	FPXLongArray  creation_path;
1247 
1248 	FPXbool       name_man_release_valid;
1249 	FPXWideStr    name_man_release;
1250 
1251 	FPXbool       user_defined_id_valid;
1252 	FPXWideStr    user_defined_id;
1253 
1254 	FPXbool       original_sharpness_approximation_valid;
1255 	float         original_sharpness_approximation;
1256 } FPXFileSourceGroup;
1257 
1258 FPXStatus FPX_SetSourceGroup (
1259         FPXImageHandle*     theFPX,
1260         FPXFileSourceGroup* theSourceGroup);
1261 
1262 FPXStatus FPX_GetSourceGroup (
1263         FPXImageHandle*     theFPX,
1264           FPXFileSourceGroup* theSourceGroup);
1265 
1266 /***************************************************************************/
1267 
1268 typedef struct {
1269 	FPXbool       copyright_valid;
1270 	FPXWideStr    copyright;
1271 
1272 	FPXbool       legal_broker_for_orig_image_valid;
1273 	FPXWideStr    legal_broker_for_orig_image;
1274 
1275 	FPXbool       legal_broker_for_digital_image_valid;
1276 	FPXWideStr    legal_broker_for_digital_image;
1277 
1278 	FPXbool       authorship_valid;
1279 	FPXWideStr    authorship;
1280 
1281 	FPXbool       intellectual_prop_notes_valid;
1282 	FPXWideStr    intellectual_prop_notes;
1283 } FPXIntellectualPropertyGroup;
1284 
1285  FPXStatus FPX_SetIntellectualPropGroup (
1286         FPXImageHandle*     theFPX,
1287 	FPXIntellectualPropertyGroup*  thePropGroup);
1288 
1289  FPXStatus FPX_GetIntellectualPropGroup (
1290         FPXImageHandle*     theFPX,
1291 	FPXIntellectualPropertyGroup*  thePropGroup);
1292 
1293 /***************************************************************************/
1294 
1295 typedef enum {
1296 	FPX_UNIDENTIFIED_TARGET = 0,
1297 	FPX_COLOR_CHART,
1298 	FPX_GREY_CARD,
1299 	FPX_GREYSCALE,
1300 	FPX_RESOLUTION_CHART,
1301 	FPX_INCH_SCALE,
1302 	FPX_CENTIMETER_SCALE,
1303 	FPX_MILLIMETER_SCALE,
1304 	FPX_MICROMETER_SCALE
1305 } FPXTestTargetInImage;
1306 
1307 typedef struct {
1308 	FPXbool         test_target_in_the_image_valid;
1309 	uint32_t        test_target_in_the_image;
1310 
1311 	FPXbool         group_caption_valid;
1312 	FPXWideStr      group_caption;
1313 
1314 	FPXbool         caption_text_valid;
1315 	FPXWideStr      caption_text;
1316 
1317 	FPXbool         people_in_the_image_valid;
1318 	FPXWideStrArray people_in_the_image;
1319 
1320 	FPXbool         things_in_image_valid;
1321 	FPXWideStrArray things_in_image;
1322 
1323 	FPXbool         date_of_original_image_valid;
1324 	FPXfiletime     date_of_original_image;
1325 
1326 	FPXbool         events_in_the_image_valid;
1327 	FPXWideStrArray events_in_the_image;
1328 
1329 	FPXbool         places_in_the_valid;
1330 	FPXWideStrArray places_in_the;
1331 
1332 	FPXbool         content_description_notes_valid;
1333 	FPXWideStr      content_description_notes;
1334 } FPXContentDescriptionGroup;
1335 
1336 FPXStatus FPX_SetContentDescriptionGroup (
1337         FPXImageHandle*     theFPX,
1338 	FPXContentDescriptionGroup*    theContentGroup);
1339 
1340 FPXStatus FPX_GetContentDescriptionGroup (
1341         FPXImageHandle*     theFPX,
1342 	FPXContentDescriptionGroup*    theContentGroup);
1343 
1344 /***************************************************************************/
1345 
1346 typedef struct {
1347 	FPXbool     camera_manufacturer_name_valid;
1348 	FPXWideStr  camera_manufacturer_name;
1349 
1350 	FPXbool     camera_model_name_valid;
1351 	FPXWideStr  camera_model_name;
1352 
1353 	FPXbool     camera_serial_number_valid;
1354 	FPXWideStr  camera_serial_number;
1355 } FPXCameraInformationGroup;
1356 
1357 FPXStatus FPX_SetCameraInformationGroup (
1358         FPXImageHandle*	 theFPX,
1359 	FPXCameraInformationGroup*    theCameraGroup);
1360 
1361 FPXStatus FPX_GetCameraInformationGroup (
1362         FPXImageHandle*	 theFPX,
1363 	FPXCameraInformationGroup*    theCameraGroup);
1364 
1365 /***************************************************************************/
1366 
1367 typedef enum {
1368 	FPX_UNIDENTIFIED_EXPOSURE_PROGRAM = 0,
1369 	FPX_MANUAL,
1370 	FPX_PROGRAM_NORMAL,
1371 	FPX_APERTURE_PRIORITY,
1372 	FPX_SHUTTER_PRIORITY,
1373 	FPX_PROGRAM_CREATIVE,
1374 	FPX_PROGRAM_ACTION,
1375 	FPX_PROTRAIT_MODE,
1376 	FPX_LANDSCAPE_MODE
1377 } FPXExposureProgram;
1378 
1379 typedef enum {
1380 	FPX_UNIDENTIFED_METERING_MODE = 0,
1381 	FPX_AVERAGE,
1382 	FPX_CENTER_WEIGHTED_AVERAGE,
1383 	FPX_SPOT,
1384 	FPX_MULTI_SPOT
1385 } FPXMeteringMode;
1386 
1387 typedef enum {
1388 	FPX_UNIDENTIFIED_SCENE_ILLUMINANT = 0,
1389 	FPX_DAYLIGHT,
1390 	FPX_FLUORESCENT_LIGHT,
1391 	FPX_TUNGSTEN_LAMP,
1392 	FPX_FLASH,
1393 	FPX_STANDARD_ILLUMINANT_A,
1394 	FPX_STANDARD_ILLUMINANT_B,
1395 	FPX_STANDARD_ILLUMINANT_C,
1396 	FPX_D55_ILLUMINANT,
1397 	FPX_D65_ILLUMINANT,
1398 	FPX_D75_ILLUMINANT
1399 } FPXSceneIlluminant;
1400 
1401 typedef enum {
1402 	FPX_FLASH_USE_UNKNOWN = 0,
1403 	FPX_NO_FLASH_USED,
1404 	FPX_FLASH_USED
1405 } FPXFlash;
1406 
1407 typedef enum {
1408 	FPX_NOT_A_CAMERA_FEATURE_FLASH_RETURN = 0,
1409 	FPX_SUBJECT_OUTSIDE_FLASH_RANGE,
1410 	FPX_SUBJECT_INSIDE_FLASH_RANGE
1411 } FPXFlashReturn;
1412 
1413 typedef enum {
1414 	FPX_NOT_A_CAMERA_FEATURE_BACKLIGHT = 0,
1415 	FPX_FRONT_LIT,
1416 	FPX_BACK_LIT1,
1417 	FPX_BACK_LIT2
1418 } FPXBackLight;
1419 
1420 typedef enum {
1421 	FPX_UNIDENTIFIED_SPECIAL_EFFECTS_OPTICAL_FILTER = 0,
1422 	FPX_NONE,
1423 	FPX_COLORED,
1424 	FPX_DIFFUSION,
1425 	FPX_MULTI_IMAGE,
1426 	FPX_POLARIZING,
1427 	FPX_SPLIT_FIELD,
1428 	FPX_STAR
1429 } FPXSpecialEffectsOpticalFilter;
1430 
1431 typedef struct {
1432       unsigned int length; // number of filters
1433       FPXSpecialEffectsOpticalFilter *ptr;
1434 } FPXOpticalFilterArray;
1435 
1436 typedef struct {
1437 	FPXbool            capture_date_valid;
1438 	FPXfiletime        capture_date;
1439 
1440 	FPXbool            exposure_time_valid;
1441 	float              exposure_time;
1442 
1443 	FPXbool            f_number_valid;
1444 	float              f_number;
1445 
1446 	FPXbool            exposure_program_valid;
1447 	FPXExposureProgram exposure_program;
1448 
1449 	FPXbool            brightness_value_valid;
1450 	FPXRealArray       brightness_value;
1451 
1452 	FPXbool            exposure_bias_value_valid;
1453 	float              exposure_bias_value;
1454 
1455 	FPXbool            subject_distance_valid;
1456 	FPXRealArray       subject_distance;
1457 
1458 	FPXbool            metering_mode_valid;
1459 	FPXMeteringMode    metering_mode;
1460 
1461 	FPXbool            scene_illuminant_valid;
1462 	FPXSceneIlluminant scene_illuminant;
1463 
1464 	FPXbool            focal_length_valid;
1465 	float              focal_length;
1466 
1467 	FPXbool            maximum_aperature_value_valid;
1468 	float              maximum_aperature_value;
1469 
1470 	FPXbool            flash_valid;
1471 	FPXFlash           flash;
1472 
1473 	FPXbool            flash_energy_valid;
1474 	float              flash_energy;
1475 
1476 	FPXbool            flash_return_valid;
1477 	FPXFlashReturn     flash_return;
1478 
1479 	FPXbool            back_light_valid;
1480 	FPXBackLight       back_light;
1481 
1482 	FPXbool            subject_location_valid;
1483 	FPXRealArray       subject_location;
1484 
1485 	FPXbool            exposure_index_valid;
1486 	float              exposure_index;
1487 
1488 	FPXbool           special_effects_optical_filter_valid;
1489 	FPXLongArray    special_effects_optical_filter;
1490 
1491 	FPXbool            per_picture_notes_valid;
1492 	FPXWideStr         per_picture_notes;
1493 } FPXPerPictureCameraSettingsGroup;
1494 
1495 FPXStatus FPX_SetPerPictureGroup (
1496         FPXImageHandle*	        theFPX,
1497 	FPXPerPictureCameraSettingsGroup*    thePerPictureGroup);
1498 
1499 FPXStatus FPX_GetPerPictureGroup (
1500         FPXImageHandle*	        theFPX,
1501 	FPXPerPictureCameraSettingsGroup*    thePerPictureGroup);
1502 
1503 /***************************************************************************/
1504 
1505 typedef enum {
1506 	FPX_UNDEFINED = 0,
1507 	FPX_MONOCHROME_AREA_SENSOR,
1508 	FPX_ONE_CHIP_COLOR_AREA_SENSOR,
1509 	FPX_TWO_CHIP_COLOR_AREA_SENSOR,
1510 	FPX_THREE_CHIP_COLOR_AREA_SENSOR,
1511 	FPX_COLOR_SEQUENCIAL_AREA_SENSOR,
1512 	FPX_MONOCHROME_LINEAR_SENSOR,
1513 	FPX_TRILINEAR_SENSOR,
1514 	FPX_COLOR_SEQUENCIAL_LINEAR_SENSOR
1515 } FPXSensingMethod;
1516 
1517 typedef enum {
1518 	FPX_RED = 0,
1519 	FPX_GREEN,
1520 	FPX_BLUE,
1521 	FPX_CYAN,
1522 	FPX_MAGENTA,
1523 	FPX_YELLOW,
1524 	FPX_WHITE
1525 } FPXColorFilterPatternValues;
1526 
1527 typedef struct {
1528 	unsigned int    number_of_columns;
1529 	unsigned int    number_of_rows;
1530 	FPXWideStrArray      column_headings;
1531 	FPXRealArray     data;
1532 } FPXSpacialFrequencyResponseBlock;
1533 
1534 typedef struct {
1535 	unsigned short    cfa_repeat_rows;
1536 	unsigned short    cfa_repeat_cols;
1537 	FPXStr            cfa_array;
1538 } FPXCFA_PatternBlock;
1539 
1540 typedef struct {
1541 	unsigned short   number_of_columns;
1542 	unsigned short   number_of_rows;
1543 	FPXWideStrArray      column_headings;
1544 	FPXRealArray     data;
1545 } FPXOECF_Block;
1546 
1547 typedef struct {
1548 	FPXbool           sensing_method_valid;
1549 	FPXSensingMethod  sensing_method;
1550 
1551 	FPXbool           focal_plane_x_resolution_valid;
1552 	float             focal_plane_x_resolution;
1553 
1554 	FPXbool           focal_plane_y_resolution_valid;
1555 	float             focal_plane_y_resolution;
1556 
1557 	FPXbool           focal_plane_resolution_unit_valid;
1558 	FPXResolutionUnit focal_plane_resolution_unit;
1559 
1560 	FPXbool           spacial_frequency_valid;
1561 	FPXSpacialFrequencyResponseBlock spacial_frequency;
1562 
1563 	FPXbool           cfa_pattern_valid;
1564 	FPXCFA_PatternBlock cfa_pattern;
1565 
1566 	FPXbool           spectral_sensitivity_valid;
1567 	FPXWideStr        spectral_sensitivity;
1568 
1569 	FPXbool           iso_speed_ratings_valid;
1570 	FPXShortArray     iso_speed_ratings;
1571 
1572 	FPXbool            oecf_valid;
1573 	FPXOECF_Block    oecf;
1574 } FPXDigitalCameraCharacterizationGroup;
1575 
1576 FPXStatus FPX_SetDigitalCameraGroup (
1577         FPXImageHandle*	          theFPX,
1578 	FPXDigitalCameraCharacterizationGroup* theDigitalCameraGroup);
1579 
1580 FPXStatus FPX_GetDigitalCameraGroup (
1581         FPXImageHandle*	          theFPX,
1582 	FPXDigitalCameraCharacterizationGroup* theDigitalCameraGroup);
1583 
1584 /***************************************************************************/
1585 
1586 typedef enum {
1587 	FPX_UNIDENTIFIED = 0,
1588 	FPX_NEGATIVE_BW,
1589 	FPX_NEGATIVE_COLOR,
1590 	FPX_REVERSAL_BW,
1591 	FPX_REVERSAL_COLOR,
1592 	FPX_CHROMAGENIC,
1593 	FPX_INTERNEGATIVE_BW,
1594 	FPX_INTERNEGATIVE_COLOR
1595 } FPXFilmCategory;
1596 
1597 
1598 typedef struct {
1599 	FPXbool           film_brand_valid;
1600 	FPXWideStr        film_brand;
1601 
1602 	FPXbool           film_category_valid;
1603 	FPXFilmCategory   film_category;
1604 
1605 	FPXbool           film_size_valid;
1606 	float       film_size_x;
1607 	float       film_size_y;
1608 	FPXResolutionUnit film_size_unit;
1609 
1610 	FPXbool           film_roll_number_valid;
1611 	unsigned short    film_roll_number;
1612 
1613 	FPXbool           film_frame_number_valid;
1614 	unsigned short    film_frame_number;
1615 } FPXFilmDescriptionGroup;
1616 
1617 FPXStatus FPX_SetFilmDescriptionGroup (
1618         FPXImageHandle*          theFPX,
1619 	FPXFilmDescriptionGroup* theFilmGroup);
1620 
1621 FPXStatus FPX_GetFilmDescriptionGroup (
1622         FPXImageHandle*          theFPX,
1623 	FPXFilmDescriptionGroup* theFilmGroup);
1624 
1625 /***************************************************************************/
1626 
1627 typedef enum {
1628 	FPX_UNIDENTIFIED_ORIGINAL_MEDIUM = 0,
1629 	FPX_CONTINUOUS_TONE_IMAGE,
1630 	FPX_HALFTONE_IMAGE,
1631 	FPX_LINE_ART
1632 } FPXOriginalMedium;
1633 
1634 typedef enum {
1635 	FPX_UNIDENTIFIED_TYPE_OF_REFLECTION_ORIGINAL = 0,
1636 	FPX_BW_PRINT,
1637 	FPX_COLOR_PRINT,
1638 	FPX_BW_DOCUMENT,
1639 	FPX_COLOR_DOCUMENT
1640 } FPXTypeOfReflectionOriginal;
1641 
1642 typedef struct {
1643 	float             original_size_x;
1644 	float             original_size_y;
1645 	FPXResolutionUnit original_size_unit;
1646 } FPXScannedImageSizeBlock;
1647 
1648 typedef struct {
1649 	FPXbool                     original_scanned_image_size_valid;
1650 	FPXScannedImageSizeBlock    original_scanned_image_size;
1651 
1652 	FPXbool                     original_document_size_valid;
1653 	FPXScannedImageSizeBlock    original_document_size;
1654 
1655 	FPXbool                     original_medium_valid;
1656 	FPXOriginalMedium           original_medium;
1657 
1658 	FPXbool                     type_of_reflection_original_valid;
1659 	FPXTypeOfReflectionOriginal type_of_reflection_original;
1660 } FPXOriginalDocumentScanDescriptionGroup;
1661 
1662 FPXStatus FPX_SetOriginalDocDescriptionGroup (
1663         FPXImageHandle*	            theFPX,
1664 	FPXOriginalDocumentScanDescriptionGroup* theDocGroup);
1665 
1666 FPXStatus FPX_GetOriginalDocDescriptionGroup (
1667         FPXImageHandle*	            theFPX,
1668 	FPXOriginalDocumentScanDescriptionGroup* theDocGroup);
1669 
1670 /***************************************************************************/
1671 
1672 
1673 typedef struct {
1674 	FPXbool       scanner_manufacturer_name_valid;
1675 	FPXWideStr    scanner_manufacturer_name;
1676 
1677 	FPXbool       scanner_model_name_valid;
1678 	FPXWideStr    scanner_model_name;
1679 
1680 	FPXbool       scanner_serial_number_valid;
1681 	FPXWideStr    scanner_serial_number;
1682 
1683 	FPXbool       scan_software_valid;
1684 	FPXWideStr    scan_software;
1685 
1686 	FPXbool       scan_software_revision_date_valid;
1687 	DATE          scan_software_revision_date;
1688 
1689 	FPXbool       service_bureau_org_name_valid;
1690 	FPXWideStr    service_bureau_org_name;
1691 
1692 	FPXbool       scan_operator_id_valid;
1693 	FPXWideStr    scan_operator_id;
1694 
1695 	FPXbool       scan_date_valid;
1696 	FPXfiletime   scan_date;
1697 
1698 	FPXbool       last_modified_date_valid;
1699 	FPXfiletime   last_modified_date;
1700 
1701 	FPXbool       scanner_pixel_size_valid;
1702 	float         scanner_pixel_size;
1703 } FPXScanDevicePropertyGroup;
1704 
1705 FPXStatus FPX_SetScanDevicePropertyGroup (
1706         FPXImageHandle*             theFPX,
1707 	FPXScanDevicePropertyGroup* theScanGroup);
1708 
1709 FPXStatus FPX_GetScanDevicePropertyGroup (
1710         FPXImageHandle*             theFPX,
1711 	FPXScanDevicePropertyGroup* theScanGroup);
1712 
1713 /****************************************************************************/
1714 /* EXTENSION LIST MANAGEMENT	                                  */
1715 /****************************************************************************/
1716 
1717 #define FPX_MAX_EXTENSION_ITEMS   5
1718 
1719 typedef enum {
1720 	FPX_EXTENSION_PERSISTENT = 0,
1721 	FPX_EXTENSION_VOLATILE,
1722 	FPX_EXTENSION_POTENTIALLY_VOLATILE
1723 } FPXExtensionPersistence;
1724 
1725 typedef struct {
1726 	FPXWideStr                extensionName;
1727 	CLSID                     extensionClassID;
1728 	FPXExtensionPersistence   extensionPersistence;
1729 
1730 	FPXbool           extensionCreationDateIsValid;
1731 	FPXfiletime               extensionCreationDate;
1732 
1733 	FPXbool           extensionModificationDateIsValid;
1734 	FPXfiletime               extensionModificationDate;
1735 
1736 	FPXbool           creatingApplicationIsValid;
1737 	FPXWideStr                creatingApplication;
1738 
1739 	FPXbool           extensionDescriptionIsValid;
1740 	FPXWideStr                extensionDescription;
1741 
1742 	FPXbool           streamPathNameIsValid;
1743 	FPXWideStrArray           streamPathName;
1744 
1745 	FPXbool           fpxStreamPathNameIsValid;
1746 	FPXWideStrArray           fpxStreamPathName;
1747 
1748 	FPXbool           fpxStreamOffsetIsValid;
1749 	FPXLongArray            fpxStreamOffset;
1750 
1751 	FPXbool           propertySetPathNameIsValid;
1752 	FPXWideStrArray           propertySetPathName;
1753 
1754 	FPXbool           propertySetFormatIDIsValid;
1755 	FPXClsIDArray             propertySetFormatID;
1756 
1757 	FPXbool           propertySetIDCodesIsValid;
1758 	FPXWideStrArray           propertySetIDCodes;
1759 
1760 } FPXExtensionDescription;
1761 
1762 FPXStatus FPX_GetExtensionDescription (
1763 	FPXImageHandle*               theFPX,
1764 	LPWSTR                        extensionName,
1765 	FPXExtensionDescription*      theDescription);
1766 FPXStatus FPX_SetExtensionDescription (
1767 	FPXImageHandle*               theFPX,
1768 	LPWSTR                        extensionName,
1769 	FPXExtensionDescription*      theDescription);
1770 FPXStatus FPX_GetStreamPointer (
1771 	FPXImageHandle*             theFPX,
1772 	char*                       streamName,
1773 	IStream**                   oleStream);
1774 FPXStatus FPX_GetPropertySetPointer (
1775 	FPXImageHandle*             theFPX,
1776 	char*                       propertySetName,
1777 	IStream**                   olePropertySet);
1778 
1779 //  Viewing Toolkit Class Definitions
1780 //  ---------------------------------
1781 
1782 /* Some of these are classes, but in C they can only be structs */
1783 #ifdef __cplusplus
1784 typedef class PageImage FPXPage;
1785 typedef class ViewWorld FPXWorld;
1786 typedef class ViewImage FPXImageInWorld;
1787 typedef class ViewWindow FPXWindow;
1788 #else
1789 typedef struct PageImage FPXPage;
1790 typedef struct ViewWorld FPXWorld;
1791 typedef struct ViewImage FPXImageInWorld;
1792 typedef struct ViewWindow FPXWindow;
1793 #endif
1794 
1795 // Formatted output tools :
1796 // Perhaps misnamed. Actually should be called simple render or
1797 // simple print. provide quick means of rendering a single image.
1798 // allows for simple rotation. Auto scales to maximize rotated
1799 // image size in page without crop.
1800 
1801 FPXStatus FPX_SetPageSetup (
1802 	FPXImageHandle* theFPX,
1803 	FPXPage**       thePage,
1804 	int             width,
1805 	int             height,
1806 	float           rotation,
1807 	FPXColorspace   backgroundColorspace,
1808 	FPXBackground   backgroundColor);
1809 
1810 FPXStatus FPX_ClosePage (
1811 	FPXPage*      thePage);
1812 
1813 FPXStatus FPX_ReadPage (
1814 	FPXPage*      thePage,
1815 	FPXImageDesc* renderingBuffer);
1816 
1817 FPXStatus FPX_ReadPageLine (
1818 	FPXPage*      thePage,
1819 	int           lineNumber,
1820 	FPXImageDesc* renderingBuffer);
1821 
1822 // World tools :
1823 
1824 FPXStatus FPX_CreateWorld (
1825 	FPXWorld**    theWorld,
1826 	float         width,
1827 	float         height,
1828 	FPXColorspace backgroundColorspace,
1829 	FPXBackground backgroundColor);
1830 
1831 FPXStatus FPX_DeleteWorld (
1832 	FPXWorld*     theWorld);
1833 
1834 // the following several functions are for managing multiple images
1835 // in a world.
1836 // Should we wish to support multiple FPX images in a world,
1837 // we will need these functions.
1838 
1839 // List of images management :
1840 
1841 FPXStatus FPX_AddImage (
1842 	FPXWorld*         theWorld,
1843 	FPXImageInWorld** theImage,
1844 	FPXImageHandle*   theFPX);
1845 
1846 // Adds an image to the world. returns handle to the
1847 // FPXImageInWorld.
1848 // The image is placed as specified by the affine
1849 // matrix in it's view.
1850 
1851 FPXStatus FPX_DeleteImage (
1852 	FPXWorld*        theWorld,
1853 	FPXImageInWorld* theImage);
1854 
1855 // removes an image from the world.
1856 // does not remove associated window created at
1857 // FPX_AddImage time.
1858 
1859 FPXStatus FPX_GetFirstImage (
1860 	FPXWorld*         theWorld,
1861 	FPXImageInWorld** theImage);
1862 
1863 // get first image from world image list.
1864 
1865 FPXStatus FPX_GetLastImage (
1866 	FPXWorld*         theWorld,
1867 	FPXImageInWorld** theImage);
1868 
1869 // get last image from world image list.
1870 
1871 FPXStatus FPX_GetCurrentImage (
1872 	FPXWorld*         theWorld,
1873 	FPXImageInWorld** theImage);
1874 
1875 // get current image from world image list.
1876 
1877 FPXStatus FPX_NextImage (
1878 	FPXWorld*         theWorld,
1879 	FPXImageInWorld** theImage);
1880 
1881 // get the next image in the list. becomes current.
1882 
1883 FPXStatus FPX_PreviousImage (
1884 	FPXWorld*         theWorld,
1885 	FPXImageInWorld** theImage);
1886 
1887 // get the previous image in the list. becomes current.
1888 
1889 // misc.
1890 
1891 // Image position tools :
1892 FPXStatus FPX_SetImageSize (
1893 	FPXImageInWorld* theImage,
1894 	float            width,
1895 	float            height);
1896 
1897 // Set width and height of image in world coord.s
1898 // I.e. scale in x and y.
1899 
1900 FPXStatus FPX_SetImageTransform (
1901 	FPXImageInWorld* theImage,
1902 	float x0,  float y0,
1903 	float m11, float m12, float m21, float m22);
1904 
1905 // Set full 2D affine in one swell foop.
1906 
1907 FPXStatus FPX_ApplyImageTransform (
1908 	FPXImageInWorld* theImage,
1909 	float x0,  float y0,
1910 	float m11, float m12, float m21, float m22);
1911 
1912 // Compose the specified affine with the existing affine xfrm
1913 // of the image.
1914 
1915 FPXStatus FPX_TranslateImage (
1916 	FPXImageInWorld* theImage,
1917 	float dx, float dy);
1918 
1919 // Move the image in world coord.s. will form new rendering xform.
1920 // Composed with existing xform.
1921 
1922 FPXStatus FPX_RotateImage (
1923 	FPXImageInWorld* theImage,
1924 	float x0, float y0,
1925 	float theta);
1926 
1927 // Rotate an image ccw about a given point.
1928 // Implemented as xlate of said point to origin, rotate,
1929 // xlate back.
1930 
1931 FPXStatus FPX_ScaleImage (
1932 	FPXImageInWorld* theImage,
1933 	float x0, float y0,
1934 	float sx, float sy);
1935 
1936 // Scale in x and y about a specific point.
1937 // Implemented as xlation of said point to origin, scale,
1938 // xlate back.
1939 
1940 FPXStatus FPX_ShearHorizontal (
1941 	FPXImageInWorld* theImage,
1942 	float x0, float y0,
1943 	float sh);
1944 
1945 // Compose a horizontal shear on to the xform.
1946 // Shear is wrt a given point. Implemented by translation of
1947 // said point to the origin, shear, translation back.
1948 
1949 FPXStatus FPX_ShearVertical (
1950 	FPXImageInWorld* theImage,
1951 	float x0, float y0,
1952 	float sh);
1953 
1954 // Compose a vertical shear on to the xform.
1955 // Shear is wrt a given point. Implemented by translation of
1956 // said point to the origin, shear, translation back.
1957 
1958 FPXStatus FPX_FlipHorizontal (
1959 	FPXImageInWorld* theImage,
1960 	float x0, float y0);
1961 
1962 // Flip (mirror) image about a horzontal line.
1963 // Said line runs through x0,y0.
1964 // Implemented by xlate of point to origin, scale x by -1,
1965 // xlate back.
1966 
1967 FPXStatus FPX_FlipVertical (
1968 	FPXImageInWorld* theImage,
1969 	float x0, float y0);
1970 
1971 // Flip (mirror) image about a vertical line.
1972 // Said line runs through x0,y0.
1973 // Implemented by xlate of point to origin, scale x by -1,
1974 // xlate back.
1975 
1976 FPXStatus FPX_GetOutlineParallelogram (
1977 	FPXImageInWorld* theImage,
1978 	float* x0, float* y0,
1979 	float* x1, float* y1,
1980 	float* x2, float* y2,
1981 	float* x3, float* y3);
1982 
1983 // Return corners of an image as rendered.
1984 // The bounding box including shear and rotation and crop (ROI).
1985 
1986 FPXStatus FPX_GetOutlineRectangle (
1987 	FPXImageInWorld* theImage,
1988 	float* x0, float* y0,
1989 	float* x1, float* y1);
1990 
1991 // Get the corners of a 0 rotation rectangle which bounds the
1992 // image. Conventional bounding box.
1993 
1994 FPXStatus FPX_GetOrigin (
1995 	FPXImageInWorld* theImage,
1996 	float* x0, float* y0);
1997 
1998 // return coord.s of origin of the image (upper left)
1999 // == translation values from xfrm. I.e. location of the
2000 // upper left.
2001 
2002 FPXStatus FPX_SetImageCrop (
2003 	FPXImageInWorld* theImage,
2004 	float x0, float y0,
2005 	float x1, float y1);
2006 
2007 // Set Region of Interest (ROI) on image.
2008 // Coords. are in world coords.
2009 
2010 FPXStatus FPX_ResetImageCrop (
2011 	FPXImageInWorld* theImage);
2012 
2013 // Set ROI to full image.
2014 
2015 // Viewing options: this concern the usage of the alpha channel stored along
2016 // with the image in the composition:
2017 
2018 FPXStatus FPX_UseAlphaChannel (
2019 	FPXImageInWorld* theImage,
2020 	FPXbool          useAlphaChannel);
2021 // The alpha channel is taken into account if (useAlphaChannel == true)
2022 
2023 FPXStatus FPX_InvertAlphaChannel (
2024 	FPXImageInWorld* theImage,
2025 	FPXbool          inverseAlpha);
2026 // The opacity is inversed prior composition if (inverseAlpha == true)
2027 
2028 // View Window  tools :
2029 // An FPX window is really a viewport on the world.
2030 // It establishes resolution and hence pixels.
2031 
2032 FPXStatus FPX_CreateWindow (
2033 	FPXWorld*    theWorld,
2034 	FPXWindow**  theWindow,
2035 	float x0,    float y0,
2036 	float width, float height,
2037 	float resolution);
2038 
2039 FPXStatus FPX_DeleteWindow (
2040 	FPXWindow* theWindow);
2041 
2042 FPXStatus FPX_ReadWindowSample (
2043 	FPXWindow*    theWindow,
2044 	int x0,       int y0,
2045 	FPXImageDesc* windowBufferInfo);
2046 
2047 // Render one lump of output.
2048 // This is a 4x4 square about the specified point (in pixels)
2049 // in the window.
2050 
2051 FPXStatus FPX_RefreshWindow (
2052 	FPXWindow*    theWindow,
2053 	FPXImageDesc* windowBufferInfo);
2054 
2055 // Render the entire window at once.
2056 // Includes a progress Function, as rendering may take a while,
2057 // especially at high res.
2058 
2059 FPXStatus FPX_TranslateWindow (
2060 	FPXWindow* theWindow,
2061 	float  dx, float  dy);
2062 
2063 // Move a window in world coords.
2064 // Changes xform associated with window.
2065 
2066 FPXStatus FPX_ResizeWindow (
2067 	FPXWindow*   theWindow,
2068 	float width, float height);
2069 
2070 // Crop or enlarge a window, without changing resolution.
2071 // I.e. no zooming, just a bigger window with more pixels in it.
2072 
2073 FPXStatus FPX_ZoomWindow (
2074 	FPXWindow* theWindow,
2075 	float      zoomRatio);
2076 
2077 // Change window dimensions and resolution inversely so as
2078 // to zoom/dezoom.
2079 
2080 FPXStatus FPX_GetWindowDefinition (
2081 	FPXWindow*    theWindow,
2082 	float* x0,    float* y0,
2083 	float* width, float* height,
2084 	float* resolution);
2085 
2086 // Get vital statistics about a window: location, size,
2087 // resolution.
2088 
2089 FPXStatus FPX_WindowToWorld (
2090 	FPXWindow* theWindow,
2091 	int i,     int j,
2092 	float* x,  float* y);
2093 
2094 // Xform point from window (pixels) to world coords.
2095 
2096 FPXStatus FPX_WorldToWindow (
2097 	FPXWindow* theWindow,
2098 	float x, float y,
2099 	int* i, int* j);
2100 
2101 // Xform point from world coords. to window coord.s (pixels.)
2102 
2103 
2104 //      Contrast adjustment:
2105 //	Setting, getting, processing.
2106 //	Note that this is really a property of a View of an image.
2107 //	We will associate it with the image in the world.
2108 /*
2109         Contrast Adjustment
2110 */
2111 
2112 FPXStatus FPX_SetImageInWorldContrastAdjustment (
2113 	FPXImageInWorld*       theImage,
2114 	FPXContrastAdjustment* theContrastAdjustment);
2115 
2116 FPXStatus FPX_GetImageInWorldContrastAdjustment (
2117 	FPXImageInWorld*       theImage,
2118 	FPXContrastAdjustment* theContrastAdjustment);
2119 
2120 
2121 //      Color twist:
2122 //	Setting, getting, processing.
2123 /*
2124         ColorTwist Matrix */
2125 
2126 FPXStatus FPX_SetImageInWorldColorTwistMatrix (
2127 	FPXImageInWorld*     theImage,
2128 	FPXColorTwistMatrix* theColorTwistMatrix);
2129 
2130 FPXStatus FPX_GetImageInWorldColorTwistMatrix (
2131 	FPXImageInWorld*     theImage,
2132 	FPXColorTwistMatrix* theColorTwistMatrix);
2133 
2134 //      Sharpening:
2135 //	Setting, getting, processing.
2136 //	This is defined to occur after Image Decompression, but
2137 //	before color transformation/twisting/constrast adjustment.
2138 
2139 /*        Filtering. */
2140 
2141 FPXStatus FPX_SetImageInWorldFilteringValue (
2142 	FPXImageInWorld*   theImage,
2143 	FPXFilteringValue* theFiltering);
2144 
2145 FPXStatus FPX_GetImageInWorldFilteringValue (
2146 	FPXImageInWorld*   theImage,
2147 	FPXFilteringValue* theFiltering);
2148 
2149 /* Get current Image in World Affine Matrix */
2150 
2151 FPXStatus FPX_GetImageInWorldAffineMatrix (
2152 	FPXImageInWorld*    theImage,
2153 	FPXAffineMatrix*  mat);
2154 
2155 /* Set current Image in World Affine Matrix */
2156 
2157 FPXStatus FPX_SetImageInWorldAffineMatrix (
2158 	FPXImageInWorld*    theImage,
2159 	FPXAffineMatrix*  mat);
2160 
2161 #ifdef __cplusplus
2162 }
2163 #endif
2164 /****************************************************************************/
2165 #endif // FPXLibAPI_h
2166 /****************************************************************************/
2167