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