JPEG I/O

inline ImageBundle<RGB> huira::read_image_jpeg(const fs::path &filepath)

Reads a JPEG file and returns linear RGB data.

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

Parameters:

filepath – Path to the JPEG file to read

Returns:

An ImageBundle<RGB> containing the linear RGB image.

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

Reads a JPEG from an in-memory buffer and returns linear RGB data.

Converts from sRGB to linear light. Grayscale JPEGs are promoted to RGB by TurboJPEG during decompression.

Parameters:
  • data – Pointer to the JPEG data in memory

  • size – Size of the data in bytes

Returns:

An ImageBundle<RGB> containing the linear RGB image.

inline ImageBundle<float> huira::read_image_jpeg_mono(const fs::path &filepath)

Reads a JPEG file and returns linear mono data.

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

Parameters:

filepath – Path to the JPEG file to read

Returns:

An ImageBundle<float> containing the linear mono image.

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

Reads a JPEG from an in-memory buffer and returns linear mono data.

Converts from sRGB to linear light, then averages the RGB channels.

Parameters:
  • data – Pointer to the JPEG data in memory

  • size – Size of the data in bytes

Returns:

An ImageBundle<float> containing the linear mono image.

Warning

doxygenfunction: Unable to resolve function “huira::write_image_jpeg” 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_jpeg(const fs::path &filepath, const ImageBundle<RGB> &output_image, int quality)
- void write_image_jpeg(const fs::path &filepath, const ImageBundle<float> &output_image, int quality)

Warning

doxygenfunction: Unable to resolve function “huira::write_image_jpeg” 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_jpeg(const fs::path &filepath, const ImageBundle<RGB> &output_image, int quality)
- void write_image_jpeg(const fs::path &filepath, const ImageBundle<float> &output_image, int quality)