MtmdBitmap

An image or audio bitmap loaded from a file or raw buffer. Construct via MtmdBitmap.fromRGB, MtmdBitmap.fromAudio, or MtmdContext.loadBitmap.

Members

Functions

id
const(char)* id()

Optional KV-cache tracking ID.

setId
void setId(const(char)* s)
Undocumented in source. Be warned that the author may not have intended to support it.

Mixins

__anonymous
mixin Owned!(mtmd_bitmap, mtmd_bitmap_free)
Undocumented in source.

Properties

data
const(ubyte)[] data [@property getter]

Raw pixel/sample bytes (read-only slice into C memory).

isAudio
bool isAudio [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
nx
uint nx [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
ny
uint ny [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

fromAudio
MtmdBitmap fromAudio(const(float)[] samples)

Create from float PCM audio samples (mono, any sample rate).

fromRGB
MtmdBitmap fromRGB(uint nx, uint ny, const(ubyte)[] data)

Create from a raw RGB pixel buffer (RGBRGBRGB…). data.length must equal nx * ny * 3.

Mixed In Members

From mixin Owned!(mtmd_bitmap, mtmd_bitmap_free)

this
this()
Undocumented in source.
this(this)
this(this)
Undocumented in source.
~this
~this()
Undocumented in source.
opCast
bool opCast()

True when the handle holds a non-null pointer.

ptr
T* ptr [@property getter]

Raw C pointer (mutable).

ptr
const(T)* ptr [@property getter]

Raw C pointer (const view).

Meta