本文整理汇总了C++中cmsDeleteTransform函数的典型用法代码示例。如果您正苦于以下问题:C++ cmsDeleteTransform函数的具体用法?C++ cmsDeleteTransform怎么用?C++ cmsDeleteTransform使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cmsDeleteTransform函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: lcms_image_transform_indexed
static void
lcms_image_transform_indexed (gint32 image,
cmsHPROFILE src_profile,
cmsHPROFILE dest_profile,
GimpColorRenderingIntent intent,
gboolean bpc)
{
cmsHTRANSFORM transform;
guchar *cmap;
gint n_cmap_bytes;
cmsUInt32Number format = TYPE_RGB_8;
cmap = gimp_image_get_colormap (image, &n_cmap_bytes);
transform = cmsCreateTransform (src_profile, format,
dest_profile, format,
intent,
cmsFLAGS_NOOPTIMIZE |
bpc ? cmsFLAGS_BLACKPOINTCOMPENSATION : 0);
if (transform)
{
cmsDoTransform (transform, cmap, cmap, n_cmap_bytes / 3);
cmsDeleteTransform (transform);
}
else
{
g_warning ("cmsCreateTransform() failed!");
}
gimp_image_set_colormap (image, cmap, n_cmap_bytes);
}
开发者ID:STRNG,项目名称:gimp,代码行数:32,代码来源:lcms.c
示例2: gscms_release_link
/* Have the CMS release the link */
void
gscms_release_link(gsicc_link_t *icclink)
{
if (icclink->link_handle !=NULL )
cmsDeleteTransform(icclink->link_handle);
icclink->link_handle = NULL;
}
开发者ID:DecisiveMocha,项目名称:ghostpdl,代码行数:9,代码来源:gsicc_lcms.c
示例3: gui_cleanup
void gui_cleanup(struct dt_iop_module_t *self)
{
dt_iop_colortransfer_gui_data_t *g = (dt_iop_colortransfer_gui_data_t *)self->gui_data;
dt_colorspaces_cleanup_profile(g->hsRGB);
dt_colorspaces_cleanup_profile(g->hLab);
cmsDeleteTransform(g->xform);
free(self->gui_data);
self->gui_data = NULL;
}
开发者ID:chubinou,项目名称:darktable,代码行数:9,代码来源:colortransfer.c
示例4: WriteNamedColorCRD
static
int WriteNamedColorCRD(cmsIOHANDLER* m, cmsHPROFILE hNamedColor, int Intent, cmsUInt32Number dwFlags)
{
cmsHTRANSFORM xform;
int i, nColors, nColorant;
cmsUInt32Number OutputFormat;
char ColorName[32];
char Colorant[128];
cmsNAMEDCOLORLIST* NamedColorList;
OutputFormat = cmsFormatterForColorspaceOfProfile(hNamedColor, 2, FALSE);
nColorant = T_CHANNELS(OutputFormat);
xform = cmsCreateTransform(hNamedColor, TYPE_NAMED_COLOR_INDEX, NULL, OutputFormat, Intent, dwFlags);
if (xform == NULL) return 0;
NamedColorList = cmsGetNamedColorList(xform);
if (NamedColorList == NULL) return 0;
_cmsIOPrintf(m, "<<\n");
_cmsIOPrintf(m, "(colorlistcomment) (%s) \n", "Named profile");
_cmsIOPrintf(m, "(Prefix) [ (Pantone ) (PANTONE ) ]\n");
_cmsIOPrintf(m, "(Suffix) [ ( CV) ( CVC) ( C) ]\n");
nColors = cmsNamedColorCount(NamedColorList);
for (i=0; i < nColors; i++) {
cmsUInt16Number In[1];
cmsUInt16Number Out[cmsMAXCHANNELS];
In[0] = (cmsUInt16Number) i;
if (!cmsNamedColorInfo(NamedColorList, i, ColorName, NULL, NULL, NULL, NULL))
continue;
cmsDoTransform(xform, In, Out, 1);
BuildColorantList(Colorant, nColorant, Out);
_cmsIOPrintf(m, " (%s) [ %s ]\n", ColorName, Colorant);
}
_cmsIOPrintf(m, " >>");
if (!(dwFlags & cmsFLAGS_NODEFAULTRESOURCEDEF)) {
_cmsIOPrintf(m, " /Current exch /HPSpotTable defineresource pop\n");
}
cmsDeleteTransform(xform);
return 1;
}
开发者ID:LuaDist,项目名称:lcms2,代码行数:54,代码来源:cmsps2.c
示例5: gimp_view_renderer_transform_free
static void
gimp_view_renderer_transform_free (GimpViewRenderer *renderer)
{
if (renderer->profile_transform)
{
cmsDeleteTransform (renderer->profile_transform);
renderer->profile_transform = NULL;
renderer->profile_src_format = NULL;
renderer->profile_dest_format = NULL;
}
}
开发者ID:ni1son,项目名称:gimp,代码行数:11,代码来源:gimpviewrenderer.c
示例6: gui_cleanup
void gui_cleanup(struct dt_iop_module_t *self)
{
dt_iop_colorzones_gui_data_t *c = (dt_iop_colorzones_gui_data_t *)self->gui_data;
dt_conf_set_int("plugins/darkroom/colorzones/gui_channel", c->channel);
dt_colorspaces_cleanup_profile(c->hsRGB);
dt_colorspaces_cleanup_profile(c->hLab);
cmsDeleteTransform(c->xform);
dt_draw_curve_destroy(c->minmax_curve);
free(self->gui_data);
self->gui_data = NULL;
}
开发者ID:munialabs,项目名称:openPablo,代码行数:11,代码来源:colorzones.c
示例7: cleanup_pipe
void cleanup_pipe(struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
{
dt_iop_colorout_data_t *d = (dt_iop_colorout_data_t *)piece->data;
if(d->xform)
{
cmsDeleteTransform(d->xform);
d->xform = NULL;
}
free(piece->data);
piece->data = NULL;
}
开发者ID:dirkbr,项目名称:darktable,代码行数:12,代码来源:colorout.c
示例8: cdisplay_lcms_finalize
static void
cdisplay_lcms_finalize (GObject *object)
{
CdisplayLcms *lcms = CDISPLAY_LCMS (object);
if (lcms->transform)
{
cmsDeleteTransform (lcms->transform);
lcms->transform = NULL;
}
G_OBJECT_CLASS (cdisplay_lcms_parent_class)->finalize (object);
}
开发者ID:adozenlines,项目名称:gimp,代码行数:13,代码来源:display-filter-lcms.c
示例9: cleanup_pipe
void cleanup_pipe (struct dt_iop_module_t *self, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece)
{
dt_iop_colorout_data_t *d = (dt_iop_colorout_data_t *)piece->data;
if(d->output) dt_colorspaces_cleanup_profile(d->output);
dt_colorspaces_cleanup_profile(d->Lab);
if (d->xform)
{
cmsDeleteTransform(d->xform);
d->xform = 0;
}
free(piece->data);
}
开发者ID:jimmy1977,项目名称:darktable,代码行数:13,代码来源:colorout.c
示例10: convert_space
void* convert_space (const void *source_data_ptr, int width, int height) {
// Assign the memory for the transform
void *YourOutputBuffer = malloc(sizeof(void)*width*height*4);
// Create the required variables
cmsHPROFILE hInProfile, hOutProfile;
cmsHTRANSFORM hTransform;
// Load the colour profiles
hInProfile = cmsOpenProfileFromFile("/Library/Application Support/Nikon/Profiles/NKAdobe.icm", "r");
hOutProfile = cmsCreate_sRGBProfile();
// Create the transform matrix
hTransform = cmsCreateTransform(hInProfile,
TYPE_RGBA_8,
hOutProfile,
TYPE_RGBA_8,
INTENT_PERCEPTUAL,
0);
// Convert the image colours
cmsDoTransform(hTransform,
source_data_ptr,
YourOutputBuffer,
width*height);
// Delete the opened stuff
cmsDeleteTransform(hTransform);
cmsCloseProfile(hInProfile);
cmsCloseProfile(hOutProfile);
// Create the return data object
// CFDataRef ret_val = CFDataCreate (NULL, YourOutputBuffer, height * width * 4);
// release the old image
// CFRelease (source_data_ptr);
// Null the pointer after releasing
source_data_ptr = NULL;
// NULL the pointer
source_data_ptr = NULL;
// Free the temp buffer for the colour space image
// free(YourOutputBuffer);
fprintf(stdout, "Colour space converted.");
// return the new image
return YourOutputBuffer;
}
开发者ID:xj,项目名称:thumbs,代码行数:51,代码来源:image_processing.c
示例11: gcm_cell_renderer_set_color
static void
gcm_cell_renderer_set_color (GcmCellRendererColor *renderer)
{
CdColorRGB8 rgb;
GdkPixbuf *pixbuf = NULL;
gint height = 26; /* TODO: needs to be a property */
gint width = 400; /* TODO: needs to be a property */
gint x, y;
guchar *pixels;
guint pos;
cmsHPROFILE profile_srgb = NULL;
cmsHPROFILE profile_lab = NULL;
cmsHTRANSFORM xform = NULL;
/* nothing set yet */
if (renderer->color == NULL)
goto out;
/* convert the color to sRGB */
profile_lab = cmsCreateLab2Profile (NULL);
profile_srgb = cmsCreate_sRGBProfile ();
xform = cmsCreateTransform (profile_lab, TYPE_Lab_DBL,
profile_srgb, TYPE_RGB_8,
INTENT_ABSOLUTE_COLORIMETRIC, 0);
cmsDoTransform (xform, renderer->color, &rgb, 1);
/* create a pixbuf of the right size */
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height);
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
pixels = gdk_pixbuf_get_pixels (pixbuf);
for (y=0; y<height; y++) {
for (x=0; x<width; x++) {
pos = (y*width+x) * 3;
pixels[pos+0] = rgb.R;
pixels[pos+1] = rgb.G;
pixels[pos+2] = rgb.B;
}
}
out:
g_object_set (renderer, "pixbuf", pixbuf, NULL);
if (profile_srgb != NULL)
cmsCloseProfile (profile_srgb);
if (profile_lab != NULL)
cmsCloseProfile (profile_lab);
if (xform != NULL)
cmsDeleteTransform (xform);
if (pixbuf != NULL)
g_object_unref (pixbuf);
}
开发者ID:NitikaAgarwal,项目名称:gnome-color-manager,代码行数:50,代码来源:gcm-cell-renderer-color.c
示例12: Q_ASSERT
void IccColorProfile::calculateFloatUIMinMax(void)
{
QVector<KoChannelInfo::DoubleRange> &ret = d->shared->uiMinMaxes;
cmsHPROFILE cprofile = d->shared->lcmsProfile->lcmsProfile();
Q_ASSERT(cprofile);
cmsColorSpaceSignature color_space_sig = cmsGetColorSpace(cprofile);
unsigned int num_channels = cmsChannelsOf(color_space_sig);
unsigned int color_space_mask = _cmsLCMScolorSpace(color_space_sig);
Q_ASSERT(num_channels>=1 && num_channels <=4); // num_channels==1 is for grayscale, we need to handle it
Q_ASSERT(color_space_mask);
// to try to find the max range of float/doubles for this profile,
// pass in min/max int and make the profile convert that
// this is far from perfect, we need a better way, if possible to get the "bounds" of a profile
uint16_t in_min_pixel[4] = {0,0,0,0};
uint16_t in_max_pixel[4] = {0xFFFF,0xFFFF,0xFFFF,0xFFFF};
double out_min_pixel[4] = {0,0,0,0};
double out_max_pixel[4] = {0,0,0,0};
cmsHTRANSFORM trans = cmsCreateTransform(
cprofile,
(COLORSPACE_SH(color_space_mask)|CHANNELS_SH(num_channels)|BYTES_SH(2)),
cprofile,
(COLORSPACE_SH(color_space_mask)|FLOAT_SH(1)|CHANNELS_SH(num_channels)|BYTES_SH(0)), //NOTE THAT 'BYTES' FIELD IS SET TO ZERO ON DLB because 8 bytes overflows the bitfield
INTENT_PERCEPTUAL, 0); // does the intent matter in this case?
if (trans) {
cmsDoTransform(trans, in_min_pixel, out_min_pixel, 1);
cmsDoTransform(trans, in_max_pixel, out_max_pixel, 1);
cmsDeleteTransform(trans);
}//else, we'll just default to [0..1] below
ret.resize(num_channels);
for (unsigned int i=0; i<num_channels; ++i) {
if (out_min_pixel[i] < out_max_pixel[i]) {
ret[i].minVal = out_min_pixel[i];
ret[i].maxVal = out_max_pixel[i];
} else {
// aparently we can't even guarentee that converted_to_double(0x0000) < converted_to_double(0xFFFF)
// assume [0..1] in such cases
// we need to find a really solid way of determining the bounds of a profile, if possible
ret[i].minVal = 0;
ret[i].maxVal = 1;
}
}
}
开发者ID:TheTypoMaster,项目名称:calligra,代码行数:50,代码来源:IccColorProfile.cpp
示例13: main
int main(int argc, char* argv[])
{
int r, g, b;
cmsUInt8Number RGB[3], RGB_OUT[3];
cmsHTRANSFORM xform;
cmsHPROFILE hProfile;
double err, SumX=0, SumX2=0, Peak = 0, n = 0;
if (argc != 2) {
printf("roundtrip <RGB icc profile>\n");
return 1;
}
hProfile = cmsOpenProfileFromFile(argv[1], "r");
xform = cmsCreateTransform(hProfile,TYPE_RGB_8, hProfile, TYPE_RGB_8, INTENT_RELATIVE_COLORIMETRIC, cmsFLAGS_NOOPTIMIZE);
for (r=0; r< 256; r++) {
printf("%d \r", r);
for (g=0; g < 256; g++) {
for (b=0; b < 256; b++) {
RGB[0] = r;
RGB[1] = g;
RGB[2] = b;
cmsDoTransform(xform, RGB, RGB_OUT, 1);
err = VecDist(RGB, RGB_OUT);
SumX += err;
SumX2 += err * err;
n += 1.0;
if (err > Peak)
Peak = err;
}
}
}
printf("Average %g\n", SumX / n);
printf("Max %g\n", Peak);
printf("Std %g\n", sqrt((n*SumX2 - SumX * SumX) / (n*(n-1))));
cmsCloseProfile(hProfile);
cmsDeleteTransform(xform);
return 0;
}
开发者ID:AlexiaChen,项目名称:ImageMagick_Cmake,代码行数:49,代码来源:roundtrip.c
示例14: CloseTransforms
static
void CloseTransforms(void)
{
int i;
if (hColorTransform) cmsDeleteTransform(hColorTransform);
if (hInput) cmsCloseProfile(hInput);
if (hOutput) cmsCloseProfile(hOutput);
if (hProof) cmsCloseProfile(hProof);
for (i=0; i < nProfiles; i++)
cmsCloseProfile(hProfiles[i]);
hColorTransform = NULL; hInput = NULL; hOutput = NULL; hProof = NULL;
}
开发者ID:BorodaZizitopa,项目名称:ghostscript,代码行数:15,代码来源:icctrans.c
示例15: cmsDetectTAC
// Detect Total area coverage of the profile
cmsFloat64Number CMSEXPORT cmsDetectTAC(cmsHPROFILE hProfile)
{
cmsTACestimator bp;
cmsUInt32Number dwFormatter;
cmsUInt32Number GridPoints[MAX_INPUT_DIMENSIONS];
cmsHPROFILE hLab;
cmsContext ContextID = cmsGetProfileContextID(hProfile);
// TAC only works on output profiles
if (cmsGetDeviceClass(hProfile) != cmsSigOutputClass) {
return 0;
}
// Create a fake formatter for result
dwFormatter = cmsFormatterForColorspaceOfProfile(hProfile, 4, TRUE);
bp.nOutputChans = T_CHANNELS(dwFormatter);
bp.MaxTAC = 0; // Initial TAC is 0
// for safety
if (bp.nOutputChans >= cmsMAXCHANNELS) return 0;
hLab = cmsCreateLab4ProfileTHR(ContextID, NULL);
if (hLab == NULL) return 0;
// Setup a roundtrip on perceptual intent in output profile for TAC estimation
bp.hRoundTrip = cmsCreateTransformTHR(ContextID, hLab, TYPE_Lab_16,
hProfile, dwFormatter, INTENT_PERCEPTUAL, cmsFLAGS_NOOPTIMIZE|cmsFLAGS_NOCACHE);
cmsCloseProfile(hLab);
if (bp.hRoundTrip == NULL) return 0;
// For L* we only need black and white. For C* we need many points
GridPoints[0] = 6;
GridPoints[1] = 74;
GridPoints[2] = 74;
if (!cmsSliceSpace16(3, GridPoints, EstimateTAC, &bp)) {
bp.MaxTAC = 0;
}
cmsDeleteTransform(bp.hRoundTrip);
// Results in %
return bp.MaxTAC;
}
开发者ID:Gustfh,项目名称:jdk8u-dev-jdk,代码行数:47,代码来源:cmsgmt.c
示例16: color_man_cache_unref
static void color_man_cache_unref(ColorManCache *cc)
{
if (!cc) return;
cc->refcount--;
if (cc->refcount < 1)
{
if (cc->transform) cmsDeleteTransform(cc->transform);
if (cc->profile_in) cmsCloseProfile(cc->profile_in);
if (cc->profile_out) cmsCloseProfile(cc->profile_out);
g_free(cc->profile_in_file);
g_free(cc->profile_out_file);
g_free(cc);
}
}
开发者ID:metux,项目名称:geeqie,代码行数:17,代码来源:color-man.c
示例17: WriteNamedColorCSA
static
int WriteNamedColorCSA(cmsIOHANDLER* m, cmsHPROFILE hNamedColor, int Intent)
{
cmsHTRANSFORM xform;
cmsHPROFILE hLab;
int i, nColors;
char ColorName[32];
cmsNAMEDCOLORLIST* NamedColorList;
hLab = cmsCreateLab4ProfileTHR(m ->ContextID, NULL);
xform = cmsCreateTransform(hNamedColor, TYPE_NAMED_COLOR_INDEX, hLab, TYPE_Lab_DBL, Intent, 0);
if (xform == NULL) return 0;
NamedColorList = cmsGetNamedColorList(xform);
if (NamedColorList == NULL) return 0;
_cmsIOPrintf(m, "<<\n");
_cmsIOPrintf(m, "(colorlistcomment) (%s)\n", "Named color CSA");
_cmsIOPrintf(m, "(Prefix) [ (Pantone ) (PANTONE ) ]\n");
_cmsIOPrintf(m, "(Suffix) [ ( CV) ( CVC) ( C) ]\n");
nColors = cmsNamedColorCount(NamedColorList);
for (i=0; i < nColors; i++) {
cmsUInt16Number In[1];
cmsCIELab Lab;
In[0] = (cmsUInt16Number) i;
if (!cmsNamedColorInfo(NamedColorList, i, ColorName, NULL, NULL, NULL, NULL))
continue;
cmsDoTransform(xform, In, &Lab, 1);
_cmsIOPrintf(m, " (%s) [ %.3f %.3f %.3f ]\n", ColorName, Lab.L, Lab.a, Lab.b);
}
_cmsIOPrintf(m, ">>\n");
cmsDeleteTransform(xform);
cmsCloseProfile(hLab);
return 1;
}
开发者ID:LuaDist,项目名称:lcms2,代码行数:46,代码来源:cmsps2.c
示例18: cdisplay_proof_finalize
static void
cdisplay_proof_finalize (GObject *object)
{
CdisplayProof *proof = CDISPLAY_PROOF (object);
if (proof->profile)
{
g_free (proof->profile);
proof->profile = NULL;
}
if (proof->transform)
{
cmsDeleteTransform (proof->transform);
proof->transform = NULL;
}
G_OBJECT_CLASS (cdisplay_proof_parent_class)->finalize (object);
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:19,代码来源:display-filter-proof.c
示例19: ComputeKToLstar
// Compute K -> L* relationship. Flags may include black point compensation. In this case,
// the relationship is assumed from the profile with BPC to a black point zero.
static
cmsToneCurve* ComputeKToLstar(cmsContext ContextID,
cmsUInt32Number nPoints,
cmsUInt32Number nProfiles,
const cmsUInt32Number Intents[],
const cmsHPROFILE hProfiles[],
const cmsBool BPC[],
const cmsFloat64Number AdaptationStates[],
cmsUInt32Number dwFlags)
{
cmsToneCurve* out = NULL;
cmsUInt32Number i;
cmsHTRANSFORM xform;
cmsCIELab Lab;
cmsFloat32Number cmyk[4];
cmsFloat32Number* SampledPoints;
xform = _cmsChain2Lab(ContextID, nProfiles, TYPE_CMYK_FLT, TYPE_Lab_DBL, Intents, hProfiles, BPC, AdaptationStates, dwFlags);
if (xform == NULL) return NULL;
SampledPoints = (cmsFloat32Number*) _cmsCalloc(ContextID, nPoints, sizeof(cmsFloat32Number));
if (SampledPoints == NULL) goto Error;
for (i=0; i < nPoints; i++) {
cmyk[0] = 0;
cmyk[1] = 0;
cmyk[2] = 0;
cmyk[3] = (cmsFloat32Number) ((i * 100.0) / (nPoints-1));
cmsDoTransform(xform, cmyk, &Lab, 1);
SampledPoints[i]= (cmsFloat32Number) (1.0 - Lab.L / 100.0); // Negate K for easier operation
}
out = cmsBuildTabulatedToneCurveFloat(ContextID, nPoints, SampledPoints);
Error:
cmsDeleteTransform(xform);
if (SampledPoints) _cmsFree(ContextID, SampledPoints);
return out;
}
开发者ID:Gustfh,项目名称:jdk8u-dev-jdk,代码行数:45,代码来源:cmsgmt.c
示例20: close_transform
BOOL close_transform( HTRANSFORM handle )
{
DWORD_PTR index;
struct transform *transform;
EnterCriticalSection( &MSCMS_handle_cs );
index = (DWORD_PTR)handle - 1;
if (index > num_transform_handles)
{
LeaveCriticalSection( &MSCMS_handle_cs );
return FALSE;
}
transform = &transformtable[index];
cmsDeleteTransform( transform->cmstransform );
memset( transform, 0, sizeof(struct transform) );
LeaveCriticalSection( &MSCMS_handle_cs );
return TRUE;
}
开发者ID:RareHare,项目名称:reactos,代码行数:21,代码来源:handle.c
注:本文中的cmsDeleteTransform函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论