• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

GradientGlowFilter.h

Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
00003 // 
00004 // This program is free software; you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation; either version 3 of the License, or
00007 // (at your option) any later version.
00008 // 
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 // 
00014 // You should have received a copy of the GNU General Public License
00015 // along with this program; if not, write to the Free Software
00016 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00017 
00018 
00019 #ifndef GNASH_GRADIENTGLOWFILTER_H
00020 #define GNASH_GRADIENTGLOWFILTER_H
00021 
00022 #include "BitmapFilter.h"
00023 
00024 #include <vector>
00025 #include <boost/cstdint.hpp> // For C99 int types
00026 
00027 
00028 namespace gnash {
00029 
00030 // A gradient glow effect filter.
00031 class GradientGlowFilter : public BitmapFilter
00032 {
00033 public:
00034     typedef enum
00035     {
00036         INNER_GLOW = 2,
00037         OUTER_GLOW = 1,
00038         FULL_GLOW = 3
00039     } glow_types;
00040 
00041     // Fill from a SWFStream. See parser/filter_factory.cpp for the implementations.
00042     virtual bool read(SWFStream& in);
00043 
00044     virtual ~GradientGlowFilter() { return; }
00045 
00046     GradientGlowFilter() : 
00047         m_distance(0.0f), m_angle(0.0f), m_colors(), m_alphas(), m_ratios(),
00048         m_blurX(0.0f), m_blurY(0.0f),  m_strength(0.0f), m_quality(0),
00049         m_type(INNER_GLOW), m_knockout(false)
00050     { return; }
00051 
00052     GradientGlowFilter(float distance, float angle,
00053         std::vector<boost::uint32_t> colors,
00054         std::vector<boost::uint8_t> alphas,
00055         std::vector<boost::uint8_t> ratios,
00056         float blurX, float blurY, float strength,
00057         boost::uint8_t quality, glow_types type, bool knockout) :
00058         m_distance(distance), m_angle(angle), m_colors(colors), m_alphas(alphas),
00059         m_ratios(ratios), m_blurX(blurX), m_blurY(blurY), m_strength(strength),
00060         m_quality(quality), m_type(type), m_knockout(knockout)
00061     { return; }
00062 
00063     float m_distance; // Distance of the filter in pixels.
00064     float m_angle; // Angle of the filter.
00065     std::vector<boost::uint32_t> m_colors; // Colors of the gradients.
00066     std::vector<boost::uint8_t> m_alphas; // Alphas of the gradients.
00067     std::vector<boost::uint8_t> m_ratios; // Ratios of the gradients.
00068     float m_blurX; // horizontal blur
00069     float m_blurY; // vertical blur
00070     float m_strength; // How strong is the filter.
00071     boost::uint8_t m_quality; // How many times to apply the filter.
00072     glow_types m_type; // What type of effect.
00073     bool m_knockout; // If true, render only the filter effect.
00074 };
00075 
00076 } // Namespace gnash
00077 
00078 #endif // GNASH_GRADIENTGLOWFILTER_H

Generated on Thu Sep 30 2010 14:34:58 for Gnash by  doxygen 1.7.1