Пример #1
0
/* PTGetPT writes a PT to external memory in FuT format.  */
PTErr_t
	PTGetPT (	PTRefNum_t	PTRefNum,
				KpInt32_t	mBlkSize,
				PTAddr_t	PTAddr)
{
PTErr_t		errnum;

	errnum = PTGetPTF (PTRefNum, PTTYPE_FUTF, mBlkSize, PTAddr);

	return (errnum);
}
Пример #2
0
/***************************************************************************
 * FUNCTION NAME
 *      SpXformBufferDT
 *
 * DESCRIPTION
 *      This function copies the PT associated with the PTRefNum in
 *      the Xform to the Address given.  It will be in the format
 *      requested by the caller.  The SpXform is NOT freed by this
 *      function.
 *
 *
 
***************************************************************************/
SpStatus_t KSPAPI SpXformToBufferDT(SpXform_t	spXform,
				KpUInt32_t	LutType,
				KpInt32_t	SpDataType,
				KpUInt32_t	Datasize,
				SpHugeBuffer_t pXformData)
{

PTRefNum_t	refNum;
SpStatus_t	spStatus;
KpUInt32_t	PTDatasize;
PTErr_t		PTStat;
KpUInt32_t	MFType;
KpInt32_t	KcmDataType;

	spStatus = SpDTtoKcmDT (SpDataType, &KcmDataType);
	if (spStatus != SpStatSuccess) {
		return (spStatus);
	}

	/*      Get the Color Processor PTRefNum of the SpXform */
	spStatus = SpXformGetRefNum (spXform, &refNum);
	if (SpStatSuccess != spStatus)
		return spStatus;

/* determine type of transform to get */
	switch (LutType) {
	case SP_ICC_FUT:
		MFType = PTTYPE_FUTF;
		break;

	case SP_ICC_MFT1:
		MFType = PTTYPE_MFT1;
		break;

	case SP_ICC_MFT2:
		if (KcmDataType == KCM_ICC_TYPE_0)
			MFType = PTTYPE_MFT2_VER_0;
		else
			MFType = PTTYPE_MFT2;
		break;

	case SP_ICC_MAB1:
		MFType = PTTYPE_MAB1;
		break;

	case SP_ICC_MAB2:
		MFType = PTTYPE_MAB2;
		break;

	case SP_ICC_MBA1:
		MFType = PTTYPE_MBA1;
		break;

	case SP_ICC_MBA2:
		MFType = PTTYPE_MBA2;
		break;

	default:
		return SpStatOutOfRange;
	}

/* ask color processor for the size of the Transform */
	PTStat = PTGetSizeF (refNum, MFType, (KpInt32_t FAR *)&PTDatasize);
	if (KCP_SUCCESS != PTStat)
		return SpStatusFromPTErr(PTStat);

	if (PTDatasize > Datasize)
		return SpStatBufferTooSmall;

	#if defined KCP_DIAG_LOG
	{KpChar_t	string[256];
	sprintf (string, "\nSpXformToBufferDT\n spXform %x, PTRefNum %x", 
		spXform, pXformData);
	kcpDiagLog (string); }
	#endif

/* ask color processor for the Transform data */
	PTStat = PTGetPTF(refNum, MFType, 
			Datasize, (PTAddr_t) pXformData);

	return SpStatusFromPTErr(PTStat);

}