PNG I/O

inline ImageBundle<RGB> huira::read_image_png(const fs::path &filepath, bool read_alpha)

Reads a PNG file and returns linear RGB + alpha data.

Convenience overload that reads the file into memory and forwards to the buffer-based implementation.

inline ImageBundle<RGB> huira::read_image_png(const unsigned char *data, std::size_t size, bool read_alpha)

Reads a PNG from an in-memory buffer and returns linear RGB + alpha data.

Parameters:
  • data – Pointer to the PNG 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_png_mono(const fs::path &filepath, bool read_alpha)

Reads a PNG file and returns linear mono + alpha data.

Convenience overload that reads the file into memory and forwards to the buffer-based implementation.

inline ImageBundle<float> huira::read_image_png_mono(const unsigned char *data, std::size_t size, bool read_alpha)

Reads a PNG from an in-memory buffer and returns linear mono + alpha data.

Parameters:
  • data – Pointer to the PNG 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.

Warning

doxygenfunction: Unable to resolve function “huira::write_image_png” with arguments (const fs::path&, const Image<RGB>&, int) in doxygen xml output for project “huira” from directory: /home/runner/work/huira/huira/build/doxygen/xml. Potential matches:

- void write_image_png(const fs::path &filepath, const ImageBundle<RGB> &output_image)
- void write_image_png(const fs::path &filepath, const ImageBundle<float> &output_image)

Warning

doxygenfunction: Unable to resolve function “huira::write_image_png” with arguments (const fs::path&, const Image<RGB>&, const Image<float>&, int) in doxygen xml output for project “huira” from directory: /home/runner/work/huira/huira/build/doxygen/xml. Potential matches:

- void write_image_png(const fs::path &filepath, const ImageBundle<RGB> &output_image)
- void write_image_png(const fs::path &filepath, const ImageBundle<float> &output_image)

Warning

doxygenfunction: Unable to resolve function “huira::write_image_png” with arguments (const fs::path&, const Image<float>&, int) in doxygen xml output for project “huira” from directory: /home/runner/work/huira/huira/build/doxygen/xml. Potential matches:

- void write_image_png(const fs::path &filepath, const ImageBundle<RGB> &output_image)
- void write_image_png(const fs::path &filepath, const ImageBundle<float> &output_image)

Warning

doxygenfunction: Unable to resolve function “huira::write_image_png” with arguments (const fs::path&, const Image<float>&, const Image<float>&, int) in doxygen xml output for project “huira” from directory: /home/runner/work/huira/huira/build/doxygen/xml. Potential matches:

- void write_image_png(const fs::path &filepath, const ImageBundle<RGB> &output_image)
- void write_image_png(const fs::path &filepath, const ImageBundle<float> &output_image)