fltk.images.rgb
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.
License
BSD-3-Clause
Copyright
Copyright © 2025 DDN (D Developer Network) Members
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
FltkRgbImage _rgbHandleThe underlying RGB image handleMethods
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.