temporary scaling test code, proper defaults for crop().
[imager.git] / lib / Imager / Regops.pm
CommitLineData
84324192
AMH
1# AUTOMATICALLY GENERATED BY regops.perl
2package Imager::Regops;
3use strict;
4require Exporter;
5use vars qw(@ISA @EXPORT @EXPORT_OK %Attr $MaxOperands $PackCode);
6@ISA = qw(Exporter);
7@EXPORT_OK = qw(%Attr $MaxOperands $PackCode);
8
9use constant RBC_ADD => 0;
10use constant RBC_SUBTRACT => 1;
11use constant RBC_MULT => 2;
12use constant RBC_DIV => 3;
13use constant RBC_MOD => 4;
14use constant RBC_POW => 5;
15use constant RBC_UMINUS => 6;
16use constant RBC_MULTP => 7;
17use constant RBC_ADDP => 8;
18use constant RBC_SUBTRACTP => 9;
19use constant RBC_SIN => 10;
20use constant RBC_COS => 11;
21use constant RBC_ATAN2 => 12;
22use constant RBC_SQRT => 13;
23use constant RBC_DISTANCE => 14;
24use constant RBC_GETP1 => 15;
25use constant RBC_GETP2 => 16;
26use constant RBC_GETP3 => 17;
27use constant RBC_VALUE => 18;
28use constant RBC_HUE => 19;
29use constant RBC_SAT => 20;
30use constant RBC_HSV => 21;
31use constant RBC_RED => 22;
32use constant RBC_GREEN => 23;
33use constant RBC_BLUE => 24;
34use constant RBC_RGB => 25;
35use constant RBC_INT => 26;
36use constant RBC_IF => 27;
37use constant RBC_IFP => 28;
38use constant RBC_LE => 29;
39use constant RBC_LT => 30;
40use constant RBC_GE => 31;
41use constant RBC_GT => 32;
42use constant RBC_EQ => 33;
43use constant RBC_NE => 34;
44use constant RBC_AND => 35;
45use constant RBC_OR => 36;
46use constant RBC_NOT => 37;
47use constant RBC_ABS => 38;
48use constant RBC_RET => 39;
49use constant RBC_JUMP => 40;
50use constant RBC_JUMPZ => 41;
51use constant RBC_JUMPNZ => 42;
52use constant RBC_SET => 43;
53use constant RBC_SETP => 44;
54use constant RBC_PRINT => 45;
55use constant RBC_OP_COUNT => 46;
56
57@EXPORT = qw(RBC_ADD RBC_SUBTRACT RBC_MULT RBC_DIV RBC_MOD RBC_POW RBC_UMINUS RBC_MULTP RBC_ADDP RBC_SUBTRACTP RBC_SIN RBC_COS RBC_ATAN2 RBC_SQRT RBC_DISTANCE RBC_GETP1 RBC_GETP2 RBC_GETP3 RBC_VALUE RBC_HUE RBC_SAT RBC_HSV RBC_RED RBC_GREEN RBC_BLUE RBC_RGB RBC_INT RBC_IF RBC_IFP RBC_LE RBC_LT RBC_GE RBC_GT RBC_EQ RBC_NE RBC_AND RBC_OR RBC_NOT RBC_ABS RBC_RET RBC_JUMP RBC_JUMPZ RBC_JUMPNZ RBC_SET RBC_SETP RBC_PRINT RBC_OP_COUNT);
58
59%Attr = (
b4e32feb
AMH
60 'or' => {
61 'opcode' => 36,
84324192 62 'parms' => 2,
b4e32feb
AMH
63 'func' => '0',
64 'types' => 'rr',
65 'result' => 'r'
84324192 66 },
84324192 67 'getp1' => {
84324192 68 'opcode' => 15,
84324192 69 'parms' => 2,
84324192 70 'func' => 1,
b4e32feb
AMH
71 'types' => 'rr',
72 'result' => 'p'
84324192 73 },
b4e32feb
AMH
74 'uminus' => {
75 'opcode' => 6,
76 'parms' => 1,
77 'func' => '0',
78 'types' => 'r',
79 'result' => 'r'
80 },
84324192 81 'getp2' => {
84324192 82 'opcode' => 16,
b4e32feb 83 'parms' => 2,
84324192 84 'func' => 1,
b4e32feb
AMH
85 'types' => 'rr',
86 'result' => 'p'
84324192
AMH
87 },
88 'getp3' => {
84324192 89 'opcode' => 17,
b4e32feb 90 'parms' => 2,
84324192 91 'func' => 1,
b4e32feb
AMH
92 'types' => 'rr',
93 'result' => 'p'
84324192 94 },
b4e32feb
AMH
95 'jumpnz' => {
96 'opcode' => 42,
97 'parms' => 1,
98 'func' => '0',
99 'types' => 'r',
100 'result' => undef
101 },
102 'op_count' => {
103 'opcode' => 46,
104 'parms' => '0',
105 'func' => '0',
106 'types' => '',
107 'result' => undef
108 },
109 'blue' => {
110 'opcode' => 24,
111 'parms' => 1,
112 'func' => 1,
113 'types' => 'p',
114 'result' => 'r'
115 },
116 'int' => {
117 'opcode' => 26,
118 'parms' => 1,
119 'func' => 1,
120 'types' => 'r',
121 'result' => 'r'
122 },
123 'le' => {
124 'opcode' => 29,
125 'parms' => 2,
126 'func' => '0',
127 'types' => 'rr',
128 'result' => 'r'
129 },
130 'multp' => {
131 'opcode' => 7,
132 'parms' => 2,
133 'func' => '0',
134 'types' => 'pr',
135 'result' => 'p'
136 },
137 'ne' => {
138 'opcode' => 34,
139 'parms' => 2,
140 'func' => '0',
141 'types' => 'rr',
142 'result' => 'r'
143 },
144 'jumpz' => {
145 'opcode' => 41,
84324192 146 'parms' => 1,
b4e32feb
AMH
147 'func' => '0',
148 'types' => 'r',
149 'result' => undef
150 },
151 'atan2' => {
152 'opcode' => 12,
153 'parms' => 2,
84324192 154 'func' => 1,
b4e32feb
AMH
155 'types' => 'rr',
156 'result' => 'r'
84324192
AMH
157 },
158 'subtractp' => {
84324192 159 'opcode' => 9,
b4e32feb
AMH
160 'parms' => 2,
161 'func' => '0',
162 'types' => 'pp',
163 'result' => 'p'
84324192 164 },
b4e32feb
AMH
165 'rgb' => {
166 'opcode' => 25,
167 'parms' => 3,
168 'func' => 1,
169 'types' => 'rrr',
170 'result' => 'p'
171 },
172 'red' => {
173 'opcode' => 22,
84324192 174 'parms' => 1,
84324192 175 'func' => 1,
b4e32feb
AMH
176 'types' => 'p',
177 'result' => 'r'
84324192 178 },
b4e32feb
AMH
179 'setp' => {
180 'opcode' => 44,
181 'parms' => 1,
182 'func' => '0',
183 'types' => 'p',
184 'result' => 'p'
185 },
84324192 186 'jump' => {
84324192 187 'opcode' => 40,
b4e32feb
AMH
188 'parms' => '0',
189 'func' => '0',
190 'types' => '',
191 'result' => undef
84324192 192 },
b4e32feb
AMH
193 'value' => {
194 'opcode' => 18,
195 'parms' => 1,
196 'func' => 1,
197 'types' => 'p',
198 'result' => 'r'
199 },
200 'mod' => {
201 'opcode' => 4,
202 'parms' => 2,
203 'func' => '0',
204 'types' => 'rr',
205 'result' => 'r'
206 },
207 'lt' => {
208 'opcode' => 30,
209 'parms' => 2,
210 'func' => '0',
211 'types' => 'rr',
212 'result' => 'r'
84324192 213 },
b4e32feb
AMH
214 'mult' => {
215 'opcode' => 2,
216 'parms' => 2,
217 'func' => '0',
218 'types' => 'rr',
219 'result' => 'r'
220 },
221 'hue' => {
222 'opcode' => 19,
223 'parms' => 1,
224 'func' => 1,
225 'types' => 'p',
226 'result' => 'r'
227 },
84324192 228 'div' => {
84324192 229 'opcode' => 3,
b4e32feb
AMH
230 'parms' => 2,
231 'func' => '0',
232 'types' => 'rr',
233 'result' => 'r'
84324192 234 },
b4e32feb
AMH
235 'cos' => {
236 'opcode' => 11,
237 'parms' => 1,
84324192 238 'func' => 1,
b4e32feb
AMH
239 'types' => 'r',
240 'result' => 'r'
84324192 241 },
b4e32feb
AMH
242 'subtract' => {
243 'opcode' => 1,
244 'parms' => 2,
245 'func' => '0',
246 'types' => 'rr',
247 'result' => 'r'
248 },
249 'sat' => {
250 'opcode' => 20,
84324192 251 'parms' => 1,
b4e32feb
AMH
252 'func' => 1,
253 'types' => 'p',
254 'result' => 'r'
255 },
256 'add' => {
257 'opcode' => '0',
258 'parms' => 2,
259 'func' => '0',
260 'types' => 'rr',
261 'result' => 'r'
84324192 262 },
84324192 263 'sin' => {
84324192 264 'opcode' => 10,
b4e32feb 265 'parms' => 1,
84324192 266 'func' => 1,
b4e32feb
AMH
267 'types' => 'r',
268 'result' => 'r'
84324192
AMH
269 },
270 'sqrt' => {
84324192 271 'opcode' => 13,
b4e32feb 272 'parms' => 1,
84324192 273 'func' => 1,
b4e32feb
AMH
274 'types' => 'r',
275 'result' => 'r'
84324192 276 },
b4e32feb
AMH
277 'ret' => {
278 'opcode' => 39,
279 'parms' => 1,
280 'func' => '0',
281 'types' => 'p',
282 'result' => undef
283 },
84324192 284 'distance' => {
84324192 285 'opcode' => 14,
b4e32feb 286 'parms' => 4,
84324192 287 'func' => 1,
b4e32feb
AMH
288 'types' => 'rrrr',
289 'result' => 'r'
84324192 290 },
b4e32feb
AMH
291 'set' => {
292 'opcode' => 43,
293 'parms' => 1,
294 'func' => '0',
295 'types' => 'r',
296 'result' => 'r'
297 },
298 'ge' => {
299 'opcode' => 31,
84324192 300 'parms' => 2,
b4e32feb
AMH
301 'func' => '0',
302 'types' => 'rr',
303 'result' => 'r'
84324192 304 },
b4e32feb
AMH
305 'print' => {
306 'opcode' => 45,
307 'parms' => 1,
308 'func' => '0',
309 'types' => 'r',
310 'result' => undef
311 },
312 'if' => {
313 'opcode' => 27,
314 'parms' => 3,
315 'func' => 1,
316 'types' => 'rrr',
317 'result' => 'r'
318 },
319 'not' => {
320 'opcode' => 37,
84324192 321 'parms' => 1,
b4e32feb
AMH
322 'func' => '0',
323 'types' => 'r',
324 'result' => 'r'
84324192 325 },
b4e32feb
AMH
326 'hsv' => {
327 'opcode' => 21,
84324192 328 'parms' => 3,
84324192 329 'func' => 1,
b4e32feb
AMH
330 'types' => 'rrr',
331 'result' => 'p'
84324192 332 },
b4e32feb
AMH
333 'green' => {
334 'opcode' => 23,
84324192 335 'parms' => 1,
b4e32feb
AMH
336 'func' => 1,
337 'types' => 'p',
338 'result' => 'r'
84324192 339 },
b4e32feb
AMH
340 'and' => {
341 'opcode' => 35,
342 'parms' => 2,
343 'func' => '0',
344 'types' => 'rr',
345 'result' => 'r'
346 },
347 'abs' => {
348 'opcode' => 38,
84324192 349 'parms' => 1,
84324192 350 'func' => 1,
b4e32feb
AMH
351 'types' => 'r',
352 'result' => 'r'
84324192 353 },
b4e32feb
AMH
354 'eq' => {
355 'opcode' => 33,
84324192 356 'parms' => 2,
b4e32feb
AMH
357 'func' => '0',
358 'types' => 'rr',
359 'result' => 'r'
84324192 360 },
b4e32feb
AMH
361 'pow' => {
362 'opcode' => 5,
84324192 363 'parms' => 2,
b4e32feb
AMH
364 'func' => '0',
365 'types' => 'rr',
366 'result' => 'r'
84324192 367 },
b4e32feb
AMH
368 'addp' => {
369 'opcode' => 8,
370 'parms' => 2,
371 'func' => '0',
372 'types' => 'pp',
373 'result' => 'p'
374 },
375 'gt' => {
376 'opcode' => 32,
377 'parms' => 2,
378 'func' => '0',
379 'types' => 'rr',
380 'result' => 'r'
381 },
382 'ifp' => {
383 'opcode' => 28,
84324192 384 'parms' => 3,
84324192 385 'func' => 1,
b4e32feb
AMH
386 'types' => 'rpp',
387 'result' => 'p'
388 }
84324192
AMH
389 );
390$MaxOperands = 4;
391$PackCode = "i";
3921;
393
394__END__
395
396=head1 NAME
397
398Imager::Regops - generated information about the register based VM
399
400=head1 SYNOPSIS
401
402 use Imager::Regops;
403 $Imager::Regops::Attr{$opname}->{opcode} # opcode for given operator
404 $Imager::Regops::Attr{$opname}->{parms} # number of parameters
405 $Imager::Regops::Attr{$opname}->{types} # types of parameters
406 $Imager::Regops::Attr{$opname}->{func} # operator is a function
407 $Imager::Regops::Attr{$opname}->{result} # r for numeric, p for pixel result
408 $Imager::Regops::MaxOperands; # maximum number of operands
409
410=head1 DESCRIPTION
411
412This module is generated automatically from regmach.h so we don't need to
413maintain the same information in at least one extra place.
414
415At least that's the idea.
416
417=head1 AUTHOR
418
419Tony Cook, tony@develop-help.com
420
421=head1 SEE ALSO
422
423perl(1), Imager(3), http://www.eecs.umich.edu/~addi/perl/Imager/
424
425=cut
426