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