2 * Copyright 2006-2008, Haiku.
3 * Distributed under the terms of the MIT License.
6 * Artur Wyszynski <harakash@gmail.com>
11 #include <GradientRadialFocus.h>
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
;
27 BGradientRadialFocus::BGradientRadialFocus(const BPoint
& center
, float radius
,
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
;
40 BGradientRadialFocus::BGradientRadialFocus(float cx
, float cy
, float radius
,
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
;
54 BGradientRadialFocus::Center() const
56 return BPoint(fData
.radial_focus
.cx
, fData
.radial_focus
.cy
);
62 BGradientRadialFocus::SetCenter(const BPoint
& center
)
64 fData
.radial_focus
.cx
= center
.x
;
65 fData
.radial_focus
.cy
= center
.y
;
71 BGradientRadialFocus::SetCenter(float cx
, float cy
)
73 fData
.radial_focus
.cx
= cx
;
74 fData
.radial_focus
.cy
= cy
;
80 BGradientRadialFocus::Focal() const
82 return BPoint(fData
.radial_focus
.fx
, fData
.radial_focus
.fy
);
88 BGradientRadialFocus::SetFocal(const BPoint
& focal
)
90 fData
.radial_focus
.fx
= focal
.x
;
91 fData
.radial_focus
.fy
= focal
.y
;
97 BGradientRadialFocus::SetFocal(float fx
, float fy
)
99 fData
.radial_focus
.fx
= fx
;
100 fData
.radial_focus
.fy
= fy
;
106 BGradientRadialFocus::Radius() const
108 return fData
.radial_focus
.radius
;
114 BGradientRadialFocus::SetRadius(float radius
)
116 fData
.radial_focus
.radius
= radius
;