1pod::Prima::types(3)  User Contributed Perl Documentation pod::Prima::types(3)
2
3
4

NAME

6       Prima::types - builtin types
7

DESCRIPTION

9       Auxiliary second-citizen classes that are not usually created manually
10       but used as results of Prima methods and accepted as inputs. These
11       classes names can be distinguished that their name is started by a
12       lower-case letter.
13

Prima::array

15       Overloaded C array that can be used transparently as a normal perl
16       array of numbers.  The reason "Prima::array" exists is that Prima
17       methods don't need to do expensive conversions between a perl array of
18       scalars to C array of integers or floats.
19
20       new LETTER = [idsS], BUF = undef
21           Creates a new C array with type either int, double, short, and
22           unsigned short.  There are also methods "new_int", "new_double",
23           "new_short", and "new_ushort" that to the same.
24
25           BUF, a normal perl string, can be used to initialize the array, if
26           any (and can be pre-populated with pack()). Otherwise an array is
27           created as empty.
28
29       is_array SCALAR
30           Checks whether SCALAR is a "Prima::array" object.
31
32       substr OFFSET, LENGTH, REPLACEMENT
33           Emulates perl's "substr" except operates not on character but C
34           type level.  Returns a new "Prima::array" object.
35
36       append ARRAY
37           Assuming two arrays have same type, appends the ARRAY's contents to
38           own content.
39
40       clone
41           Clones the array.
42

Prima::matrix

44       An array of 6 doubles with some helper methods attached.
45
46       A,B,C,D,X,Y
47           Named accessory properties for the 6 members.  The members can just
48           as well be accessed directly with array syntax.
49
50       clone
51           Clones the matrix object
52
53       identity
54           Resets the matrix to identity
55
56       inverse_transform @POINTS | $POINTS_ARRAY
57           Applies inverse matrix tranformations to an array or arrayref of
58           points, and returns in the same format (i e array for array, ref
59           for ref).
60
61       new [ @ARRAY ]
62           Creates a new object and optionally initializes it with @ARRAY
63
64       multiply MATRIX
65           Multiplies the matrices and stores the result
66
67       rotate ANGLE
68           Rotates the matrix
69
70       scale MX,MY
71           Scales the matrix
72
73       shear DX,DY
74           Shears the matrix
75
76       set @ARRAY
77           Assigns all 6 members at once
78
79       translate DX,DY
80           Translates the matrix
81
82       transform @POINTS | $POINTS_ARRAY
83           Applies matrix tranformations to an array or arrayref of points,
84           and returns in the same format (i e array for array, ref for ref).
85
86       See also: Prima::Matrix
87

Prima::Matrix

89       Same as "Prima::matrix" but explicitly binds to drawable objects, so
90       that all changes to the matrix are immediately reflected in the
91       drawable.
92
93       Features all the methods available to "Prima::matrix" (except "apply"),
94       plus the ones described below.
95
96       new CANVAS
97           Creates new instance
98
99       canvas DRAWABLE
100           Accesses the associated drawable object
101
102       get Returns the current matrix
103
104       reset
105           Sets matrix to "Prima::matrix::identity", or (1,0,0,1,0,0)
106
107       save, restore
108           Saves and restores the matrix content in the internal stack
109

Prima::rect

111       Represents rectangular object either as rectangle ( X1,Y1,X2,Y2 ) or
112       box ( X,Y,WIDTH,HEIGHT ).
113
114       box Returns X, Y, WIDTH, HEIGHT
115
116       clone
117           Clones the object
118
119       enlarge N
120           Enlarges the rectangle by N
121
122       inclusive
123           Rectangle itself is agnostic of its 2D presentation, but assuming
124           the coordinates are inclusive-exclusive, "inclusive" returns
125           X1,Y1,X2,Y2 as inclusive-inclusive rectangle.
126
127       intersect RECT
128           Intersects with RECT and stores the result
129
130       is_empty
131           Returns true if rectangle's width and height are zero
132
133       is_equal RECT
134           Returns true if both rectangles are equal
135
136       new () | (WIDTH,HEIGHT) | (X1,Y1,X2,Y2)
137           Creates new object with rectangle syntax
138
139       new_box X,Y,WIDTH,HEIGHT
140           Creates new object with box syntax
141
142       origin
143           Returns X,Y
144
145       shrink N
146           Shrinks the rectangle by N
147
148       size
149           Return WIDTH and HEIGHT
150
151       union RECT
152           Joins with RECT and stores the result
153

AUTHOR

155       Dmitry Karasik, <dmitry@karasik.eu.org>.
156

SEE ALSO

158       Prima
159
160
161
162perl v5.38.0                      2023-07-21              pod::Prima::types(3)
Impressum