fltk.rgb_image

FLTK RGB Image Class

This module provides the RgbImage class that wraps FLTK's Fl_RGB_Image. RgbImage allows creating images from raw pixel data.

Authors

Dejan Lekić

License

BSD-3-Clause
class RgbImage

Types 1

RGB image created from raw pixel data.

RgbImage stores image data in RGB or RGBA format. The pixel data is copied when the image is created, so the original buffer can be freed after construction.

Example:

// Create a 2x2 red image (RGB)
ubyte[] pixels = [
   255, 0, 0,  255, 0, 0,  // Row 1: red, red
   255, 0, 0,  255, 0, 0   // Row 2: red, red
];
auto img = new RgbImage(pixels, 2, 2, 3);
assert(img.width == 2);
assert(img.height == 2);
assert(img.depth == 3);

Fields
FltkImage _rgbHandleThe underlying RGB image handle
Methods
FltkImage rgbHandle() @safe nothrow @nogcReturns the underlying RGB image handle.
bool isValid() const @safe nothrow @nogcChecks if this RGB image is valid.
const(ubyte)[] pixels() const nothrow @nogcGets the pixel data as a D slice.
Constructors
this(const(ubyte)[] data, int width, int height, int depth = 3, int lineSize = 0)Creates a new RGB image from pixel data.
Destructors
~thisDestroys the RGB image and releases resources.