CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
color_space_utils.h
Go to the documentation of this file.
1
16#pragma once
17
18#include <OpenImageIO/imagebuf.h>
20
21#include <expected>
22#include <string>
23#include <utility>
24
26
34using ColorSpaceInfo = std::pair<bool, std::string>;
35
48[[nodiscard]] bool isLinearToken(std::string_view colorspace) noexcept;
49
62[[nodiscard]] ColorSpaceInfo analyzeColorSpace(const OIIO::ImageSpec& spec) noexcept;
63
74[[nodiscard]] std::expected<void, ErrorHandling::CoreError>
75transformToColorSpace(OIIO::ImageBuf& image, std::string_view target_cs);
76
81[[nodiscard]] std::string getColorSpace(const OIIO::ImageBuf& buf) noexcept;
82
83} // namespace CaptureMoment::Core::Utils
Central error handling system for CaptureMoment Core library.
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::pair< bool, std::string > ColorSpaceInfo
Result of a color space analysis.
std::string getColorSpace(const OIIO::ImageBuf &buf) noexcept
Extracts the color space name from an OIIO image buffer metadata.
CaptureMoment — footer