BMP I/O

inline std::pair<Image<RGB>, Image<float>> 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:

A pair containing the linear RGB image and an optional alpha image.

inline std::pair<Image<RGB>, Image<float>> 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:

A pair containing the linear RGB image and an optional alpha image.

inline std::pair<Image<float>, Image<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:

A pair containing the linear mono image and an optional alpha image.

inline std::pair<Image<float>, Image<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:

A pair containing the linear mono image and an optional alpha image.