/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
// This file is available under and governed by the GNU General Public // License version 2 only, as published by the Free Software Foundation. // However, the following notice accompanied the original version of this // file: // //--------------------------------------------------------------------------------- // // Little Color Management System // Copyright (c) 1998-2022 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the Software // is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO // THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // //--------------------------------------------------------------------------------- // // This is the plug-in header file. Normal LittleCMS clients should not use it. // It is provided for plug-in writers that may want to access the support // functions to do low level operations. All plug-in related structures // are defined here. Including this file forces to include the standard API too.
#ifndef _lcms_plugin_H
// Deal with Microsoft's attempt at deprecating C standard runtime functions #ifdef _MSC_VER # if (_MSC_VER >= 1400) # ifndef _CRT_SECURE_NO_DEPRECATE # define _CRT_SECURE_NO_DEPRECATE # endif # ifndef _CRT_SECURE_NO_WARNINGS # define _CRT_SECURE_NO_WARNINGS # endif # endif #endif
#ifndef _lcms2_H #include"lcms2.h" #endif
// We need some standard C functions. #include <stdlib.h> #include <math.h> #include <stdarg.h> #include <memory.h> #include <string.h>
cmsUInt32Number Magic; // 'acpp' signature
cmsUInt32Number ExpectedVersion; // Expected version of LittleCMS
cmsUInt32Number Type; // Type of plug-in struct _cmsPluginBaseStruct* Next; // For multiple plugin definition. NULL for end of list.
} cmsPluginBase;
// Maximum number of types in a plugin array #define MAX_TYPES_IN_LCMS_PLUGIN 20
// Interpolation. 16 bits and floating point versions. struct _cms_interp_struc;
// Interpolation callbacks
// 16 bits forward interpolation. This function performs precision-limited linear interpolation // and is supposed to be quite fast. Implementation may be tetrahedral or trilinear, and plug-ins may // choose to implement any other interpolation algorithm. typedefvoid (* _cmsInterpFn16)(CMSREGISTER const cmsUInt16Number Input[],
CMSREGISTER cmsUInt16Number Output[],
CMSREGISTER conststruct _cms_interp_struc* p);
// Floating point forward interpolation. Full precision interpolation using floats. This is not a // time critical function. Implementation may be tetrahedral or trilinear, and plug-ins may // choose to implement any other interpolation algorithm. typedefvoid (* _cmsInterpFnFloat)(cmsFloat32Number const Input[],
cmsFloat32Number Output[], conststruct _cms_interp_struc* p);
// This type holds a pointer to an interpolator that can be either 16 bits or float typedefunion {
_cmsInterpFn16 Lerp16; // Forward interpolation in 16 bits
_cmsInterpFnFloat LerpFloat; // Forward interpolation in floating point
} cmsInterpFunction;
// Flags for interpolator selection #define CMS_LERP_FLAGS_16BITS 0x0000 // The default #define CMS_LERP_FLAGS_FLOAT 0x0001 // Requires different implementation #define CMS_LERP_FLAGS_TRILINEAR 0x0100 // Hint only
#define MAX_INPUT_DIMENSIONS 15
typedefstruct _cms_interp_struc { // Used on all interpolations. Supplied by lcms2 when calling the interpolation function
cmsContext ContextID; // The calling thread
cmsUInt32Number dwFlags; // Keep original flags
cmsUInt32Number nInputs; // != 1 only in 3D interpolation
cmsUInt32Number nOutputs; // != 1 only in 3D interpolation
cmsUInt32Number nSamples[MAX_INPUT_DIMENSIONS]; // Valid on all kinds of tables
cmsUInt32Number Domain[MAX_INPUT_DIMENSIONS]; // Domain = nSamples - 1
cmsUInt32Number opta[MAX_INPUT_DIMENSIONS]; // Optimization for 3D CLUT. This is the number of nodes premultiplied for each // dimension. For example, in 7 nodes, 7, 7^2 , 7^3, 7^4, etc. On non-regular // Samplings may vary according of the number of nodes for each dimension.
constvoid *Table; // Points to the actual interpolation table
cmsInterpFunction Interpolation; // Points to the function to do the interpolation
// Parametric curves. A negative type means same function but analytically inverted. Max. number of params is 10
// Evaluator callback for user-supplied parametric curves. May implement more than one type typedef cmsFloat64Number (* cmsParametricCurveEvaluator)(cmsInt32Number Type, const cmsFloat64Number Params[10], cmsFloat64Number R);
// Plug-in may implement an arbitrary number of parametric curves typedefstruct {
cmsPluginBase base;
cmsUInt32Number nFunctions; // Number of supported functions
cmsUInt32Number FunctionTypes[MAX_TYPES_IN_LCMS_PLUGIN]; // The identification types
cmsUInt32Number ParameterCount[MAX_TYPES_IN_LCMS_PLUGIN]; // Number of parameters for each function
cmsParametricCurveEvaluator Evaluator; // The evaluator
// Formatters. This plug-in adds new handlers, replacing them if they already exist. Formatters dealing with // cmsFloat32Number (bps = 4) or double (bps = 0) types are requested via FormatterFloat callback. Others come across // Formatter16 callback
// This type holds a pointer to a formatter that can be either 16 bits or cmsFloat32Number typedefunion {
cmsFormatter16 Fmt16;
cmsFormatterFloat FmtFloat;
// Tag type handler. Each type is free to return anything it wants, and it is up to the caller to // know in advance what is the type contained in the tag. typedefstruct _cms_typehandler_struct {
cmsTagTypeSignature Signature; // The signature of the type
// This is the tag plugin, which identifies tags. For writing, a pointer to function is provided. // This function should return the desired type for this tag, given the version of profile // and the data being serialized. typedefstruct {
cmsUInt32Number ElemCount; // If this tag needs an array, how many elements should keep
// For reading.
cmsUInt32Number nSupportedTypes; // In how many types this tag can come (MAX_TYPES_IN_LCMS_PLUGIN maximum)
cmsTagTypeSignature SupportedTypes[MAX_TYPES_IN_LCMS_PLUGIN];
// For writing
cmsTagTypeSignature (* DecideType)(cmsFloat64Number ICCVersion, constvoid *Data);
} cmsTagDescriptor;
// Plug-in implements a single tag typedefstruct {
cmsPluginBase base;
// Custom intents. This function should join all profiles specified in the array in // a single LUT. Any custom intent in the chain redirects to custom function. If more than // one custom intent is found, the one located first is invoked. Usually users should use only one // custom intent, so mixing custom intents in same multiprofile transform is not supported.
// This function allocates a generic MPE
CMSAPI cmsStage* CMSEXPORT _cmsStageAllocPlaceholder(cmsContext ContextID,
cmsStageSignature Type,
cmsUInt32Number InputChannels,
cmsUInt32Number OutputChannels,
_cmsStageEvalFn EvalPtr, // Points to fn that evaluates the element (always in floating point)
_cmsStageDupElemFn DupElemPtr, // Points to a fn that duplicates the stage
_cmsStageFreeElemFn FreePtr, // Points to a fn that sets the element free void* Data); // A generic pointer to whatever memory needed by the element typedefstruct {
cmsPluginBase base;
cmsTagTypeHandler Handler;
// Matrix typedefstruct {
cmsFloat64Number* Double; // floating point for the matrix
cmsFloat64Number* Offset; // The offset
} _cmsStageMatrixData;
// CLUT typedefstruct {
union { // Can have only one of both representations at same time
cmsUInt16Number* T; // Points to the table 16 bits table
cmsFloat32Number* TFloat; // Points to the cmsFloat32Number table
//---------------------------------------------------------------------------------------------------------- // Optimization. Using this plug-in, additional optimization strategies may be implemented. // The function should return TRUE if any optimization is done on the LUT, this terminates // the optimization search. Or FALSE if it is unable to optimize and want to give a chance // to the rest of optimizers.
// This function may be used to set the optional evaluator and a block of private data. If private data is being used, an optional // duplicator and free functions should also be specified in order to duplicate the LUT construct. Use NULL to inhibit such functionality.
typedefvoid (* _cmsTransformFn)(struct _cmstransform_struct *CMMcargo, // Legacy function, handles just ONE scanline. constvoid* InputBuffer, void* OutputBuffer,
cmsUInt32Number Size,
cmsUInt32Number Stride); // Stride in bytes to the next plane in planar formats
// Let's plug-in to guess the best number of workers #define CMS_GUESS_MAX_WORKERS -1
typedefstruct {
cmsPluginBase base;
cmsInt32Number MaxWorkers; // Number of starts to do as maximum
cmsUInt32Number WorkerFlags; // Reserved
_cmsTransform2Fn SchedulerFn; // callback to setup functions
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.