2 // Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
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.
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.
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_GRADIENTGLOWFILTER_H
20 #define GNASH_GRADIENTGLOWFILTER_H
22 #include "BitmapFilter.h"
25 #include <boost/cstdint.hpp> // For C99 int types
30 // A gradient glow effect filter.
31 class GradientGlowFilter
: public BitmapFilter
41 // Fill from a SWFStream. See parser/filter_factory.cpp for the implementations.
42 virtual bool read(SWFStream
& in
);
44 virtual ~GradientGlowFilter() { return; }
46 GradientGlowFilter() :
47 m_distance(0.0f
), m_angle(0.0f
), m_colors(), m_alphas(), m_ratios(),
48 m_blurX(0.0f
), m_blurY(0.0f
), m_strength(0.0f
), m_quality(0),
49 m_type(INNER_GLOW
), m_knockout(false)
52 GradientGlowFilter(float distance
, float angle
,
53 std::vector
<boost::uint32_t> colors
,
54 std::vector
<boost::uint8_t> alphas
,
55 std::vector
<boost::uint8_t> ratios
,
56 float blurX
, float blurY
, float strength
,
57 boost::uint8_t quality
, glow_types type
, bool knockout
) :
58 m_distance(distance
), m_angle(angle
), m_colors(colors
), m_alphas(alphas
),
59 m_ratios(ratios
), m_blurX(blurX
), m_blurY(blurY
), m_strength(strength
),
60 m_quality(quality
), m_type(type
), m_knockout(knockout
)
63 float m_distance
; // Distance of the filter in pixels.
64 float m_angle
; // Angle of the filter.
65 std::vector
<boost::uint32_t> m_colors
; // Colors of the gradients.
66 std::vector
<boost::uint8_t> m_alphas
; // Alphas of the gradients.
67 std::vector
<boost::uint8_t> m_ratios
; // Ratios of the gradients.
68 float m_blurX
; // horizontal blur
69 float m_blurY
; // vertical blur
70 float m_strength
; // How strong is the filter.
71 boost::uint8_t m_quality
; // How many times to apply the filter.
72 glow_types m_type
; // What type of effect.
73 bool m_knockout
; // If true, render only the filter effect.
78 #endif // GNASH_GRADIENTGLOWFILTER_H