Gnash  0.8.11dev
ColorTransform_as.h
Go to the documentation of this file.
1 // ColorTransform_as.h: ActionScript "ColorTransform" class, for Gnash.
2 //
3 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
4 // Free Software Foundation, Inc
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 //
20 
21 #ifndef GNASH_ASOBJ_COLORTRANSFORM_H
22 #define GNASH_ASOBJ_COLORTRANSFORM_H
23 
24 #include "Relay.h"
25 
26 namespace gnash {
27  class as_object;
28  struct ObjectURI;
29 }
30 
31 namespace gnash {
32 
33 // This is used directly by flash.geom.Transform, as it is
34 // much more efficient than a pseudo-ActionScript implementation.
35 class ColorTransform_as : public Relay
36 {
37 
38 public:
39 
40  ColorTransform_as(double rm, double gm, double bm, double am,
41  double ro, double go, double bo, double ao);
42 
43  // Tests show that the ColorTransform
44  // object has its own properties on initialization, so they have
45  // getter-setters and are *not* simple properties. Storing and
46  // manipulating as doubles (they cannot be anything else - see ctor) is
47  // better for speed and memory than using as_value.
48  void setAlphaMultiplier(double am) { _alphaMultiplier = am; }
49  void setRedMultiplier(double rm) { _redMultiplier = rm; }
50  void setBlueMultiplier(double bm) { _blueMultiplier = bm; }
51  void setGreenMultiplier(double gm) { _greenMultiplier = gm; }
52 
53  void setAlphaOffset(double ao) { _alphaOffset = ao; }
54  void setRedOffset(double ro) { _redOffset = ro; }
55  void setBlueOffset(double bo) { _blueOffset = bo; }
56  void setGreenOffset(double go) { _greenOffset = go; }
57 
58  double getAlphaMultiplier() const { return _alphaMultiplier; }
59  double getRedMultiplier() const { return _redMultiplier; }
60  double getBlueMultiplier() const { return _blueMultiplier; }
61  double getGreenMultiplier() const { return _greenMultiplier; }
62 
63  double getAlphaOffset() const { return _alphaOffset; }
64  double getRedOffset() const { return _redOffset; }
65  double getBlueOffset() const { return _blueOffset; }
66  double getGreenOffset() const { return _greenOffset; }
67 
68  void concat(const ColorTransform_as& other);
69 
70 private:
71 
72  double _alphaMultiplier;
73  double _alphaOffset;
74  double _blueMultiplier;
75  double _blueOffset;
76  double _greenMultiplier;
77  double _greenOffset;
78  double _redMultiplier;
79  double _redOffset;
80 
81 };
82 
85 
87 
88 } // end of gnash namespace
89 
90 #endif
void setAlphaMultiplier(double am)
Definition: ColorTransform_as.h:48
void setBlueMultiplier(double bm)
Definition: ColorTransform_as.h:50
double getBlueOffset() const
Definition: ColorTransform_as.h:65
void setGreenMultiplier(double gm)
Definition: ColorTransform_as.h:51
uri
Definition: test.py:12
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
void setRedOffset(double ro)
Definition: ColorTransform_as.h:54
double getAlphaMultiplier() const
Definition: ColorTransform_as.h:58
double getGreenMultiplier() const
Definition: ColorTransform_as.h:61
The base class for all ActionScript objects.
Definition: as_object.h:161
double getAlphaOffset() const
Definition: ColorTransform_as.h:63
A URI for describing as_objects.
Definition: ObjectURI.h:44
void setBlueOffset(double bo)
Definition: ColorTransform_as.h:55
double getGreenOffset() const
Definition: ColorTransform_as.h:66
Definition: ColorTransform_as.h:35
double getBlueMultiplier() const
Definition: ColorTransform_as.h:60
void setRedMultiplier(double rm)
Definition: ColorTransform_as.h:49
ColorTransform_as(double rm, double gm, double bm, double am, double ro, double go, double bo, double ao)
Definition: ColorTransform_as.cpp:55
void colortransform_class_init(as_object &where, const ObjectURI &uri)
Initialize the global ColorTransform class.
Definition: ColorTransform_as.cpp:87
void concat(const ColorTransform_as &other)
Definition: ColorTransform_as.cpp:72
This is the base class for type-specific object data.
Definition: Relay.h:49
void setGreenOffset(double go)
Definition: ColorTransform_as.h:56
void setAlphaOffset(double ao)
Definition: ColorTransform_as.h:53
double getRedMultiplier() const
Definition: ColorTransform_as.h:59
void registerColorTransformNative(as_object &global)
Definition: ColorTransform_as.cpp:96
double getRedOffset() const
Definition: ColorTransform_as.h:64