TIFF I/O¶
Reading¶
-
inline ImageBundle<RGB> huira::read_image_tiff_rgb(const fs::path &filepath, bool read_alpha)¶
Reads a TIFF file and returns linear RGB + optional alpha data.
Convenience overload that reads the file into memory and forwards to the buffer-based implementation.
-
inline ImageBundle<RGB> huira::read_image_tiff_rgb(const unsigned char *data, std::size_t size, bool read_alpha)¶
Reads a TIFF from an in-memory buffer and returns linear RGB + optional alpha data.
Interprets the TIFF data as RGB color:
1-channel: promoted to RGB (equal values in all channels)
3-channel: interpreted as RGB directly
4-channel with alpha: RGB + separate alpha
Other channel counts: throws an error
- Parameters:
data – Pointer to the TIFF data in memory
size – Size of the data in bytes
read_alpha – If false, alpha channel is not extracted even if present
- Returns:
An ImageBundle<RGB> containing the linear RGB image and an optional alpha image.
-
inline ImageBundle<float> huira::read_image_tiff_mono(const fs::path &filepath, bool read_alpha)¶
Reads a TIFF file and returns linear mono + optional alpha data.
Convenience overload that reads the file into memory and forwards to the buffer-based implementation.
-
inline ImageBundle<float> huira::read_image_tiff_mono(const unsigned char *data, std::size_t size, bool read_alpha)¶
Reads a TIFF from an in-memory buffer and returns linear mono + optional alpha data.
Interprets the TIFF data as single-channel:
1-channel: returned directly
3-channel: averaged to mono
Other channel counts (excluding alpha): throws an error
- Parameters:
data – Pointer to the TIFF data in memory
size – Size of the data in bytes
read_alpha – If false, alpha channel is not extracted even if present
- Returns:
An ImageBundle<float> containing the linear mono image and an optional alpha image.
Writing¶
Warning
doxygenfunction: Unable to resolve function “huira::write_image_tiff” with arguments (const fs::path&, const Image<RGB>&, int, const std::string&, const std::string&) in doxygen xml output for project “huira” from directory: /home/runner/work/huira/huira/build/doxygen/xml. Potential matches:
- template<IsSpectral TSpectral> void write_image_tiff(const fs::path &filepath, const ImageBundle<TSpectral> &bundle, const std::string &description, const std::string &artist)
- void write_image_tiff(const fs::path &filepath, const ImageBundle<RGB> &bundle, const std::string &description, const std::string &artist)
- void write_image_tiff(const fs::path &filepath, const ImageBundle<float> &bundle, const std::string &description, const std::string &artist)
Warning
doxygenfunction: Unable to resolve function “huira::write_image_tiff” with arguments (const fs::path&, const Image<float>&, int, const std::string&, const std::string&) in doxygen xml output for project “huira” from directory: /home/runner/work/huira/huira/build/doxygen/xml. Potential matches:
- template<IsSpectral TSpectral> void write_image_tiff(const fs::path &filepath, const ImageBundle<TSpectral> &bundle, const std::string &description, const std::string &artist)
- void write_image_tiff(const fs::path &filepath, const ImageBundle<RGB> &bundle, const std::string &description, const std::string &artist)
- void write_image_tiff(const fs::path &filepath, const ImageBundle<float> &bundle, const std::string &description, const std::string &artist)
Warning
doxygenfunction: Unable to resolve function “huira::write_image_tiff” with arguments (const fs::path&, const Image<TSpectral>&, int, const std::string&, const std::string&) in doxygen xml output for project “huira” from directory: /home/runner/work/huira/huira/build/doxygen/xml. Potential matches:
- template<IsSpectral TSpectral> void write_image_tiff(const fs::path &filepath, const ImageBundle<TSpectral> &bundle, const std::string &description, const std::string &artist)
- void write_image_tiff(const fs::path &filepath, const ImageBundle<RGB> &bundle, const std::string &description, const std::string &artist)
- void write_image_tiff(const fs::path &filepath, const ImageBundle<float> &bundle, const std::string &description, const std::string &artist)