- added log() and exp() functions to transform2()
[imager.git] / lib / Imager / Regops.pm
CommitLineData
84324192
AMH
1# AUTOMATICALLY GENERATED BY regops.perl
2package Imager::Regops;
3use strict;
4require Exporter;
5use vars qw(@ISA @EXPORT @EXPORT_OK %Attr $MaxOperands $PackCode);
6@ISA = qw(Exporter);
7@EXPORT_OK = qw(%Attr $MaxOperands $PackCode);
8
9use constant RBC_ADD => 0;
10use constant RBC_SUBTRACT => 1;
11use constant RBC_MULT => 2;
12use constant RBC_DIV => 3;
13use constant RBC_MOD => 4;
14use constant RBC_POW => 5;
15use constant RBC_UMINUS => 6;
16use constant RBC_MULTP => 7;
17use constant RBC_ADDP => 8;
18use constant RBC_SUBTRACTP => 9;
19use constant RBC_SIN => 10;
20use constant RBC_COS => 11;
21use constant RBC_ATAN2 => 12;
22use constant RBC_SQRT => 13;
23use constant RBC_DISTANCE => 14;
24use constant RBC_GETP1 => 15;
25use constant RBC_GETP2 => 16;
26use constant RBC_GETP3 => 17;
27use constant RBC_VALUE => 18;
28use constant RBC_HUE => 19;
29use constant RBC_SAT => 20;
30use constant RBC_HSV => 21;
31use constant RBC_RED => 22;
32use constant RBC_GREEN => 23;
33use constant RBC_BLUE => 24;
34use constant RBC_RGB => 25;
35use constant RBC_INT => 26;
36use constant RBC_IF => 27;
37use constant RBC_IFP => 28;
38use constant RBC_LE => 29;
39use constant RBC_LT => 30;
40use constant RBC_GE => 31;
41use constant RBC_GT => 32;
42use constant RBC_EQ => 33;
43use constant RBC_NE => 34;
44use constant RBC_AND => 35;
45use constant RBC_OR => 36;
46use constant RBC_NOT => 37;
47use constant RBC_ABS => 38;
48use constant RBC_RET => 39;
49use constant RBC_JUMP => 40;
50use constant RBC_JUMPZ => 41;
51use constant RBC_JUMPNZ => 42;
52use constant RBC_SET => 43;
53use constant RBC_SETP => 44;
54use constant RBC_PRINT => 45;
e5744e01
TC
55use constant RBC_RGBA => 46;
56use constant RBC_HSVA => 47;
57use constant RBC_ALPHA => 48;
aed9d070
TC
58use constant RBC_LOG => 49;
59use constant RBC_EXP => 50;
60use constant RBC_OP_COUNT => 51;
84324192 61
aed9d070 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);
84324192
AMH
63
64%Attr = (
e5744e01
TC
65 'setp' => {
66 'result' => 'p',
b4e32feb 67 'parms' => 1,
e5744e01
TC
68 'opcode' => 44,
69 'func' => 0,
70 'types' => 'p'
b4e32feb 71 },
e5744e01
TC
72 'green' => {
73 'result' => 'r',
74 'parms' => 1,
75 'opcode' => 23,
76 'func' => 1,
77 'types' => 'p'
78 },
79 'abs' => {
80 'result' => 'r',
b4e32feb 81 'parms' => 1,
e5744e01 82 'opcode' => 38,
b4e32feb 83 'func' => 1,
e5744e01 84 'types' => 'r'
b4e32feb
AMH
85 },
86 'le' => {
e5744e01 87 'result' => 'r',
b4e32feb 88 'parms' => 2,
e5744e01
TC
89 'opcode' => 29,
90 'func' => 0,
91 'types' => 'rr'
b4e32feb 92 },
e5744e01
TC
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 },
b4e32feb 107 'ne' => {
e5744e01
TC
108 'result' => 'r',
109 'parms' => 2,
b4e32feb 110 'opcode' => 34,
e5744e01
TC
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',
b4e32feb 151 'parms' => 2,
e5744e01
TC
152 'opcode' => 30,
153 'func' => 0,
154 'types' => 'rr'
b4e32feb 155 },
e5744e01
TC
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'
b4e32feb
AMH
169 },
170 'atan2' => {
e5744e01
TC
171 'result' => 'r',
172 'parms' => 2,
b4e32feb 173 'opcode' => 12,
e5744e01
TC
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',
b4e32feb 186 'parms' => 2,
e5744e01
TC
187 'opcode' => 17,
188 'func' => 1,
189 'types' => 'rr'
190 },
191 'value' => {
192 'result' => 'r',
193 'parms' => 1,
194 'opcode' => 18,
84324192 195 'func' => 1,
e5744e01 196 'types' => 'p'
84324192
AMH
197 },
198 'subtractp' => {
e5744e01 199 'result' => 'p',
b4e32feb 200 'parms' => 2,
e5744e01
TC
201 'opcode' => 9,
202 'func' => 0,
203 'types' => 'pp'
84324192 204 },
e5744e01
TC
205 'ge' => {
206 'result' => 'r',
207 'parms' => 2,
208 'opcode' => 31,
209 'func' => 0,
210 'types' => 'rr'
211 },
212 'sat' => {
213 'result' => 'r',
84324192 214 'parms' => 1,
e5744e01 215 'opcode' => 20,
84324192 216 'func' => 1,
e5744e01 217 'types' => 'p'
84324192
AMH
218 },
219 'jump' => {
e5744e01
TC
220 'result' => undef,
221 'parms' => 0,
84324192 222 'opcode' => 40,
e5744e01
TC
223 'func' => 0,
224 'types' => ''
84324192 225 },
e5744e01
TC
226 'if' => {
227 'result' => 'r',
228 'parms' => 3,
229 'opcode' => 27,
230 'func' => 1,
231 'types' => 'rrr'
84324192
AMH
232 },
233 'div' => {
e5744e01 234 'result' => 'r',
b4e32feb 235 'parms' => 2,
e5744e01
TC
236 'opcode' => 3,
237 'func' => 0,
238 'types' => 'rr'
84324192 239 },
e5744e01
TC
240 'ifp' => {
241 'result' => 'p',
242 'parms' => 3,
243 'opcode' => 28,
84324192 244 'func' => 1,
e5744e01 245 'types' => 'rpp'
84324192 246 },
e5744e01
TC
247 'set' => {
248 'result' => 'r',
84324192 249 'parms' => 1,
e5744e01
TC
250 'opcode' => 43,
251 'func' => 0,
252 'types' => 'r'
84324192 253 },
e5744e01
TC
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 },
84324192 268 'sin' => {
e5744e01 269 'result' => 'r',
b4e32feb 270 'parms' => 1,
e5744e01 271 'opcode' => 10,
84324192 272 'func' => 1,
e5744e01 273 'types' => 'r'
84324192
AMH
274 },
275 'sqrt' => {
e5744e01 276 'result' => 'r',
b4e32feb 277 'parms' => 1,
e5744e01 278 'opcode' => 13,
84324192 279 'func' => 1,
e5744e01 280 'types' => 'r'
84324192 281 },
e5744e01
TC
282 'alpha' => {
283 'result' => 'r',
284 'parms' => 1,
285 'opcode' => 48,
286 'func' => 1,
287 'types' => 'p'
288 },
84324192 289 'distance' => {
e5744e01 290 'result' => 'r',
b4e32feb 291 'parms' => 4,
e5744e01 292 'opcode' => 14,
84324192 293 'func' => 1,
e5744e01 294 'types' => 'rrrr'
84324192 295 },
e5744e01
TC
296 'gt' => {
297 'result' => 'r',
84324192 298 'parms' => 2,
e5744e01
TC
299 'opcode' => 32,
300 'func' => 0,
301 'types' => 'rr'
b4e32feb 302 },
e5744e01
TC
303 'red' => {
304 'result' => 'r',
84324192 305 'parms' => 1,
e5744e01
TC
306 'opcode' => 22,
307 'func' => 1,
308 'types' => 'p'
84324192 309 },
e5744e01
TC
310 'rgb' => {
311 'result' => 'p',
84324192 312 'parms' => 3,
e5744e01 313 'opcode' => 25,
84324192 314 'func' => 1,
e5744e01 315 'types' => 'rrr'
84324192 316 },
e5744e01
TC
317 'hue' => {
318 'result' => 'r',
319 'parms' => 1,
320 'opcode' => 19,
321 'func' => 1,
322 'types' => 'p'
323 },
aed9d070
TC
324 'log' => {
325 'result' => 'r',
326 'parms' => 1,
327 'opcode' => 49,
328 'func' => 1,
329 'types' => 'r'
330 },
e5744e01
TC
331 'hsva' => {
332 'result' => 'p',
333 'parms' => 4,
334 'opcode' => 47,
335 'func' => 1,
336 'types' => 'rrrr'
337 },
338 'print' => {
339 'result' => undef,
84324192 340 'parms' => 1,
e5744e01
TC
341 'opcode' => 45,
342 'func' => 0,
343 'types' => 'r'
84324192 344 },
e5744e01
TC
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',
84324192 361 'parms' => 1,
e5744e01 362 'opcode' => 26,
84324192 363 'func' => 1,
e5744e01 364 'types' => 'r'
84324192 365 },
e5744e01
TC
366 'op_count' => {
367 'result' => undef,
368 'parms' => 0,
aed9d070 369 'opcode' => 51,
e5744e01
TC
370 'func' => 0,
371 'types' => ''
372 },
373 'or' => {
374 'result' => 'r',
84324192 375 'parms' => 2,
e5744e01
TC
376 'opcode' => 36,
377 'func' => 0,
378 'types' => 'rr'
84324192 379 },
e5744e01
TC
380 'jumpz' => {
381 'result' => undef,
382 'parms' => 1,
383 'opcode' => 41,
384 'func' => 0,
385 'types' => 'r'
386 },
387 'add' => {
388 'result' => 'r',
84324192 389 'parms' => 2,
e5744e01
TC
390 'opcode' => 0,
391 'func' => 0,
392 'types' => 'rr'
84324192 393 },
aed9d070
TC
394 'exp' => {
395 'result' => 'r',
396 'parms' => 1,
397 'opcode' => 50,
398 'func' => 1,
399 'types' => 'r'
400 },
e5744e01
TC
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',
84324192 417 'parms' => 3,
e5744e01 418 'opcode' => 21,
84324192 419 'func' => 1,
e5744e01
TC
420 'types' => 'rrr'
421 },
422 'uminus' => {
423 'result' => 'r',
424 'parms' => 1,
425 'opcode' => 6,
426 'func' => 0,
427 'types' => 'r'
428 }
84324192
AMH
429 );
430$MaxOperands = 4;
431$PackCode = "i";
4321;
433
434__END__
435
436=head1 NAME
437
438Imager::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
452This module is generated automatically from regmach.h so we don't need to
453maintain the same information in at least one extra place.
454
455At least that's the idea.
456
457=head1 AUTHOR
458
459Tony Cook, tony@develop-help.com
460
461=head1 SEE ALSO
462
aed9d070 463perl(1), Imager(3), http://imager.perl.org/~addi/perl/Imager/
84324192
AMH
464
465=cut
466