### Build with Meson Source: https://github.com/mm2/little-cms/blob/master/BUILDING.md Currently in testing. Requires meson and ninja. To install to a custom prefix, use the --prefix option during setup. ```bash meson setup build ninja -C build meson test -C build meson install -C build ``` ```bash meson setup build --prefix=/your/prefix ``` -------------------------------- ### Build with Autotools Source: https://github.com/mm2/little-cms/blob/master/BUILDING.md Use this for traditional Unix-like platforms. Ensure autoconf, automake, and libtool are installed. To install to a custom prefix, use the --prefix option with configure. ```bash ./autogen.sh # if building from a git checkout ./configure make make check make install ``` ```bash ./configure --prefix=/your/prefix ``` -------------------------------- ### Example: Create sRGB-like Profile Source: https://github.com/mm2/little-cms/blob/master/_autodocs/07-virtual-profiles.md This example demonstrates creating an sRGB-like profile using `cmsCreateRGBProfileTHR` with predefined white point and primary chromaticities, and a gamma 2.4 transfer function. ```c cmsCIExyY sRGBWhitePoint = {0.3127, 0.3290, 1.0}; cmsCIExyYTRIPLE sRGBPrimaries = { {0.64, 0.33, 1.0}, // Red {0.30, 0.60, 1.0}, // Green {0.15, 0.06, 1.0} // Blue }; cmsToneCurve *curve = cmsBuildGamma(ctx, 2.4); cmsToneCurve *curves[3] = {curve, curve, curve}; cmsHPROFILE sRGB = cmsCreateRGBProfileTHR(ctx, &sRGBWhitePoint, &sRGBPrimaries, curves); ``` -------------------------------- ### Custom Memory Handler Plugin Example Source: https://github.com/mm2/little-cms/blob/master/_autodocs/12-plugin-api.md Provides an example of implementing a custom memory handler plugin using system malloc and free functions. This plugin can be registered to customize memory allocation for Little CMS operations. ```c #include "lcms2.h" #include "lcms2_plugin.h" // Custom allocator using system malloc void* myMalloc(cmsContext ctx, cmsUInt32Number size) { return malloc(size); } void myFree(cmsContext ctx, void* ptr) { free(ptr); } void* myRealloc(cmsContext ctx, void* ptr, cmsUInt32Number size) { return realloc(ptr, size); } // Plugin definition cmsPluginMemHandler memPlugin = { .base = { .Magic = cmsPluginMagicNumber, .ExpectedVersion = 2190, .Type = cmsPluginMemHandlerSig, .Next = NULL }, .MallocPtr = myMalloc, .FreePtr = myFree, .ReallocPtr = myRealloc, .MallocZeroPtr = NULL, .CallocPtr = NULL, .DupPtr = NULL }; // Register plugin cmsContext ctx = cmsCreateContext(&memPlugin, NULL); ``` -------------------------------- ### Get Creation Date/Time and Set/Get Profile Version Source: https://github.com/mm2/little-cms/blob/master/_autodocs/03-profile-api.md Functions to retrieve the profile's creation date and time, and to set or get its version number. ```c cmsBool cmsGetHeaderCreationDateTime(cmsHPROFILE hProfile, struct tm *Dest); void cmsSetProfileVersion(cmsHPROFILE hProfile, cmsFloat64Number Version); cmsFloat64Number cmsGetProfileVersion(cmsHPROFILE hProfile); ``` -------------------------------- ### Example Error Handler Implementation Source: https://github.com/mm2/little-cms/blob/master/_autodocs/10-utilities-context.md An example of how to implement and register a custom error handler function in C. This handler prints errors to stderr. ```c void errorHandler(cmsContext ctx, cmsUInt32Number code, const char *msg) { fprintf(stderr, "LittleCMS Error %u: %s\n", code, msg); } cmsSetLogErrorHandler(errorHandler); ``` -------------------------------- ### Iterate through dictionary entries Source: https://github.com/mm2/little-cms/blob/master/_autodocs/09-named-colors-dict-api.md This example demonstrates how to iterate over all entries in a dictionary using cmsDictGetEntryList and cmsDictNextEntry, printing the key and value of each entry. ```c const cmsDICTentry *e = cmsDictGetEntryList(dict); while (e != NULL) { wprintf(L"%s = %s\n", e->Name, e->Value); e = cmsDictNextEntry(e); } ``` -------------------------------- ### Get IT8 Data by Patch and Sample Name Source: https://github.com/mm2/little-cms/blob/master/_autodocs/11-it8-cgats-api.md Retrieves data as a string for a given patch and sample name from an IT8 handle. Example usage: cmsIT8GetData(it8, "1", "XYZ_X"). ```c const char* cmsIT8GetData(cmsHANDLE hIT8, const char* cPatch, const char* cSample); ``` -------------------------------- ### Read Measurement Data Example Source: https://github.com/mm2/little-cms/blob/master/_autodocs/11-it8-cgats-api.md Demonstrates loading an IT8 file, iterating through patches, and retrieving LAB color data. Ensure the 'measurements.txt' file exists and is accessible. ```c // Load measurement file cmsHANDLE it8 = cmsIT8LoadFromFile(ctx, "measurements.txt"); if (it8 == NULL) { perror("Failed to load IT8 file"); return; } // Get measurement data int patchCount = cmsIT8GetPatchByName(it8, ""); // Get last patch for (int i = 0; i <= patchCount; i++) { const char *name = cmsIT8GetPatchName(it8, i, NULL); double l = cmsIT8GetDataDbl(it8, name, "LAB_L"); double a = cmsIT8GetDataDbl(it8, name, "LAB_A"); double b = cmsIT8GetDataDbl(it8, name, "LAB_B"); printf("Patch %s: L=%f, a=%f, b=%f\n", name, l, a, b); } cmsIT8Free(it8); ``` -------------------------------- ### Create RGB Profile with Custom Gamma Curves Source: https://github.com/mm2/little-cms/blob/master/_autodocs/05-tone-curve-api.md Example demonstrating the creation of an RGB profile using custom gamma curves for each channel. Ensure proper cleanup of allocated resources. ```c // Create tone curves cmsToneCurve *gammaR = cmsBuildGamma(ctx, 2.2); cmsToneCurve *gammaG = cmsBuildGamma(ctx, 2.2); cmsToneCurve *gammaB = cmsBuildGamma(ctx, 2.2); cmsToneCurve *curves[3] = {gammaR, gammaG, gammaB}; // Create white point and primaries cmsCIExyY white; cmsCIExyYTRIPLE primaries; // ... populate white and primaries ... // Create profile cmsHPROFILE profile = cmsCreateRGBProfileTHR(ctx, &white, &primaries, curves); // ... use profile ... // Cleanup cmsFreeProfileSequenceDescription(pseq); cmsFreeToneCurveTriple(curves); cmsCloseProfile(profile); ``` -------------------------------- ### Create Custom Pipeline: RGB input -> Tone curves -> Matrix -> Output Source: https://github.com/mm2/little-cms/blob/master/_autodocs/08-pipeline-lut-api.md This example demonstrates how to construct a custom color transformation pipeline. It includes adding per-channel tone curves and a color correction matrix. ```c // Create pipeline: RGB input -> Tone curves -> Matrix -> Output cmsPipeline *pipe = cmsPipelineAlloc(ctx, 3, 3); // Add per-channel tone curves cmsToneCurve *curves[3]; curves[0] = curves[1] = curves[2] = cmsBuildGamma(ctx, 2.2); cmsStage *curveStage = cmsStageAllocToneCurves(ctx, 3, curves); cmsPipelineInsertStage(pipe, cmsAT_END, curveStage); // Add matrix for color correction cmsFloat64Number matrix[9] = { 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 // identity }; cmsStage *matrixStage = cmsStageAllocMatrix(ctx, 3, 3, matrix, NULL); cmsPipelineInsertStage(pipe, cmsAT_END, matrixStage); // Apply to data cmsUInt16Number input[3] = {32768, 32768, 32768}; cmsUInt16Number output[3]; cmsPipelineEval16(input, output, pipe); // Cleanup cmsPipelineFree(pipe); cmsFreeToneCurveTriple(curves); ``` -------------------------------- ### Create Custom RGB Workspace Profile Source: https://github.com/mm2/little-cms/blob/master/_autodocs/07-virtual-profiles.md This example demonstrates how to create a custom RGB profile using the Rec.709 primaries and D65 white point. It includes setting up the color space, transfer functions, and then creating and using a transform. Remember to clean up allocated resources. ```c // Define Rec.709 primaries with D65 white point cmsCIExyY rec709White = {0.3127, 0.3290, 1.0}; cmsCIExyYTRIPLE rec709Primaries = { {0.64, 0.33, 1.0}, // Red {0.30, 0.60, 1.0}, // Green {0.15, 0.06, 1.0} // Blue }; // Create linear transfer function cmsToneCurve *linear = cmsBuildGamma(ctx, 1.0); cmsToneCurve *curves[3] = {linear, linear, linear}; // Create profile cmsHPROFILE rec709 = cmsCreateRGBProfileTHR(ctx, &rec709White, &rec709Primaries, curves); // Use in transform cmsHPROFILE sRGB = cmsCreate_sRGBProfileTHR(ctx); cmsHTRANSFORM xform = cmsCreateTransformTHR(ctx, rec709, TYPE_RGB_FLT, sRGB, TYPE_RGB_FLT, INTENT_PERCEPTUAL, 0); // ... apply transform ... // Cleanup cmsDeleteTransform(xform); cmsCloseProfile(rec709); cmsCloseProfile(sRGB); cmsFreeToneCurveTriple(curves); ``` -------------------------------- ### Get I/O Handler from Profile Source: https://github.com/mm2/little-cms/blob/master/_autodocs/10-utilities-context.md Retrieves the I/O handler associated with a given profile handle. ```c cmsIOHANDLER* cmsGetProfileIOhandler(cmsHPROFILE hProfile); ``` -------------------------------- ### Optimized Image Processing with Little CMS Source: https://github.com/mm2/little-cms/blob/master/_autodocs/13-quick-reference.md Shows an example of transforming image data line by line using `cmsDoTransformLineStride`. This method can improve cache locality for large images compared to processing pixel by pixel. ```c // Setup cmsHTRANSFORM xform = /* ... */; unsigned char* image = /* ... */; int width = 640, height = 480; // Transform per-line (better cache locality) for (int y = 0; y < height; y++) { unsigned char* line = &image[y * width * 3]; cmsDoTransformLineStride(xform, line, line, // In-place transform width, 1, // 1 line 0, 0, // Contiguous 0, 0); // Planar n/a } ``` -------------------------------- ### Build with CMake Source: https://github.com/mm2/little-cms/blob/master/BUILDING.md Recommended for native Windows builds (MSVC). Requires CMake 3.x or later. CMake package config files are installed for downstream CMake projects. Cross-compilation is supported via toolchain files. ```bash cmake -S . -B build cmake --build build ctest --test-dir build cmake --install build ``` ```bash cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/your/prefix ``` -------------------------------- ### Get Profile Version as Float Source: https://github.com/mm2/little-cms/blob/master/_autodocs/10-utilities-context.md Retrieves the version of a profile as a floating-point number. This provides a more human-readable format for the version. ```c cmsFloat64Number cmsGetProfileVersion(cmsHPROFILE hProfile); ``` -------------------------------- ### Get the next dictionary entry Source: https://github.com/mm2/little-cms/blob/master/_autodocs/09-named-colors-dict-api.md Use cmsDictNextEntry to advance to the next entry in the dictionary. Returns NULL when the end of the list is reached. ```c const cmsDICTentry* cmsDictNextEntry(const cmsDICTentry* e); ``` -------------------------------- ### Create Simple Gamma Tone Curve Source: https://github.com/mm2/little-cms/blob/master/_autodocs/05-tone-curve-api.md Generates a basic power-law tone curve using a specified gamma exponent. Example usage shows creating a gamma 2.2 curve. ```c cmsToneCurve* cmsBuildGamma(cmsContext ContextID, cmsFloat64Number Gamma); ``` ```c cmsBuildGamma(ctx, 2.2) creates x^2.2 curve. ``` -------------------------------- ### Build and Link Little CMS on Linux/macOS Source: https://github.com/mm2/little-cms/blob/master/_autodocs/README.md Use pkg-config to automatically find the necessary compiler and linker flags for the Little CMS library on Linux or macOS. ```bash # On Linux/macOS gcc myapp.c -o myapp `pkg-config --cflags --libs lcms2` ``` -------------------------------- ### cmsGetTagCount Source: https://github.com/mm2/little-cms/blob/master/_autodocs/03-profile-api.md Gets the total number of tags present in a profile. ```APIDOC ## cmsGetTagCount ### Description Gets the total number of tags present in a profile. ### Method (Implicitly C function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **hProfile** (cmsHPROFILE) - Required - Profile handle ### Response #### Success Response Number of tags (cmsInt32Number) #### Error Response (Not specified, likely 0 or negative) ``` -------------------------------- ### Create I/O Handler from File Source: https://github.com/mm2/little-cms/blob/master/_autodocs/10-utilities-context.md Opens a file and creates an I/O handler for it. Specify the file name and access mode. ```c cmsIOHANDLER* cmsOpenIOhandlerFromFile(cmsContext ContextID, const char* FileName, const char* AccessMode); ``` -------------------------------- ### cmsStageOutputChannels Source: https://github.com/mm2/little-cms/blob/master/_autodocs/08-pipeline-lut-api.md Gets the number of output channels for a given stage. ```APIDOC ## cmsStageOutputChannels ### Description Get output channel count of stage. ### Signature ```c cmsUInt32Number cmsStageOutputChannels(const cmsStage* mpe); ``` ``` -------------------------------- ### Creating an RGB Profile from Scratch in Little CMS Source: https://github.com/mm2/little-cms/blob/master/_autodocs/13-quick-reference.md Illustrates the process of defining color space parameters, gamma curves, and then creating a new RGB profile using Little CMS. This is useful for custom color space definitions. ```c // Define color space cmsCIExyY whitePoint = {0.3127, 0.3290, 1.0}; // D65 cmsCIExyYTRIPLE primaries = { {0.64, 0.33, 1.0}, // Red {0.30, 0.60, 1.0}, // Green {0.15, 0.06, 1.0} // Blue }; // Create gamma curves cmsToneCurve *curve = cmsBuildGamma(NULL, 2.2); cmsToneCurve *curves[3] = {curve, curve, curve}; // Create profile cmsHPROFILE profile = cmsCreateRGBProfile(&whitePoint, &primaries, curves); // Use profile cmsHTRANSFORM xform = cmsCreateTransform( profile, TYPE_RGB_8, sRGB, TYPE_RGB_8, INTENT_PERCEPTUAL, 0); // Cleanup cmsDeleteTransform(xform); cmsCloseProfile(profile); cmsFreeToneCurveTriple(curves); ``` -------------------------------- ### cmsStageInputChannels Source: https://github.com/mm2/little-cms/blob/master/_autodocs/08-pipeline-lut-api.md Gets the number of input channels for a given stage. ```APIDOC ## cmsStageInputChannels ### Description Get input channel count of stage. ### Signature ```c cmsUInt32Number cmsStageInputChannels(const cmsStage* mpe); ``` ``` -------------------------------- ### Get the first dictionary entry Source: https://github.com/mm2/little-cms/blob/master/_autodocs/09-named-colors-dict-api.md Use cmsDictGetEntryList to retrieve a pointer to the first entry in the dictionary. Returns NULL if the dictionary is empty. Do not modify the returned structure. ```c const cmsDICTentry* cmsDictGetEntryList(cmsHANDLE hDict); ``` -------------------------------- ### Get Profile Device Class Source: https://github.com/mm2/little-cms/blob/master/_autodocs/03-profile-api.md Retrieves the device class signature of a profile. ```c cmsProfileClassSignature cmsGetDeviceClass(cmsHPROFILE hProfile); ``` -------------------------------- ### Initialize CIECAM02 Model Source: https://github.com/mm2/little-cms/blob/master/_autodocs/06-colorimetry-api.md Initializes the CIECAM02 color appearance model. Requires viewing condition parameters. ```c cmsHANDLE cmsCIECAM02Init(cmsContext ContextID, const cmsViewingConditions* pVC); ``` -------------------------------- ### Inspect Profile Information Source: https://github.com/mm2/little-cms/blob/master/_autodocs/13-quick-reference.md Opens a profile, retrieves its class, color space, PCS, and localized description. Lists all tags and checks for intent support. ```c cmsHPROFILE profile = cmsOpenProfileFromFile("profile.icc", "r"); // Get basic info cmsProfileClassSignature deviceClass = cmsGetDeviceClass(profile); cmsColorSpaceSignature colorSpace = cmsGetColorSpace(profile); cmsColorSpaceSignature pcs = cmsGetPCS(profile); // Get localized description wchar_t desc[256]; cmsGetProfileInfo(profile, cmsInfoDescription, "en", "US", desc, sizeof(desc)/sizeof(wchar_t)); wprintf(L"Profile: %s\n", desc); // List tags cmsInt32Number tagCount = cmsGetTagCount(profile); for (int i = 0; i < tagCount; i++) { cmsTagSignature tag = cmsGetTagSignature(profile, i); printf("Tag: 0x%08X\n", tag); } // Check intent support if (cmsIsIntentSupported(profile, INTENT_PERCEPTUAL, LCMS_USED_AS_INPUT)) { printf("Supports perceptual intent\n"); } cmsCloseProfile(profile); ``` -------------------------------- ### Get Profile Connection Space (PCS) Source: https://github.com/mm2/little-cms/blob/master/_autodocs/03-profile-api.md Retrieves the profile connection space signature. ```c cmsColorSpaceSignature cmsGetPCS(cmsHPROFILE hProfile); ``` -------------------------------- ### Create RGB Profile from Scratch Source: https://github.com/mm2/little-cms/blob/master/_autodocs/README.md Creates a custom RGB ICC profile programmatically using specified white point, primaries, and gamma. Ensure to free allocated tone curve memory. ```c cmsCIExyY whitePoint = {0.3127, 0.3290, 1.0}; // D65 cmsCIExyYTRIPLE primaries = { {0.64, 0.33, 1.0}, {0.30, 0.60, 1.0}, {0.15, 0.06, 1.0} }; cmsToneCurve *gamma = cmsBuildGamma(NULL, 2.2); cmsToneCurve *curves[3] = {gamma, gamma, gamma}; cmsHPROFILE profile = cmsCreateRGBProfile(&whitePoint, &primaries, curves); // Use profile... cmsCloseProfile(profile); cmsFreeToneCurveTriple(curves); ``` -------------------------------- ### Get Tag Count Source: https://github.com/mm2/little-cms/blob/master/_autodocs/03-profile-api.md Retrieves the total number of tags present in an ICC profile. ```c cmsInt32Number cmsGetTagCount(cmsHPROFILE hProfile); ``` -------------------------------- ### Get Input Color Space Source: https://github.com/mm2/little-cms/blob/master/_autodocs/03-profile-api.md Retrieves the input color space signature of a given profile. ```c cmsColorSpaceSignature cmsGetColorSpace(cmsHPROFILE hProfile); ``` -------------------------------- ### cmsCIECAM02Init Source: https://github.com/mm2/little-cms/blob/master/_autodocs/06-colorimetry-api.md Initializes the CIECAM02 color appearance model with specified viewing conditions. This function must be called before using other CIECAM02 functions. ```APIDOC ## cmsCIECAM02Init ### Description Initialize CIECAM02 model with viewing conditions. ### Method Not applicable (C function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters Table | Parameter | Type | Description | |---|---|---| | ContextID | cmsContext | Context identifier | | pVC | const cmsViewingConditions* | Viewing condition parameters | ### Returns CAM02 model handle, or NULL on error ### Notes Must specify surround, background luminance, adaptation level, etc. ``` -------------------------------- ### Get Pixel Formatter for Profile's PCS Source: https://github.com/mm2/little-cms/blob/master/_autodocs/03-profile-api.md Retrieves a suitable pixel formatter for a profile's Profile Connection Space (PCS). Parameters include bytes per channel (`nBytes`) and whether data is floating-point (`lIsFloat`). ```c cmsUInt32Number cmsFormatterForPCSOfProfile(cmsHPROFILE hProfile, cmsUInt32Number nBytes, cmsBool lIsFloat); ``` -------------------------------- ### Create OKLab Profile Source: https://github.com/mm2/little-cms/blob/master/_autodocs/07-virtual-profiles.md Generates an OKLab profile, a modern, perceptually uniform alternative to Lab color space. It offers better hue uniformity. ```c cmsHPROFILE cmsCreate_OkLabProfile(cmsContext ctx); ``` -------------------------------- ### Get D50 Standard Illuminant XYZ Source: https://github.com/mm2/little-cms/blob/master/_autodocs/06-colorimetry-api.md Retrieves the standard XYZ values for the D50 illuminant. ```c const cmsCIEXYZ* cmsD50_XYZ(void); ``` -------------------------------- ### Get File Size Source: https://github.com/mm2/little-cms/blob/master/_autodocs/10-utilities-context.md Retrieves the size of a file in bytes. Supports large files with CMS_LARGE_FILE_SUPPORT. ```c long int cmsfilelength(FILE* f); #ifdef CMS_LARGE_FILE_SUPPORT long long int cmsfilelength(FILE* f); #endif ``` -------------------------------- ### Get Number of Colors in List Source: https://github.com/mm2/little-cms/blob/master/_autodocs/09-named-colors-dict-api.md Retrieves the total count of named colors currently stored in the list. ```c cmsUInt32Number cmsNamedColorCount(const cmsNAMEDCOLORLIST* v); ``` -------------------------------- ### Get D50 Standard Illuminant xyY Source: https://github.com/mm2/little-cms/blob/master/_autodocs/06-colorimetry-api.md Retrieves the standard xyY chromaticity values for the D50 illuminant. ```c const cmsCIExyY* cmsD50_xyY(void); ``` -------------------------------- ### Create and Save IT8 Measurement File Source: https://github.com/mm2/little-cms/blob/master/_autodocs/11-it8-cgats-api.md This snippet demonstrates how to create a new IT8 measurement file, set its properties and data format, add sample data, and save it to a file. Ensure the Little CMS library is linked and initialized. ```c // Create new IT8 cmsHANDLE it8 = cmsIT8Alloc(ctx); // Set properties cmsIT8SetPropertyStr(it8, "DESCRIPTOR", "ColorChecker SG"); cmsIT8SetPropertyStr(it8, "STANDARD", "CGATS.17"); // Define data format cmsIT8SetDataFormat(it8, 0, "PATCH_T"); cmsIT8SetDataFormat(it8, 1, "LAB_L"); cmsIT8SetDataFormat(it8, 2, "LAB_A"); cmsIT8SetDataFormat(it8, 3, "LAB_B"); // Add measurement data cmsIT8SetData(it8, "1", "PATCH_T", "1"); cmsIT8SetDataDbl(it8, "1", "LAB_L", 50.0); cmsIT8SetDataDbl(it8, "1", "LAB_A", 5.0); cmsIT8SetDataDbl(it8, "1", "LAB_B", -10.0); // Save cmsBool ok = cmsIT8SaveToFile(it8, "output.txt"); cmsIT8Free(it8); ``` -------------------------------- ### Get User Data from LittleCMS Context Source: https://github.com/mm2/little-cms/blob/master/_autodocs/10-utilities-context.md Retrieves the application-specific user data that was passed during context creation. ```c void* cmsGetContextUserData(cmsContext ContextID); ``` -------------------------------- ### cmsDictAlloc Source: https://github.com/mm2/little-cms/blob/master/_autodocs/09-named-colors-dict-api.md Creates an empty dictionary. This is the initial step before adding any key-value pairs. ```APIDOC ## cmsDictAlloc ### Description Creates an empty dictionary. ### Method `cmsDictAlloc` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Returns - **cmsHANDLE** - Dictionary handle, or NULL on error ``` -------------------------------- ### Create Proofing Transform Source: https://github.com/mm2/little-cms/blob/master/_autodocs/04-transform-api.md Creates a color transform for soft proofing with gamut checking. Enables cmsFLAGS_GAMUTCHECK and cmsFLAGS_SOFTPROOFING automatically. ```c cmsHTRANSFORM cmsCreateProofingTransform(cmsHPROFILE Input, cmsUInt32Number InputFormat, cmsHPROFILE Output, cmsUInt32Number OutputFormat, cmsHPROFILE Proofing, cmsUInt32Number Intent, cmsUInt32Number ProofingIntent, cmsUInt32Number dwFlags); cmsHTRANSFORM cmsCreateProofingTransformTHR(cmsContext ContextID, cmsHPROFILE Input, cmsUInt32Number InputFormat, cmsHPROFILE Output, cmsUInt32Number OutputFormat, cmsHPROFILE Proofing, cmsUInt32Number Intent, cmsUInt32Number ProofingIntent, cmsUInt32Number dwFlags); ``` -------------------------------- ### Set Multifield Property in IT8 Source: https://github.com/mm2/little-cms/blob/master/_autodocs/11-it8-cgats-api.md Sets a multifield property for an IT8 handle. An example demonstrates setting the WAVELENGTH_RANGE STEP. ```c cmsBool cmsIT8SetPropertyMulti(cmsHANDLE hIt8, const char* Key, const char* SubKey, const char *Buffer); ``` ```c cmsIT8SetPropertyMulti(it8, "WAVELENGTH_RANGE", "STEP", "10"); ``` -------------------------------- ### Get Profile Creator Signature Source: https://github.com/mm2/little-cms/blob/master/_autodocs/03-profile-api.md Retrieves the creator signature from the profile header, identifying the application or system that created the profile. ```c cmsUInt32Number cmsGetHeaderCreator(cmsHPROFILE hProfile); ``` -------------------------------- ### Create XYZ Profile - cmsCreateXYZProfile Source: https://github.com/mm2/little-cms/blob/master/_autodocs/07-virtual-profiles.md Creates an XYZ color profile, suitable for absolute colorimetric rendering. This function does not require any parameters. The THR variant allows for a context ID. ```c cmsHPROFILE cmsCreateXYZProfile(void); cmsHPROFILE cmsCreateXYZProfileTHR(cmsContext ContextID); ``` -------------------------------- ### Finalize MD5 and Get Result Source: https://github.com/mm2/little-cms/blob/master/_autodocs/12-plugin-api.md Finalizes the MD5 calculation and retrieves the resulting 16-byte hash. This should be called after all data has been added. ```c void cmsMD5finish(cmsProfileID* ProfileID, cmsHANDLE Handle); ``` -------------------------------- ### Minimal RGB to sRGB Transform Source: https://github.com/mm2/little-cms/blob/master/_autodocs/13-quick-reference.md Demonstrates a basic workflow for transforming an RGB image buffer from a custom profile to the sRGB color space using Little CMS. Ensure 'profile.icc' exists and is a valid ICC profile. ```c #include "lcms2.h" #include int main() { // Load profiles cmsHPROFILE inputProfile = cmsOpenProfileFromFile("profile.icc", "r"); cmsHPROFILE sRGB = cmsCreate_sRGBProfile(); // Create transform cmsHTRANSFORM transform = cmsCreateTransform( inputProfile, TYPE_RGB_8, sRGB, TYPE_RGB_8, INTENT_PERCEPTUAL, 0); // Apply to pixel buffer unsigned char input[3] = {100, 150, 200}; unsigned char output[3]; cmsDoTransform(transform, input, output, 1); printf("Input: %d,%d,%d\n", input[0], input[1], input[2]); printf("Output: %d,%d,%d\n", output[0], output[1], output[2]); // Cleanup cmsDeleteTransform(transform); cmsCloseProfile(inputProfile); cmsCloseProfile(sRGB); return 0; } ``` -------------------------------- ### cmsCreateDeviceLinkFromCubeFile Source: https://github.com/mm2/little-cms/blob/master/_autodocs/07-virtual-profiles.md Creates a device link profile from a 3D LUT CUBE file. This allows importing 3D LUTs from various software. ```APIDOC ## cmsCreateDeviceLinkFromCubeFile ### Description Creates a devicelink from 3D LUT CUBE file. ### Usage Import 3D LUTs from software like DaVinci Resolve, Nuke, etc. ### Parameters #### Path Parameters - **cFileName** (const char*) - Required - Path to CUBE file ### Signature ```c cmsHPROFILE cmsCreateDeviceLinkFromCubeFile(const char* cFileName); cmsHPROFILE cmsCreateDeviceLinkFromCubeFileTHR(cmsContext ContextID, const char* cFileName); ``` ### Returns Devicelink profile handle, or NULL on error ``` -------------------------------- ### Get Multifield Property from IT8 Handle Source: https://github.com/mm2/little-cms/blob/master/_autodocs/11-it8-cgats-api.md Retrieves a multifield property value from an IT8 handle using a key and subkey. ```c const char* cmsIT8GetPropertyMulti(cmsHANDLE hIT8, const char* Key, const char *SubKey); ``` -------------------------------- ### Get Profile ICC Version Source: https://github.com/mm2/little-cms/blob/master/_autodocs/10-utilities-context.md Retrieves the ICC version of a given profile. The version is returned as a 32-bit unsigned integer. ```c cmsUInt32Number cmsGetEncodedICCversion(cmsHPROFILE hProfile); ``` -------------------------------- ### Load Profile and Transform Pixels Source: https://github.com/mm2/little-cms/blob/master/_autodocs/README.md Loads an input ICC profile and an sRGB output profile, creates a transformation, and then transforms a single RGB pixel. Remember to clean up resources afterward. ```c #include "lcms2.h" // Load profiles cmsHPROFILE input = cmsOpenProfileFromFile("input.icc", "r"); cmsHPROFILE output = cmsCreate_sRGBProfile(); // Create transformation cmsHTRANSFORM transform = cmsCreateTransform( input, TYPE_RGB_8, output, TYPE_RGB_8, INTENT_PERCEPTUAL, 0); // Transform pixels unsigned char rgb[3] = {100, 150, 200}; cmsDoTransform(transform, rgb, rgb, 1); // Cleanup cmsDeleteTransform(transform); cmsCloseProfile(input); cmsCloseProfile(output); ``` -------------------------------- ### cmsCreate_OkLabProfile Source: https://github.com/mm2/little-cms/blob/master/_autodocs/07-virtual-profiles.md Creates an OKLab profile, which is a modern, perceptually uniform alternative to Lab color space, offering better hue uniformity. ```APIDOC ## cmsCreate_OkLabProfile ### Description Creates an OKLab profile (perceptually uniform, modern alternative to Lab). ### Notes OKLab provides better hue uniformity than Lab. ### Signature ```c cmsHPROFILE cmsCreate_OkLabProfile(cmsContext ctx); ``` ### Returns OKLab profile handle, or NULL on error ``` -------------------------------- ### Get Pointer to First Stage Source: https://github.com/mm2/little-cms/blob/master/_autodocs/08-pipeline-lut-api.md Obtain a pointer to the first stage of a pipeline with cmsPipelineGetPtrToFirstStage. Returns NULL if the pipeline is empty. ```c cmsStage* cmsPipelineGetPtrToFirstStage(const cmsPipeline* lut); ``` -------------------------------- ### Thread-Safe Context Management in Little CMS Source: https://github.com/mm2/little-cms/blob/master/_autodocs/13-quick-reference.md Demonstrates how to create and use thread-specific contexts for Little CMS operations to ensure thread safety. Each thread should manage its own context for loading profiles and creating transforms. ```c // Create context per thread void* threadFunc(void* arg) { // Create thread-specific context cmsContext ctx = cmsCreateContext(NULL, NULL); // Load profiles with context cmsHPROFILE profile = cmsOpenProfileFromFileTHR(ctx, "file.icc", "r"); // Create transforms with context cmsHTRANSFORM xform = cmsCreateTransformTHR(ctx, profile, TYPE_RGB_8, sRGB, TYPE_RGB_8, INTENT_PERCEPTUAL, 0); // ... use transform ... // Cleanup cmsDeleteTransform(xform); cmsCloseProfile(profile); cmsDeleteContext(ctx); return NULL; } ``` -------------------------------- ### Create Device Link Profile from CUBE File Source: https://github.com/mm2/little-cms/blob/master/_autodocs/07-virtual-profiles.md Creates a device link profile by importing a 3D LUT from a CUBE file. This is useful for importing LUTs from software like DaVinci Resolve or Nuke. ```c cmsHPROFILE cmsCreateDeviceLinkFromCubeFile(const char* cFileName); cmsHPROFILE cmsCreateDeviceLinkFromCubeFileTHR(cmsContext ContextID, const char* cFileName); ``` -------------------------------- ### Set String Property in IT8 Source: https://github.com/mm2/little-cms/blob/master/_autodocs/11-it8-cgats-api.md Sets a string property for an IT8 handle. Example usage provided for setting the DESCRIPTOR property. ```c cmsBool cmsIT8SetPropertyStr(cmsHANDLE hIT8, const char* cProp, const char *Str); ``` ```c cmsIT8SetPropertyStr(it8, "DESCRIPTOR", "ColorChecker SG") ``` -------------------------------- ### Gamut Check Pattern Source: https://github.com/mm2/little-cms/blob/master/_autodocs/13-quick-reference.md Enables gamut checking for color transformations. If a pixel is out of gamut, it will be replaced with an alarm color (green in this example). ```c cmsSetAlarmCodes((cmsUInt16Number[cmsMAXCHANNELS]){0, 65535, 0, 0}); // Green alarm cmsHTRANSFORM xform = cmsCreateTransform( profile, TYPE_RGB_8, sRGB, TYPE_RGB_8, INTENT_PERCEPTUAL, cmsFLAGS_GAMUTCHECK); // Enable gamut check unsigned char pixel[3] = {200, 100, 50}; cmsDoTransform(xform, pixel, pixel, 1); // If pixel is out of gamut, it's now replaced with alarm color (green) ``` -------------------------------- ### Open ICC Profile from File Source: https://github.com/mm2/little-cms/blob/master/_autodocs/03-profile-api.md Loads an ICC profile from a specified file path. Use 'r' for read access and 'w' for write access. For thread-safe operations, consider using `cmsOpenProfileFromFileTHR`. ```c cmsHPROFILE cmsOpenProfileFromFile(const char * ICCProfile, const char *sAccess); ``` -------------------------------- ### cmsPipelineDup Source: https://github.com/mm2/little-cms/blob/master/_autodocs/08-pipeline-lut-api.md Creates a deep copy of an existing pipeline. ```APIDOC ## cmsPipelineDup ### Description Create a deep copy of pipeline. ### Method Not applicable (C function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **Orig** (const cmsPipeline*) - Pipeline to duplicate ### Returns Copy of pipeline, or NULL on error ``` -------------------------------- ### Get Device Attributes Source: https://github.com/mm2/little-cms/blob/master/_autodocs/03-profile-api.md Retrieves the device attributes from the profile header. Attributes include device type (reflective/transparent) and glossiness (glossy/matte). ```c void cmsGetHeaderAttributes(cmsHPROFILE hProfile, cmsUInt64Number* Flags); ``` -------------------------------- ### Create RGB Profile from Chromaticity and Transfer Function Source: https://github.com/mm2/little-cms/blob/master/_autodocs/07-virtual-profiles.md Use `cmsCreateRGBProfile` to create an RGB profile. The `cmsCreateRGBProfileTHR` variant allows specifying a context ID for thread safety. ```c cmsHPROFILE cmsCreateRGBProfile(const cmsCIExyY* WhitePoint, const cmsCIExyYTRIPLE* Primaries, cmsToneCurve* const TransferFunction[3]); cmsHPROFILE cmsCreateRGBProfileTHR(cmsContext ContextID, const cmsCIExyY* WhitePoint, const cmsCIExyYTRIPLE* Primaries, cmsToneCurve* const TransferFunction[3]); ``` -------------------------------- ### Get Tag Signature by Index Source: https://github.com/mm2/little-cms/blob/master/_autodocs/03-profile-api.md Retrieves the signature of a tag at a specific index within the profile. Returns 0 if the index is out of range. ```c cmsTagSignature cmsGetTagSignature(cmsHPROFILE hProfile, cmsUInt32Number n); ``` -------------------------------- ### Allocate Zeroed Memory with Context Source: https://github.com/mm2/little-cms/blob/master/_autodocs/10-utilities-context.md Allocates memory and initializes it to zero using the provided context. Returns a zeroed memory pointer or NULL on failure. ```c void* _cmsMallocZero(cmsContext ContextID, cmsUInt32Number size); ``` -------------------------------- ### Get Patch Name by Index Source: https://github.com/mm2/little-cms/blob/master/_autodocs/11-it8-cgats-api.md Retrieves the name of a patch from an IT8 file using its index. Returns NULL if the index is out of range. ```c const char* cmsIT8GetPatchName(cmsHANDLE hIT8, int nPatch, char* buffer); ``` -------------------------------- ### Create Grayscale Profile - cmsCreateGrayProfile Source: https://github.com/mm2/little-cms/blob/master/_autodocs/07-virtual-profiles.md Use this function to create a grayscale profile. It requires a white point and a transfer function. The THR variant allows specifying a context ID. ```c cmsHPROFILE cmsCreateGrayProfile(const cmsCIExyY* WhitePoint, const cmsToneCurve* TransferFunction); cmsHPROFILE cmsCreateGrayProfileTHR(cmsContext ContextID, const cmsCIExyY* WhitePoint, const cmsToneCurve* TransferFunction); ``` -------------------------------- ### cmsIT8Alloc Source: https://github.com/mm2/little-cms/blob/master/_autodocs/11-it8-cgats-api.md Creates an empty IT8 container. This is the initial step before loading or manipulating IT8 data. ```APIDOC ## cmsIT8Alloc ### Description Create empty IT8 container. ### Method Not applicable (C function) ### Endpoint Not applicable (C function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```c // Example usage in C #include "lcms2.h" cmsHANDLE hIT8 = cmsIT8Alloc(NULL); if (hIT8 == NULL) { // Handle error } ``` ### Response #### Success Response Returns an IT8 handle (cmsHANDLE). #### Response Example ```c cmsHANDLE hIT8; // Handle to the IT8 container ``` **Returns**: IT8 handle, or NULL on error ``` -------------------------------- ### Get LittleCMS Library Version Source: https://github.com/mm2/little-cms/blob/master/_autodocs/10-utilities-context.md Retrieves the version of the LittleCMS library as an integer. The version is encoded such that major and minor versions can be extracted. ```c int cmsGetEncodedCMMversion(void); ``` ```c int version = cmsGetEncodedCMMversion(); int major = version / 100; int minor = version % 100; printf("LittleCMS %d.%d\n", major, minor); ``` -------------------------------- ### Get IT8 Sheet Type Source: https://github.com/mm2/little-cms/blob/master/_autodocs/11-it8-cgats-api.md Retrieves the sheet type identifier from an IT8 handle. Returns a string representing the sheet type. ```c const char* cmsIT8GetSheetType(cmsHANDLE hIT8); ``` -------------------------------- ### Get Pointer to Last Stage Source: https://github.com/mm2/little-cms/blob/master/_autodocs/08-pipeline-lut-api.md Access the last stage of a pipeline using cmsPipelineGetPtrToLastStage. Returns NULL if the pipeline contains no stages. ```c cmsStage* cmsPipelineGetPtrToLastStage(const cmsPipeline* lut); ``` -------------------------------- ### Create I/O Handler from Stream Source: https://github.com/mm2/little-cms/blob/master/_autodocs/10-utilities-context.md Creates an I/O handler from an existing FILE* stream. ```c cmsIOHANDLER* cmsOpenIOhandlerFromStream(cmsContext ContextID, FILE* Stream); ``` -------------------------------- ### cmsCreateBCHSWabstractProfile Source: https://github.com/mm2/little-cms/blob/master/_autodocs/07-virtual-profiles.md Creates an abstract profile with Brightness, Contrast, Hue, Saturation, and temperature adjustments. This function is suitable for general use. ```APIDOC ## cmsCreateBCHSWabstractProfile ### Description Creates an abstract profile applying Brightness, Contrast, Hue, Saturation, and temperature adjustments. This function is suitable for general use. ### Signature ```c cmsHPROFILE cmsCreateBCHSWabstractProfile(cmsUInt32Number nLUTPoints, cmsFloat64Number Bright, cmsFloat64Number Contrast, cmsFloat64Number Hue, cmsFloat64Number Saturation, cmsUInt32Number TempSrc, cmsUInt32Number TempDest); ``` ### Parameters #### Path Parameters - **nLUTPoints** (cmsUInt32Number) - Required - CLUT grid size per dimension - **Bright** (cmsFloat64Number) - Required - Brightness adjustment (-1 to 1) - **Contrast** (cmsFloat64Number) - Required - Contrast adjustment (-1 to 1) - **Hue** (cmsFloat64Number) - Required - Hue rotation (0-360 degrees) - **Saturation** (cmsFloat64Number) - Required - Saturation adjustment (-1 to 1) - **TempSrc** (cmsUInt32Number) - Required - Source temperature (Kelvin) or 0 for none - **TempDest** (cmsUInt32Number) - Required - Destination temperature (Kelvin) or 0 for none ### Returns Abstract profile handle, or NULL on error ### Usage Create adjustment profiles for photo editing workflows. ``` -------------------------------- ### Get Profile Context ID Source: https://github.com/mm2/little-cms/blob/master/_autodocs/03-profile-api.md Retrieves the context ID associated with a given profile. Returns NULL if the profile uses the global context. ```c cmsContext cmsGetProfileContextID(cmsHPROFILE hProfile); ``` -------------------------------- ### Get CMM ID Source: https://github.com/mm2/little-cms/blob/master/_autodocs/03-profile-api.md Retrieves the CMM (Color Management Module) signature from the profile header. This identifies the software used to create the profile. ```c cmsUInt32Number cmsGetHeaderCMM(cmsHPROFILE hProfile); ``` -------------------------------- ### _cmsMallocZero Source: https://github.com/mm2/little-cms/blob/master/_autodocs/10-utilities-context.md Allocates a block of memory of the specified size within a given context and initializes it to zero. Returns a pointer to the zeroed memory or NULL if the allocation fails. ```APIDOC ## _cmsMallocZero ### Description Allocate zeroed memory. ### Signature ```c void* _cmsMallocZero(cmsContext ContextID, cmsUInt32Number size); ``` ### Returns Zeroed memory pointer, or NULL on failure ``` -------------------------------- ### Get Profile Header Flags Source: https://github.com/mm2/little-cms/blob/master/_autodocs/03-profile-api.md Retrieves the flag bits from the profile header. These flags indicate embedded profile status and usage restrictions. ```c cmsUInt32Number cmsGetHeaderFlags(cmsHPROFILE hProfile); ``` -------------------------------- ### Allocate Array of Elements with Context Source: https://github.com/mm2/little-cms/blob/master/_autodocs/10-utilities-context.md Allocates an array of elements and initializes the memory to zero using the provided context. Returns a zeroed memory pointer or NULL on failure. ```c void* _cmsCalloc(cmsContext ContextID, cmsUInt32Number num, cmsUInt32Number size); ``` -------------------------------- ### Get PostScript ColorRenderingDictionary (CRD) Source: https://github.com/mm2/little-cms/blob/master/_autodocs/10-utilities-context.md Retrieves the PostScript ColorRenderingDictionary for a profile. Can be used to determine the required buffer size by passing NULL for the buffer. ```c cmsUInt32Number cmsGetPostScriptCRD(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUInt32Number dwFlags, void* Buffer, cmsUInt32Number dwBufferLen); ``` -------------------------------- ### Create Linearization Device Link Profile Source: https://github.com/mm2/little-cms/blob/master/_autodocs/07-virtual-profiles.md Creates a device link profile for linearization, applying tone curves per channel. Use this to bake linearization curves into a profile for distribution. ```c cmsHPROFILE cmsCreateLinearizationDeviceLink(cmsColorSpaceSignature ColorSpace, cmsToneCurve* const TransferFunctions[]); cmsHPROFILE cmsCreateLinearizationDeviceLinkTHR(cmsContext ContextID, cmsColorSpaceSignature ColorSpace, cmsToneCurve* const TransferFunctions[]); ``` -------------------------------- ### Get PostScript ColorSpaceArray (CSA) Source: https://github.com/mm2/little-cms/blob/master/_autodocs/10-utilities-context.md Retrieves the PostScript ColorSpaceArray for a profile. Can be used to determine the required buffer size by passing NULL for the buffer. ```c cmsUInt32Number cmsGetPostScriptCSA(cmsContext ContextID, cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUInt32Number dwFlags, void* Buffer, cmsUInt32Number dwBufferLen); ``` -------------------------------- ### Get Stage Context ID Source: https://github.com/mm2/little-cms/blob/master/_autodocs/08-pipeline-lut-api.md Retrieve the context identifier associated with a stage using `cmsGetStageContextID`. This can be useful for managing multiple contexts or debugging. ```c cmsContext cmsGetStageContextID(const cmsStage* mpe); ``` -------------------------------- ### cmsCreateGrayProfile, cmsCreateGrayProfileTHR Source: https://github.com/mm2/little-cms/blob/master/_autodocs/07-virtual-profiles.md Creates a grayscale color profile. It takes a white point and a transfer function as input. ```APIDOC ## cmsCreateGrayProfile, cmsCreateGrayProfileTHR ### Description Creates a grayscale color profile. ### Method C API Function ### Parameters #### Path Parameters - **WhitePoint** (const cmsCIExyY*) - Required - Gray white point - **TransferFunction** (const cmsToneCurve*) - Required - Tone curve ### Returns Grayscale profile handle, or NULL on error ``` -------------------------------- ### Get Next Stage in Pipeline Source: https://github.com/mm2/little-cms/blob/master/_autodocs/08-pipeline-lut-api.md Use `cmsStageNext` to retrieve the subsequent stage in a pipeline. Returns NULL if the current stage is the last one. ```c cmsStage* cmsStageNext(const cmsStage* mpe); ``` -------------------------------- ### cmsGBDAlloc Source: https://github.com/mm2/little-cms/blob/master/_autodocs/10-utilities-context.md Allocates and creates a new gamut boundary description (GBD) handle. This is the initial step in defining a GBD. ```APIDOC ## cmsGBDAlloc ### Description Creates a gamut boundary description (GBD). ### Signature ```c cmsHANDLE cmsGBDAlloc(cmsContext ContextID); ``` ### Returns GBD handle, or NULL on error. ``` -------------------------------- ### Get String Property from IT8 Handle Source: https://github.com/mm2/little-cms/blob/master/_autodocs/11-it8-cgats-api.md Retrieves a string property value associated with an IT8 handle. Returns NULL if the property is not found. ```c const char* cmsIT8GetProperty(cmsHANDLE hIT8, const char* cProp); ``` -------------------------------- ### Create I/O Handler from Memory Buffer Source: https://github.com/mm2/little-cms/blob/master/_autodocs/10-utilities-context.md Creates an I/O handler for a memory buffer. Requires buffer, size, and access mode. ```c cmsIOHANDLER* cmsOpenIOhandlerFromMem(cmsContext ContextID, void *Buffer, cmsUInt32Number size, const char* AccessMode); ``` -------------------------------- ### Get Number of Stages in Pipeline Source: https://github.com/mm2/little-cms/blob/master/_autodocs/08-pipeline-lut-api.md Count the number of processing stages within a pipeline using cmsPipelineStageCount. This helps in understanding the complexity of the transformation. ```c cmsUInt32Number cmsPipelineStageCount(const cmsPipeline* lut); ``` -------------------------------- ### Manually Build and Link Little CMS Source: https://github.com/mm2/little-cms/blob/master/_autodocs/README.md Manually specify the linker flag '-llcms2' when compiling your application with the Little CMS library. ```bash # Or manually gcc myapp.c -o myapp -llcms2 ``` -------------------------------- ### Get Number of Output Channels Source: https://github.com/mm2/little-cms/blob/master/_autodocs/08-pipeline-lut-api.md Use cmsPipelineOutputChannels to find out the number of output channels for a pipeline. This specifies how many values the pipeline will produce. ```c cmsUInt32Number cmsPipelineOutputChannels(const cmsPipeline* lut); ``` -------------------------------- ### cmsCreateBCHSWabstractProfileTHR Source: https://github.com/mm2/little-cms/blob/master/_autodocs/07-virtual-profiles.md Creates an abstract profile with Brightness, Contrast, Hue, Saturation, and temperature adjustments, with explicit context handling. This function allows for thread-safe profile creation. ```APIDOC ## cmsCreateBCHSWabstractProfileTHR ### Description Creates an abstract profile applying Brightness, Contrast, Hue, Saturation, and temperature adjustments, with explicit context handling. This function allows for thread-safe profile creation. ### Signature ```c cmsHPROFILE cmsCreateBCHSWabstractProfileTHR(cmsContext ContextID, cmsUInt32Number nLUTPoints, cmsFloat64Number Bright, cmsFloat64Number Contrast, cmsFloat64Number Hue, cmsFloat64Number Saturation, cmsUInt32Number TempSrc, cmsUInt32Number TempDest); ``` ### Parameters #### Path Parameters - **ContextID** (cmsContext) - Required - The context identifier for the operation. - **nLUTPoints** (cmsUInt32Number) - Required - CLUT grid size per dimension - **Bright** (cmsFloat64Number) - Required - Brightness adjustment (-1 to 1) - **Contrast** (cmsFloat64Number) - Required - Contrast adjustment (-1 to 1) - **Hue** (cmsFloat64Number) - Required - Hue rotation (0-360 degrees) - **Saturation** (cmsFloat64Number) - Required - Saturation adjustment (-1 to 1) - **TempSrc** (cmsUInt32Number) - Required - Source temperature (Kelvin) or 0 for none - **TempDest** (cmsUInt32Number) - Required - Destination temperature (Kelvin) or 0 for none ### Returns Abstract profile handle, or NULL on error ### Usage Create adjustment profiles for photo editing workflows in a multi-threaded environment. ``` -------------------------------- ### Allocate a new dictionary Source: https://github.com/mm2/little-cms/blob/master/_autodocs/09-named-colors-dict-api.md Use cmsDictAlloc to create an empty dictionary. Returns a handle to the dictionary or NULL on error. ```c cmsHANDLE cmsDictAlloc(cmsContext ContextID); ``` -------------------------------- ### Get Pipeline Context ID Source: https://github.com/mm2/little-cms/blob/master/_autodocs/08-pipeline-lut-api.md Retrieve the thread context associated with a pipeline using cmsGetPipelineContextID. This is useful for debugging or managing thread-specific data. ```c cmsContext cmsGetPipelineContextID(const cmsPipeline* lut); ``` -------------------------------- ### Get Output Profile Named Colors Source: https://github.com/mm2/little-cms/blob/master/_autodocs/04-transform-api.md Retrieves the named color list associated with the output profile of the transform. Returns NULL if not available. ```c cmsNAMEDCOLORLIST* cmsGetTransformOutputColorants(cmsHTRANSFORM hTransform); ```