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(auto ref V v, float x, float y, float r0, float r1, float a0, float a1, COLOR c)

Rough anti-aliased fillsector

aaSoftCircle
void aaSoftCircle(auto ref V v, float x, float y, float r1, float r2, float r3, COLOR color, float globalAlpha = 1.0f)

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

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

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

crop
auto crop(auto ref 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(auto ref V v, box2i rect, COLOR c0, COLOR c1)

Fill rectangle while interpolating a color horiontally

loadImageSeparateAlpha
OwnedImage!RGBA loadImageSeparateAlpha(in void[] imageDataRGB, in 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(in void[] imageData)

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

Meta