CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
color_space_utils.h File Reference

Utilities for analyzing and converting image color spaces. More...

#include <OpenImageIO/imagebuf.h>
#include "common/error_handling/core_error.h"
#include <expected>
#include <string>
#include <utility>
+ Include dependency graph for color_space_utils.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  CaptureMoment
 
namespace  CaptureMoment::Core
 Manages the lifecycle of a single IWorkingImage instance.
 
namespace  CaptureMoment::Core::Utils
 

Typedefs

using CaptureMoment::Core::Utils::ColorSpaceInfo = std::pair<bool, std::string>
 Result of a color space analysis.
 

Functions

bool CaptureMoment::Core::Utils::isLinearToken (std::string_view colorspace) noexcept
 Checks whether an OIIO-detected color space token represents linear data.
 
ColorSpaceInfo CaptureMoment::Core::Utils::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 > CaptureMoment::Core::Utils::transformToColorSpace (OIIO::ImageBuf &image, std::string_view target_cs)
 Converts an image buffer to a target color space (in-place).
 
std::string CaptureMoment::Core::Utils::getColorSpace (const OIIO::ImageBuf &buf) noexcept
 Extracts the color space name from an OIIO image buffer metadata.
 

Detailed Description

Utilities for analyzing and converting image color spaces.

Author
CaptureMoment Team
Date
2026

Provides functions to:

  • Detect if an image's pixel data is linear via OIIO metadata.
  • Convert an image to a target color space via OIIO colorconvert.

OIIO automatically detects and stores the color space in the "oiio:ColorSpace" ImageSpec attribute when reading a file. These utilities read that metadata — no manual file inspection needed.

Definition in file color_space_utils.h.

CaptureMoment — footer