Image

Image description structure. (Colors are in RGBA format.)

Constructors

this
this()

Empty constructor image.

this
this(uint w, uint h)

Allocates space for image data.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

allocatePlace
void allocatePlace(uint w, uint h)

Allocates space for image data.

blit
void blit(Image otherImage, Vecf position)

Merges two images (no alpha blending).

bytes
ubyte[] bytes()

Gives away bytes as data for an image.

bytes
void bytes(ubyte[] data)

Accepts bytes as data for an image.

copy
Image copy(int x, int y, int cWidth, int cHeight)

Redraws the part to a new picture.

draw
void draw(IRenderer renderer, Vecf position)
Undocumented in source. Be warned that the author may not have intended to support it.
drawEx
void drawEx(IRenderer renderer, Vecf position, float angle, Vecf center, Vecf size, ubyte alpha, Color!ubyte color)
Undocumented in source. Be warned that the author may not have intended to support it.
empty
bool empty()

Whether the data has the current image.

fill
void fill(Color!ubyte color)

Fills the data with color.

freeData
void freeData()

Free image data.

getPixel
Color!ubyte getPixel(int x, int y)

Returns the pixel at the specified location.

load
Image load(string path)

Loads a surface from a file. Supported formats are described here: https://code.dlang.org/packages/imageformats

resize
Image resize(uint newWidth, uint newHeight)

Resizes the image.

scale
Image scale(float k)

Enlarges the image by a factor.

setPixel
void setPixel(int x, int y, Color!ubyte color)

Sets the pixel to the specified position.

toTexture
void toTexture()

Converts an image to a texture (i.e. for rendering an image with hardware acceleration). At the same time, now, when the image is called, the texture itself will be drawn. You can get such a texture and change its parameters from the "texture" property.

toTextureWithoutShape
void toTextureWithoutShape()

Converts an image to a texture (i.e. for rendering an image with hardware acceleration). At the same time, now, when the image is called, the texture itself will be drawn. You can get such a texture and change its parameters from the "texture" property.

Properties

dup
Image dup [@property getter]

Dynamic copy of the image.

height
uint height [@property getter]

Image height.

pixels
Color!ubyte[] pixels [@property getter]
Color!ubyte[] pixels [@property setter]

Image dataset.

texture
Texture texture [@property getter]

The texture that was generated by the "toTexture" function. Using the field, you can set the shape of the texture and its other parameters.

width
uint width [@property getter]

Image width.

Inherited Members

From IDrawable

draw
void draw(IRenderer renderer, Vecf position)

draw object implemetation

From IDrawableEx

drawEx
void drawEx(IRenderer renderer, Vecf position, float angle, Vecf center, Vecf size, ubyte alpha, Color!ubyte color)

draw object implemetation

Meta