File: GeometryLayer.js

package info (click to toggle)
freej 0.10git20080824-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 13,504 kB
  • ctags: 19,398
  • sloc: ansic: 135,255; cpp: 32,550; sh: 9,318; perl: 2,932; asm: 2,355; yacc: 1,178; makefile: 1,119; java: 136; lex: 94; python: 16
file content (200 lines) | stat: -rw-r--r-- 8,835 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/** This file is intended solely for being parsed by JSDoc
    to produce documentation for the FreeJ's Javascript API
    it is not a script you can run into FreeJ
    it is not intended to be an example of good JavaScript OO-programming,
    nor is it intended to fulfill any specific purpose apart from generating documentation

    @author Jaromil
    @version 0.8
*/

///////////////////////////////////////////////////
// GEOMETRY LAYER

/** The Geometry Layer constructor is used to create new instances of this layer
    @class The Geometry Layer lets you draw geometrical forms and
    shapes on its surface, as a vectorial drawing tool for programmers.
    This layer is well optimized for speed and good rendering.
    @author Andreas Schiffler (SDL_gfx), Jaromil
    @constructor
    @returns a new allocated Geometry Layer
*/
function GeometryLayer() { };
GeometryLayer.prototype		= new Layer();

/** Clears all the layer with the currently selected color */
function clear() { };
GeometryLayer.prototype.clear = clear;

/** Set the current color to a new value.
    This method accepts arguments in various ways:
    a single value is treated as a hexadecimal triplet (like in web pages) so you can use 0xFFEEDD;
    3 arguments are treated like an Red, Green and Blue triplet;
    4 arguments are treated like Red, Green, Blue and Alpha channel for opacity.
    @param {double} hex_color hexadecimal value in RGB format (or more arguments...) */
function color() { };
GeometryLayer.prototype.color = color;

/** Draw a pixel at x,y position with currently selected color.
    @param {int} x horizontal position, from left to right
    @param {int} y vertical position, from up to down */
function pixel(x, y) { };
GeometryLayer.prototype.pixel = pixel;

/** Draw an horizontal line from position x1,y tracing until x2 position.
    Lenght of the line will be then x2-x1.
    @param {int} x1 horizontal position at start of the line
    @param {int} x2 horizontal position at end of the line
    @param {int} y vertical position of the line */
function hline(x1,x2,y) { };
GeometryLayer.prototype.hline = hline;

/** Draw an vertical line from position x,y1 tracing until y2 position.
    Lenght of the line will be then y2-y1.
    @param {int} x horizontal position of the line
    @param {int} y1 vertical position at start of the line
    @param {int} y2 vertical position at end of the line */
function vline(x,y1,y2) { };
GeometryLayer.prototype.vline = vline;

/** Draw a rectangle.
    @param {int} x1 horizontal position of upper-left vertex
    @param {int} y1 vertical position of upper-left vertex
    @param {int} x2 horizontal position of lower-right vertex
    @param {int} y2 vertical position of lower-right vertex */
function rectangle(x1, y1, x2, y2) { };
GeometryLayer.prototype.rectangle = rectangle;

/** Draw a rectangle filled with currently selected color
    @param {int} x1 horizontal position of upper-left vertex
    @param {int} y1 vertical position of upper-left vertex
    @param {int} x2 horizontal position of lower-right vertex
    @param {int} y2 vertical position of lower-right vertex */
function rectangle_fill(x1, y1, x2, y2) { };
GeometryLayer.prototype.rectangle_fill = rectangle_fill;

/** Draw a line between two vertex.
    @param {int} x1 horizontal position of first vertex
    @param {int} y1 vertical position of first vertex
    @param {int} x2 horizontal position of second vertex
    @param {int} y2 vertical position of second vertex */
function line(x1, y1, x2, y2) { };
GeometryLayer.prototype.line = line;

/** Draw a smoothed line between two vertex.
    Antialias is used to blend the line contour
    @param {int} x1 horizontal position of first vertex
    @param {int} y1 vertical position of first vertex
    @param {int} x2 horizontal position of second vertex
    @param {int} y2 vertical position of second vertex */
function aaline(x1, y1, x2, y2) { };
GeometryLayer.prototype.aaline = aaline;

/** Draw a circle given the coordinate of it center and its radius.
    @param {int} x horizontal position of the center
    @param {int} y vertical position of the center
    @param {int} radius lenght in pixels */
function circle(x, y, radius) { };
GeometryLayer.prototype.circle = circle;

