Perfectly Clear SDK Documentation  8.3.0.146
PFCImageFile.h
Go to the documentation of this file.
1 
8 #ifndef PFCIMAGEFILE_H
9 #define PFCIMAGEFILE_H
10 
11 #ifdef WIN32
12 #if defined(PFCIMAGEFILEDLL_LIBRARY)
13 # define PFCIMAGEFILEDLLSHARED_EXPORT __declspec(dllexport)
14 #else
15 # define PFCIMAGEFILEDLLSHARED_EXPORT __declspec(dllimport)
16 #endif
17 #else
18 # define PFCIMAGEFILEDLLSHARED_EXPORT
19 #endif
20 
21 #include <string>
22 
24 typedef enum {
30 
64 class PFCIMAGEFILEDLLSHARED_EXPORT PFCImageFile
65 {
66 
67 public:
68  PFCImageFile();
69  PFCImageFile(int width, int height, int bytes_per_pixel, int stride);
70  ~PFCImageFile();
78  PFC_FILE_LOAD_STATUS LoadImageFile(const char *filename, bool bConvertToSRGB, const char *iccFolderPath);
86  bool SaveImageFile(const char *filename, int jpegQuality, bool bConvertToOriginalColorSpace, bool bEmbedOriginalMetadata);
87  void AllocBuffer(int width, int height, int bytes_per_pixel, int stride);
88 
94  unsigned char *raw_image = NULL;
96  int width;
98  int height;
102  int stride;
105 
108 
109 private:
110  PFC_FILE_LOAD_STATUS read_jpeg_file( const char *filename, bool bConvertToSRGB, const char *iccFolderPath);
111  int write_jpeg_file( const char *filename, int quality, bool bConvertToOriginalColorSpace, bool bEmbedOriginalMetadata );
112  bool ConvertToSRGB();
113  bool ConvertFromSRGBToOriginal();
114  bool applyColorTransform(void* hTransform);
115  PFC_FILE_LOAD_STATUS read_rawdump( const char *filename);
116  bool write_rawdump(const char *basename); // adds dump params to the name: basename.hex -> basename-<w>-<h>-<bpp>.hex
117 
118  void* hTransformToSRGB;
119  void* hTransformSRGBToOriginal;
120  unsigned int embeddedICCLen;
121  unsigned char* embeddedICCBuf;
122 
123  bool bIgnoreNonembeddedIcc; // TODO:
124 
125  std::string originalPath;
126 };
127 
128 #endif // PFCIMAGEFILE_H
Error: failed to convert to sRGB.
Definition: PFCImageFile.h:28
Error: unsupported file.
Definition: PFCImageFile.h:27
Error.
Definition: PFCImageFile.h:26
PFCImageFile Class to encapsulate file handling.
Definition: PFCImageFile.h:64
PFC_FILE_LOAD_STATUS
Return status values.
Definition: PFCImageFile.h:24
int jpeg_color_space
Definition: PFCImageFile.h:107
Success.
Definition: PFCImageFile.h:25