fltk.core.images
FLTK Images Library Bindings
This package provides low-level D bindings for the FLTK images library (libfltk_images), which adds support for loading various image formats.
Supported image formats:
- BMP (Windows Bitmap)
- GIF (Graphics Interchange Format)
- JPEG (Joint Photographic Experts Group)
- PNG (Portable Network Graphics)
- PNM/PPM/PGM (Portable Anymap)
- XBM (X BitMap)
- XPM (X PixMap)
Memory Management:
- Images created with
*_new()functions must be destroyed withfltk_image_delete() - Shared images use reference counting via
Fl_Shared_Image
Example:
import fltk.core.images;
void main() {
// Load a PNG image
auto img = fltk_png_image_new("photo.png");
if (img !is null) {
auto w = fltk_image_w(fltk_png_image_as_image(img));
auto h = fltk_image_h(fltk_png_image_as_image(img));
writefln("Image size: %dx%d", w, h);
fltk_png_image_delete(img);
}
}
License
Copyright
Types 27
Opaque handle for Fl_Image base class.
This is the base type for all image handles.
private void * ptrAlias for image handle
Opaque handle for Fl_RGB_Image.
RGB images store pixel data in RGB or RGBA format.
private void * ptrAlias for RGB image handle
Opaque handle for Fl_Bitmap.
Bitmaps are monochrome (1-bit) images.
private void * ptrAlias for bitmap handle
Opaque handle for Fl_Pixmap.
Pixmaps store images in XPM format.
private void * ptrAlias for pixmap handle
Opaque handle for Fl_Shared_Image.
Shared images are reference-counted and cached.
private void * ptrAlias for shared image handle
Opaque handle for Fl_BMP_Image.
private void * ptrAlias for BMP image handle
Opaque handle for Fl_GIF_Image.
private void * ptrAlias for GIF image handle
Opaque handle for Fl_JPEG_Image.
private void * ptrAlias for JPEG image handle
Opaque handle for Fl_PNG_Image.
private void * ptrAlias for PNG image handle
Opaque handle for Fl_PNM_Image.
private void * ptrAlias for PNM image handle
Opaque handle for Fl_XBM_Image.
private void * ptrAlias for XBM image handle
Opaque handle for Fl_XPM_Image.
private void * ptrAlias for XPM image handle
Opaque handle for Fl_Tiled_Image.
private void * ptrAlias for tiled image handle
Image loading error codes.
These values indicate the result of image loading operations.
Functions 63
bool isValid(FltkPngImage image) @safe nothrow @nogcChecks if a PNG image handle is valid (non-null).bool isValid(FltkJpegImage image) @safe nothrow @nogcChecks if a JPEG image handle is valid (non-null).bool isValid(FltkBmpImage image) @safe nothrow @nogcChecks if a BMP image handle is valid (non-null).bool isValid(FltkGifImage image) @safe nothrow @nogcChecks if a GIF image handle is valid (non-null).bool isValid(FltkSharedImage image) @safe nothrow @nogcChecks if a shared image handle is valid (non-null).FltkImage fltk_image_copy(FltkImage image, int w, int h)Creates a copy of the image, optionally scaled.void fltk_image_color_average(FltkImage image, uint color, float blend)Applies a color average to the image.FltkRgbImage fltk_rgb_image_new(const(ubyte) * data, int w, int h, int d, int ld)Creates a new RGB image from pixel data.FltkPngImage fltk_png_image_new_data(const(ubyte) * data, int len)Creates a new PNG image from memory data.FltkJpegImage fltk_jpeg_image_new_data(const(ubyte) * data, int len)Creates a new JPEG image from memory data.FltkTiledImage fltk_tiled_image_new(FltkImage image, int w, int h)Creates a new tiled image from a source image.FltkSharedImage fltk_shared_image_get(const(char) * filename)Gets a shared image from file (loads if not cached).