RIP - Raster and Image Processor



class  Surface;

Digital mplementation of images.


this(T, U)(T width, U height, RGBColor rgbColor = new RGBColor(0, 0, 0)) if (allArithmetic!(T, U));

Parameters
T width width of image
U height height of image
RGBColor rgbColor main color

@property Surface  dup();

Returns
duplicate of surface

@property immutable(Surface)  idup();

Returns
immutable duplicate of surface

RGBColor  opIndex(T)(T i) if (allArithmetic!T);

Parameters
T i index of pixel
Returns
pixel
Example:
Surface sur = new Surface[10, 10];
RGBColor pixel = sur[45];

RGBColor  opIndex(T, U)(T i, U j) if (allArithmetic!(T, U));

Like  opIndex. For two indexes

Parameters
T i first index of pixel
U j second index of pixel
Returns
Pixel
Example:
Surface sur = new Surface[10, 10];
RGBColor pixel = sur[4, 6];

void  opIndexAssign(T)(RGBColor rgbColor, T i) if (allArithmetic!T);

Parameters
RGBColor rgbColor new color of pixel
T i first index of pixel
j second index of pixel
Returns
Pixel
Example:
Surface sur = new Surface[10, 10];
sur[45] = new RGBColor(0, 45, 65);

void  opIndexAssign(T, U)(RGBColor rgbColor, T i, U j) if (allArithmetic!(T, U));

Like  opIndexAssign. For two indexes.

Parameters
RGBColor rgbColor new color of pixel
T i first index of pixel
U j second index of pixel
Returns
Pixel
Example:
Surface sur = new Surface[10, 10];
sur[4, 5] = new RGBColor(0, 45, 65);

auto  getPixelsRange();

Create pixel's range and return it;

Returns
PixelsRange

const auto  getPixels();

Returns
Array of pixels