#include "puma2config.h"
#include "ImageReader.h"
#include "PumaException.h"
#include "PumaMessages.h"
#include <cstdio>
#include <cerrno>
#include <string>
#include <png.h>
#include <jpeglib.h>
Go to the source code of this file.
Functions |
static int | getPNMinteger (FILE *fp) |
void | jpeg_memory_src (j_decompress_ptr cinfo, JOCTET *ptr, size_t numBytes) |
static bool | readImageColorBuiltinPNM (ColorImageRGB8 &img, FILE *fp) |
static bool | readImageColorJPEG_generic (ColorImageRGB8 &img, struct jpeg_decompress_struct &cinfo) |
static bool | readImageColorJPEGFromFile (ColorImageRGB8 &img, FILE *fp) |
static bool | readImageColorJPEGFromMemory (ColorImageRGB8 &img, JOCTET *ptr, size_t numBytes) |
static bool | readImageColorPNG (ColorImageRGB8 &img, FILE *fp) |
static bool | readImageGrayBuiltinPNM (GrayLevelImage8 &img, FILE *fp) |
static bool | readImageGrayJPEG (GrayLevelImage8 &img, FILE *fp) |
static bool | readImageGrayPNG (GrayLevelImage8 &img, FILE *fp) |
static bool | readPNMheader (FILE *filePointer, int &pCode, int &pWid, int &pHig, int &pDep) |
static void | skipPNMcomment (FILE *fp) |
Function Documentation
Read an integer value form the header of a PNM (PBM, PGM, PPM) file header (or body for P1-P3). Skips any white space and comments, then reads a sequence of digits.
- Parameters:
-
[in] | fp | File pointer to read from |
- Returns:
- returns the integer value of the number read.
- Precondition:
- fp points somwhere were the next integer is expected
- Postcondition:
- character right behind the last digit was consumed by getc(), or end-of-file was reached.
Definition at line 355 of file ImageReader.cpp.
void jpeg_memory_src |
( |
j_decompress_ptr |
cinfo, |
|
|
JOCTET * |
ptr, |
|
|
size_t |
numBytes |
|
) |
| |
static bool readPNMheader |
( |
FILE * |
filePointer, |
|
|
int & |
pCode, |
|
|
int & |
pWid, |
|
|
int & |
pHig, |
|
|
int & |
pDep |
|
) |
| [static] |
Skip comments in a PNM (PBM, PGM, PPM) file header (or body for P1-P3). Reads and discards characters from a file pointer until end-of-line or and-of-file is reached.
- Parameters:
-
[in] | fp | File pointer to read from |
- Precondition:
- comment char '#' was just read before with getc(fp)
- Postcondition:
- newline char of this comment was read as last character or end-of-file was reached.
Definition at line 336 of file ImageReader.cpp.