Panda3D

colorScaleAttrib.I

00001 // Filename: colorScaleAttrib.I
00002 // Created by:  drose (14Mar02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 ////////////////////////////////////////////////////////////////////
00017 //     Function: ColorScaleAttrib::Copy Constructor
00018 //       Access: Protected
00019 //  Description: Use ColorScaleAttrib::make() to construct a new
00020 //               ColorScaleAttrib object.
00021 ////////////////////////////////////////////////////////////////////
00022 INLINE ColorScaleAttrib::
00023 ColorScaleAttrib(const ColorScaleAttrib &copy) :
00024   _off(copy._off),
00025   _has_scale(copy._has_scale),
00026   _has_rgb_scale(copy._has_rgb_scale),
00027   _has_alpha_scale(copy._has_alpha_scale),
00028   _scale(copy._scale)
00029 {
00030 }
00031 
00032 ////////////////////////////////////////////////////////////////////
00033 //     Function: ColorScaleAttrib::is_off
00034 //       Access: Published
00035 //  Description: Returns true if the ColorScaleAttrib will ignore any
00036 //               color scales inherited from above, false otherwise.
00037 //               This is not the same thing as !has_scale(); a
00038 //               ColorScaleAttrib may have the "off" flag set and also
00039 //               have another scale specified.
00040 ////////////////////////////////////////////////////////////////////
00041 INLINE bool ColorScaleAttrib::
00042 is_off() const {
00043   return _off;
00044 }
00045 
00046 ////////////////////////////////////////////////////////////////////
00047 //     Function: ColorScaleAttrib::is_identity
00048 //       Access: Published
00049 //  Description: Returns true if the ColorScaleAttrib is an identity
00050 //               attrib, false if it is either an off attrib or it has
00051 //               a scale.
00052 ////////////////////////////////////////////////////////////////////
00053 INLINE bool ColorScaleAttrib::
00054 is_identity() const {
00055   return !_off && !_has_scale;
00056 }
00057 
00058 ////////////////////////////////////////////////////////////////////
00059 //     Function: ColorScaleAttrib::has_scale
00060 //       Access: Published
00061 //  Description: Returns true if the ColorScaleAttrib has a
00062 //               non-identity scale, false otherwise (in which case it
00063 //               might be an off attrib or an identity attrib).
00064 ////////////////////////////////////////////////////////////////////
00065 INLINE bool ColorScaleAttrib::
00066 has_scale() const {
00067   return _has_scale;
00068 }
00069 
00070 ////////////////////////////////////////////////////////////////////
00071 //     Function: ColorScaleAttrib::has_rgb_scale
00072 //       Access: Published
00073 //  Description: Returns true if the ColorScaleAttrib has a
00074 //               non-identity scale in the RGB components (ignoring
00075 //               alpha), or false otherwise.
00076 ////////////////////////////////////////////////////////////////////
00077 INLINE bool ColorScaleAttrib::
00078 has_rgb_scale() const {
00079   return _has_rgb_scale;
00080 }
00081 
00082 ////////////////////////////////////////////////////////////////////
00083 //     Function: ColorScaleAttrib::has_alpha_scale
00084 //       Access: Published
00085 //  Description: Returns true if the ColorScaleAttrib has a
00086 //               non-identity scale in the alpha component (ignoring
00087 //               RGB), or false otherwise.
00088 ////////////////////////////////////////////////////////////////////
00089 INLINE bool ColorScaleAttrib::
00090 has_alpha_scale() const {
00091   return _has_alpha_scale;
00092 }
00093 
00094 ////////////////////////////////////////////////////////////////////
00095 //     Function: ColorScaleAttrib::get_scale
00096 //       Access: Published
00097 //  Description: Returns the scale to be applied to colors.
00098 ////////////////////////////////////////////////////////////////////
00099 INLINE const LVecBase4 &ColorScaleAttrib::
00100 get_scale() const {
00101   return _scale;
00102 }
 All Classes Functions Variables Enumerations