00001
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _GAN_IMAGE_DPX_IO_H
00030 #define _GAN_IMAGE_DPX_IO_H
00031
00032 #include <stdio.h>
00033 #include <gandalf/common/misc_defs.h>
00034 #include <gandalf/image/image_defs.h>
00035
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039
00043 typedef enum Gan_DPXTransferCharacteristic
00044 {
00045 GAN_DPXTRANSFER_USER_DEFINED = 0,
00046 GAN_DPXTRANSFER_PRINTING_DENSITY = 1,
00047 GAN_DPXTRANSFER_LINEAR = 2,
00048 GAN_DPXTRANSFER_LOGARITHMIC = 3,
00049 GAN_DPXTRANSFER_UNSPECIFIED_VIDEO = 4,
00050 GAN_DPXTRANSFER_SMPTE240M = 5,
00051 GAN_DPXTRANSFER_CCIR709_1 = 6,
00052 GAN_DPXTRANSFER_CCIR601_2BG = 7,
00053 GAN_DPXTRANSFER_CCIR601_2M = 8,
00054 GAN_DPXTRANSFER_NTSC = 9,
00055 GAN_DPXTRANSFER_PAL = 10,
00056 GAN_DPXTRANSFER_ZLINEAR = 11,
00057 GAN_DPXTRANSFER_ZHOMOGENEOUS = 12,
00058 GAN_DPXTRANSFER_DEFAULT
00059 } Gan_DPXTransferCharacteristic;
00060
00061 typedef enum Gan_DPXColorimetricCharacteristics
00062 {
00063 GAN_DPXCOLORIMETRIC_USER_DEFINED = 0,
00064 GAN_DPXCOLORIMETRIC_PRINTING_DENSITY = 1,
00065 GAN_DPXCOLORIMETRIC_UNSPECIFIED_VIDEO = 4,
00066 GAN_DPXCOLORIMETRIC_SMPTE240M = 5,
00067 GAN_DPXCOLORIMETRIC_CCIR709_1 = 6,
00068 GAN_DPXCOLORIMETRIC_CCIR601_2BG = 7,
00069 GAN_DPXCOLORIMETRIC_CCIR601_2M = 8,
00070 GAN_DPXCOLORIMETRIC_NTSC = 9,
00071 GAN_DPXCOLORIMETRIC_PAL = 10,
00072 GAN_DPXCOLORIMETRIC_DEFAULT
00073 } Gan_DPXColorimetricCharacteristics;
00074
00078 typedef struct Gan_DPXWriteControlStruct
00079 {
00081 unsigned int bit_size;
00082
00084 Gan_DPXTransferCharacteristic transfer;
00085
00087 Gan_DPXColorimetricCharacteristics colorimetric;
00088 } Gan_DPXWriteControlStruct;
00089
00090
00091 void vReverseEndiannessUI32(gan_uint32* pui32Val);
00092 void vReverseEndiannessUI16(gan_uint16* pui16Val);
00093 Gan_Image *pgiRead8BitDPXImageData(FILE* pfInFile, Gan_Bool bReversedEndianness, gan_uint16 ui16Packing,
00094 gan_uint32 ui32eolPadding, gan_uint32 ui32eoImagePadding,
00095 Gan_ImageFormat eFormat, Gan_Type eType,
00096 gan_uint32 ui32PixelsPerLine, gan_uint32 ui32LinesPerImageEle,
00097 Gan_Image* pgiImage);
00098 Gan_Image *pgiRead10BitDPXImageData(FILE* pfInFile, Gan_Bool bReversedEndianness, gan_uint16 ui16bPacked,
00099 gan_uint32 ui32eolPadding, gan_uint32 ui32eoImagePadding,
00100 Gan_ImageFormat eFormat, Gan_Type eType,
00101 gan_uint32 ui32PixelsPerLine, gan_uint32 ui32LinesPerImageEle,
00102 Gan_Image* pgiImage);
00103 Gan_Bool bWrite8BitDPXImageData(FILE* pfOutFile, Gan_Image* pgiImage, Gan_Bool bReverseBytes);
00104 Gan_Bool bWrite10BitDPXImageData(FILE* pfOutFile, Gan_Image* pgiImage, Gan_Bool bReverseBytes);
00105
00106
00107 void gan_initialise_dpx_write_control_struct(Gan_DPXWriteControlStruct *controlstr);
00108 Gan_Image *gan_read_dpx_image_stream ( FILE *infile, Gan_Image *image );
00109 Gan_Image *gan_read_dpx_image ( const char *filename, Gan_Image *image );
00110 Gan_Bool gan_write_dpx_image_stream ( FILE *outfile, Gan_Image *image, Gan_DPXWriteControlStruct *controlstr );
00111 Gan_Bool gan_write_dpx_image ( const char *filename, Gan_Image *image, Gan_DPXWriteControlStruct *controlstr );
00112
00113 #ifdef __cplusplus
00114 }
00115 #endif
00116
00117 #endif