Drop the bool operator for ObjectURI, to avoid getting the kind of side-effect that...
[gnash.git] / libcore / BevelFilter.h
blob9d972bd66946211ef6306602ca5192419073e0e6
1 //
2 // Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef GNASH_BEVELFILTER_H
20 #define GNASH_BEVELFILTER_H
22 #include "BitmapFilter.h"
24 #include <boost/cstdint.hpp> // for XintXX_t
26 namespace gnash {
28 // A bevel effect filter.
29 class BevelFilter : public BitmapFilter
31 public:
32 typedef enum
34 OUTER_BEVEL = 1,
35 INNER_BEVEL = 2,
36 FULL_BEVEL = 3
37 } bevel_type;
39 // Fill from a SWFStream. See parser/filter_factory.cpp for the implementations.
40 virtual bool read(SWFStream& in);
42 virtual ~BevelFilter() { return; }
44 BevelFilter() :
45 m_distance(0.0f), m_angle(0.0f), m_highlightColor(0),
46 m_highlightAlpha(0), m_shadowColor(0), m_shadowAlpha(0),
47 m_blurX(0.0f), m_blurY(0.0f), m_strength(0.0f), m_quality(0),
48 m_type(FULL_BEVEL), m_knockout(false)
49 { return; }
51 BevelFilter(float distance, float angle, boost::uint32_t hcolor,
52 boost::uint8_t halpha, boost::uint32_t scolor, boost::uint8_t salpha,
53 float blurX, float blurY, float strength,
54 boost::uint8_t quality, bevel_type type, bool knockout) :
55 m_distance(distance), m_angle(angle), m_highlightColor(hcolor),
56 m_highlightAlpha(halpha), m_shadowColor(scolor), m_shadowAlpha(salpha),
57 m_blurX(blurX), m_blurY(blurY), m_strength(strength),
58 m_quality(quality), m_type(type), m_knockout(knockout)
59 { return; }
61 float m_distance; // Distance of the filter in pixels.
62 float m_angle; // Angle of the filter.
63 boost::uint32_t m_highlightColor; // Color of the highlight.
64 boost::uint8_t m_highlightAlpha; // Alpha of the highlight.
65 boost::uint32_t m_shadowColor; // RGB color.
66 boost::uint8_t m_shadowAlpha; // Alpha strength, as a percentage(?)
67 float m_blurX; // horizontal blur
68 float m_blurY; // vertical blur
69 float m_strength; // How strong is the filter.
70 boost::uint8_t m_quality; // How many times to apply the filter.
71 bevel_type m_type; // The type of filter. (Rendered as string in AS)
72 bool m_knockout; // If true, render only the filter effect.
75 } // Namespace gnash
77 #endif // GNASH_BEVELFILTER_H