|
A Portable Floating-Point-Based Image Format
1.0
|
#include <stdio.h>#include <limits.h>

Go to the source code of this file.
Defines | |
| #define | PFI_VERSION "1.2" |
| #define | PFI_EPSILON (3 * DBL_EPSILON) |
| #define | DLL_EXPORT |
| #define | pfi_htof32(x) (x) |
| #define | pfi_ftoh32(x) (x) |
| #define | pfi_htof16(x) (x) |
| #define | pfi_ftoh16(x) (x) |
Enumerations | |
| enum | { pfi_grey = 0, pfi_rgb, pfi_yuv, pfi_unknown } |
Functions | |
| int | pfi_getv (FILE *stream, double *valp) |
| int | pfi_putv (FILE *stream, double val) |
| int | pfi_properties (FILE *stream, int *rows, int *cols, int *colors, int *colormodel) |
| double * | pfi_read (FILE *stream, int *rows, int *cols, int *colors, int *colormodel) |
| int | pfi_write (FILE *stream, double *buf, int rows, int cols, int colors, int colormodel, char *fname) |
| DLL_EXPORT int | pfi_read_name (char *name, int rows, int cols, int colors, double *result) |
| DLL_EXPORT int | pfi_write_name (char *name, double *buf, int rows, int cols, int colors, int colormodel) |
| DLL_EXPORT int | pfi_properties_name (char *name, int *rows, int *cols, int *colors, int *colormodel) |
| #define DLL_EXPORT |
| #define PFI_EPSILON (3 * DBL_EPSILON) |
| #define pfi_ftoh16 | ( | x | ) | (x) |
| #define pfi_ftoh32 | ( | x | ) | (x) |
| #define pfi_htof16 | ( | x | ) | (x) |
| #define pfi_htof32 | ( | x | ) | (x) |
| #define PFI_VERSION "1.2" |
| anonymous enum |
| int pfi_getv | ( | FILE * | stream, |
| double * | valp | ||
| ) |
Reads a double value from an open pfi file
| stream | The open file. |
| valp | A reference to the value to be read. |
Definition at line 380 of file pfi.c.
References DPRINTF, pfi2double(), pfi_ftoh16, pfi_ftoh32, and PIXEL_PFIS.
| int pfi_properties | ( | FILE * | stream, |
| int * | rows, | ||
| int * | cols, | ||
| int * | colors, | ||
| int * | colormodel | ||
| ) |
Gets the pfi image properties from an open file.
| stream | The open file. |
| rows | A reference to the number of rows to be determined from the image header. |
| cols | A reference to the number of cols to be determined from the image header. |
| colors | A reference to the number of colors to be determined from the image header. |
| colormodel | A reference to an integer to represent the colormodel used in this image to be determined from the image header. We use 0 for none (greyscale), 1 for RGB etc. |
Definition at line 489 of file pfi.c.
References DPRINTF, numexpect(), and skipcomments().
| DLL_EXPORT int pfi_properties_name | ( | char * | name, |
| int * | rows, | ||
| int * | cols, | ||
| int * | colors, | ||
| int * | colormodel | ||
| ) |
Gets the pfi image properties from an image file.
| name | The file name. |
| rows | A reference to the number of rows to be determined from the image header. |
| cols | A reference to the number of cols to be determined from the image header. |
| colors | A reference to the number of colors to be determined from the image header. |
| colormodel | A reference to an integer to represent the colormodel used in this image to be determined from the image header. We use 0 for none (greyscale), 1 for RGB etc. |
Definition at line 888 of file pfi.c.
References pfi_properties().
| int pfi_putv | ( | FILE * | stream, |
| double | val | ||
| ) |
Writes a double value into an open pfi file.
| stream | The open file. |
| val | The value to be written. |
Definition at line 428 of file pfi.c.
References double2pfi(), DPRINTF, pfi_htof16, pfi_htof32, and PIXEL_PFIS.
| double* pfi_read | ( | FILE * | stream, |
| int * | rows, | ||
| int * | cols, | ||
| int * | colors, | ||
| int * | colormodel | ||
| ) |
Reads a pfi image from an open file.
| stream | The open file. |
| rows | A reference to the number of rows to be determined from the image header. |
| cols | A reference to the number of cols to be determined from the image header. |
| colors | A reference to the number of colors to be determined from the image header. |
| colormodel | A reference to an integer to represent the colormodel used in this image to be determined from the image header. We use 0 for none (greyscale), 1 for RGB etc. |
Definition at line 654 of file pfi.c.
References DPRINTF, pfi_properties(), and pfi_read_internal().
| DLL_EXPORT int pfi_read_name | ( | char * | name, |
| int | rows, | ||
| int | cols, | ||
| int | colors, | ||
| double * | result | ||
| ) |
Reads a pfi image.
| name | The file name. |
| rows | the number of rows |
| cols | the number of cols |
| colors | the number of colors |
| result | A double array containing the image. The colors are stored one after another, so we've got pixel one with all colors first, then pixel two etc. |
Definition at line 770 of file pfi.c.
References pfi_read_internal().
| int pfi_write | ( | FILE * | stream, |
| double * | buf, | ||
| int | rows, | ||
| int | cols, | ||
| int | colors, | ||
| int | colormodel, | ||
| char * | fname | ||
| ) |
Writes a pfi image to an open file.
| stream | The open file. |
| buf | A reference to the buffer containing the image. The colors are stored one after another, so we've got pixel one with all colors first, then pixel two etc. |
| rows | A reference to the number of rows to be determined from the image header. |
| cols | A reference to the number of cols to be determined from the image header. |
| colors | A reference to the number of colors to be determined from the image header. |
| colors | A reference to the number of colors to be determined from the image header. |
| colormodel | An integer to represent the colormodel used in this image. We use 0 for none (greyscale), 1 for RGB etc. |
| fname | The name which will be written to the file header. |
Definition at line 715 of file pfi.c.
References pfi_putv().
| DLL_EXPORT int pfi_write_name | ( | char * | name, |
| double * | buf, | ||
| int | rows, | ||
| int | cols, | ||
| int | colors, | ||
| int | colormodel | ||
| ) |
Opens and writes a pfi image.
| name | The file name. |
| buf | A reference to the buffer containing the image. The colors are stored one after another, so we've got pixel one with all colors first, then pixel two etc. |
| rows | A reference to the number of rows to be determined from the image header. |
| cols | A reference to the number of cols to be determined from the image header. |
| colors | A reference to the number of colors to be determined from the image header. |
| colors | A reference to the number of colors to be determined from the image header. |
| colormodel | An integer to represent the colormodel used in this image. We use 0 for none (greyscale), 1 for RGB etc. |
Definition at line 833 of file pfi.c.
References pfi_write().
1.7.6.1