Welcome to mirror list, hosted at ThFree Co, Russian Federation.

COM_ChannelInfo.h « intern « compositor « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ec78e7e1cb192a926dd9d88c6ed5b50b5ea8371a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*
 * Copyright 2011, Blender Foundation.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * Contributor: 
 *		Jeroen Bakker 
 *		Monique Dewanchand
 */

#ifndef _COM_ChannelInfo_h
#define _COM_ChannelInfo_h

#include <vector>
#include "BKE_text.h"
#include <string>
#include "DNA_node_types.h"
#include "BLI_rect.h"

using namespace std;

/**
 * @brief List of possible channel types
 * @ingroup Model
 */
typedef enum ChannelType {
	COM_CT_ColorComponent /** @brief this channel is contains color information. Specific used is determined by channelnumber, and in the future color space */,
	COM_CT_Alpha /** @brief this channel is contains transparency value */,
	COM_CT_Value /** @brief this channel is contains a value */,
	COM_CT_X /** @brief this channel is contains a X value */,
	COM_CT_Y /** @brief this channel is contains a Y value */,
	COM_CT_Z /** @brief this channel is contains a Z value */,
	COM_CT_W /** @brief this channel is contains a W value */,
	COM_CT_UNUSED /** @brief this channel is unused */
} ChannelType;

/**
 * @brief ChannelInfo holds information about a channel.
 *
 * Channels are transported from node to node via a NodeLink.
 * ChannelInfo holds specific setting of these channels in order that the to-node of the link
 * Can handle specific logic per channel setting.
 *
 * @note currently this is not used, but a future place to implement color spacing and other things.
 * @ingroup Model
 */
class ChannelInfo {
private:
	/**
	 * @brief the channel number, in the link. [0-3]
	 */
	int m_number;

	/**
	 * @brief type of channel
	 */
	ChannelType m_type;

	/**
	 * @brieg Is this value in this channel premultiplied with its alpha
	 * @note only valid if type = ColorComponent;
	 */
	bool m_premultiplied;

//	/**
//	 * Color space of this value.
//	 * only valid when type = ColorComponent;
//	 */
//	string colorspacename;

public:
	/**
	 * @brief creates a new ChannelInfo and set default values
	 */
	ChannelInfo();

	/**
	 * @brief set the index of this channel in the NodeLink
	 */
	void setNumber(const int number) { this->m_number = number; }

	/**
	 * @brief get the index of this channel in the NodeLink
	 */
	const int getNumber() const { return this->m_number; }

	/**
	 * @brief set the type of channel
	 */
	void setType(const ChannelType type) { this->m_type = type; }

	/**
	 * @brief get the type of channel
	 */
	const ChannelType getType() const { return this->m_type; }

	/**
	 * @brief set the premultiplicatioin of this channel
	 */
	void setPremultiplied(const bool premultiplied) { this->m_premultiplied = premultiplied; }

	/**
	 * @brief is this channel premultiplied
	 */
	const bool isPremultiplied() const { return this->m_premultiplied; }
};


#endif