00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00120 #ifndef CPFSPD_H_INCLUDED
00121 #define CPFSPD_H_INCLUDED
00122
00123 #ifdef __cplusplus
00124 extern "C" {
00125 #endif
00126
00127
00128 #include <stdio.h>
00129
00130
00134 typedef enum {
00135 P_OK = 0,
00136 P_FILE_OPEN_FAILED = 100,
00137 P_FILE_CREATE_FAILED = 101,
00138 P_FILE_MODIFY_FAILED = 102,
00139 P_FILE_IS_NOT_PFSPD_FILE = 103,
00140 P_WRITE_FAILED = 110,
00141 P_READ_FAILED = 111,
00142 P_SEEK_FAILED = 112,
00143 P_NEGATIVE_SEEK_ON_STDIO = 113,
00144 P_WRITE_BEYOND_EOF_STDOUT = 115,
00145 P_REWRITE_ON_STDOUT = 116,
00146 P_REWRITE_MODIFIED_HEADER = 117,
00147 P_TOO_MANY_IMAGES = 199,
00148 P_TOO_MANY_COMPONENTS = 200,
00149 P_INVALID_COMPONENT = 201,
00150 P_NO_IH_RECORDS_ALLOWED = 202,
00151 P_ILLEGAL_BYTES_PER_REC = 203,
00152 P_ILLEGAL_TEM_SBSMPL = 204,
00153 P_INVALID_AUXILIARY = 205,
00154 P_ILLEGAL_LIN_SBSMPL = 206,
00155 P_ILLEGAL_PIX_SBSMPL = 207,
00156 P_SHOULD_BE_INTERLACED = 210,
00157 P_READ_CHR_FROM_LUM_ONLY = 211,
00158 P_READ_RGB_FROM_LUM_ONLY = 212,
00159 P_READ_PLANAR_CHR_FROM_MULT_CHR = 213,
00160 P_READ_RGB_FROM_YUV = 214,
00161 P_READ_CHR_FROM_RGB = 215,
00162 P_READ_CHR_FROM_STREAM = 216,
00163 P_READ_RGB_FROM_STREAM = 217,
00164 P_READ_INVALID_COMPONENT = 218,
00165 P_WRITE_INVALID_COMPONENT = 219,
00166 P_WRONG_LUM_COMP_SIZE = 220,
00167 P_WRONG_CHR_COMP_SIZE = 221,
00168 P_WRONG_RGB_COMP_SIZE = 222,
00169 P_WRONG_STREAM_COMP_SIZE = 223,
00170 P_WRONG_XYZ_COMP_SIZE = 224,
00171 P_EXCEEDING_DESCRIPTION_SIZE = 225,
00172 P_WRONG_EXTRA_COMP_SIZE = 226,
00173 P_WRONG_SUBSAMPLE_FACTOR = 227,
00174 P_EXCEEDING_AUXILIARY_DATA_SIZE = 228,
00175 P_EXCEEDING_AUXILIARY_HDR_SIZE = 229,
00176 P_HEADER_IS_MODIFIED = 230,
00177 P_INCOMP_MULT_COLOR_FORMAT = 242,
00178 P_INCOMP_PLANAR_COLOR_FORMAT = 243,
00179 P_ILLEGAL_COLOR_FORMAT = 300,
00180 P_ILLEGAL_IMAGE_FREQUENCY = 400,
00181 P_ILLEGAL_IMAGE_FREQ_MOD = 410,
00182 P_ILLEGAL_ILP_FREQ_MOD = 420,
00183 P_ILLEGAL_IMAGE_SIZE = 500,
00184 P_ILLEGAL_INTERLACE = 501,
00185 P_ILLEGAL_COMP_SIZE = 502,
00186 P_ILLEGAL_PHSHFT = 503,
00187 P_ILLEGAL_ASPECT_RATIO = 600,
00188 P_ILLEGAL_SIZE_FREQUENCY = 700,
00189 P_ILLEGAL_SIZE_INTERLACED_MODE = 701,
00190 P_ILLEGAL_SIZE_PROGRESSIVE_MODE = 702,
00191 P_ILLEGAL_FORMAT_INTERL_MODE = 703,
00192 P_ILLEGAL_NUM_OF_PIX_PER_LINE = 710,
00193 P_ILLEGAL_FILE_DATA_FORMAT = 800,
00194 P_FILE_DATA_FORMATS_NOT_EQUAL = 810,
00195 P_ILLEGAL_MEM_DATA_FORMAT = 820,
00196 P_UNKNOWN_FILE_TYPE = 830,
00197 P_UNKNOWN_MEM_TYPE = 840,
00198 P_INCOMP_FLOAT_CONVERSION = 850,
00199 P_MALLOC_FAILED = 900
00200 } pT_status;
00217 #define P_FILENAME_MAX 1024
00218
00223
00224 #define P_NUM_GLOB_RECS 2
00225
00226
00227 #define P_SNR_IMAGES 7
00228 #define P_SNR_COMPON 5
00229 #define P_SNR_FD_RECS 5
00230 #define P_SNR_AUXDAT_RECS 5
00231 #define P_SAPPL_TYPE 25
00232 #define P_SBYTES_REC 7
00233 #define P_SENDIAN_CODE 1
00234 #define P_SAUX_HDR_RECS 5
00235 #define P_LEN_GLOB_STR 60
00236
00237
00238
00239 #define P_SIMA_FREQ 12
00240 #define P_SLIN_FREQ 12
00241 #define P_SPIX_FREQ 12
00242 #define P_SACT_LINES 6
00243 #define P_SACT_PIXEL 6
00244 #define P_SINTERLACE 2
00245 #define P_SH_PP_SIZE 5
00246 #define P_SV_PP_SIZE 5
00247 #define P_LEN_GLOB_ATT 60
00248
00249
00250
00251 #define P_NUM_COMP_RECS 2
00252
00253
00254 #define P_SLIN_IMAGE 6
00255 #define P_SPIX_LINE 6
00256 #define P_SDATA_FMT 4
00257 #define P_LEN_COMP_STR 16
00258
00259
00260
00261 #define P_STEM_SBSMPL 2
00262 #define P_SLIN_SBSMPL 2
00263 #define P_SPIX_SBSMPL 2
00264 #define P_STEM_PHSHFT 2
00265 #define P_SLIN_PHSHFT 2
00266 #define P_SPIX_PHSHFT 2
00267 #define P_SCOM_CODE 5
00268 #define P_LEN_COMP_ATT 17
00269
00270
00271
00272 #define P_SDESCRIPTION 2048
00273 #define P_BYTES_REC 512
00274 #define P_SAUX_NAME 16
00275 #define P_SAUX_HDR 16384
00276
00279 #define P_PFSPD_MAX_COMP 128
00280
00284 #define P_Y_COM_CODE "Y "
00285 #define P_UV_COM_CODE "U/V "
00286 #define P_U_COM_CODE "U "
00287 #define P_V_COM_CODE "V "
00288 #define P_R_COM_CODE "R "
00289 #define P_G_COM_CODE "G "
00290 #define P_B_COM_CODE "B "
00291 #define P_S_COM_CODE "S "
00292 #define P_P_COM_CODE "P "
00293 #define P_XYZX_COM_CODE "X "
00294 #define P_XYZY_COM_CODE "Y "
00295 #define P_XYZZ_COM_CODE "Z "
00296 #define P_VOID_COM_CODE "void "
00297
00300 #define P_VIDEO_APPL_TYPE "VIDEO "
00301
00303 #define P_AUX_LAST " 8"
00304
00308 #define P_B8_DATA_FMT "B*8 "
00309 #define P_B10_DATA_FMT "B*10"
00310 #define P_B12_DATA_FMT "B*12"
00311 #define P_B14_DATA_FMT "B*14"
00312 #define P_I2_DATA_FMT "I*2 "
00313 #define P_R2_DATA_FMT "R*2 "
00314
00317
00318
00319
00320
00321
00322
00323
00324
00326 typedef struct {
00327 int lin_image;
00328 int pix_line;
00329 char data_fmt[P_SDATA_FMT + 1];
00330 int tem_sbsmpl;
00331 int lin_sbsmpl;
00332 int pix_sbsmpl;
00333 int tem_phshft;
00334 int lin_phshft;
00335 int pix_phshft;
00336 char com_code[P_SCOM_CODE + 1];
00337 } pT_component;
00338
00340 typedef struct {
00341
00342
00343
00344 int nr_images;
00345 int nr_compon;
00346 int nr_fd_recs;
00347 int nr_aux_data_recs;
00348 char appl_type[P_SAPPL_TYPE + 1];
00349 int bytes_rec;
00350 int little_endian;
00351 int nr_aux_hdr_recs;
00352 double ima_freq;
00353 double lin_freq;
00354 double pix_freq;
00355 int act_lines;
00356 int act_pixel;
00357 int interlace;
00358 int h_pp_size;
00359 int v_pp_size;
00360 pT_component comp[P_PFSPD_MAX_COMP];
00361
00362
00363
00364
00365
00366 char description[P_SDESCRIPTION];
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376 int disable_hdr_checks;
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393 int modified;
00394
00395
00396 unsigned long offset_lo;
00397
00398
00399 unsigned long offset_hi;
00400
00401
00402
00403
00404
00405 unsigned char aux_hdrs[P_SAUX_HDR];
00406 } pT_header;
00407
00418 #define P_COMPONENT_INIT {0, 0, "", 0, 0, 0, 0, 0, 0, ""}
00419 #define P_HEADER_INIT {0, 0, 0, 0, "", 0, 0, 0, \
00420 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, \
00421 {P_COMPONENT_INIT, P_COMPONENT_INIT, \
00422 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00423 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00424 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00425 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00426 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00427 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00428 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00429 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00430 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00431 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00432 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00433 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00434 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00435 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00436 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00437 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00438 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00439 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00440 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00441 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00442 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00443 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00444 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00445 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00446 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00447 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00448 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00449 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00450 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00451 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00452 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00453 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00454 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00455 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00456 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00457 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00458 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00459 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00460 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00461 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00462 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00463 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00464 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00465 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00466 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00467 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00468 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00469 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00470 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00471 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00472 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00473 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00474 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00475 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00476 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00477 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00478 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00479 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00480 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00481 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00482 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00483 P_COMPONENT_INIT, P_COMPONENT_INIT, \
00484 P_COMPONENT_INIT, P_COMPONENT_INIT}, \
00485 "", 0, 0, 0, 0, P_AUX_LAST}
00486
00490
00491
00492
00493
00494
00503 #define P_STD_IMA_FREQ_50HZ (50.00)
00504 #define P_STD_IMA_FREQ_60HZ (59.94)
00505 #define P_STD_IMA_FREQ_REAL_60HZ (60.00)
00506
00508 typedef enum {
00509 P_50HZ = 0,
00510 P_60HZ,
00511 P_REAL_60HZ,
00512
00513 P_75HZ,
00514 P_90HZ,
00515 P_REAL_90HZ,
00516 P_100HZ,
00517 P_120HZ,
00518 P_REAL_120HZ,
00519 P_25HZ,
00520 P_24HZ,
00521 P_REAL_24HZ,
00522 P_30HZ,
00523 P_REAL_30HZ,
00524 P_UNKNOWN_FREQ
00525 } pT_freq;
00526
00528 typedef enum {
00529 P_NO_COLOR = 0,
00530 P_COLOR_422,
00531 P_COLOR_420,
00532 P_COLOR_444_PL,
00533 P_COLOR_422_PL,
00534 P_COLOR_420_PL,
00535 P_COLOR_RGB,
00536 P_STREAM,
00537
00538 P_COLOR_XYZ,
00539 P_UNKNOWN_COLOR
00540 } pT_color;
00541
00543 typedef enum {
00544 P_4_3 = 0,
00545 P_16_9,
00546 P_AS_WH,
00547 P_UNKNOWN_ASPECT_RATIO
00548 } pT_asp_rat;
00549
00551 typedef enum {
00552 P_8_BIT_FILE = 0,
00553 P_10_BIT_FILE,
00554 P_12_BIT_FILE,
00555 P_14_BIT_FILE,
00556 P_16_BIT_FILE,
00557 P_16_REAL_FILE,
00558 P_UNKNOWN_DATA_FORMAT
00559 } pT_data_fmt;
00560
00562 typedef enum {
00563 P_SD = 0,
00564 P_CIF,
00565 P_QCIF,
00566
00567
00568
00569 P_HDp,
00570 P_HDi,
00571 P_UNKNOWN_SIZE
00572 } pT_size;
00573
00575 typedef enum {
00576 P_FLOAT = 0,
00577 P_DOUBLE,
00578 P_LONG,
00579 P_ULONG,
00580 P_INT,
00581 P_UINT,
00582 P_SHORT,
00583 P_USHORT,
00584 P_CHAR,
00585 P_UCHAR
00586 } pT_buf_type;
00587
00588
00720 extern pT_status p_check_header (const pT_header *header);
00721
00723 extern pT_status p_read_header (const char *filename,
00724 pT_header *header);
00725
00729 extern pT_status p_write_header (const char *filename,
00730 pT_header *header);
00731
00753 extern pT_status p_rewrite_header (const char *filename,
00754 pT_header *header);
00755
00762 extern pT_status p_copy_header (pT_header *new_header,
00763 const pT_header *header);
00764
00769 extern pT_status p_print_header (const pT_header *header,
00770 FILE *stream);
00771
00786 extern pT_status p_create_header (pT_header *header,
00787 pT_color color,
00788 pT_freq image_freq);
00789
00811 extern pT_status p_create_ext_header (pT_header *header,
00812 pT_color color,
00813 pT_freq image_freq,
00814 pT_size image_size,
00815 int pixels_per_line,
00816 int progressive,
00817 pT_asp_rat ratio);
00832 extern pT_status p_mod_num_frames (pT_header *header,
00833 int num_frames);
00835 extern pT_status p_mod_color_format (pT_header *header,
00836 pT_color color_format);
00838 extern pT_status p_mod_aspect_ratio (pT_header *header,
00839 pT_asp_rat ratio);
00840
00842 extern pT_status p_mod_to_progressive (pT_header *header);
00843
00845 extern pT_status p_mod_to_interlaced (pT_header *header);
00846
00851 extern pT_status p_mod_to_dbl_image_rate (pT_header *header);
00852
00857 extern pT_status p_mod_to_onehalf_image_rate (pT_header *header);
00858
00860 extern pT_status p_mod_image_size (pT_header* header,
00861 int width,
00862 int height);
00863
00871 extern pT_status p_mod_defined_image_size (pT_header* header,
00872 pT_size image_size,
00873 int pixels_per_line);
00874
00879 extern pT_status p_mod_all_freqs (pT_header *header,
00880 double image_freq,
00881 double line_freq,
00882 double pixel_freq);
00883
00891 extern pT_status p_mod_defined_image_freq (pT_header* header,
00892 pT_freq image_freq);
00893
00895 extern pT_status p_mod_file_data_format (pT_header *header,
00896 pT_data_fmt file_data_fmt);
00897
00899 extern pT_status p_mod_file_description (pT_header *header,
00900 char *description);
00910 extern int p_get_num_frames (const pT_header *header);
00912 extern int p_is_interlaced (const pT_header *header);
00914 extern int p_is_progressive (const pT_header *header);
00916 extern int p_get_frame_width (const pT_header *header);
00918 extern int p_get_frame_height (const pT_header *header);
00919
00920
00927 extern void p_get_y_buffer_size (const pT_header *header,
00928 int *width,
00929 int *height);
00938 extern void p_get_uv_buffer_size (const pT_header *header,
00939 int *width,
00940 int *height);
00947 extern void p_get_rgb_buffer_size (const pT_header *header,
00948 int *width,
00949 int *height);
00954 extern void p_get_s_buffer_size (const pT_header *header,
00955 int *width,
00956 int *height);
00957
00959 extern pT_color p_get_color_format (const pT_header *header);
00960
00962 extern void p_get_all_freqs (const pT_header *header,
00963 double *image_freq,
00964 double *line_freq,
00965 double *pixel_freq);
00966
00968 extern pT_freq p_get_image_freq (const pT_header *header);
00969
00971 extern pT_size p_get_image_size (const pT_header *header);
00972
00974 extern pT_asp_rat p_get_aspect_ratio (const pT_header *header);
00975
00977 extern pT_data_fmt p_get_file_data_format (const pT_header *header);
00978
00982 extern char *p_get_file_description (const pT_header *header);
00983
01192 #define P_READ_Y 0
01193 #define P_READ_ALL 1
01194 #define P_READ_UV 2
01195 #define P_READ_U 3
01196 #define P_READ_V 4
01197 #define P_READ_R 5
01198 #define P_READ_G 6
01199 #define P_READ_B 7
01200
01205 #define P_8_BIT_MEM (0 * 16)
01206 #define P_10_BIT_MEM (1 * 16)
01207 #define P_12_BIT_MEM (2 * 16)
01208 #define P_14_BIT_MEM (3 * 16)
01209 #define P_16_BIT_MEM (4 * 16)
01210 #define P_16_BIT_MEM_LSB (5 * 16)
01211 #define P_AF_BIT_MEM (7 * 16)
01212
01253
01254
01255
01256
01257
01258
01259
01260
01261
01262 extern pT_status p_read_field
01263 (const char *filename, pT_header *header,
01264 int frame, int field,
01265 unsigned char *y_fld,
01266 unsigned char *uv_fld,
01267 int read_mode,
01268 int width, int fld_height, int stride);
01269 extern pT_status p_read_frame
01270 (const char *filename, pT_header *header,
01271 int frame,
01272 unsigned char *y_or_s_frm,
01273 unsigned char *uv_frm,
01274 int read_mode,
01275 int width, int frm_height, int stride);
01276 extern pT_status p_write_field
01277 (const char *filename, pT_header *header,
01278 int frame, int field,
01279 const unsigned char *y_fld,
01280 const unsigned char *uv_fld,
01281 int width, int fld_height, int stride);
01282 extern pT_status p_write_frame
01283 (const char *filename, pT_header *header,
01284 int frame,
01285 const unsigned char *y_or_s_frm,
01286 const unsigned char *uv_frm,
01287 int width, int frm_height, int stride);
01288
01289 extern pT_status p_read_field_16
01290 (const char *filename, pT_header *header,
01291 int frame, int field,
01292 unsigned short *y_fld,
01293 unsigned short *uv_fld,
01294 int read_mode,
01295 int width, int fld_height, int stride);
01296 extern pT_status p_read_frame_16
01297 (const char *filename, pT_header *header,
01298 int frame,
01299 unsigned short *y_or_s_frm,
01300 unsigned short *uv_frm,
01301 int read_mode,
01302 int width, int frm_height, int stride);
01303 extern pT_status p_write_field_16
01304 (const char *filename, pT_header *header,
01305 int frame, int field,
01306 const unsigned short *y_fld,
01307 const unsigned short *uv_fld,
01308 int write_mode,
01309 int width, int fld_height, int stride);
01310 extern pT_status p_write_frame_16
01311 (const char *filename, pT_header *header,
01312 int frame,
01313 const unsigned short *y_or_s_frm,
01314 const unsigned short *uv_frm,
01315 int write_mode,
01316 int width, int frm_height, int stride);
01317
01318
01319
01320
01321
01322
01323
01324
01325
01326
01327
01328 extern pT_status p_read_field_planar
01329 (const char *filename, pT_header *header,
01330 int frame, int field,
01331 unsigned char *y_or_r_fld,
01332 unsigned char *u_or_g_fld,
01333 unsigned char *v_or_b_fld,
01334 int read_mode,
01335 int width, int fld_height, int stride, int uv_stride);
01336 extern pT_status p_read_frame_planar
01337 (const char *filename, pT_header *header,
01338 int frame,
01339 unsigned char *y_or_r_frm,
01340 unsigned char *u_or_g_frm,
01341 unsigned char *v_or_b_frm,
01342 int read_mode,
01343 int width, int frm_height, int stride, int uv_stride);
01344 extern pT_status p_write_field_planar
01345 (const char *filename, pT_header *header,
01346 int frame, int field,
01347 const unsigned char *y_or_r_fld,
01348 const unsigned char *u_or_g_fld,
01349 const unsigned char *v_or_b_fld,
01350 int width, int fld_height, int stride, int uv_stride);
01351 extern pT_status p_write_frame_planar
01352 (const char *filename, pT_header *header,
01353 int frame,
01354 const unsigned char *y_or_r_frm,
01355 const unsigned char *u_or_g_frm,
01356 const unsigned char *v_or_b_frm,
01357 int width, int frm_height, int stride, int uv_stride);
01358
01359 extern pT_status p_read_field_planar_16
01360 (const char *filename, pT_header *header,
01361 int frame, int field,
01362 unsigned short *y_or_r_fld,
01363 unsigned short *u_or_g_fld,
01364 unsigned short *v_or_b_fld,
01365 int read_mode,
01366 int width, int fld_height, int stride, int uv_stride);
01367 extern pT_status p_read_frame_planar_16
01368 (const char *filename, pT_header *header,
01369 int frame,
01370 unsigned short *y_or_r_frm,
01371 unsigned short *u_or_g_frm,
01372 unsigned short *v_or_b_frm,
01373 int read_mode,
01374 int width, int frm_height, int stride, int uv_stride);
01375 extern pT_status p_write_field_planar_16
01376 (const char *filename, pT_header *header,
01377 int frame, int field,
01378 const unsigned short *y_or_r_fld,
01379 const unsigned short *u_or_g_fld,
01380 const unsigned short *v_or_b_fld,
01381 int write_mode,
01382 int width, int fld_height, int stride, int uv_stride);
01383 extern pT_status p_write_frame_planar_16
01384 (const char *filename, pT_header *header,
01385 int frame,
01386 const unsigned short *y_or_r_frm,
01387 const unsigned short *u_or_g_frm,
01388 const unsigned short *v_or_b_frm,
01389 int write_mode,
01390 int width, int frm_height, int stride, int uv_stride);
01391
01433 extern pT_status p_read_field_comp
01434 (const char *filename, pT_header *header,
01435 int frame, int field, int comp,
01436 unsigned char *c_fld,
01437 int read_mode,
01438 int width, int fld_height, int stride);
01439 extern pT_status p_read_frame_comp
01440 (const char *filename, pT_header *header,
01441 int frame, int comp,
01442 unsigned char *c_frm,
01443 int read_mode,
01444 int width, int frm_height, int stride);
01445 extern pT_status p_write_field_comp
01446 (const char *filename, pT_header *header,
01447 int frame, int field, int comp,
01448 const unsigned char *c_fld,
01449 int width, int fld_height, int stride);
01450 extern pT_status p_write_frame_comp
01451 (const char *filename, pT_header *header,
01452 int frame, int comp,
01453 const unsigned char *c_frm,
01454 int width, int frm_height, int stride);
01455
01456 extern pT_status p_read_field_comp_16
01457 (const char *filename, pT_header *header,
01458 int frame, int field, int comp,
01459 unsigned short *c_fld,
01460 int read_mode,
01461 int width, int fld_height, int stride);
01462 extern pT_status p_read_frame_comp_16
01463 (const char *filename, pT_header *header,
01464 int frame, int comp,
01465 unsigned short *c_frm,
01466 int read_mode,
01467 int width, int frm_height, int stride);
01468 extern pT_status p_write_field_comp_16
01469 (const char *filename, pT_header *header,
01470 int frame, int field, int comp,
01471 const unsigned short *c_fld,
01472 int write_mode,
01473 int width, int fld_height, int stride);
01474 extern pT_status p_write_frame_comp_16
01475 (const char *filename, pT_header *header,
01476 int frame, int comp,
01477 const unsigned short *c_frm,
01478 int write_mode,
01479 int width, int frm_height, int stride);
01497 extern int p_mod_add_comp (pT_header *header);
01498
01502 extern int p_get_comp_by_name (const pT_header *header, const char *name);
01503
01505 extern int p_get_num_comps (const pT_header *header);
01506
01510 extern pT_status p_mod_set_comp_2
01511 (pT_header *header, const int comp,
01512 const char *name,
01513 const pT_data_fmt file_data_fmt,
01514 const int pix_subsample,
01515 const int line_subsample,
01516 const int multiplex_factor);
01517
01521 #define p_mod_set_comp(h,c,n,d,p,l) p_mod_set_comp_2((h),(c),(n),(d),(p),(l),1)
01522
01527 extern pT_status p_mod_rm_comp (pT_header *header, const int comp);
01528
01530 extern pT_status p_mod_rm_extra_comps (pT_header *header);
01531
01536 extern pT_status p_get_comp_2
01537 (const pT_header *header, const int comp,
01538 char *name,
01539 pT_data_fmt *file_data_fmt,
01540 int *pix_subsample,
01541 int *line_subsample,
01542 int *multiplex_factor);
01543
01547 #define p_get_comp(h,c,n,d,p,l) p_get_comp_2((h),(c),(n),(d),(p),(l),NULL)
01548
01555 extern pT_status p_get_comp_buffer_size (const pT_header *header, const int comp,
01556 int *width, int *height);
01599 extern pT_status p_cce_read_comp
01600 (const char *filename, pT_header *header,
01601 int frame, int field, int comp,
01602 void *abuf, pT_buf_type atype,
01603 int offset, int gain,
01604 int width, int height, int stride);
01605
01606 extern pT_status p_cce_write_comp
01607 (const char *filename, pT_header *header,
01608 int frame, int field, int comp,
01609 const void *abuf, pT_buf_type atype,
01610 int offset, int gain,
01611 int width, int height, int stride);
01636 extern pT_status p_cce_read_float_xyz(
01637 const char *filename,
01638 pT_header *header,
01639 int frame,
01640 int field,
01641 float *r_or_x_frm,
01642 float *g_or_y_frm,
01643 float *b_or_z_frm,
01644 int width, int height, int stride );
01645 extern pT_status p_cce_write_float_xyz(
01646 const char *filename,
01647 pT_header *header,
01648 int frame,
01649 int field,
01650 float *r_or_x_frm,
01651 float *g_or_y_frm,
01652 float *b_or_z_frm,
01653 int width, int height, int stride );
01654
01692 extern int p_mod_add_aux (
01693 pT_header * header,
01694 int max_size,
01695 const char * name,
01696 int descr_len,
01697 const char * description );
01698
01700 extern int p_get_num_aux (
01701 const pT_header *header );
01702
01704 extern int p_get_aux_by_name (
01705 const pT_header * header,
01706 const char * name );
01707
01713 extern pT_status p_mod_rm_aux (
01714 pT_header * header,
01715 int aux_id );
01716
01728 extern pT_status p_get_aux (
01729 const pT_header *header,
01730 int aux_id,
01731 int * max_size,
01732 char * name,
01733 int * descr_len,
01734 char * description );
01735
01747 extern pT_status p_read_aux (
01748 const char * filename,
01749 pT_header * header,
01750 int frame,
01751 int field,
01752 int aux_id,
01753 int * size,
01754 unsigned char * buf );
01755
01756
01768 extern pT_status p_write_aux (
01769 const char * filename,
01770 pT_header * header,
01771 int frame,
01772 int field,
01773 int aux_id,
01774 int size,
01775 unsigned char * buf );
01776
01813 extern pT_status p_open_file (const char *filename, int write);
01814 extern pT_status p_close_file (const char *filename);
01837 extern pT_status p_set_file_buf_size (const int size_kb);
01838 extern int p_get_file_buf_size (void);
01847 extern void p_fatal_error (pT_status status,
01848 FILE *stream);
01854 extern void p_fatal_error_fileio (pT_status status,
01855 const char *filename,
01856 FILE *stream);
01858 extern char *p_get_error_string (pT_status status);
01872 extern char *p_revision_str;
01873
01875 extern char *p_get_version (void);
01876
01880 extern char *p_get_magic (void);
01881
01884 #ifdef __cplusplus
01885 }
01886 #endif
01887
01888 #endif