本文整理汇总了C++中DImg::setIccProfile方法的典型用法代码示例。如果您正苦于以下问题:C++ DImg::setIccProfile方法的具体用法?C++ DImg::setIccProfile怎么用?C++ DImg::setIccProfile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DImg
的用法示例。
在下文中一共展示了DImg::setIccProfile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
bool IccTransform::apply(DImg& image, DImgLoaderObserver* const observer)
{
if (!willHaveEffect())
{
if (!d->outputProfile.isNull() && !d->doNotEmbed)
{
image.setIccProfile(d->outputProfile);
}
return true;
}
if (!checkProfiles())
{
return false;
}
TransformDescription description;
if (d->proofProfile.isNull())
{
description = getDescription(image);
if (!open(description))
{
return false;
}
}
else
{
description = getProofingDescription(image);
if (!openProofing(description))
{
return false;
}
}
if (observer)
{
observer->progressInfo(&image, 0.1F);
}
transform(image, description, observer);
if (!d->doNotEmbed)
{
image.setIccProfile(d->outputProfile);
}
// if this was a RAW color image, it is no more
image.removeAttribute(QLatin1String("uncalibratedColor"));
return true;
}
示例2: makePixmap
void InsertTextWidget::makePixmap()
{
int orgW = d->iface->originalSize().width();
int orgH = d->iface->originalSize().height();
float ratioW = (float)d->w / (float)orgW;
float ratioH = (float)d->h / (float)orgH;
int x, y;
if (d->textRect.isValid())
{
// convert from widget to image coordinates
x = d->textRect.x() - d->rect.x();
y = d->textRect.y() - d->rect.y();
}
else
{
x = -1;
y = -1;
}
// get preview image data
DImg image = d->iface->preview();
image.setIccProfile( d->iface->original()->getIccProfile() );
// paint pixmap for drawing this widget
// First, fill with background color
d->pixmap->fill(d->bgColor);
QPainter p(d->pixmap);
// Convert image to pixmap and draw it
QPixmap imagePixmap = d->iface->convertToPixmap(image);
p.drawPixmap(d->rect.x(), d->rect.y(),
imagePixmap, 0, 0, imagePixmap.width(), imagePixmap.height());
// prepare painter for use by compose image
p.setClipRect(d->rect);
p.translate(d->rect.x(), d->rect.y());
int borderWidth = qMax(1, qRound(ratioW));
// compose image and draw result directly on pixmap, with correct offset
QRect textRect = composeImage(&image, &p, x, y,
d->textFont, d->textFont.pointSizeF(),
d->textRotation, d->textColor, d->textOpacity,
d->alignMode, d->textString, d->textTransparent, d->backgroundColor,
d->textBorder ? BORDER_NORMAL : BORDER_SUPPORT, borderWidth, borderWidth,
(ratioW > ratioH) ? ratioW : ratioH);
p.end();
// store new text rectangle
// convert from image to widget coordinates
d->textRect.setX(textRect.x() + d->rect.x());
d->textRect.setY(textRect.y() + d->rect.y());
d->textRect.setSize(textRect.size());
}
示例3: sz
uchar* ImageIface::Private::previewImageData()
{
if (previewImage.isNull())
{
DImg* im = 0;
if (previewType == FullImage)
{
im = core->getImg();
if (!im || im->isNull())
{
return 0;
}
}
else // ImageSelection
{
im = new DImg(core->getImgSelection());
if (!im)
{
return 0;
}
if (im->isNull())
{
delete im;
return 0;
}
im->setIccProfile(core->getEmbeddedICC());
}
QSize sz(im->width(), im->height());
sz.scale(constrainWidth, constrainHeight, Qt::KeepAspectRatio);
previewImage = im->smoothScale(sz.width(), sz.height());
previewWidth = previewImage.width();
previewHeight = previewImage.height();
// only create another copy if needed, in setPreviewImage
targetPreviewImage = previewImage;
if (previewType == ImageSelection)
{
delete im;
}
}
DImg previewData = previewImage.copyImageData();
return previewData.stripImageData();
}