本文整理汇总了C++中Filter::filterResolution方法的典型用法代码示例。如果您正苦于以下问题:C++ Filter::filterResolution方法的具体用法?C++ Filter::filterResolution怎么用?C++ Filter::filterResolution使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Filter
的用法示例。
在下文中一共展示了Filter::filterResolution方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: determineAbsolutePaintRect
void SourceGraphic::determineAbsolutePaintRect()
{
Filter* filter = this->filter();
FloatRect paintRect = filter->sourceImageRect();
paintRect.scale(filter->filterResolution().width(), filter->filterResolution().height());
setAbsolutePaintRect(enclosingIntRect(paintRect));
}
示例2: apply
void FETile::apply()
{
// FIXME: See bug 47315. This is a hack to work around a compile failure, but is incorrect behavior otherwise.
#if ENABLE(SVG)
FilterEffect* in = inputEffect(0);
in->apply();
if (!in->resultImage())
return;
GraphicsContext* filterContext = effectContext();
if (!filterContext)
return;
setIsAlphaImage(in->isAlphaImage());
// Source input needs more attention. It has the size of the filterRegion but gives the
// size of the cutted sourceImage back. This is part of the specification and optimization.
FloatRect tileRect = in->maxEffectRect();
FloatPoint inMaxEffectLocation = tileRect.location();
FloatPoint maxEffectLocation = maxEffectRect().location();
if (in->filterEffectType() == FilterEffectTypeSourceInput) {
Filter* filter = this->filter();
tileRect = filter->filterRegion();
tileRect.scale(filter->filterResolution().width(), filter->filterResolution().height());
}
OwnPtr<ImageBuffer> tileImage;
if (!SVGImageBufferTools::createImageBuffer(tileRect, tileRect, tileImage, ColorSpaceDeviceRGB))
return;
GraphicsContext* tileImageContext = tileImage->context();
tileImageContext->translate(-inMaxEffectLocation.x(), -inMaxEffectLocation.y());
tileImageContext->drawImageBuffer(in->resultImage(), ColorSpaceDeviceRGB, in->absolutePaintRect().location());
RefPtr<Pattern> pattern = Pattern::create(tileImage->copyImage(), true, true);
AffineTransform patternTransform;
patternTransform.translate(inMaxEffectLocation.x() - maxEffectLocation.x(), inMaxEffectLocation.y() - maxEffectLocation.y());
pattern->setPatternSpaceTransform(patternTransform);
filterContext->setFillPattern(pattern);
filterContext->fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()));
#endif
}
示例3: applySoftware
void FETile::applySoftware()
{
FilterEffect* in = inputEffect(0);
ImageBuffer* resultImage = createImageBufferResult();
if (!resultImage)
return;
setIsAlphaImage(in->isAlphaImage());
// Source input needs more attention. It has the size of the filterRegion but gives the
// size of the cutted sourceImage back. This is part of the specification and optimization.
FloatRect tileRect = in->maxEffectRect();
FloatPoint inMaxEffectLocation = tileRect.location();
FloatPoint maxEffectLocation = maxEffectRect().location();
if (in->filterEffectType() == FilterEffectTypeSourceInput) {
Filter* filter = this->filter();
tileRect = filter->absoluteFilterRegion();
tileRect.scale(filter->filterResolution().width(), filter->filterResolution().height());
}
OwnPtr<ImageBuffer> tileImage;
if (!SVGRenderingContext::createImageBufferForPattern(tileRect, tileRect, tileImage, filter()->renderingMode()))
return;
GraphicsContext* tileImageContext = tileImage->context();
tileImageContext->translate(-inMaxEffectLocation.x(), -inMaxEffectLocation.y());
tileImageContext->drawImageBuffer(in->asImageBuffer(), in->absolutePaintRect().location());
RefPtr<Pattern> pattern = Pattern::create(tileImage->copyImage(CopyBackingStore), true, true);
AffineTransform patternTransform;
patternTransform.translate(inMaxEffectLocation.x() - maxEffectLocation.x(), inMaxEffectLocation.y() - maxEffectLocation.y());
pattern->setPatternSpaceTransform(patternTransform);
GraphicsContext* filterContext = resultImage->context();
filterContext->setFillPattern(pattern);
filterContext->fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()));
}