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