CGColorSpace 文档译文

A profile that specifies how to interpret a color value for display.(说明色值该如何显示的抽象描述)

Overview

A color space is multi-dimensional, and each dimension represents a specific color component. For example, the colors in an RGB color space have three dimensions or components—red, green, and blue. The intensity of each component is represented by floating point values—their range and meaning depends on the color space in question.
Different types of devices (scanners, monitors, printers) operate within different color spaces (RGB, CMYK, grayscale). Additionally, two devices of the same type (for example, color displays from different manufacturers) may operate within the same kind of color space, yet still produce a different range of colors, or gamut. Color spaces that are correctly specified ensure that an image has a consistent appearance regardless of the output device.

颜色空间是多维度的,每个维度表示特定的颜色分量。RGB颜色空间拥有3个维度也可以说是3个颜色分量——分别是红,绿,蓝。每个颜色分量强度通过浮点类型来表示,范围和含义取决所讨论的颜色空间。
不同的设备(扫描仪,监控,打印机)使用不同类别的颜色空间(RGB,CMYK,灰度)。此外,相同的两设备在相同的颜色空间操作,可能会产生不同的色域。指定正确的颜色空间可以使无论输出设备如何都可以保证图像在不同设备上的一致性显示。

CoreGraphics supports several kinds of color spaces:(CoreGraphics支持多种颜色空间)

  • Calibrated color spaces ensure that colors appear the same when displayed on different devices. The visual appearance of the color is preserved, as far as the capabilities of the device allow.

为了使不同设备上颜色显示没有偏差,我们需要指定正确的颜色空间。若设备能力允许,就能保证颜色在视觉上不会出现偏差。

  • Device-dependent color spaces are tied to the system of color representation of a particular device. Device color spaces are not recommended when high-fidelity color preservation is important.

依赖于设备的颜色空间是和在指定设备的颜色表现系统相关联。当需要高保真呈现时,不推荐使用设备相关的颜色空间

  • Special color spaces—indexed and pattern. An indexed color space contains a color table with up to 256 entries and a base color space to which the color table entries are mapped. Each entry in the color table specifies one color in the base color space. A pattern color space is used when stroking or filling with a pattern.

特殊的颜色空间-索引和图案。索引的颜色空间包含至多256个条目和颜色表条目映射到的基础颜色空间。每一个条目代表着颜色表中在基础颜色空间中特指的一个颜色。图案颜色空间在图案被填充或描边时使用。

Creating Device-Independent Color Spaces 设备无关,意味着在不同的设备(颜色空间)上,显示的效果保持一致

CGColorSpaceCreateCalibratedGray
 Creates a calibrated grayscale color space.

创建用于对灰度色值进行校准的颜色空间

CGColorSpaceCreateRGB
 Creates a calibrated RGB color space.

创建用于对RGB色值进行校准的颜色空间

CGColorSpaceCreateICCBased
 创建与设备无关的颜色空间,该颜色空间根据ICC颜色配置文件规范定义。(有谁知道ICC 是什么东西吗)

未完待续,先去看基础概念了。。。

猜你喜欢

转载自blog.csdn.net/weixin_34067102/article/details/86845012