SubPixmap

A subpixmap represents a subimage of a Pixmap.

This wrapper provides convenient access to a rectangular slice of a Pixmap.

╔═════════════╗
║ Pixmap      ║
║             ║
║      ┌───┐  ║
║      │Sub│  ║
║      └───┘  ║
╚═════════════╝

Constructors

this
this(Pixmap source, Size size, Point offset)
this
this(Pixmap source, Point offset, Size size)

Members

Functions

extractToNewPixmap
Pixmap extractToNewPixmap()

Allocates a new Pixmap cropped to the pixel data of the subimage.

extractToPixmap
Pixmap extractToPixmap(Pixmap target)

Copies the pixel data – cropped to the subimage region – into the target Pixmap.

height
int height()
void height(int value)

Height of the subimage.

isValid
bool isValid()

Determines whether the area of the subimage lies within the source image and does not overflow its lines.

length
int length()

Number of pixels in the subimage.

oppositeOffset
Point oppositeOffset()

Advanced functionality.

oppositeOffsetX
int oppositeOffsetX()

Advanced functionality.

oppositeOffsetY
int oppositeOffsetY()

Advanced functionality.

scan
inout(Pixel) scan(Point pos)

Retrieves the pixel at the requested position of the subimage.

scanLine
inout(Pixel)[] scanLine()

Retrieves the first line of the subimage.

sourceMarginBottom
int sourceMarginBottom()

Advanced functionality.

sourceMarginLeft
int sourceMarginLeft()

Advanced functionality.

sourceMarginRight
int sourceMarginRight()

Advanced functionality.

sourceMarginTop
int sourceMarginTop()

Advanced functionality.

sourceMarginX
int sourceMarginX()

Advanced functionality.

sourceMarginY
int sourceMarginY()

Advanced functionality.

sourceOffsetEnd
Point sourceOffsetEnd()

Advanced functionality.

sourceOffsetLinear
int sourceOffsetLinear()
void sourceOffsetLinear(int value)

Linear offset of the subimage within the source image.

sourceOffsetLinearEnd
int sourceOffsetLinearEnd()

Linear offset of the subimage within the source image.

sourceOffsetOf
int sourceOffsetOf(Point pos)

Advanced functionality.

width
int width()
void width(int value)

Width of the subimage.

xferTo
void xferTo(SubPixmap target)

Copies the pixels of this subimage to a target image.

xferTo
void xferTo(SubPixmap target, Blend blend)

Blends the pixels of this subimage into a target image.

Variables

offset
Point offset;

2D offset of the subimage

size
Size size;

Size of the subimage

source
Pixmap source;

Source image referenced by the subimage

Meta