本文整理汇总了C++中DImg::stripImageData方法的典型用法代码示例。如果您正苦于以下问题:C++ DImg::stripImageData方法的具体用法?C++ DImg::stripImageData怎么用?C++ DImg::stripImageData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DImg
的用法示例。
在下文中一共展示了DImg::stripImageData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setPreviewImage
void RawImport::setPreviewImage()
{
// Preserve metadata from loaded image, and take post-processed image data
d->postProcessedImage = d->previewWidget->demosaicedImage().copyMetaData();
DImg data = filter()->getTargetImage();
d->postProcessedImage.putImageData(data.width(), data.height(), data.sixteenBit(), data.hasAlpha(),
data.stripImageData(), false);
d->previewWidget->setPostProcessedImage(d->postProcessedImage);
d->settingsBox->setPostProcessedImage(d->postProcessedImage);
EditorToolIface::editorToolIface()->setToolStopProgress();
setBusy(false);
}
示例2: 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();
}
示例3: putImageDataAndHistory
bool UndoManager::putImageDataAndHistory(DImg* const img, int stepsBack) const
{
if (stepsBack <= 0 || stepsBack > d->undoActions.size())
{
return false;
}
/*
* We need to find a snapshot, for the state the given number of steps back.
* 0 steps back is the current state of the EditorCore.
* 1 step back is the snapshot of the last undo action, at d->undoActions.size() - 1.
* The next problem is that if the corresponding action is reversible,
* we do not have a snapshot, but need to walk forward to the first snapshot (or current
* state), then apply the reversible steps.
*/
int step = d->undoActions.size() - stepsBack;
int snapshot;
for (snapshot = step; snapshot < d->undoActions.size(); ++snapshot)
{
if (dynamic_cast<UndoActionIrreversible*>(d->undoActions.at(snapshot)))
{
break;
}
}
if (snapshot == step)
{
getSnapshot(step, img);
}
else
{
DImg reverting;
// Get closest available snapshot
if (snapshot < d->undoActions.size())
{
getSnapshot(snapshot, &reverting);
}
else
{
reverting = d->core->getImg()->copyImageData();
}
// revert reversible actions, until reaching desired step
for (; snapshot > step; snapshot--)
{
UndoActionReversible* const reversible = dynamic_cast<UndoActionReversible*>(d->undoActions.at(snapshot - 1));
if (!reversible) // would be a bug
{
continue;
}
reversible->getReverseFilter().apply(reverting);
}
img->putImageData(reverting.width(), reverting.height(), reverting.sixteenBit(),
reverting.hasAlpha(), reverting.stripImageData(), false);
}
// adjust history
UndoAction* const action = d->undoActions.at(step);
UndoMetadataContainer dataBeforeStep = action->getMetadata();
dataBeforeStep.toImage(*img);
return true;
}