Krita Source Code Documentation
Loading...
Searching...
No Matches
KoXyzColorSpaceTraits.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2007 Cyrille Berger <cberger@cberger.net>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#ifndef _KO_XYZ_COLORSPACE_TRAITS_H_
8#define _KO_XYZ_COLORSPACE_TRAITS_H_
9
10
11
16template<typename _channels_type_>
17struct KoXyzTraits : public KoColorSpaceTrait<_channels_type_, 4, 3> {
18
19 typedef _channels_type_ channels_type;
21
22 static const qint32 x_pos = 0;
23 static const qint32 y_pos = 1;
24 static const qint32 z_pos = 2;
25
35
37 inline static channels_type x(quint8* data) {
39 return d[x_pos];
40 }
42 inline static void setX(quint8* data, channels_type nv) {
44 d[x_pos] = nv;
45 }
47 inline static channels_type y(quint8* data) {
49 return d[y_pos];
50 }
52 inline static void setY(quint8* data, channels_type nv) {
54 d[y_pos] = nv;
55 }
57 inline static channels_type z(quint8* data) {
59 return d[z_pos];
60 }
62 inline static void setZ(quint8* data, channels_type nv) {
64 d[z_pos] = nv;
65 }
66};
67
68
69struct KoXyzU8Traits : public KoXyzTraits<quint8> {
70};
71
72struct KoXyzU16Traits : public KoXyzTraits<quint16> {
73};
74
75#include <KoConfig.h>
76#ifdef HAVE_OPENEXR
77#include <half.h>
78
79struct KoXyzF16Traits : public KoXyzTraits<half> {
80};
81
82#endif
83
84struct KoXyzF32Traits : public KoXyzTraits<float> {
85};
86
87struct KoXyzF64Traits : public KoXyzTraits<double> {
88};
89
90#endif
static const channels_type * nativeArray(const quint8 *a)
KoColorSpaceTrait< _channels_type_, 4, 3 > parent
static void setX(quint8 *data, channels_type nv)
Set the x component.
_channels_type_ channels_type
static void setY(quint8 *data, channels_type nv)
Set the y component.
static channels_type y(quint8 *data)
static const qint32 x_pos
static void setZ(quint8 *data, channels_type nv)
Set the z component.
static channels_type z(quint8 *data)
static const qint32 z_pos
static const qint32 y_pos
static channels_type x(quint8 *data)