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 #ifndef GNASHCXFORM_H
00019 #define GNASHCXFORM_H
00020
00021 #include "dsodefs.h"
00022
00023 #include <string>
00024 #include <iosfwd>
00025 #include <boost/cstdint.hpp>
00026
00027 namespace gnash {
00028 class rgba;
00029 class SWFStream;
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
00077 void read_rgb(SWFStream& in);
00078
00080 void read_rgba(SWFStream& in);
00081
00082 };
00083
00084 inline bool
00085 operator==(const SWFCxForm& a, const SWFCxForm& b)
00086 {
00087 return a.ra == b.ra &&
00088 a.rb == b.rb &&
00089 a.ga == b.ga &&
00090 a.gb == b.gb &&
00091 a.ba == b.ba &&
00092 a.bb == b.bb &&
00093 a.aa == b.aa &&
00094 a.ab == b.ab;
00095 }
00096
00097 inline bool
00098 operator!=(const SWFCxForm& a, const SWFCxForm& b)
00099 {
00100 return !(a == b);
00101 }
00102
00104
00108 inline bool
00109 invisible(const SWFCxForm& cx)
00110 {
00111 return (255 * cx.aa >> 8) + cx.ab == 0;
00112 }
00113
00114 std::ostream& operator<<(std::ostream& os, const SWFCxForm& cx);
00115
00116 }
00117
00118 #endif
00119
00120
00121
00122
00123
00124