/** Draw a smoothed circle given the coordinate of it center and its radius.
    Antialias is used to blend the circle contour.
    @param {int} x horizontal position of the center
    @param {int} y vertical position of the center
    @param {int} radius lenght in pixels */
function aacircle(x, y, radius) { };
GeometryLayer.prototype.aacircle = aacircle;

/** Draw a filled circle given the coordinate of it center and its radius.
    Current color is used to fill.
    @param {int} x horizontal position of the center
    @param {int} y vertical position of the center
    @param {int} radius lenght in pixels */
function circle_fill(x, y, radius) { };
GeometryLayer.prototype.circle_fill = circle_fill;

/** Draw an ellipse.
    Given the coordinates of its center, of its horizontal and vertical radius, an ellipse is drawn.
    @param {int} x horizontal position of the center
    @param {int} y vertical position of the center
    @param {int} r_x lenght of horizontal radius
    @param {int} r_y lenght of vertical radius */
function ellipse(x, y, r_x, r_y) { };
GeometryLayer.prototype.ellipse = ellipse;

/** Draw an smoothed ellipse.  Given the coordinates of its center, of
    its horizontal and vertical radius, an antialiased ellipse is
    drawn.
    @param {int} x horizontal position of the center
    @param {int} y vertical position of the center
    @param {int} r_x lenght of horizontal radius
    @param {int} r_y lenght of vertical radius */
function aaellipse(x, y, r_x, r_y) { };
GeometryLayer.prototype.aaellipse = aaellipse;

/** Draw a filled ellipse.  Given the coordinates of its center, of
    its horizontal and vertical radius, an ellipse is drawn and filled
    with the current color.
    @param {int} x horizontal position of the center
    @param {int} y vertical position of the center
    @param {int} r_x lenght of horizontal radius
    @param {int} r_y lenght of vertical radius */
function ellipse_fill(x, y, r_x, r_y) { };
GeometryLayer.prototype.ellipse_fill = ellipse_fill;

/** Draw a pie. Given the coordinates of its center, of its radius, of
 * its start and end degrees, a pie is drawn (the uncompleted circle
 * with an angle left open, like the pacman character...)
 @param {int} x horizontal position of the center
 @param {int} y vertical position of the center
 @param {int} radius lenght of radius
 @param {int} start degree (0-360)
 @param {int} end degree (0-360) */
function pie(x, y, radius, start, end) { };
GeometryLayer.prototype.pie = pie;

/** Draw a filled pie. Given the coordinates of its center, of its
 * radius, of its start and end degrees, a pie is drawn and filled
 * with the current color.
 @param {int} x horizontal position of the center
 @param {int} y vertical position of the center
 @param {int} radius lenght of radius
 @param {int} start degree (0-360)
 @param {int} end degree (0-360) */
function pie_fill(x, y, radius, start, end) { };
GeometryLayer.prototype.pie_fill = pie_fill;

/** Draw a triangle. Given the coordinates of 3 vertices a triangle
    is drawn joining all of them.
    @param {int} x1 horizontal position of first vertex
    @param {int} y1 vertical position of first vertex
    @param {int} x2 horizontal position of second vertex
    @param {int} y2 vertical position of second vertex
    @param {int} x3 horizontal position of third vertex
    @param {int} y3 vertical position of third vertex */
function trigon() { };
GeometryLayer.prototype.trigon = trigon;

/** Draw a smoothed triangle. Given the coordinates of 3 vertices an
    antialiased triangle is drawn joining all of them.
    @param {int} x1 horizontal position of first vertex
    @param {int} y1 vertical position of first vertex
    @param {int} x2 horizontal position of second vertex
    @param {int} y2 vertical position of second vertex
    @param {int} x3 horizontal position of third vertex
    @param {int} y3 vertical position of third vertex */
function aatrigon() { };
GeometryLayer.prototype.aatrigon = aatrigon;

/** Draw a filled triangle. Given the coordinates of 3 vertices a
    triangle is drawn joining all of them and then filled with the
    current color.
    @param {int} x1 horizontal position of first vertex
    @param {int} y1 vertical position of first vertex
    @param {int} x2 horizontal position of second vertex
    @param {int} y2 vertical position of second vertex
    @param {int} x3 horizontal position of third vertex
    @param {int} y3 vertical position of third vertex */
function trigon_fill() { };
GeometryLayer.prototype.trigon_fill = trigon_fill;