![]() |
Perfectly Clear SDK Documentation
8.3.1.149
|
PFCImageFile Class to encapsulate file handling. More...
#include <PFCImageFile.h>
Public Member Functions | |
PFC_FILE_LOAD_STATUS | LoadImageFile (const char *filename, bool bConvertToSRGB, const char *iccFolderPath) |
Load JPEG from file on disk. More... | |
bool | SaveImageFile (const char *filename, int jpegQuality, bool bConvertToOriginalColorSpace, bool bEmbedOriginalMetadata) |
Write image data to file. More... | |
Data Fields | |
unsigned char * | raw_image = NULL |
int | width |
int | height |
int | bytes_per_pixel |
int | stride |
bool | sourceSRGB |
int | jpeg_color_space |
PFCImageFile Class to encapsulate file handling.
This is an optional class you can use to read and write JPEG files, manage EXIF metadata and perform color space conversion (to / from sRGB). At this time, only RGB formatted JPEG images are supported. Basic usage:
Then, load PFCIMAGE with this data:
Correct the image:
Then write image back to disk:
Definition at line 64 of file PFCImageFile.h.
PFC_FILE_LOAD_STATUS LoadImageFile | ( | const char * | filename, |
bool | bConvertToSRGB, | ||
const char * | iccFolderPath | ||
) |
Load JPEG from file on disk.
filename | [in] - path to file to load |
bConvertToSRGB | [in] - Bool to control conversion to sRGB, usually should be set to true |
iccFolderPath | [in] - Some JPEGs may be in AdobeRGB without AdobeRGB being actually embedded. Path to folder containing AdobeRGB1998.icc should be passed here |
bool SaveImageFile | ( | const char * | filename, |
int | jpegQuality, | ||
bool | bConvertToOriginalColorSpace, | ||
bool | bEmbedOriginalMetadata | ||
) |
Write image data to file.
filename | [in] - filename to write to |
jpegQuality | [in] - Compression quality from zero (lowest) to 100 (highest quality). We recommend 92 |
bConvertToOriginalColorSpace | [in] - Convert the file back to the input colorspace? If false, the resutling file will be in sRGB. |
bEmbedOriginalMetadata | [in] - Set to true to copy EXIF data from original to output. This can be critical for images with EXIF rotation flag |
int bytes_per_pixel |
bytes per pixel
Definition at line 100 of file PFCImageFile.h.
int height |
image height
Definition at line 98 of file PFCImageFile.h.
int jpeg_color_space |
JPEG Color Space = JCS_RGB or JCS_GRAYSCALE for grayscale images
Definition at line 107 of file PFCImageFile.h.
unsigned char* raw_image = NULL |
image data. Can be loaded directly into PFCIMAGE
Definition at line 94 of file PFCImageFile.h.
bool sourceSRGB |
set to true if the input image is determined to be in sRGB
Definition at line 104 of file PFCImageFile.h.
int stride |
image stride
Definition at line 102 of file PFCImageFile.h.
int width |
image width
Definition at line 96 of file PFCImageFile.h.