15 #ifndef COLORBLENDATTRIB_H
16 #define COLORBLENDATTRIB_H
18 #include "pandabase.h"
20 #include "renderAttrib.h"
45 O_one_minus_incoming_color,
47 O_one_minus_fbuffer_color,
49 O_one_minus_incoming_alpha,
51 O_one_minus_fbuffer_alpha,
53 O_one_minus_constant_color,
55 O_one_minus_constant_alpha,
56 O_incoming_color_saturate,
65 O_one_minus_color_scale,
67 O_one_minus_alpha_scale,
72 INLINE ColorBlendAttrib(Mode mode, Operand a, Operand b,
78 static CPT(
RenderAttrib) make(Mode mode, Operand a, Operand b,
82 INLINE Mode get_mode()
const;
83 INLINE Operand get_operand_a()
const;
84 INLINE Operand get_operand_b()
const;
85 INLINE
LColor get_color()
const;
87 INLINE
bool involves_constant_color()
const;
88 INLINE
bool involves_color_scale()
const;
90 INLINE
static bool involves_constant_color(Operand operand);
91 INLINE
static bool involves_color_scale(Operand operand);
94 virtual void output(ostream &out)
const;
97 virtual int compare_to_impl(
const RenderAttrib *other)
const;
98 virtual size_t get_hash_impl()
const;
105 bool _involves_constant_color;
106 bool _involves_color_scale;
109 static int get_class_slot() {
112 virtual int get_slot()
const {
113 return get_class_slot();
117 static void register_with_read_factory();
128 static void init_type() {
129 RenderAttrib::init_type();
130 register_type(_type_handle,
"ColorBlendAttrib",
131 RenderAttrib::get_class_type());
132 _attrib_slot =
register_slot(_type_handle, 100, make_default);
135 return get_class_type();
137 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
141 static int _attrib_slot;
144 ostream &operator << (ostream &out, ColorBlendAttrib::Mode mode);
145 ostream &operator << (ostream &out, ColorBlendAttrib::Operand operand);
147 #include "colorBlendAttrib.I"
static int register_slot(TypeHandle type_handle, int sort, RenderAttribRegistry::MakeDefaultFunc *make_default_func)
Adds the indicated TypeHandle to the registry, if it is not there already, and returns a unique slot ...
This is the base class for a number of render attributes (other than transform) that may be set on sc...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Base class for objects that can be written to and read from Bam files.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
This is the base class for all three-component vectors and points.
This specifies how colors are blended into the frame buffer, for special effects. ...
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
static const LVecBase4f & zero()
Returns a zero-length vector.