tcp: Fix 64 bit build with debugging features enabled.
[haiku.git] / src / kits / interface / GradientRadialFocus.cpp
blob6a76bd8385f7bf54f0f98b785e277113cf42cf28
1 /*
2 * Copyright 2006-2008, Haiku.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Artur Wyszynski <harakash@gmail.com>
7 */
9 #include <Point.h>
10 #include <Gradient.h>
11 #include <GradientRadialFocus.h>
14 // constructor
15 BGradientRadialFocus::BGradientRadialFocus()
17 fData.radial_focus.cx = 0.0f;
18 fData.radial_focus.cy = 0.0f;
19 fData.radial_focus.fx = 0.0f;
20 fData.radial_focus.fy = 0.0f;
21 fData.radial_focus.radius = 0.0f;
22 fType = TYPE_RADIAL_FOCUS;
26 // constructor
27 BGradientRadialFocus::BGradientRadialFocus(const BPoint& center, float radius,
28 const BPoint& focal)
30 fData.radial_focus.cx = center.x;
31 fData.radial_focus.cy = center.y;
32 fData.radial_focus.fx = focal.x;
33 fData.radial_focus.fy = focal.y;
34 fData.radial_focus.radius = radius;
35 fType = TYPE_RADIAL_FOCUS;
39 // constructor
40 BGradientRadialFocus::BGradientRadialFocus(float cx, float cy, float radius,
41 float fx, float fy)
43 fData.radial_focus.cx = cx;
44 fData.radial_focus.cy = cy;
45 fData.radial_focus.fx = fx;
46 fData.radial_focus.fy = fy;
47 fData.radial_focus.radius = radius;
48 fType = TYPE_RADIAL_FOCUS;
52 // Center
53 BPoint
54 BGradientRadialFocus::Center() const
56 return BPoint(fData.radial_focus.cx, fData.radial_focus.cy);
60 // SetCenter
61 void
62 BGradientRadialFocus::SetCenter(const BPoint& center)
64 fData.radial_focus.cx = center.x;
65 fData.radial_focus.cy = center.y;
69 // SetCenter
70 void
71 BGradientRadialFocus::SetCenter(float cx, float cy)
73 fData.radial_focus.cx = cx;
74 fData.radial_focus.cy = cy;
78 // Focal
79 BPoint
80 BGradientRadialFocus::Focal() const
82 return BPoint(fData.radial_focus.fx, fData.radial_focus.fy);
86 // SetFocal
87 void
88 BGradientRadialFocus::SetFocal(const BPoint& focal)
90 fData.radial_focus.fx = focal.x;
91 fData.radial_focus.fy = focal.y;
95 // SetFocal
96 void
97 BGradientRadialFocus::SetFocal(float fx, float fy)
99 fData.radial_focus.fx = fx;
100 fData.radial_focus.fy = fy;
104 // Radius
105 float
106 BGradientRadialFocus::Radius() const
108 return fData.radial_focus.radius;
112 // SetRadius
113 void
114 BGradientRadialFocus::SetRadius(float radius)
116 fData.radial_focus.radius = radius;