blend2d/image

Procs

proc destroyImage(img: Image) {....raises: [], tags: [], forbids: [].}
proc exportAs(img: Image; path: string) {....raises: [], tags: [], forbids: [].}
Exports an Image to given path. The codec is initialized from path extension
proc getAspectRatio(width, height, minWidth, minHeight: int): (int, int) {.
    ...raises: [], tags: [], forbids: [].}
proc getData(img: Image): ImageData {....raises: [], tags: [], forbids: [].}
Returns a BLImageData from img
proc getHeight(img: Image): int32 {....raises: [], tags: [], forbids: [].}
Retrieve the height of an Image
proc getWidth(img: Image): int32 {....raises: [], tags: [], forbids: [].}
Retrieve the width of an Image
proc height(img: Image): int32 {.inline, ...raises: [], tags: [], forbids: [].}
An alias of getHeight
proc init(width, height: int; pixelFormat: BLFormat = BL_FORMAT_PRGB32): Image {.
    ...raises: [], tags: [], forbids: [].}
Create a new Image
proc open(path: string): Image {....raises: [], tags: [], forbids: [].}
proc resize(img: Image; width, height: int32;
            scaleFilter: BLImageScaleFilter = BLImageScaleFilterNearest): Image {.
    discardable, ...raises: [], tags: [], forbids: [].}
Resize an image by maintaining the aspect ratio and returns a new Image
proc resize(img: var Image; width, height: int32;
            scaleFilter: BLImageScaleFilter = BLImageScaleFilterNearest) {.
    ...raises: [], tags: [], forbids: [].}
Resize a mutable image, keeping the aspect ratio
proc width(img: Image): int32 {.inline, ...raises: [], tags: [], forbids: [].}
An alias of getWidth

Macros

macro group(imgIdent: untyped; width, height, contextStmt: untyped): untyped

A macro utility that help organize your 2D computations in grouped-like layers.

This macro calls the ctx macro utility, which expose the current Context as this identifier.