LICCProfile::ConvertParametricCurveTypeToBuffer

#include "ltwrappr.h"

L_INT LICCProfile::ConvertParametricCurveTypeToBuffer(pData, pIccTagParametricCurveType)

L_UCHAR * pData;

/* pointer to a buffer */

pICCTAG_PARAMETRIC_CURVE_TYPE pIccTagParametricCurveType;

/* pointer to a structure */

Converts the information in 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 pData pointer must be allocated by the user. Its size must be equal to the size in bytes of the structure pointed to by pIccTagParametricCurveType parameter; otherwise an error may occur and corrupted data will return.

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

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::InitHeader, LICCProfile::Initialize, LICCProfile::SetCMMType, LICCProfile::SetColorSpace, LICCProfile::SetConnectionSpace, LICCProfile::SetCreator, LICCProfile::SetDateTime, LICCProfile::SetDeviceAttributes, LICCProfile::SetDeviceClass, LICCProfile::SetDevManufacturer, LICCProfile::SetDevModel, LICCProfile::SetFlags, LICCProfile::SetPrimaryPlatform, LICCProfile::SetRenderingIntent, LICCProfile::Convert2bFixed2bNumberToDouble, LICCProfile::CreateTagData, LICCProfile::DeleteTag, LICCProfile::ConvertDoubleTo2bFixed2bNumber, LICCProfile::FreeTagType, LICCProfile::GenerateFile, LICCProfile::GeneratePointer, LICCProfile::GetTagData, LICCProfile::GetTagTypeSig, LICCProfile::Save, LICCProfile::SetTagData, LICCProfile::Fill, LICCProfile::Load, LICCProfile::Free, LICCProfile::GetParametricCurveNumberOfParameters, LICCProfile::DoubleToU8Fixed8Number, LICCProfile::U8Fixed8NumberToDouble, LICCProfile::ConvertCLUTToBuffer, LICCProfile::ConvertCurveTypeToBuffer, LICCProfile::SetProfileId, Class Members

Topics:

Using ICC Profile Functions

 

ICC Profile Functions: Tags

 

ICC Profile Functions: Creating an ICC Profile

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); 
}