Data Structures
Core data types for images, engine instances, and analysis results.
This page documents the foundational data structures used throughout the Perfectly Clear SDK.
Image structure
This structure represents image data passed to the SDK for processing.
PFCIMAGE
Defines an image buffer including dimensions, pixel format, and data pointer for SDK processing.
typedef struct {
int width;
int height;
int stride;
PFCPIXELFORMAT format;
unsigned char *data;
} PFCIMAGE;| Field | Type | Description |
|---|---|---|
| width | int | Pixel width of image |
| height | int | Pixel height of image |
| stride | int | Byte width of each scanline or row |
| format | PFCPIXELFORMAT | Pixel format defining byte order |
| data | unsigned char* | Pointer to first byte of image data buffer |
Notes:
The stride may be larger than width times bytes per pixel if rows are padded for alignment. The SDK modifies image data in place during processing.
Example:
PFCIMAGE image;
image.width = 1920;
image.height = 1080;
image.stride = 1920 * 3; // 3 bytes per pixel, no padding
image.format = PFC_PixelFormat24bppBGR;
image.data = myImageBuffer;
int result = PFC_AutoCorrect(&image, NULL, param);Engine structure
This structure manages the processing engine used for image correction operations.
PFCENGINE
Contains the internal engine pointer and initialization status for a processing engine instance.
typedef struct {
PFCINTERNAL pEngine;
PFCENGINESTATUS status;
} PFCENGINE;| Field | Type | Description |
|---|---|---|
| pEngine | PFCINTERNAL | Internal pointer to engine implementation |
| status | PFCENGINESTATUS | Engine initialization status |
Usage:
PFCENGINE* pEngine = PFC_CreateEngine();
if (pEngine->status != ENGINESTATUS_OK) {
printf("Engine status: %d\n", pEngine->status);
}
// Use engine for processing...
PFC_DestroyEngine(pEngine);Profile structure
This structure stores image analysis results that enable efficient parameter adjustments without recalculation.
PFCIMAGEPROFILE
Contains pre-calculated analysis data and feature status codes returned by PFC_Calc.
typedef struct {
PFCINTERNAL pPfcParam;
PFCINTERNAL pNoiseParam;
PFCINTERNAL pRedEyeParam;
PFCINTERNAL pSFBParam;
PFCINTERNAL pInternal;
PFCCORE_STATUS CORE_Status;
PFCNR_STATUS NR_Status;
PFCFB_STATUS FB_Status;
PFCRE_STATUS RE_Status;
int Status;
} PFCIMAGEPROFILE;| Field | Type | Description |
|---|---|---|
| CORE_Status | PFCCORE STATUS | Core pre-calc status |
| NR_Status | PFCNR STATUS | Noise Removal pre-calc status |
| FB_Status | PFCFB STATUS | Face Beautification pre-calc status |
| RE_Status | PFCRE STATUS | Red Eye pre-calc status |
| Status | int | Summary status bits |
Note: The PFCPROFILE type is a pointer to PFCIMAGEPROFILE:
#define PFCPROFILE PFCIMAGEPROFILE*Geometry structures
These structures define basic geometric primitives used for coordinates and regions.
PFCPOINT
Represents a two-dimensional point with integer x and y coordinates.
typedef struct {
int x;
int y;
} PFCPOINT;PFCRECT
Represents a rectangular region with position and dimensions.
typedef struct {
int left;
int top;
int width;
int height;
} PFCRECT;Face detection structures
These structures contain face detection results including facial landmarks and attributes.
PFCFBFACEINFO
Contains simplified face geometry including eye positions and face bounds from Face Beautification detection.
typedef struct {
PFCPOINT leftEye;
PFCPOINT rightEye;
PFCRECT face;
} PFCFBFACEINFO;| Field | Type | Description |
|---|---|---|
| leftEye | PFCPOINT | Left eye position |
| rightEye | PFCPOINT | Right eye position |
| face | PFCRECT | Face bounding rectangle |
Example:
PFCFBFACEINFO face;
int numFaces = PFC_FBFaceCount(profile);
for (int i = 0; i < numFaces; i++) {
if (PFC_GetFaceInfo(profile, &face, i)) {
printf("Face %d: eyes at (%d,%d) and (%d,%d)\n", i,
face.leftEye.x, face.leftEye.y,
face.rightEye.x, face.rightEye.y);
}
}PFCFACERECT
Contains comprehensive face detection data including landmarks, angles, and confidence scores from Face Aware Exposure analysis.
typedef struct PFCFaceRect {
PFCRECT rect;
PFCRECT rcEyeL;
PFCRECT rcEyeR;
PFCRECT rcMouth;
PFCPOINT ptEyeL;
PFCPOINT ptEyeR;
int angle;
int blinkLevel;
int blinkLevelL;
int blinkLevelR;
int confidence;
int smileLevel;
int yawAngle;
int FAE[3];
int widthImage;
int heightImage;
struct PFCFaceRect *pNext;
} PFCFACERECT;| Field | Type | Description |
|---|---|---|
| rect | PFCRECT | Face bounding rectangle |
| rcEyeL | PFCRECT | Left eye rectangle |
| rcEyeR | PFCRECT | Right eye rectangle |
| rcMouth | PFCRECT | Mouth rectangle |
| ptEyeL | PFCPOINT | Left eye coordinates with 10-bit fixed-point |
| ptEyeR | PFCPOINT | Right eye coordinates with 10-bit fixed-point |
| angle | int | Roll angle from -179 to 180 degrees |
| confidence | int | Detection confidence |
| smileLevel | int | Smile detection level |
| yawAngle | int | Yaw angle from -90 to 90 degrees |
| widthImage | int | Source image width |
| heightImage | int | Source image height |
| pNext | PFCFACERECT* | Next face in linked list |
Example:
PFCFACERECT* face = NULL;
while ((face = PFC_EnumFAEFaceRect(profile, face))) {
printf("Face at (%d,%d), confidence: %d\n",
face->rect.left, face->rect.top, face->confidence);
}PFC-SDK Version 10.7.2.1269 built from 4fa849d8101945eea725a08dd0dae5101f090fa0 on 11-10-2025.
Copyright © 2026 EyeQ Imaging Inc. All rights reserved.