]> git.imager.perl.org - imager.git/blob - lib/Imager/Regops.pm
convert scale.c to scale.im so we have 8 bit/sample and double/sample
[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           'abs' => {
66                      'func' => 1,
67                      'opcode' => 38,
68                      'parms' => 1,
69                      'result' => 'r',
70                      'types' => 'r'
71                    },
72           'add' => {
73                      'func' => 0,
74                      'opcode' => 0,
75                      'parms' => 2,
76                      'result' => 'r',
77                      'types' => 'rr'
78                    },
79           'addp' => {
80                       'func' => 0,
81                       'opcode' => 8,
82                       'parms' => 2,
83                       'result' => 'p',
84                       'types' => 'pp'
85                     },
86           'alpha' => {
87                        'func' => 1,
88                        'opcode' => 48,
89                        'parms' => 1,
90                        'result' => 'r',
91                        'types' => 'p'
92                      },
93           'and' => {
94                      'func' => 0,
95                      'opcode' => 35,
96                      'parms' => 2,
97                      'result' => 'r',
98                      'types' => 'rr'
99                    },
100           'atan2' => {
101                        'func' => 1,
102                        'opcode' => 12,
103                        'parms' => 2,
104                        'result' => 'r',
105                        'types' => 'rr'
106                      },
107           'blue' => {
108                       'func' => 1,
109                       'opcode' => 24,
110                       'parms' => 1,
111                       'result' => 'r',
112                       'types' => 'p'
113                     },
114           'cos' => {
115                      'func' => 1,
116                      'opcode' => 11,
117                      'parms' => 1,
118                      'result' => 'r',
119                      'types' => 'r'
120                    },
121           'distance' => {
122                           'func' => 1,
123                           'opcode' => 14,
124                           'parms' => 4,
125                           'result' => 'r',
126                           'types' => 'rrrr'
127                         },
128           'div' => {
129                      'func' => 0,
130                      'opcode' => 3,
131                      'parms' => 2,
132                      'result' => 'r',
133                      'types' => 'rr'
134                    },
135           'eq' => {
136                     'func' => 0,
137                     'opcode' => 33,
138                     'parms' => 2,
139                     'result' => 'r',
140                     'types' => 'rr'
141                   },
142           'exp' => {
143                      'func' => 1,
144                      'opcode' => 50,
145                      'parms' => 1,
146                      'result' => 'r',
147                      'types' => 'r'
148                    },
149           'ge' => {
150                     'func' => 0,
151                     'opcode' => 31,
152                     'parms' => 2,
153                     'result' => 'r',
154                     'types' => 'rr'
155                   },
156           'getp1' => {
157                        'func' => 1,
158                        'opcode' => 15,
159                        'parms' => 2,
160                        'result' => 'p',
161                        'types' => 'rr'
162                      },
163           'getp2' => {
164                        'func' => 1,
165                        'opcode' => 16,
166                        'parms' => 2,
167                        'result' => 'p',
168                        'types' => 'rr'
169                      },
170           'getp3' => {
171                        'func' => 1,
172                        'opcode' => 17,
173                        'parms' => 2,
174                        'result' => 'p',
175                        'types' => 'rr'
176                      },
177           'green' => {
178                        'func' => 1,
179                        'opcode' => 23,
180                        'parms' => 1,
181                        'result' => 'r',
182                        'types' => 'p'
183                      },
184           'gt' => {
185                     'func' => 0,
186                     'opcode' => 32,
187                     'parms' => 2,
188                     'result' => 'r',
189                     'types' => 'rr'
190                   },
191           'hsv' => {
192                      'func' => 1,
193                      'opcode' => 21,
194                      'parms' => 3,
195                      'result' => 'p',
196                      'types' => 'rrr'
197                    },
198           'hsva' => {
199                       'func' => 1,
200                       'opcode' => 47,
201                       'parms' => 4,
202                       'result' => 'p',
203                       'types' => 'rrrr'
204                     },
205           'hue' => {
206                      'func' => 1,
207                      'opcode' => 19,
208                      'parms' => 1,
209                      'result' => 'r',
210                      'types' => 'p'
211                    },
212           'if' => {
213                     'func' => 1,
214                     'opcode' => 27,
215                     'parms' => 3,
216                     'result' => 'r',
217                     'types' => 'rrr'
218                   },
219           'ifp' => {
220                      'func' => 1,
221                      'opcode' => 28,
222                      'parms' => 3,
223                      'result' => 'p',
224                      'types' => 'rpp'
225                    },
226           'int' => {
227                      'func' => 1,
228                      'opcode' => 26,
229                      'parms' => 1,
230                      'result' => 'r',
231                      'types' => 'r'
232                    },
233           'jump' => {
234                       'func' => 0,
235                       'opcode' => 40,
236                       'parms' => 0,
237                       'result' => undef,
238                       'types' => ''
239                     },
240           'jumpnz' => {
241                         'func' => 0,
242                         'opcode' => 42,
243                         'parms' => 1,
244                         'result' => undef,
245                         'types' => 'r'
246                       },
247           'jumpz' => {
248                        'func' => 0,
249                        'opcode' => 41,
250                        'parms' => 1,
251                        'result' => undef,
252                        'types' => 'r'
253                      },
254           'le' => {
255                     'func' => 0,
256                     'opcode' => 29,
257                     'parms' => 2,
258                     'result' => 'r',
259                     'types' => 'rr'
260                   },
261           'log' => {
262                      'func' => 1,
263                      'opcode' => 49,
264                      'parms' => 1,
265                      'result' => 'r',
266                      'types' => 'r'
267                    },
268           'lt' => {
269                     'func' => 0,
270                     'opcode' => 30,
271                     'parms' => 2,
272                     'result' => 'r',
273                     'types' => 'rr'
274                   },
275           'mod' => {
276                      'func' => 0,
277                      'opcode' => 4,
278                      'parms' => 2,
279                      'result' => 'r',
280                      'types' => 'rr'
281                    },
282           'mult' => {
283                       'func' => 0,
284                       'opcode' => 2,
285                       'parms' => 2,
286                       'result' => 'r',
287                       'types' => 'rr'
288                     },
289           'multp' => {
290                        'func' => 0,
291                        'opcode' => 7,
292                        'parms' => 2,
293                        'result' => 'p',
294                        'types' => 'pr'
295                      },
296           'ne' => {
297                     'func' => 0,
298                     'opcode' => 34,
299                     'parms' => 2,
300                     'result' => 'r',
301                     'types' => 'rr'
302                   },
303           'not' => {
304                      'func' => 0,
305                      'opcode' => 37,
306                      'parms' => 1,
307                      'result' => 'r',
308                      'types' => 'r'
309                    },
310           'op_count' => {
311                           'func' => 0,
312                           'opcode' => 51,
313                           'parms' => 0,
314                           'result' => undef,
315                           'types' => ''
316                         },
317           'or' => {
318                     'func' => 0,
319                     'opcode' => 36,
320                     'parms' => 2,
321                     'result' => 'r',
322                     'types' => 'rr'
323                   },
324           'pow' => {
325                      'func' => 0,
326                      'opcode' => 5,
327                      'parms' => 2,
328                      'result' => 'r',
329                      'types' => 'rr'
330                    },
331           'print' => {
332                        'func' => 0,
333                        'opcode' => 45,
334                        'parms' => 1,
335                        'result' => undef,
336                        'types' => 'r'
337                      },
338           'red' => {
339                      'func' => 1,
340                      'opcode' => 22,
341                      'parms' => 1,
342                      'result' => 'r',
343                      'types' => 'p'
344                    },
345           'ret' => {
346                      'func' => 0,
347                      'opcode' => 39,
348                      'parms' => 1,
349                      'result' => undef,
350                      'types' => 'p'
351                    },
352           'rgb' => {
353                      'func' => 1,
354                      'opcode' => 25,
355                      'parms' => 3,
356                      'result' => 'p',
357                      'types' => 'rrr'
358                    },
359           'rgba' => {
360                       'func' => 1,
361                       'opcode' => 46,
362                       'parms' => 4,
363                       'result' => 'p',
364                       'types' => 'rrrr'
365                     },
366           'sat' => {
367                      'func' => 1,
368                      'opcode' => 20,
369                      'parms' => 1,
370                      'result' => 'r',
371                      'types' => 'p'
372                    },
373           'set' => {
374                      'func' => 0,
375                      'opcode' => 43,
376                      'parms' => 1,
377                      'result' => 'r',
378                      'types' => 'r'
379                    },
380           'setp' => {
381                       'func' => 0,
382                       'opcode' => 44,
383                       'parms' => 1,
384                       'result' => 'p',
385                       'types' => 'p'
386                     },
387           'sin' => {
388                      'func' => 1,
389                      'opcode' => 10,
390                      'parms' => 1,
391                      'result' => 'r',
392                      'types' => 'r'
393                    },
394           'sqrt' => {
395                       'func' => 1,
396                       'opcode' => 13,
397                       'parms' => 1,
398                       'result' => 'r',
399                       'types' => 'r'
400                     },
401           'subtract' => {
402                           'func' => 0,
403                           'opcode' => 1,
404                           'parms' => 2,
405                           'result' => 'r',
406                           'types' => 'rr'
407                         },
408           'subtractp' => {
409                            'func' => 0,
410                            'opcode' => 9,
411                            'parms' => 2,
412                            'result' => 'p',
413                            'types' => 'pp'
414                          },
415           'uminus' => {
416                         'func' => 0,
417                         'opcode' => 6,
418                         'parms' => 1,
419                         'result' => 'r',
420                         'types' => 'r'
421                       },
422           'value' => {
423                        'func' => 1,
424                        'opcode' => 18,
425                        'parms' => 1,
426                        'result' => 'r',
427                        'types' => 'p'
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/
464
465 =cut
466