本文整理汇总了C++中SkPixmap::colorSpace方法的典型用法代码示例。如果您正苦于以下问题:C++ SkPixmap::colorSpace方法的具体用法?C++ SkPixmap::colorSpace怎么用?C++ SkPixmap::colorSpace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkPixmap
的用法示例。
在下文中一共展示了SkPixmap::colorSpace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Supports
static bool Supports(const SkPixmap& dst, const SkPixmap& src, const SkPaint& paint) {
// the caller has already inspected the colorspace on src and dst
SkASSERT(!SkColorSpaceXformSteps::Required(src.colorSpace(), dst.colorSpace()));
if (dst.colorType() != src.colorType()) {
return false;
}
if (paint.getMaskFilter() || paint.getColorFilter() || paint.getImageFilter()) {
return false;
}
if (0xFF != paint.getAlpha()) {
return false;
}
SkBlendMode mode = paint.getBlendMode();
return SkBlendMode::kSrc == mode || (SkBlendMode::kSrcOver == mode && src.isOpaque());
}
示例2: blitH
void SkRasterPipelineBlitter::blitH(int x, int y, int w) {
fDstPtr = fDst.writable_addr(0,y);
if (fCanMemsetInBlitH) {
switch (fDst.shiftPerPixel()) {
case 0: memset ((uint8_t *)fDstPtr + x, fMemsetColor, w); return;
case 1: sk_memset16((uint16_t*)fDstPtr + x, fMemsetColor, w); return;
case 2: sk_memset32((uint32_t*)fDstPtr + x, fMemsetColor, w); return;
case 3: sk_memset64((uint64_t*)fDstPtr + x, fMemsetColor, w); return;
default: break;
}
}
if (!fBlitH) {
SkRasterPipeline p(fAlloc);
p.extend(fColorPipeline);
if (fBlend == SkBlendMode::kSrcOver
&& fDst.info().colorType() == kRGBA_8888_SkColorType
&& !fDst.colorSpace()
&& fDst.info().alphaType() != kUnpremul_SkAlphaType
&& fDitherRate == 0.0f) {
p.append(SkRasterPipeline::srcover_rgba_8888, &fDstPtr);
} else {
if (fBlend != SkBlendMode::kSrc) {
this->append_load_d(&p);
this->append_blend(&p);
this->maybe_clamp(&p);
}
this->append_store(&p);
}
fBlitH = p.compile();
}
this->maybe_shade(x,y,w);
fBlitH(x,y,w);
}
示例3: Supports
static bool Supports(const SkPixmap& dst, const SkPixmap& src, const SkPaint& paint) {
if (dst.colorType() != src.colorType()) {
return false;
}
if (!SkColorSpace::Equals(dst.colorSpace(), src.colorSpace())) {
return false;
}
if (paint.getMaskFilter() || paint.getColorFilter() || paint.getImageFilter()) {
return false;
}
if (0xFF != paint.getAlpha()) {
return false;
}
SkBlendMode mode = paint.getBlendMode();
return SkBlendMode::kSrc == mode || (SkBlendMode::kSrcOver == mode && src.isOpaque());
}