|
CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
|
Typedefs | |
| using | ColorSpaceInfo = std::pair<bool, std::string> |
| Result of a color space analysis. | |
Functions | |
| std::string | getColorSpace (const OIIO::ImageBuf &buf) noexcept |
| Extracts the color space name from an OIIO image buffer metadata. | |
| bool | isLinearToken (std::string_view colorspace) noexcept |
| Checks whether an OIIO-detected color space token represents linear data. | |
| ColorSpaceInfo | analyzeColorSpace (const OIIO::ImageSpec &spec) noexcept |
| Analyzes whether an image's pixel data is stored in a linear color space. | |
| std::expected< void, ErrorHandling::CoreError > | transformToColorSpace (OIIO::ImageBuf &image, std::string_view target_cs) |
| Converts an image buffer to a target color space (in-place). | |
| std::unique_ptr< Common::ImageRegion > | convert_RGBA_F32_to_RGBA_U8 (const Common::ImageRegion &input) |
| Converts an RGBA_F32 ImageRegion to a new RGBA_U8 ImageRegion. | |
| using CaptureMoment::Core::Utils::ColorSpaceInfo = std::pair<bool, std::string> |
Result of a color space analysis.
First element: true if the image data uses a linear transfer function. Second element: the detected color space name (CIF token). Empty if OIIO could not determine it.
Definition at line 34 of file color_space_utils.h.
|
nodiscardnoexcept |
Extracts the color space name from an OIIO image buffer metadata.
Definition at line 15 of file color_space_utils.cpp.
Referenced by transformToColorSpace().
|
nodiscardnoexcept |
Checks whether an OIIO-detected color space token represents linear data.
Matches against known CIF (Color Interop Forum) linear tokens:
| colorspace | The color space name from OIIO metadata. |
Definition at line 21 of file color_space_utils.cpp.
Referenced by analyzeColorSpace().
|
nodiscardnoexcept |
Analyzes whether an image's pixel data is stored in a linear color space.
Reads the "oiio:ColorSpace" attribute that OIIO sets automatically during file reading. Does not read the file — uses OIIO's metadata only.
| spec | The OIIO ImageSpec to inspect. |
Definition at line 46 of file color_space_utils.cpp.
References isLinearToken().
|
nodiscard |
Converts an image buffer to a target color space (in-place).
Reads the source color space from the buffer's OIIO metadata ("oiio:ColorSpace") and converts to the specified target.
| image | The image buffer to convert (modified in-place). |
| target_cs | The target color space CIF token (e.g., "lin_rec709_scene"). |
Definition at line 58 of file color_space_utils.cpp.
References CaptureMoment::Core::ErrorHandling::DecodingError, getColorSpace(), and CaptureMoment::Core::ErrorHandling::InvalidWorkingImage.
|
nodiscard |
Converts an RGBA_F32 ImageRegion to a new RGBA_U8 ImageRegion.
| input | The source RGBA_F32 region. |
Definition at line 15 of file image_conversion.cpp.
References CaptureMoment::Core::Common::ImageRegion::channels(), CaptureMoment::Core::Common::ImageRegion::height(), CaptureMoment::Core::Common::ImageRegion::isValid(), CaptureMoment::Core::Common::ImageRegion::m_channels, CaptureMoment::Core::Common::ImageRegion::m_data, CaptureMoment::Core::Common::ImageRegion::m_format, CaptureMoment::Core::Common::ImageRegion::m_height, CaptureMoment::Core::Common::ImageRegion::m_width, CaptureMoment::Core::Common::RGBA_F32, CaptureMoment::Core::Common::ImageRegion::width(), CaptureMoment::Core::Common::ImageRegion::x(), and CaptureMoment::Core::Common::ImageRegion::y().