Error codes
Status codes and decode macros for error handling in the Perfectly Clear C API.
This page documents error codes and decode macros for handling return values from Perfectly Clear SDK functions.
Decode macros
These macros extract individual feature status codes from the composite return value of PFC_Apply and PFC_AutoCorrect when the return value is greater than zero.
NRRETCODE
Extracts the Noise Removal status from the lower 8 bits of a composite return code.
#define NRRETCODE(x) (x & 0x000000FF)Returns: PFCNR STATUS
CORERETCODE
Extracts the Core correction status from bits 8-15 of a composite return code.
#define CORERETCODE(x) ((x >> 8) & 0x000000FF)Returns: PFCCORE STATUS
FBRETCODE
Extracts the Face Beautification status from bits 16-23 of a composite return code.
#define FBRETCODE(x) ((x >> 16) & 0x000000FF)Returns: PFCFB STATUS
RERETCODE
Extracts the Red Eye correction status from the upper 8 bits of a composite return code.
#define RERETCODE(x) ((x >> 24) & 0x000000FF)Returns: PFCRE STATUS
Usage example
This example demonstrates how to interpret return codes and decode warnings from correction operations.
int result = PFC_AutoCorrect(&image, &thumbnail, param);
if (result < 0) {
// Error occurred
switch (result) {
case APPLY_ERROR_PROFILE_MISSING:
printf("Error: Profile is NULL\n");
break;
case APPLY_NOSOURCE:
printf("Error: Source image is NULL\n");
break;
case APPLY_BADFORMAT:
printf("Error: Unsupported pixel format\n");
break;
case APPLY_INVALIDLICENSE:
printf("Error: Invalid license\n");
break;
default:
printf("Error code: %d\n", result);
}
} else if (result > 0) {
// Warnings - some features may not have been applied
PFCNR_STATUS nrStatus = NRRETCODE(result);
PFCCORE_STATUS coreStatus = CORERETCODE(result);
PFCFB_STATUS fbStatus = FBRETCODE(result);
PFCRE_STATUS reStatus = RERETCODE(result);
if (coreStatus != PFC_CORE_SUCCESS) {
printf("Core warning: %d\n", coreStatus);
}
if (fbStatus != PFC_FB_SUCCESS) {
printf("Face Beautification warning: %d\n", fbStatus);
}
} else {
// result == 0: Complete success
printf("Correction applied successfully\n");
}Return code summary
This table provides a quick reference for interpreting the general meaning of return values.
| Value | Meaning |
|---|---|
| 0 | Success, all corrections applied |
| Greater than 0 | Warning, use decode macros to check individual features |
| Less than 0 | Error, see PFCAPPLYSTATUS |
License status codes
These codes are returned by PFC_SetProtectionPath to indicate license validation results.
| Code | Meaning |
|---|---|
| 0 | OK |
| 101 | Undetermined errors |
| 102 | Success with active license |
| 103 | Success with active trial |
| 104 | License expired |
| 105 | System time tampered |
| 106 | Product not authorized |
| 107 | Product not found |
| 108 | Invalid license |
| 109 | License returned |
| 110 | Product inactive |
| 111 | Invalid trial period |
| 112 | Too many activations |
| 113 | Trial expired |
| 114 | License number inactive |
| 115 | Exceed allowed activations |
| 116 | Subscription expired |
| 117 | Invalid system date |
| 118 | Product in invalid state |
| 119 | No available licenses |
| 120 | Duplicate device ID |
| 121 | High missing heartbeat |
Preset file status codes
These codes are returned by PFC_ReadPresets to indicate preset file loading results.
| Code | Meaning |
|---|---|
| 0 | OK |
| -1 | Attribute errors |
| -2 | Unable to open file |
| -3 | File read error |
| -4 | Parse error |
| -5 | Cannot convert text |
| -6 | No text node |
| -7 | Element depth exceeded |
| -8 | Invalid preset file |
| -9 | Preset file contains unexpected group |
| -10 | Preset requires unavailable Scene Detection model |
PFC-SDK Version 10.7.2.1269 built from 4fa849d8101945eea725a08dd0dae5101f090fa0 on 11-10-2025.
Copyright © 2026 EyeQ Imaging Inc. All rights reserved.