Blender V4.3
BLI_color.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include "BLI_color.hh"
6
7#include <ostream>
8
9namespace blender {
10
11std::ostream &operator<<(std::ostream &stream, const eAlpha &space)
12{
13 switch (space) {
14 case eAlpha::Straight: {
15 stream << "Straight";
16 break;
17 }
19 stream << "Premultiplied";
20 break;
21 }
22 }
23 return stream;
24}
25
26std::ostream &operator<<(std::ostream &stream, const eSpace &space)
27{
28 switch (space) {
29 case eSpace::Theme: {
30 stream << "Theme";
31 break;
32 }
34 stream << "SceneLinear";
35 break;
36 }
38 stream << "SceneLinearByteEncoded";
39 break;
40 }
41 }
42 return stream;
43}
44
45template<typename ChannelStorageType, eSpace Space, eAlpha Alpha>
46std::ostream &operator<<(std::ostream &stream,
48{
49 stream << Space << Alpha << "(" << c.r << ", " << c.g << ", " << c.b << ", " << c.a << ")";
50 return stream;
51}
52
53template std::ostream &operator<<(
55template std::ostream &operator<<(
56 std::ostream &stream, const ColorRGBA<float, eSpace::SceneLinear, eAlpha::Straight> &c);
57template std::ostream &operator<<(
58 std::ostream &stream,
60template std::ostream &operator<<(
61 std::ostream &stream,
63
64} // namespace blender
ChannelStorageType r
Definition BLI_color.hh:88
ChannelStorageType g
Definition BLI_color.hh:88
ChannelStorageType b
Definition BLI_color.hh:88
ChannelStorageType a
Definition BLI_color.hh:88
std::ostream & operator<<(std::ostream &stream, const eAlpha &space)
Definition BLI_color.cc:11