14 #ifndef COLORBLENDATTRIB_H 15 #define COLORBLENDATTRIB_H 42 O_one_minus_incoming_color,
44 O_one_minus_fbuffer_color,
46 O_one_minus_incoming_alpha,
48 O_one_minus_fbuffer_alpha,
50 O_one_minus_constant_color,
52 O_one_minus_constant_alpha,
53 O_incoming_color_saturate,
58 O_one_minus_incoming1_color,
60 O_one_minus_incoming1_alpha,
70 O_one_minus_color_scale,
72 O_one_minus_alpha_scale,
78 Mode alpha_mode, Operand alpha_a, Operand alpha_b,
84 static CPT(
RenderAttrib) make(Mode mode, Operand a, Operand b,
85 const LColor &color = LColor::zero());
86 static CPT(
RenderAttrib) make(Mode rgb_mode, Operand rgb_a, Operand rgb_b,
87 Mode alpha_mode, Operand alpha_a, Operand alpha_b,
88 const LColor &color = LColor::zero());
91 INLINE Mode get_mode()
const;
92 INLINE Operand get_operand_a()
const;
93 INLINE Operand get_operand_b()
const;
95 INLINE Mode get_alpha_mode()
const;
96 INLINE Operand get_alpha_operand_a()
const;
97 INLINE Operand get_alpha_operand_b()
const;
99 INLINE LColor get_color()
const;
101 INLINE
bool involves_constant_color()
const;
102 INLINE
bool involves_color_scale()
const;
104 INLINE
static bool involves_constant_color(Operand operand);
105 INLINE
static bool involves_color_scale(Operand operand);
108 MAKE_PROPERTY(rgb_mode, get_mode);
109 MAKE_PROPERTY(rgb_operand_a, get_operand_a);
110 MAKE_PROPERTY(rgb_operand_b, get_operand_b);
112 MAKE_PROPERTY(alpha_mode, get_alpha_mode);
113 MAKE_PROPERTY(alpha_operand_a, get_alpha_operand_a);
114 MAKE_PROPERTY(alpha_operand_b, get_alpha_operand_b);
116 MAKE_PROPERTY(color, get_color);
119 virtual void output(std::ostream &out)
const;
122 virtual int compare_to_impl(
const RenderAttrib *other)
const;
123 virtual size_t get_hash_impl()
const;
129 Operand _alpha_a, _alpha_b;
131 bool _involves_constant_color;
132 bool _involves_color_scale;
135 static int get_class_slot() {
138 virtual int get_slot()
const {
139 return get_class_slot();
141 MAKE_PROPERTY(class_slot, get_class_slot);
144 static void register_with_read_factory();
155 static void init_type() {
156 RenderAttrib::init_type();
158 RenderAttrib::get_class_type());
162 return get_class_type();
164 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
168 static int _attrib_slot;
171 EXPCL_PANDA_PGRAPH std::ostream &operator << (std::ostream &out, ColorBlendAttrib::Mode mode);
172 EXPCL_PANDA_PGRAPH std::ostream &operator << (std::ostream &out, ColorBlendAttrib::Operand operand);
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...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Base class for objects that can be written to and read from Bam files.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
static int register_slot(TypeHandle type_handle, int sort, RenderAttrib *default_attrib)
Adds the indicated TypeHandle to the registry, if it is not there already, and returns a unique slot ...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
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 ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.