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