% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/colorspace_descriptors.R
\name{colorspace_descriptors}
\alias{colorspace_descriptors}
\alias{CS_ACESCG}
\alias{CS_SRGB}
\alias{CS_P3D65}
\alias{CS_BT2020}
\alias{CS_ADOBE}
\title{Prebuilt RGB Working/Display Color Spaces}
\usage{
CS_ACESCG

CS_SRGB

CS_P3D65

CS_BT2020

CS_ADOBE
}
\description{
These objects are \strong{color space descriptors} used by \code{rayimage} to tag images
and to convert between RGB spaces. Each descriptor is a named list with:
\itemize{
\item \code{name}: Character. Human-readable name of the space.
\item \code{primaries}: List with \code{r}, \code{g}, \code{b} entries giving xy chromaticities.
\item \code{rgb_to_xyz}: 3x3 numeric matrix (linear RGB -> CIE XYZ, Y=1 white).
\item \code{xyz_to_rgb}: 3x3 numeric matrix (CIE XYZ -> linear RGB).
\item \code{white_xyz}: Length-3 numeric XYZ of the reference white (normalized s.t. Y = 1).
\item \code{white_name}: Character label for the white (e.g., \code{"D60"}, \code{"D65"}).
}

These are used as:
\itemize{
\item \code{attr(img, "colorspace")}: the current working/display space for an image.
\item \code{attr(img, "white_current")}: the current assumed scene/display white (XYZ, Y=1).
}
}
\details{
Prebuilt RGB Working/Display Color Spaces
\itemize{
\item \strong{CS_ACESCG}: ACEScg (AP1 primaries, D60, scene-linear). Recommended working space.
\item \strong{CS_SRGB}: sRGB/Rec.709 (D65). Typical display space; used for PNG/JPEG/TIFF output.
\item \strong{CS_P3D65}: Display P3 (D65). Wide-gamut display space.
\item \strong{CS_BT2020}: BT.2020 (D65). Very wide-gamut; common for HDR mastering.
\item \strong{CS_ADOBE}: Adobe RGB (D65). Photo workflows.
}
}
\examples{
\dontshow{if (interactive() || identical(Sys.getenv("IN_PKGDOWN"), "true")) withAutoprint(\{ # examplesIf}
  # Tag a raw array as sRGB, then convert to ACEScg:
  arr = array(runif(64*64*4), dim = c(64, 64, 4))
  ri  = ray_read_image(arr, assume_colorspace = CS_SRGB, assume_white = CS_SRGB$white_xyz)
  riA = render_convert_colorspace(ri, to_mats = CS_ACESCG)
  plot_image(riA) # display-converted to sRGB automatically

  # Convert an sRGB JPEG to ACEScg on ingest:
  # img = ray_read_image("photo.jpg", normalize = FALSE)
  # img_aces = render_convert_colorspace(img, to_mats = CS_ACESCG)
\dontshow{\}) # examplesIf}
}
\seealso{
\itemize{
\item \code{\link[=render_convert_colorspace]{render_convert_colorspace()}} to convert images between spaces.
\item \code{\link[=render_white_balance]{render_white_balance()}} for Bradford CAT within a working space.
\item \code{\link[=plot_image]{plot_image()}}, \code{\link[=ray_write_image]{ray_write_image()}} for display/output conversion.
}
}
