ddn.data.hdf5.image
HDF5 Image Wrapper (High-Level API)
This module provides a D wrapper for HDF5 image operations using the High-Level Image API (H5IM).
License
BSD-3-Clause
enum InterlaceMode
Types 3
structImageInfo
Information about an HDF5 image.
Fields
hsize_t widthWidth of the image in pixelshsize_t heightHeight of the image in pixelshsize_t planesNumber of color planes (1 for grayscale, 3 for RGB)string interlaceInterlace mode stringhssize_t numPalettesNumber of palettes associated with the imageenumInterlaceMode : string
Interlace mode for 24-bit images.
pixel = "INTERLACE_PIXEL"Pixel interlacing (RGBRGBRGB...)
plane = "INTERLACE_PLANE"Plane interlacing (RRR...GGG...BBB...)
structImage
High-level wrapper for HDF5 image operations.
This struct provides convenient methods for creating and manipulating HDF5 images using the High-Level API.
Example:
// Create an 8-bit grayscale image
ubyte[] pixels = new ubyte[width * height];
Image.make8bit(file.handle(), "grayscale", width, height, pixels);
// Create a 24-bit color image
ubyte[] rgb = new ubyte[width * height * 3];
Image.make24bit(file.handle(), "color", width, height, InterlaceMode.pixel, rgb);Methods
void make8bit(hid_t locId, string imageName, hsize_t width, hsize_t height,
const ubyte[] data)Creates an 8-bit grayscale image.void make24bit(hid_t locId, string imageName, hsize_t width, hsize_t height,
InterlaceMode interlace, const ubyte[] data)Creates a 24-bit color image.void read(hid_t locId, string imageName, ubyte[] data)Reads image data.bool isImage(hid_t locId, string imageName)Checks if a dataset is an HDF5 image.void makePalette(hid_t locId, string paletteName, const hsize_t[] paletteDims,
const ubyte[] data)Creates a palette.void linkPalette(hid_t locId, string imageName, string paletteName)Links a palette to an image.void unlinkPalette(hid_t locId, string imageName, string paletteName)Unlinks a palette from an image.hssize_t getNumPalettes(hid_t locId, string imageName)Gets the number of palettes associated with an image.void getPaletteInfo(hid_t locId, string imageName, int paletteIndex,
hsize_t[] paletteDims)Gets palette information.void getPalette(hid_t locId, string imageName, int paletteIndex, ubyte[] data)Reads a palette.bool isPalette(hid_t locId, string paletteName)Checks if a dataset is an HDF5 palette.