Pixmap.copyTo

Copies the pixel data to the target Pixmap.

struct Pixmap
@safe pure nothrow @nogc const
copyTo

Return Value

Type: Pixmap

A size-adjusted shallow copy of the input Pixmap overwritten with the image data of the SubPixmap.

While the returned Pixmap utilizes the buffer provided by the input, the returned Pixmap might not exactly match the input.

Always use the returned Pixmap structure.

// Same buffer, but new structure:
auto pixmap2 = source.copyTo(pixmap);

// Alternatively, replace the old structure:
pixmap = source.copyTo(pixmap);

Meta