BMP I/O¶
-
inline ImageBundle<RGB> huira::read_image_bmp(const fs::path &filepath, bool read_alpha)¶
Reads a BMP file and returns linear RGB + alpha data.
Convenience overload that reads the file into memory and forwards to the buffer-based implementation.
- Parameters:
filepath – Path to the BMP file to read
read_alpha – Whether to load the alpha channel if present (default: true)
- Returns:
An ImageBundle<RGB> containing the linear RGB image and an optional alpha image.
-
inline ImageBundle<RGB> huira::read_image_bmp(const unsigned char *data, std::size_t size, bool read_alpha)¶
Reads a BMP from an in-memory buffer and returns linear RGB + alpha data.
- Parameters:
data – Pointer to the BMP data in memory
size – Size of the data in bytes
read_alpha – Whether to load the alpha channel if present (default: true)
- Returns:
An ImageBundle<RGB> containing the linear RGB image and an optional alpha image.
-
inline ImageBundle<float> huira::read_image_bmp_mono(const fs::path &filepath, bool read_alpha)¶
Reads a BMP file and returns linear mono + alpha data.
Convenience overload that reads the file into memory and forwards to the buffer-based implementation.
- Parameters:
filepath – Path to the BMP file to read
read_alpha – Whether to load the alpha channel if present (default: true)
- Returns:
An ImageBundle<float> containing the linear mono image and an optional alpha image.
-
inline ImageBundle<float> huira::read_image_bmp_mono(const unsigned char *data, std::size_t size, bool read_alpha)¶
Reads a BMP from an in-memory buffer and returns linear mono + alpha data.
RGB channels are averaged after linearization to produce mono output.
- Parameters:
data – Pointer to the BMP data in memory
size – Size of the data in bytes
read_alpha – Whether to load the alpha channel if present (default: true)
- Returns:
An ImageBundle<float> containing the linear mono image and an optional alpha image.