Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GNASHCXFORM_H
00020 #define GNASHCXFORM_H
00021
00022 #include "dsodefs.h"
00023
00024 #include <string>
00025 #include <iosfwd>
00026 #include <boost/cstdint.hpp>
00027
00028 namespace gnash {
00029 class rgba;
00030 }
00031
00032 namespace gnash {
00033
00035 class DSOEXPORT SWFCxForm
00036 {
00037 public:
00038
00040 SWFCxForm()
00041 :
00042 ra(256),
00043 ga(256),
00044 ba(256),
00045 aa(256),
00046 rb(0),
00047 gb(0),
00048 bb(0),
00049 ab(0)
00050 {
00051 }
00052
00053 boost::int16_t ra;
00054 boost::int16_t ga;
00055 boost::int16_t ba;
00056 boost::int16_t aa;
00057 boost::int16_t rb;
00058 boost::int16_t gb;
00059 boost::int16_t bb;
00060 boost::int16_t ab;
00061
00063
00067 void concatenate(const SWFCxForm& c);
00068
00070 rgba transform(const rgba& in) const;
00071
00073 void transform(boost::uint8_t& r, boost::uint8_t& g, boost::uint8_t& b,
00074 boost::uint8_t& a) const;
00075
00076 };
00077
00078 inline bool
00079 operator==(const SWFCxForm& a, const SWFCxForm& b)
00080 {
00081 return a.ra == b.ra &&
00082 a.rb == b.rb &&
00083 a.ga == b.ga &&
00084 a.gb == b.gb &&
00085 a.ba == b.ba &&
00086 a.bb == b.bb &&
00087 a.aa == b.aa &&
00088 a.ab == b.ab;
00089 }
00090
00091 inline bool
00092 operator!=(const SWFCxForm& a, const SWFCxForm& b)
00093 {
00094 return !(a == b);
00095 }
00096
00098
00102 inline bool
00103 invisible(const SWFCxForm& cx)
00104 {
00105 return (255 * cx.aa >> 8) + cx.ab == 0;
00106 }
00107
00108 std::ostream& operator<<(std::ostream& os, const SWFCxForm& cx);
00109
00110 }
00111
00112 #endif
00113
00114
00115
00116
00117
00118