poison.ui.picture
Source
Module for picture manipulation.
Authors:
Jacob Jensen
License:
https://github.com/PoisonEngine/poison-ui/blob/master/LICENSE
Imports
dsfml.graphics : Image, Texture, RenderWindow
poison.ui.paint
poison.ui.sprite
poison.core : Size, Point
public:
public final class Picture
public:
A picture for image manipulation.
public this(string imageFile);
Creates a new picture.
Parameters:
imageFile The file for an image to load onto the picture.
public this(Size size, Paint fillPaint);
Creates a new picture.
Parameters:
size The size of the picture.
fillPaint The initialization paint.
public this(ubyte[] imageBuffer);
Creates a new picture.
Parameters:
imageBuffer The buffer to load the picture from.
public this(Picture copyImage);
Creates a new picture, copied from another.
Parameters:
copyImage The image to copy.
public void clearGraphics();
Clears the graphics.
public void draw(Point position, Size size, Paint paint);
Draws paint onto the picture.
Parameters:
position The position within the picture to draw the paint.
size The size of the paint.
paint The paint to draw with.
public void gradientHorizontal(Point position, Size size, Paint from, Paint to, ubyte a = 0xff);
Paints a horizontal gradient on the picture.
Parameters:
position The position within the picture to paint the gradient.
size The size of the gradient.
from The paint to gradient from.
to The paint to gradient to.
a The alpha channel of the gradient.
public void gradientVertical(Point position, Size size, Paint from, Paint to, ubyte a = 0xff);
Paints a vertical gradient on the picture.
Parameters:
position The position within the picture to paint the gradient.
size The size of the gradient.
from The paint to gradient from.
to The paint to gradient to.
a The alpha channel of the gradient.
public void resize(Size newSize);
Resizes the picture.
Parameters:
newSize Resizes the picture.
Bug:
Currently only work for pictures with no image file.The fix is to use scale().
public void finalize();
Finalizes the picture and its graphics.
public @property string fileName();
Gets the file name.
public @property void fileName(string newFileName);
Sets the file name.
public @property ubyte[] imageBuffer();
Gets the image buffer.
public @property void imageBuffer(ubyte[] imageBuffer);
Sets the image buffer.
Generated by venom - Poison Engine's Documentation Generator
Module for picture manipulation.
Authors:
Jacob JensenLicense:
https://github.com/PoisonEngine/poison-ui/blob/master/LICENSEImports
dsfml.graphics : Image, Texture, RenderWindowpoison.ui.paint
poison.ui.sprite
poison.core : Size, Point
public final class Picture
public:
A picture for image manipulation.
public this(string imageFile);
Creates a new picture.
Parameters:
imageFile | The file for an image to load onto the picture. |
public this(Size size, Paint fillPaint);
Creates a new picture.
Parameters:
size | The size of the picture. |
fillPaint | The initialization paint. |
public this(ubyte[] imageBuffer);
Creates a new picture.
Parameters:
imageBuffer | The buffer to load the picture from. |
public this(Picture copyImage);
Creates a new picture, copied from another.
Parameters:
copyImage | The image to copy. |
public void clearGraphics();
Clears the graphics.
public void draw(Point position, Size size, Paint paint);
Draws paint onto the picture.
Parameters:
position | The position within the picture to draw the paint. |
size | The size of the paint. |
paint | The paint to draw with. |
public void gradientHorizontal(Point position, Size size, Paint from, Paint to, ubyte a = 0xff);
Paints a horizontal gradient on the picture.
Parameters:
position | The position within the picture to paint the gradient. |
size | The size of the gradient. |
from | The paint to gradient from. |
to | The paint to gradient to. |
a | The alpha channel of the gradient. |
public void gradientVertical(Point position, Size size, Paint from, Paint to, ubyte a = 0xff);
Paints a vertical gradient on the picture.
Parameters:
position | The position within the picture to paint the gradient. |
size | The size of the gradient. |
from | The paint to gradient from. |
to | The paint to gradient to. |
a | The alpha channel of the gradient. |
public void resize(Size newSize);
Resizes the picture.
Parameters:
newSize | Resizes the picture. |
Bug:
Currently only work for pictures with no image file.The fix is to use scale().public void finalize();
Finalizes the picture and its graphics.
public @property string fileName();
Gets the file name.
public @property void fileName(string newFileName);
Sets the file name.
public @property ubyte[] imageBuffer();
Gets the image buffer.
public @property void imageBuffer(ubyte[] imageBuffer);
Sets the image buffer.