2
---------------------------------------------------------------------------
3
Open Asset Import Library (ASSIMP)
4
---------------------------------------------------------------------------
6
Copyright (c) 2006-2010, ASSIMP Development Team
10
Redistribution and use of this software in source and binary forms,
11
with or without modification, are permitted provided that the following
14
* Redistributions of source code must retain the above
15
copyright notice, this list of conditions and the
18
* Redistributions in binary form must reproduce the above
19
copyright notice, this list of conditions and the
20
following disclaimer in the documentation and/or other
21
materials provided with the distribution.
23
* Neither the name of the ASSIMP team, nor the names of its
24
contributors may be used to endorse or promote products
25
derived from this software without specific prior
26
written permission of the ASSIMP Development Team.
28
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
---------------------------------------------------------------------------
42
* @brief RGBA color structure, including operators when compiling in C++
44
#ifndef AI_COLOR4D_H_INC
45
#define AI_COLOR4D_H_INC
51
#include "./Compiler/pushpack1.h"
52
// ----------------------------------------------------------------------------------
53
/** Represents a color in Red-Green-Blue space including an
54
* alpha component. Color values range from 0 to 1. */
55
// ----------------------------------------------------------------------------------
59
aiColor4D () : r(0.0f), g(0.0f), b(0.0f), a(0.0f) {}
60
aiColor4D (float _r, float _g, float _b, float _a)
61
: r(_r), g(_g), b(_b), a(_a) {}
62
aiColor4D (float _r) : r(_r), g(_r), b(_r), a(_r) {}
63
aiColor4D (const aiColor4D& o)
64
: r(o.r), g(o.g), b(o.b), a(o.a) {}
67
const aiColor4D& operator += (const aiColor4D& o);
68
const aiColor4D& operator -= (const aiColor4D& o);
69
const aiColor4D& operator *= (float f);
70
const aiColor4D& operator /= (float f);
73
bool operator == (const aiColor4D& other) const;
74
bool operator != (const aiColor4D& other) const;
76
// color tuple access, rgba order
77
inline float operator[](unsigned int i) const;
78
inline float& operator[](unsigned int i);
80
/** check whether a color is (close to) black */
81
inline bool IsBlack() const;
83
#endif // !__cplusplus
85
// Red, green, blue and alpha color values
87
} PACK_STRUCT; // !struct aiColor4D
89
#include "./Compiler/poppack1.h"
94
#endif // AI_VECTOR3D_H_INC