本文整理汇总了C++中ConstImageBuffer::At方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstImageBuffer::At方法的具体用法?C++ ConstImageBuffer::At怎么用?C++ ConstImageBuffer::At使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConstImageBuffer
的用法示例。
在下文中一共展示了ConstImageBuffer::At方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: canvas
void
Canvas::Stretch(int dest_x, int dest_y,
unsigned dest_width, unsigned dest_height,
ConstImageBuffer src,
int src_x, int src_y,
unsigned src_width, unsigned src_height)
{
assert(dest_width < 0x4000);
assert(dest_height < 0x4000);
if (dest_width == src_width && dest_height == src_height) {
/* fast path: no zooming needed */
Copy(dest_x, dest_y, dest_width, dest_height, src, src_x, src_y);
return;
}
if (dest_width >= 0x4000 || dest_height >= 0x4000)
/* paranoid sanity check; shouldn't ever happen */
return;
SDLRasterCanvas canvas(buffer);
canvas.ScaleRectangle(dest_x, dest_y, dest_width, dest_height,
src.At(src_x, src_y), src.pitch, src_width, src_height);
}
示例2: canvas
void
Canvas::StretchTransparentWhite(int dest_x, int dest_y,
unsigned dest_width, unsigned dest_height,
ConstImageBuffer src, int src_x, int src_y,
unsigned src_width, unsigned src_height)
{
if (!Clip(dest_x, dest_width, GetWidth(), src_x) ||
!Clip(dest_y, dest_height, GetHeight(), src_y))
return;
SDLRasterCanvas canvas(buffer);
TransparentPixelOperations<ActivePixelTraits> operations(canvas.Import(COLOR_WHITE));
canvas.ScaleRectangle(dest_x, dest_y, dest_width, dest_height,
src.At(src_x, src_y), src.pitch, src.width, src.height,
operations);
}
示例3: canvas
void
Canvas::StretchAnd(int dest_x, int dest_y,
unsigned dest_width, unsigned dest_height,
const Bitmap &src,
int src_x, int src_y, unsigned src_width, unsigned src_height)
{
assert(IsDefined());
assert(src.IsDefined());
ConstImageBuffer srcImg = src.GetNative();
SDLRasterCanvas canvas(buffer);
BitAndPixelOperations<ActivePixelTraits> operations;
canvas.ScaleRectangle(dest_x, dest_y, dest_width, dest_height,
srcImg.At(src_x, src_y), srcImg.pitch, src_width, src_height,
operations);
}
示例4: canvas
void
Canvas::AlphaBlendNotWhite(int dest_x, int dest_y,
unsigned dest_width, unsigned dest_height,
ConstImageBuffer src,
int src_x, int src_y,
unsigned src_width, unsigned src_height,
uint8_t alpha)
{
// TODO: support scaling
SDLRasterCanvas canvas(buffer);
NotWhiteCondition<SDLPixelTraits> c;
NotWhiteAlphaPixelOperations<SDLPixelTraits> operations(c,
PortableAlphaPixelOperations<SDLPixelTraits>(alpha));
canvas.CopyRectangle(dest_x, dest_y, dest_width, dest_height,
src.At(src_x, src_y), src.pitch,
operations);
}