本文整理汇总了C++中cmsGetColorSpace函数的典型用法代码示例。如果您正苦于以下问题:C++ cmsGetColorSpace函数的具体用法?C++ cmsGetColorSpace怎么用?C++ cmsGetColorSpace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cmsGetColorSpace函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: gscms_get_link_proof
/* Get the link from the CMS, but include proofing.
We need to note that as an option in the rendering params. If we are doing
transparency, that would only occur at the top of the stack
TODO: Add error checking */
gcmmhlink_t
gscms_get_link_proof(gcmmhprofile_t lcms_srchandle,
gcmmhprofile_t lcms_deshandle, gcmmhprofile_t lcms_proofhandle,
gsicc_rendering_param_t *rendering_params)
{
DWORD src_data_type,des_data_type;
icColorSpaceSignature src_color_space,des_color_space;
int src_nChannels,des_nChannels;
/* Get the data types */
src_color_space = cmsGetColorSpace(lcms_srchandle);
des_color_space = cmsGetColorSpace(lcms_deshandle);
src_nChannels = _cmsChannelsOf(src_color_space);
des_nChannels = _cmsChannelsOf(des_color_space);
/* For now, just do single byte data, interleaved. We can change this when we
use the transformation. */
src_data_type= (CHANNELS_SH(src_nChannels)|BYTES_SH(1));
des_data_type= (CHANNELS_SH(des_nChannels)|BYTES_SH(1));
/* Create the link. Note the gamut check alarm */
return(cmsCreateProofingTransform(lcms_srchandle, src_data_type,
lcms_deshandle, des_data_type,
lcms_proofhandle,
rendering_params->rendering_intent,
INTENT_ABSOLUTE_COLORIMETRIC,
cmsFLAGS_GAMUTCHECK | cmsFLAGS_SOFTPROOFING ));
}
开发者ID:ststeiger,项目名称:ghostsvg,代码行数:30,代码来源:gsicc_lcms.c
示例2: _cmsReadInputLUT
// Read and create a BRAND NEW MPE LUT from a given profile. All stuff dependent of version, etc
// is adjusted here in order to create a LUT that takes care of all those details
cmsPipeline* _cmsReadInputLUT(cmsHPROFILE hProfile, int Intent)
{
cmsTagTypeSignature OriginalType;
cmsTagSignature tag16 = Device2PCS16[Intent];
cmsTagSignature tagFloat = Device2PCSFloat[Intent];
cmsContext ContextID = cmsGetProfileContextID(hProfile);
if (cmsIsTag(hProfile, tagFloat)) { // Float tag takes precedence
// Floating point LUT are always V4, so no adjustment is required
return cmsPipelineDup((cmsPipeline*) cmsReadTag(hProfile, tagFloat));
}
// Revert to perceptual if no tag is found
if (!cmsIsTag(hProfile, tag16)) {
tag16 = Device2PCS16[0];
}
if (cmsIsTag(hProfile, tag16)) { // Is there any LUT-Based table?
// Check profile version and LUT type. Do the necessary adjustments if needed
// First read the tag
cmsPipeline* Lut = (cmsPipeline*) cmsReadTag(hProfile, tag16);
if (Lut == NULL) return NULL;
// After reading it, we have now info about the original type
OriginalType = _cmsGetTagTrueType(hProfile, tag16);
// The profile owns the Lut, so we need to copy it
Lut = cmsPipelineDup(Lut);
// We need to adjust data only for Lab16 on output
if (OriginalType != cmsSigLut16Type || cmsGetPCS(hProfile) != cmsSigLabData)
return Lut;
// If the input is Lab, add also a conversion at the begin
if (cmsGetColorSpace(hProfile) == cmsSigLabData)
cmsPipelineInsertStage(Lut, cmsAT_BEGIN, _cmsStageAllocLabV4ToV2(ContextID));
// Add a matrix for conversion V2 to V4 Lab PCS
cmsPipelineInsertStage(Lut, cmsAT_END, _cmsStageAllocLabV2ToV4(ContextID));
return Lut;
}
// Lut was not found, try to create a matrix-shaper
// Check if this is a grayscale profile.
if (cmsGetColorSpace(hProfile) == cmsSigGrayData) {
// if so, build appropiate conversion tables.
// The tables are the PCS iluminant, scaled across GrayTRC
return BuildGrayInputMatrixPipeline(hProfile);
}
// Not gray, create a normal matrix-shaper
return BuildRGBInputMatrixShaper(hProfile);
}
开发者ID:ststeiger,项目名称:ghostsvg,代码行数:60,代码来源:cmsio1.c
示例3: gscms_get_link_proof_devlink
/* Get the link from the CMS, but include proofing and/or a device link
profile. */
gcmmhlink_t
gscms_get_link_proof_devlink(gcmmhprofile_t lcms_srchandle,
gcmmhprofile_t lcms_proofhandle,
gcmmhprofile_t lcms_deshandle,
gcmmhprofile_t lcms_devlinkhandle,
gsicc_rendering_param_t *rendering_params,
bool src_dev_link, int cmm_flags,
gs_memory_t *mem)
{
DWORD src_data_type,des_data_type;
icColorSpaceSignature src_color_space,des_color_space;
int src_nChannels,des_nChannels;
int lcms_src_color_space, lcms_des_color_space;
cmsHPROFILE hProfiles[5];
int nProfiles = 0;
/* First handle all the source stuff */
src_color_space = cmsGetColorSpace(lcms_srchandle);
lcms_src_color_space = _cmsLCMScolorSpace(src_color_space);
/* littlecms returns -1 for types it does not (but should) understand */
if (lcms_src_color_space < 0) lcms_src_color_space = 0;
src_nChannels = _cmsChannelsOf(src_color_space);
/* For now, just do single byte data, interleaved. We can change this
when we use the transformation. */
src_data_type = (COLORSPACE_SH(lcms_src_color_space)|
CHANNELS_SH(src_nChannels)|BYTES_SH(2));
if (lcms_deshandle != NULL) {
des_color_space = cmsGetColorSpace(lcms_deshandle);
} else {
/* We must have a device link profile. */
des_color_space = cmsGetPCS(lcms_deshandle);
}
lcms_des_color_space = _cmsLCMScolorSpace(des_color_space);
if (lcms_des_color_space < 0) lcms_des_color_space = 0;
des_nChannels = _cmsChannelsOf(des_color_space);
des_data_type = (COLORSPACE_SH(lcms_des_color_space)|
CHANNELS_SH(des_nChannels)|BYTES_SH(2));
/* lcms proofing transform has a clunky API and can't include the device
link profile if we have both. So use cmsCreateMultiprofileTransform
instead and round trip the proofing profile. */
hProfiles[nProfiles++] = lcms_srchandle;
if (lcms_proofhandle != NULL) {
hProfiles[nProfiles++] = lcms_proofhandle;
hProfiles[nProfiles++] = lcms_proofhandle;
}
hProfiles[nProfiles++] = lcms_deshandle;
if (lcms_devlinkhandle != NULL) {
hProfiles[nProfiles++] = lcms_devlinkhandle;
}
return(cmsCreateMultiprofileTransform(hProfiles, nProfiles, src_data_type,
des_data_type, rendering_params->rendering_intent,
(cmm_flags | cmsFLAGS_BLACKPOINTCOMPENSATION |
cmsFLAGS_HIGHRESPRECALC |
cmsFLAGS_NOTCACHE)));
}
开发者ID:DecisiveMocha,项目名称:ghostpdl,代码行数:57,代码来源:gsicc_lcms.c
示例4: _cmsBuildKToneCurve
// Compute Black tone curve on a CMYK -> CMYK transform. This is done by
// using the proof direction on both profiles to find K->L* relationship
// then joining both curves. dwFlags may include black point compensation.
cmsToneCurve* _cmsBuildKToneCurve(cmsContext ContextID,
cmsUInt32Number nPoints,
cmsUInt32Number nProfiles,
const cmsUInt32Number Intents[],
const cmsHPROFILE hProfiles[],
const cmsBool BPC[],
const cmsFloat64Number AdaptationStates[],
cmsUInt32Number dwFlags)
{
cmsToneCurve *in, *out, *KTone;
// Make sure CMYK -> CMYK
if (cmsGetColorSpace(hProfiles[0]) != cmsSigCmykData ||
cmsGetColorSpace(hProfiles[nProfiles-1])!= cmsSigCmykData) return NULL;
// Make sure last is an output profile
if (cmsGetDeviceClass(hProfiles[nProfiles - 1]) != cmsSigOutputClass) return NULL;
// Create individual curves. BPC works also as each K to L* is
// computed as a BPC to zero black point in case of L*
in = ComputeKToLstar(ContextID, nPoints, nProfiles - 1, Intents, hProfiles, BPC, AdaptationStates, dwFlags);
if (in == NULL) return NULL;
out = ComputeKToLstar(ContextID, nPoints, 1,
Intents + (nProfiles - 1),
hProfiles + (nProfiles - 1),
BPC + (nProfiles - 1),
AdaptationStates + (nProfiles - 1),
dwFlags);
if (out == NULL) {
cmsFreeToneCurve(in);
return NULL;
}
// Build the relationship. This effectively limits the maximum accuracy to 16 bits, but
// since this is used on black-preserving LUTs, we are not loosing accuracy in any case
KTone = cmsJoinToneCurve(ContextID, in, out, nPoints);
// Get rid of components
cmsFreeToneCurve(in); cmsFreeToneCurve(out);
// Something went wrong...
if (KTone == NULL) return NULL;
// Make sure it is monotonic
if (!cmsIsToneCurveMonotonic(KTone)) {
cmsFreeToneCurve(KTone);
return NULL;
}
return KTone;
}
开发者ID:wongm168,项目名称:PegDF,代码行数:57,代码来源:cmsgmt.c
示例5: _cmsReadOutputLUT
// Create an output MPE LUT from agiven profile. Version mismatches are handled here
cmsPipeline* _cmsReadOutputLUT(cmsHPROFILE hProfile, int Intent)
{
cmsTagTypeSignature OriginalType;
cmsTagSignature tag16 = PCS2Device16[Intent];
cmsTagSignature tagFloat = PCS2DeviceFloat[Intent];
cmsContext ContextID = cmsGetProfileContextID(hProfile);
if (cmsIsTag(hProfile, tagFloat)) { // Float tag takes precedence
// Floating point LUT are always V4, so no adjustment is required
return cmsPipelineDup((cmsPipeline*) cmsReadTag(hProfile, tagFloat));
}
// Revert to perceptual if no tag is found
if (!cmsIsTag(hProfile, tag16)) {
tag16 = PCS2Device16[0];
}
if (cmsIsTag(hProfile, tag16)) { // Is there any LUT-Based table?
// Check profile version and LUT type. Do the necessary adjustments if needed
// First read the tag
cmsPipeline* Lut = (cmsPipeline*) cmsReadTag(hProfile, tag16);
if (Lut == NULL) return NULL;
// After reading it, we have info about the original type
OriginalType = _cmsGetTagTrueType(hProfile, tag16);
// The profile owns the Lut, so we need to copy it
Lut = cmsPipelineDup(Lut);
if (Lut == NULL) return NULL;
// Now it is time for a controversial stuff. I found that for 3D LUTS using
// Lab used as indexer space, trilinear interpolation should be used
if (cmsGetPCS(hProfile) == cmsSigLabData)
ChangeInterpolationToTrilinear(Lut);
// We need to adjust data only for Lab and Lut16 type
if (OriginalType != cmsSigLut16Type || cmsGetPCS(hProfile) != cmsSigLabData)
return Lut;
// Add a matrix for conversion V4 to V2 Lab PCS
cmsPipelineInsertStage(Lut, cmsAT_BEGIN, _cmsStageAllocLabV4ToV2(ContextID));
return Lut;
}
// Lut not found, try to create a matrix-shaper
// Check if this is a grayscale profile.
if (cmsGetColorSpace(hProfile) == cmsSigGrayData) {
// if so, build appropiate conversion tables.
// The tables are the PCS iluminant, scaled across GrayTRC
return BuildGrayOutputPipeline(hProfile);
}
// Not gray, create a normal matrix-shaper
return BuildRGBOutputMatrixShaper(hProfile);
}
开发者ID:AFQuentin,项目名称:openjpeg,代码行数:61,代码来源:cmsio1.c
示例6: cmsOpenProfileFromMem
bool LcmsColorProfileContainer::init()
{
if (d->profile) cmsCloseProfile(d->profile);
d->profile = cmsOpenProfileFromMem((void*)d->data->rawData().constData(), d->data->rawData().size());
#ifndef NDEBUG
if (d->data->rawData().size() == 4096) {
warnPigment << "Profile has a size of 4096, which is suspicious and indicates a possible misuse of QIODevice::read(int), check your code.";
}
#endif
if (d->profile) {
wchar_t buffer[_BUFFER_SIZE_];
d->colorSpaceSignature = cmsGetColorSpace(d->profile);
d->deviceClass = cmsGetDeviceClass(d->profile);
cmsGetProfileInfo(d->profile, cmsInfoDescription, cmsNoLanguage, cmsNoCountry, buffer, _BUFFER_SIZE_);
d->productDescription = QString::fromWCharArray(buffer);
d->valid = true;
cmsGetProfileInfo(d->profile, cmsInfoModel, cmsNoLanguage, cmsNoCountry, buffer, _BUFFER_SIZE_);
d->name = QString::fromWCharArray(buffer);
cmsGetProfileInfo(d->profile, cmsInfoManufacturer, cmsNoLanguage, cmsNoCountry, buffer, _BUFFER_SIZE_);
d->manufacturer = QString::fromWCharArray(buffer);
// Check if the profile can convert (something->this)
d->suitableForOutput = cmsIsMatrixShaper(d->profile)
|| ( cmsIsCLUT(d->profile, INTENT_PERCEPTUAL, LCMS_USED_AS_INPUT) &&
cmsIsCLUT(d->profile, INTENT_PERCEPTUAL, LCMS_USED_AS_OUTPUT) );
return true;
}
return false;
}
开发者ID:KDE,项目名称:koffice,代码行数:33,代码来源:LcmsColorProfileContainer.cpp
示例7: cmsDetectBlackPoint
int cmsDetectBlackPoint(LPcmsCIEXYZ BlackPoint, cmsHPROFILE hProfile, int Intent, DWORD dwFlags)
{
// v4 + perceptual & saturation intents does have its own black point
if ((cmsGetProfileICCversion(hProfile) >= 0x4000000) &&
(Intent == INTENT_PERCEPTUAL || Intent == INTENT_SATURATION)) {
return GetV4PerceptualBlack(BlackPoint, hProfile, dwFlags);
}
#ifdef HONOR_BLACK_POINT_TAG
// v2, v4 rel/abs colorimetric
if (cmsIsTag(hProfile, icSigMediaBlackPointTag) &&
Intent == INTENT_RELATIVE_COLORIMETRIC) {
cmsCIEXYZ BlackXYZ, UntrustedBlackPoint, TrustedBlackPoint, MediaWhite;
cmsCIELab Lab;
// If black point is specified, then use it,
cmsTakeMediaBlackPoint(&BlackXYZ, hProfile);
cmsTakeMediaWhitePoint(&MediaWhite, hProfile);
// Black point is absolute XYZ, so adapt to D50 to get PCS value
cmsAdaptToIlluminant(&UntrustedBlackPoint, &MediaWhite, cmsD50_XYZ(), &BlackXYZ);
// Force a=b=0 to get rid of any chroma
cmsXYZ2Lab(NULL, &Lab, &UntrustedBlackPoint);
Lab.a = Lab.b = 0;
if (Lab.L > 50) Lab.L = 50; // Clip to L* <= 50
cmsLab2XYZ(NULL, &TrustedBlackPoint, &Lab);
// Return BP as D50 relative or absolute XYZ (depends on flags)
if (!(dwFlags & LCMS_BPFLAGS_D50_ADAPTED))
cmsAdaptToIlluminant(BlackPoint, cmsD50_XYZ(), &MediaWhite, &TrustedBlackPoint);
else
*BlackPoint = TrustedBlackPoint;
}
#endif
// If output profile, discount ink-limiting
if (Intent == INTENT_RELATIVE_COLORIMETRIC &&
(cmsGetDeviceClass(hProfile) == icSigOutputClass) &&
(cmsGetColorSpace(hProfile) == icSigCmykData))
return BlackPointUsingPerceptualBlack(BlackPoint, hProfile, dwFlags);
// Nope, compute BP using current intent.
return BlackPointAsDarkerColorant(hProfile, Intent, BlackPoint, dwFlags);
}
开发者ID:makinacorpus,项目名称:libecw,代码行数:60,代码来源:cmswtpnt.c
示例8: gimp_color_profile_is_cmyk
/**
* gimp_color_profile_is_cmyk:
* @profile: a #GimpColorProfile
*
* Return value: %TRUE if the profile's color space is CMYK, %FALSE
* otherwise.
*
* Since: 2.10
**/
gboolean
gimp_color_profile_is_cmyk (GimpColorProfile *profile)
{
g_return_val_if_fail (GIMP_IS_COLOR_PROFILE (profile), FALSE);
return (cmsGetColorSpace (profile->priv->lcms_profile) == cmsSigCmykData);
}
开发者ID:jones263,项目名称:gimp,代码行数:16,代码来源:gimpcolorprofile.c
示例9: GetProfileColorSpace
// Equivalence between ICC color spaces and lcms color spaces
static
int GetProfileColorSpace(cmsHPROFILE hProfile)
{
cmsColorSpaceSignature ProfileSpace = cmsGetColorSpace(hProfile);
return _cmsLCMScolorSpace(ProfileSpace);
}
开发者ID:etlegacy,项目名称:EasyGen,代码行数:8,代码来源:jpgicc.c
示例10: _cmsReadFloatOutputTag
static
cmsPipeline* _cmsReadFloatOutputTag(cmsHPROFILE hProfile, cmsTagSignature tagFloat)
{
cmsContext ContextID = cmsGetProfileContextID(hProfile);
cmsPipeline* Lut = cmsPipelineDup((cmsPipeline*) cmsReadTag(hProfile, tagFloat));
cmsColorSpaceSignature PCS = cmsGetPCS(hProfile);
cmsColorSpaceSignature dataSpace = cmsGetColorSpace(hProfile);
if (Lut == NULL) return NULL;
// If PCS is Lab or XYZ, the floating point tag is accepting data in the space encoding,
// and since the formatter has already accomodated to 0..1.0, we should undo this change
if ( PCS == cmsSigLabData)
{
cmsPipelineInsertStage(Lut, cmsAT_BEGIN, _cmsStageNormalizeToLabFloat(ContextID));
}
else
if (PCS == cmsSigXYZData)
{
cmsPipelineInsertStage(Lut, cmsAT_BEGIN, _cmsStageNormalizeToXyzFloat(ContextID));
}
// the output can be Lab or XYZ, in which case normalisation is needed on the end of the pipeline
if ( dataSpace == cmsSigLabData)
{
cmsPipelineInsertStage(Lut, cmsAT_END, _cmsStageNormalizeFromLabFloat(ContextID));
}
else if ( dataSpace == cmsSigXYZData)
{
cmsPipelineInsertStage(Lut, cmsAT_END, _cmsStageNormalizeFromXyzFloat(ContextID));
}
return Lut;
}
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:34,代码来源:cmsio1.c
示例11: _cmsReadFloatInputTag
/*static
cmsPipeline* _cmsReadFloatInputTag(cmsHPROFILE hProfile, cmsTagSignature tagFloat)
{
cmsContext ContextID = cmsGetProfileContextID(hProfile);
cmsPipeline* Lut = cmsPipelineDup((cmsPipeline*) cmsReadTag(hProfile, tagFloat));
cmsColorSpaceSignature spc = cmsGetColorSpace(hProfile);
if (Lut == NULL) return NULL;
// If PCS is Lab or XYZ, the floating point tag is accepting data in the space encoding,
// and since the formatter has already accomodated to 0..1.0, we should undo this change
if ( spc == cmsSigLabData)
{
cmsPipelineInsertStage(Lut, cmsAT_END, _cmsStageNormalizeFromLabFloat(ContextID));
}
else
if (spc == cmsSigXYZData)
{
cmsPipelineInsertStage(Lut, cmsAT_END, _cmsStageNormalizeFromXyzFloat(ContextID));
}
return Lut;
}
*/
static
cmsPipeline* _cmsReadFloatInputTag(cmsHPROFILE hProfile, cmsTagSignature tagFloat)
{
cmsContext ContextID = cmsGetProfileContextID(hProfile);
cmsPipeline* Lut = cmsPipelineDup((cmsPipeline*) cmsReadTag(hProfile, tagFloat));
cmsColorSpaceSignature spc = cmsGetColorSpace(hProfile);
cmsColorSpaceSignature PCS = cmsGetPCS(hProfile);
if (Lut == NULL) return NULL;
// input and output of transform are in lcms 0..1 encoding. If XYZ or Lab spaces are used,
// these need to be normalized into the appropriate ranges (Lab = 100,0,0, XYZ=1.0,1.0,1.0)
if ( spc == cmsSigLabData)
{
cmsPipelineInsertStage(Lut, cmsAT_BEGIN, _cmsStageNormalizeToLabFloat(ContextID));
}
else if (spc == cmsSigXYZData)
{
cmsPipelineInsertStage(Lut, cmsAT_BEGIN, _cmsStageNormalizeToXyzFloat(ContextID));
}
if ( PCS == cmsSigLabData)
{
cmsPipelineInsertStage(Lut, cmsAT_END, _cmsStageNormalizeFromLabFloat(ContextID));
}
else if( PCS == cmsSigXYZData)
{
cmsPipelineInsertStage(Lut, cmsAT_END, _cmsStageNormalizeFromXyzFloat(ContextID));
}
return Lut;
}
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:56,代码来源:cmsio1.c
示例12: gimp_color_profile_is_rgb
/**
* gimp_color_profile_is_rgb:
* @profile: a #GimpColorProfile
*
* Return value: %TRUE if the profile's color space is RGB, %FALSE
* otherwise.
*
* Since: 2.10
**/
gboolean
gimp_color_profile_is_rgb (GimpColorProfile profile)
{
g_return_val_if_fail (profile != NULL, FALSE);
return (cmsGetColorSpace (profile) == cmsSigRgbData);
}
开发者ID:Distrotech,项目名称:gimp,代码行数:16,代码来源:gimpcolorprofile.c
示例13: cms_profile_getattro
static PyObject*
cms_profile_getattro(CmsProfileObject* self, PyObject* name)
{
PyObject* name_bytes;
char* name_string;
if (!PyUnicode_Check(name))
return NULL;
if (!(name_bytes = PyUnicode_AsASCIIString(name)))
return NULL;
if (!(name_string = PyBytes_AsString(name_bytes)))
return NULL;
if (!strcmp(name_string, "product_name"))
return PyUnicode_FromFormat("%s", cmsTakeProductName(self->profile));
if (!strcmp(name_string, "product_desc"))
return PyUnicode_FromFormat("%s", cmsTakeProductDesc(self->profile));
if (!strcmp(name_string, "product_info"))
return PyUnicode_FromFormat("%s", cmsTakeProductInfo(self->profile));
if (!strcmp(name_string, "rendering_intent"))
return PyLong_FromLong(cmsTakeRenderingIntent(self->profile));
if (!strcmp(name_string, "pcs"))
return PyUnicode_FromFormat("%s", findICmode(cmsGetPCS(self->profile)));
if (!strcmp(name_string, "color_space"))
return PyUnicode_FromFormat("%s",
findICmode(cmsGetColorSpace(self->profile)));
/* FIXME: add more properties (creation_datetime etc) */
return PyObject_GenericGetAttr((PyObject*)self, name);
}
开发者ID:olduvaihand,项目名称:pil3k,代码行数:32,代码来源:_imagingcms.c
示例14: GetProfileColorSpace
static
int GetProfileColorSpace(cmsHPROFILE hProfile)
{
icColorSpaceSignature ProfileSpace = cmsGetColorSpace(hProfile);
switch (ProfileSpace) {
case icSigGrayData: return PT_GRAY;
case icSigRgbData: return PT_RGB;
case icSigCmyData: return PT_CMY;
case icSigCmykData: return PT_CMYK;
case icSigYCbCrData:return PT_YCbCr;
case icSigLuvData: return PT_YUV;
case icSigXYZData: return PT_XYZ;
case icSigLabData: return PT_Lab;
case icSigLuvKData: return PT_YUVK;
case icSigHsvData: return PT_HSV;
case icSigHlsData: return PT_HLS;
case icSigYxyData: return PT_Yxy;
case icSigHexachromeData: return PT_HiFi;
default: return icMaxEnumData;
}
}
开发者ID:mworks-project,项目名称:mw_supporting,代码行数:26,代码来源:jpegicc.c
示例15: cmsOpenProfileFromMem
void libcdr::CDRParserState::setColorTransform(const std::vector<unsigned char> &profile)
{
if (profile.empty())
return;
cmsHPROFILE tmpProfile = cmsOpenProfileFromMem(&profile[0], cmsUInt32Number(profile.size()));
if (!tmpProfile)
return;
cmsHPROFILE tmpRGBProfile = cmsCreate_sRGBProfile();
cmsColorSpaceSignature signature = cmsGetColorSpace(tmpProfile);
switch (signature)
{
case cmsSigCmykData:
{
if (m_colorTransformCMYK2RGB)
cmsDeleteTransform(m_colorTransformCMYK2RGB);
m_colorTransformCMYK2RGB = cmsCreateTransform(tmpProfile, TYPE_CMYK_DBL, tmpRGBProfile, TYPE_RGB_8, INTENT_PERCEPTUAL, 0);
}
break;
case cmsSigRgbData:
{
if (m_colorTransformRGB2RGB)
cmsDeleteTransform(m_colorTransformRGB2RGB);
m_colorTransformRGB2RGB = cmsCreateTransform(tmpProfile, TYPE_RGB_8, tmpRGBProfile, TYPE_RGB_8, INTENT_PERCEPTUAL, 0);
}
break;
default:
break;
}
cmsCloseProfile(tmpProfile);
cmsCloseProfile(tmpRGBProfile);
}
开发者ID:androidfan0,项目名称:libcdr,代码行数:31,代码来源:CDRCollector.cpp
示例16: _cmsReadFloatDevicelinkTag
// Read the AToD0 tag, adjusting the encoding of Lab or XYZ if neded
static
cmsPipeline* _cmsReadFloatDevicelinkTag(cmsHPROFILE hProfile, cmsTagSignature tagFloat)
{
cmsContext ContextID = cmsGetProfileContextID(hProfile);
cmsPipeline* Lut = cmsPipelineDup((cmsPipeline*) cmsReadTag(hProfile, tagFloat));
cmsColorSpaceSignature PCS = cmsGetPCS(hProfile);
cmsColorSpaceSignature spc = cmsGetColorSpace(hProfile);
if (Lut == NULL) return NULL;
if (spc == cmsSigLabData)
{
cmsPipelineInsertStage(Lut, cmsAT_BEGIN, _cmsStageNormalizeToLabFloat(ContextID));
}
else
if (spc == cmsSigXYZData)
{
cmsPipelineInsertStage(Lut, cmsAT_BEGIN, _cmsStageNormalizeToXyzFloat(ContextID));
}
if (PCS == cmsSigLabData)
{
cmsPipelineInsertStage(Lut, cmsAT_END, _cmsStageNormalizeFromLabFloat(ContextID));
}
else
if (PCS == cmsSigXYZData)
{
cmsPipelineInsertStage(Lut, cmsAT_END, _cmsStageNormalizeFromXyzFloat(ContextID));
}
return Lut;
}
开发者ID:RedlineResearch,项目名称:OLD-OpenJDK8,代码行数:33,代码来源:cmsio1.c
示例17: WriteInputMatrixShaper
static
int WriteInputMatrixShaper(cmsIOHANDLER* m, cmsHPROFILE hProfile, cmsStage* Matrix, cmsStage* Shaper)
{
cmsColorSpaceSignature ColorSpace;
int rc;
cmsCIEXYZ BlackPointAdaptedToD50;
ColorSpace = cmsGetColorSpace(hProfile);
cmsDetectBlackPoint(&BlackPointAdaptedToD50, hProfile, INTENT_RELATIVE_COLORIMETRIC, 0);
if (ColorSpace == cmsSigGrayData) {
cmsToneCurve** ShaperCurve = _cmsStageGetPtrToCurveSet(Shaper);
rc = EmitCIEBasedA(m, ShaperCurve[0], &BlackPointAdaptedToD50);
}
else
if (ColorSpace == cmsSigRgbData) {
rc = EmitCIEBasedABC(m, GetPtrToMatrix(Matrix),
_cmsStageGetPtrToCurveSet(Shaper),
&BlackPointAdaptedToD50);
}
else {
cmsSignalError(m ->ContextID, cmsERROR_COLORSPACE_CHECK, "Profile is not suitable for CSA. Unsupported colorspace.");
return 0;
}
return rc;
}
开发者ID:LuaDist,项目名称:lcms2,代码行数:32,代码来源:cmsps2.c
示例18: gimp_lcms_profile_is_cmyk
gboolean
gimp_lcms_profile_is_cmyk (GimpColorProfile profile)
{
g_return_val_if_fail (profile != NULL, FALSE);
return (cmsGetColorSpace (profile) == cmsSigCmykData);
}
开发者ID:STRNG,项目名称:gimp,代码行数:7,代码来源:gimplcms.c
示例19: determine_lcms_format
static cmsUInt32Number
determine_lcms_format (const Babl *babl, cmsHPROFILE profile)
{
cmsUInt32Number format = COLORSPACE_SH (PT_ANY);
gint channels, bpc, alpha;
const Babl *type;
channels = cmsChannelsOf (cmsGetColorSpace (profile));
alpha = babl_format_get_n_components (babl) - channels;
bpc = babl_format_get_bytes_per_pixel (babl)
/ babl_format_get_n_components (babl);
type = babl_format_get_type (babl, 0);
if (type == babl_type ("half") ||
type == babl_type ("float") ||
type == babl_type ("double"))
format |= FLOAT_SH (1);
/* bpc == 8 overflows the bitfield otherwise */
bpc &= 0x07;
/*
* This is needed so the alpha component lines up with RGBA float
* for our memcpy hack later on.
*/
if (alpha > 1 || (alpha && channels != 3))
return 0;
format |= EXTRA_SH (alpha) | CHANNELS_SH (channels) | BYTES_SH (bpc);
return format;
}
开发者ID:bantu,项目名称:gegl,代码行数:31,代码来源:lcms-from-profile.c
示例20: gscms_get_input_channel_count
/* Get the number of channels for the profile.
Input count */
int
gscms_get_input_channel_count(gcmmhprofile_t profile)
{
icColorSpaceSignature colorspace;
colorspace = cmsGetColorSpace(profile);
return(_cmsChannelsOf(colorspace));
}
开发者ID:ststeiger,项目名称:ghostsvg,代码行数:10,代码来源:gsicc_lcms.c
注:本文中的cmsGetColorSpace函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论