1pod::Prima::types(3) User Contributed Perl Documentation pod::Prima::types(3)
2
3
4
6 Prima::types - builtin types
7
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
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
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
87 Represents rectangular object either as rectangle ( X1,Y1,X2,Y2 ) or
88 box ( X,Y,WIDTH,HEIGHT ).
89
90 box Returns X, Y, WIDTH, HEIGHT
91
92 clone
93 Clones the object
94
95 enlarge N
96 Enlarges the rectangle by N
97
98 inclusive
99 Rectangle itself is agnostic of its 2D presentation, but assuming
100 the coordinates are inclusive-exclusive, "inclusive" returns
101 X1,Y1,X2,Y2 as inclusive-inclusive rectangle.
102
103 intersect RECT
104 Intersects with RECT and stores the result
105
106 is_empty
107 Returns true if rectangle's width and height are zero
108
109 is_equal RECT
110 Returns true if both rectangles are equal
111
112 new () | (WIDTH,HEIGHT) | (X1,Y1,X2,Y2)
113 Creates new object with rectangle syntax
114
115 new_box X,Y,WIDTH,HEIGHT
116 Creates new object with box syntax
117
118 origin
119 Returns X,Y
120
121 shrink N
122 Shrinks the rectangle by N
123
124 size
125 Return WIDTH and HEIGHT
126
127 union RECT
128 Joins with RECT and stores the result
129
131 Dmitry Karasik, <dmitry@karasik.eu.org>.
132
134 Prima
135
136
137
138perl v5.36.0 2023-03-20 pod::Prima::types(3)