LICCProfile::ConvertParametricCurveTypeToBuffer

#include "ltwrappr.h"

L_INT LICCProfile::ConvertParametricCurveTypeToBuffer(pData, pIccTagParametricCurveType)

L_UCHAR L_FAR * pData;

/* pointer to a buffer */

pICCTAG_PARAMETRIC_CURVE_TYPE pIccTagParametricCurveType;

/* pointer to a structure */

Converts the information of an ICCTAG_PARAMETRIC_CURVE_TYPE structure into one buffer of sequential bytes.

Parameter

Description

pData

Pointer to a buffer to be updated with the converted information as one buffer of sequential bytes.

pIccTagParametricCurveType

Pointer to an ICCTAG_PARAMETRIC_CURVE_TYPE structure that contains the information to be converted into one buffer of sequential data.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The user must allocate the pData parameter. Its size must be equal to the size in bytes of the structure pointed to by pIccTagParametricCurveType parameter.

The size of pData buffer can be calculated as follows: 4 + 4 + 2 + 2 + 4 * number of parameters retrieved by calling LICCProfile::GetParametricCurveNumberOfParameters function. For more information, refer to the ICC.1:2004-10 specification page 56.

Required DLLs and Libraries

LTCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LICCProfile::GetParametricCurveNumberOfParameters, LICCProfile::DoubleToU8Fixed8Number, LICCProfile::U8Fixed8NumberToDouble, LICCProfile::ConvertCLUTToBuffer, LICCProfile::ConvertCurveTypeToBuffer, LICCProfile::SetProfileId

Topics:

ICC Profile Functions: Tags

 

Using ICC Profile Functions

Example

void CICCProfileDlg::FillIccParametricCurveType(ICCTAG_PARAMETRIC_CURVE_TYPE * piccParametricCurveType) 
{
   LICCProfile ICCProfile; 
   
   // get the number of parameters for our function
   L_INT numOfParameters = ICCProfile.GetParametricCurveNumberOfParameters(Func4Bytes); 

   // create the IccParametricCurve class
   piccParametricCurveType->ParametricCurve.uFunctionType = Func4Bytes; 

   // since we know that we will have 1 parameter for our function, 
   // we will fill it directly, define the function parameters
   piccParametricCurveType->ParametricCurve.pParameters = (L_INT *)GlobalAllocPtr(GHND, numOfParameters * sizeof(L_INT)); 
   piccParametricCurveType->ParametricCurve.pParameters [0] = (int) LICCProfile::ConvertDoubleTo2bFixed2bNumber(5.0); 

   // define the tag base
   piccParametricCurveType->tagBase.Signature = ParametricCurveTypeSig; 
}

/* This example converts an ICCTAG_CURVE_TYPE structure into a buffer */
void CICCProfileDlg::OnConvertParametricCurveTypeToBuffer()
{
   LICCProfile ICCProfile; 
   
   /* This example converts an ICCTAG_CURVE_TYPE structure into a buffer */
   ICCTAG_PARAMETRIC_CURVE_TYPE iccParametricCurveType; 
   L_UCHAR * pData; 
   L_INT nDataSize; 
   
   // fill the parametric curve type tag
   memset(&iccParametricCurveType, 0 ,sizeof(ICCTAG_PARAMETRIC_CURVE_TYPE)); 
   FillIccParametricCurveType(&iccParametricCurveType); 
   
   // calculate the data size
   nDataSize = 4 + 4 + 2 + 2  +  4 * ICCProfile.GetParametricCurveNumberOfParameters((ICCFUNCTIONTYPE)iccParametricCurveType.ParametricCurve.uFunctionType); 
   // then allocate the destination data pointer
   pData = (L_UCHAR *) GlobalAllocPtr(GHND, nDataSize * sizeof(L_UCHAR)); 
   if (pData == NULL) 
      return; 
   // now convert it into buffer
   ICCProfile.ConvertParametricCurveTypeToBuffer(pData, &iccParametricCurveType); 
}