dplug.graphics.drawex

Additional graphics primitives, and image loading.

Members

Classes

OwnedImage
class OwnedImage(COLOR)

Manually managed image which is also GC-proof.

Functions

aaFillSector
void aaFillSector(V v, float x, float y, float r0, float r1, float a0, float a1, COLOR c)

Rough anti-aliased fillsector

aaSoftCircle
void aaSoftCircle(V v, float x, float y, float r1, float r2, float r3, COLOR color, float globalAlpha)

Draw a circle gradually fading in between r1 and r2 and fading out between r2 and r3

blendWithAlpha
void blendWithAlpha(SRC srcView, DST dstView, ImageRef!L8 alphaView)

Blits a view onto another. The views must have the same size. PERF: optimize that

crop
auto crop(V src, box2i b)

Crop a view from a box2i

cropImageRef
ImageRef!COLOR cropImageRef(ImageRef!COLOR src, box2i rect)

Crop an ImageRef and get an ImageRef instead of a Voldemort type. This also avoid adding offset to coordinates.

horizontalSlope
void horizontalSlope(V v, box2i rect, COLOR c0, COLOR c1)

Fill rectangle while interpolating a color horiontally

loadImageSeparateAlpha
OwnedImage!RGBA loadImageSeparateAlpha(void[] imageDataRGB, void[] imageDataAlpha)

Loads two different images: - the 1st is the RGB channels - the 2nd is interpreted as greyscale and fetch in the alpha channel of the result. The OwnedImage is allocated with mallocEmplace and should be destroyed with destroyFree.

loadOwnedImage
OwnedImage!RGBA loadOwnedImage(void[] imageData)

The one function you probably want to use. Loads an image from a static array. The OwnedImage is allocated with mallocEmplace and should be destroyed with destroyFree.

Meta

Authors

Guillaume Piolat