fltk.image
FLTK Image Base Class
This module provides the base Image class that wraps FLTK's Fl_Image. All other image types inherit from this class.
The Image class provides:
- RAII-based resource management
- Property-based access to dimensions (width, height, depth)
- Image manipulation methods (copy, colorAverage, inactive, desaturate)
- Pixel data access
License
BSD-3-ClauseCopyright
Copyright © 2025 DDN (D Developer Network) Members
class Image
Types 1
classImage
Base class for all FLTK images.
This class wraps a low-level FltkImage handle and provides idiomatic D access to image properties and methods. It manages the lifetime of the underlying image handle using RAII.
Example:
// Usually you work with derived classes like PngImage or JpegImage
auto png = new PngImage("photo.png");
writefln("Size: %dx%d", png.width, png.height);
auto scaled = png.copy(100, 100); // Create scaled copyFields
FltkImage _handleThe underlying low-level image handlebool _ownsHandleWhether this instance owns the handle and should delete itMethods
void colorAverage(uint color, float blend) nothrow @nogcApplies a color average to the image in place.Constructors
Destructors
~thisDestroys the image and releases resources.