Panda3D
Loading...
Searching...
No Matches
colorScaleAttrib.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file colorScaleAttrib.I
10 * @author drose
11 * @date 2002-03-14
12 */
13
14/**
15 * Use ColorScaleAttrib::make() to construct a new ColorScaleAttrib object.
16 */
17INLINE ColorScaleAttrib::
18ColorScaleAttrib(const ColorScaleAttrib &copy) :
19 _off(copy._off),
20 _has_scale(copy._has_scale),
21 _has_rgb_scale(copy._has_rgb_scale),
22 _has_alpha_scale(copy._has_alpha_scale),
23 _scale(copy._scale)
24{
25}
26
27/**
28 * Returns true if the ColorScaleAttrib will ignore any color scales inherited
29 * from above, false otherwise. This is not the same thing as !has_scale(); a
30 * ColorScaleAttrib may have the "off" flag set and also have another scale
31 * specified.
32 */
34is_off() const {
35 return _off;
36}
37
38/**
39 * Returns true if the ColorScaleAttrib is an identity attrib, false if it is
40 * either an off attrib or it has a scale.
41 */
43is_identity() const {
44 return !_off && !_has_scale;
45}
46
47/**
48 * Returns true if the ColorScaleAttrib has a non-identity scale, false
49 * otherwise (in which case it might be an off attrib or an identity attrib).
50 */
51INLINE bool ColorScaleAttrib::
52has_scale() const {
53 return _has_scale;
54}
55
56/**
57 * Returns true if the ColorScaleAttrib has a non-identity scale in the RGB
58 * components (ignoring alpha), or false otherwise.
59 */
61has_rgb_scale() const {
62 return _has_rgb_scale;
63}
64
65/**
66 * Returns true if the ColorScaleAttrib has a non-identity scale in the alpha
67 * component (ignoring RGB), or false otherwise.
68 */
70has_alpha_scale() const {
71 return _has_alpha_scale;
72}
73
74/**
75 * Returns the scale to be applied to colors.
76 */
77INLINE const LVecBase4 &ColorScaleAttrib::
78get_scale() const {
79 return _scale;
80}
Applies a scale to colors in the scene graph and on vertices.
bool has_alpha_scale() const
Returns true if the ColorScaleAttrib has a non-identity scale in the alpha component (ignoring RGB),...
has_scale
Returns true if the ColorScaleAttrib has a non-identity scale, false otherwise (in which case it migh...
bool has_rgb_scale() const
Returns true if the ColorScaleAttrib has a non-identity scale in the RGB components (ignoring alpha),...
get_scale
Returns the scale to be applied to colors.
bool is_identity() const
Returns true if the ColorScaleAttrib is an identity attrib, false if it is either an off attrib or it...
bool is_off() const
Returns true if the ColorScaleAttrib will ignore any color scales inherited from above,...