本文整理汇总了C++中SkImageInfo::bounds方法的典型用法代码示例。如果您正苦于以下问题:C++ SkImageInfo::bounds方法的具体用法?C++ SkImageInfo::bounds怎么用?C++ SkImageInfo::bounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkImageInfo
的用法示例。
在下文中一共展示了SkImageInfo::bounds方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: validator
sk_sp<SkImage> SkImage_Lazy::onMakeSubset(const SkIRect& subset) const {
SkASSERT(fInfo.bounds().contains(subset));
SkASSERT(fInfo.bounds() != subset);
const SkIRect generatorSubset = subset.makeOffset(fOrigin.x(), fOrigin.y());
Validator validator(fSharedGenerator, &generatorSubset, fInfo.refColorSpace());
return validator ? sk_sp<SkImage>(new SkImage_Lazy(&validator)) : nullptr;
}
示例2: draw
void draw(SkCanvas* canvas) {
const int height = 2;
const int width = 2;
SkImageInfo imageInfo = SkImageInfo::Make(width, height, kN32_SkColorType, kPremul_SkAlphaType);
SkISize dimensions = imageInfo.dimensions();
SkIRect bounds = imageInfo.bounds();
SkIRect dimensionsAsBounds = SkIRect::MakeSize(dimensions);
SkDebugf("dimensionsAsBounds %c= bounds\n", dimensionsAsBounds == bounds ? '=' : '!');
}
示例3: draw
void draw(SkCanvas* canvas) {
canvas->scale(.5f, .5f);
SkImageInfo imageInfo = source.info();
SkIRect bounds = imageInfo.bounds();
for (int x : { 0, bounds.width() } ) {
for (int y : { 0, bounds.height() } ) {
canvas->drawBitmap(source, x, y);
}
}
}