Ream v0.1.0-1
C++ graphics library for Linux
Loading...
Searching...
No Matches
Static Public Member Functions | Public Attributes | List of all members
RPixelBufferRegion Struct Reference

Describes a region to be copied from/to a pixel buffer. More...

#include <RImage.h>

Static Public Member Functions

static constexpr UInt8 * AddressAt (UInt8 *origin, SkIPoint offset, UInt32 bytesPerPixel, UInt32 stride) noexcept
 Computes the address of a pixel within a buffer.
 

Public Attributes

SkIPoint offset
 Offset in pixels applied to each source rect before copying.
 
UInt32 stride
 Stride in bytes of the pixel buffer.
 
UInt8 * pixels
 Pointer to the top-left corner of the pixel buffer.
 
SkRegion region
 Set of rectangles to copy, relative to the top-left corner of the source buffer.
 
RFormat format
 The DRM format of the 'pixels' parameter.
 

Detailed Description

Describes a region to be copied from/to a pixel buffer.

Member Function Documentation

◆ AddressAt()

static constexpr UInt8 * AddressAt ( UInt8 *  origin,
SkIPoint  offset,
UInt32  bytesPerPixel,
UInt32  stride 
)
inlinestaticconstexprnoexcept

Computes the address of a pixel within a buffer.

Parameters
originPointer to the top-left corner of the buffer.
offsetPixel offset from the origin.
bytesPerPixelNumber of bytes per pixel.
strideNumber of bytes per row.
Returns
Pointer to the pixel at offset.

Member Data Documentation

◆ offset

SkIPoint offset

Offset in pixels applied to each source rect before copying.

Note
The offset is only applied to the source.

For example:

  • To copy src(10, 10, 100, 100) to dest(0, 0, 100, 100), set offset = (10, 10) and region = (0, 0, 100, 100).
  • To copy src(0, 0, 100, 100) to dest(10, 10, 100, 100), set offset = (-10, -10) and region = (10, 10, 100, 100).

◆ stride

UInt32 stride

Stride in bytes of the pixel buffer.

◆ pixels

UInt8* pixels

Pointer to the top-left corner of the pixel buffer.

◆ region

SkRegion region

Set of rectangles to copy, relative to the top-left corner of the source buffer.

◆ format

RFormat format

The DRM format of the 'pixels' parameter.