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

GradientBevelFilter.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_GRADIENTBEVELFILTER_H
00020 #define GNASH_GRADIENTBEVELFILTER_H
00021 
00022 #include "BitmapFilter.h"
00023 
00024 #include <vector>
00025 #include <boost/cstdint.hpp> // for C99 int types
00026 
00027 namespace gnash {
00028 
00029 // A gradient bevel effect filter.
00030 class GradientBevelFilter : public BitmapFilter
00031 {
00032 public:
00033     typedef enum
00034     {
00035         INNER_BEVEL = 2,
00036         OUTER_BEVEL = 1,
00037         FULL_BEVEL = 3
00038     } glow_types;
00039 
00040     // Fill from a SWFStream. See parser/filter_factory.cpp for the implementations.
00041     virtual bool read(SWFStream& in);
00042 
00043     virtual ~GradientBevelFilter() { return; }
00044 
00045     GradientBevelFilter() : 
00046         m_distance(0.0f), m_angle(0.0f), m_colors(), m_alphas(), m_ratios(),
00047         m_blurX(0.0f), m_blurY(0.0f),  m_strength(0.0f), m_quality(0),
00048         m_type(INNER_BEVEL), m_knockout(false)
00049     { return; }
00050 
00051     GradientBevelFilter(float distance, float angle,
00052         std::vector<boost::uint32_t> colors,
00053         std::vector<boost::uint8_t> alphas,
00054         std::vector<boost::uint8_t> ratios,
00055         float blurX, float blurY, float strength,
00056         boost::uint8_t quality, glow_types type, bool knockout) :
00057         m_distance(distance), m_angle(angle),
00058         m_colors(colors), m_alphas(alphas), m_ratios(ratios),
00059         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_GRADIENTBEVELFILTER_H

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