temporary scaling test code, proper defaults for crop().
[imager.git] / lib / Imager / Regops.pm
index e4d2770..01712f1 100644 (file)
@@ -57,335 +57,335 @@ use constant RBC_OP_COUNT => 46;
 @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_OP_COUNT);
 
 %Attr = (
-          'setp' => {
-                      'result' => 'p',
-                      'parms' => 1,
-                      'opcode' => 44,
-                      'func' => 0,
-                      'types' => 'p'
-                    },
-          'green' => {
-                       'result' => 'r',
-                       'parms' => 1,
-                       'opcode' => 23,
-                       'func' => 1,
-                       'types' => 'p'
-                     },
-          'abs' => {
-                     'result' => 'r',
-                     'parms' => 1,
-                     'opcode' => 38,
-                     'func' => 1,
-                     'types' => 'r'
-                   },
-          'le' => {
-                    'result' => 'r',
-                    'parms' => 2,
-                    'opcode' => 29,
-                    'func' => 0,
-                    'types' => 'rr'
-                  },
-          'cos' => {
-                     'result' => 'r',
-                     'parms' => 1,
-                     'opcode' => 11,
-                     'func' => 1,
-                     'types' => 'r'
-                   },
-          'not' => {
-                     'result' => 'r',
-                     'parms' => 1,
-                     'opcode' => 37,
-                     'func' => 0,
-                     'types' => 'r'
-                   },
-          'ne' => {
-                    'result' => 'r',
-                    'parms' => 2,
-                    'opcode' => 34,
-                    'func' => 0,
-                    'types' => 'rr'
-                  },
-          'blue' => {
-                      'result' => 'r',
-                      'parms' => 1,
-                      'opcode' => 24,
-                      'func' => 1,
-                      'types' => 'p'
-                    },
-          'and' => {
-                     'result' => 'r',
-                     'parms' => 2,
-                     'opcode' => 35,
-                     'func' => 0,
-                     'types' => 'rr'
-                   },
-          'mult' => {
-                      'result' => 'r',
-                      'parms' => 2,
-                      'opcode' => 2,
-                      'func' => 0,
-                      'types' => 'rr'
-                    },
-          'pow' => {
-                     'result' => 'r',
-                     'parms' => 2,
-                     'opcode' => 5,
-                     'func' => 0,
-                     'types' => 'rr'
-                   },
-          'lt' => {
-                    'result' => 'r',
+          'or' => {
+                    'opcode' => 36,
                     'parms' => 2,
-                    'opcode' => 30,
-                    'func' => 0,
-                    'types' => 'rr'
+                    'func' => '0',
+                    'types' => 'rr',
+                    'result' => 'r'
                   },
-          'mod' => {
-                     'result' => 'r',
-                     'parms' => 2,
-                     'opcode' => 4,
-                     'func' => 0,
-                     'types' => 'rr'
-                   },
           'getp1' => {
-                       'result' => 'p',
-                       'parms' => 2,
                        'opcode' => 15,
-                       'func' => 1,
-                       'types' => 'rr'
-                     },
-          'atan2' => {
-                       'result' => 'r',
                        'parms' => 2,
-                       'opcode' => 12,
                        'func' => 1,
-                       'types' => 'rr'
+                       'types' => 'rr',
+                       'result' => 'p'
                      },
+          'uminus' => {
+                        'opcode' => 6,
+                        'parms' => 1,
+                        'func' => '0',
+                        'types' => 'r',
+                        'result' => 'r'
+                      },
           'getp2' => {
-                       'result' => 'p',
-                       'parms' => 2,
                        'opcode' => 16,
+                       'parms' => 2,
                        'func' => 1,
-                       'types' => 'rr'
+                       'types' => 'rr',
+                       'result' => 'p'
                      },
           'getp3' => {
-                       'result' => 'p',
-                       'parms' => 2,
                        'opcode' => 17,
+                       'parms' => 2,
                        'func' => 1,
-                       'types' => 'rr'
+                       'types' => 'rr',
+                       'result' => 'p'
                      },
-          'value' => {
-                       'result' => 'r',
+          'jumpnz' => {
+                        'opcode' => 42,
+                        'parms' => 1,
+                        'func' => '0',
+                        'types' => 'r',
+                        'result' => undef
+                      },
+          'op_count' => {
+                          'opcode' => 46,
+                          'parms' => '0',
+                          'func' => '0',
+                          'types' => '',
+                          'result' => undef
+                        },
+          'blue' => {
+                      'opcode' => 24,
+                      'parms' => 1,
+                      'func' => 1,
+                      'types' => 'p',
+                      'result' => 'r'
+                    },
+          'int' => {
+                     'opcode' => 26,
+                     'parms' => 1,
+                     'func' => 1,
+                     'types' => 'r',
+                     'result' => 'r'
+                   },
+          'le' => {
+                    'opcode' => 29,
+                    'parms' => 2,
+                    'func' => '0',
+                    'types' => 'rr',
+                    'result' => 'r'
+                  },
+          'multp' => {
+                       'opcode' => 7,
+                       'parms' => 2,
+                       'func' => '0',
+                       'types' => 'pr',
+                       'result' => 'p'
+                     },
+          'ne' => {
+                    'opcode' => 34,
+                    'parms' => 2,
+                    'func' => '0',
+                    'types' => 'rr',
+                    'result' => 'r'
+                  },
+          'jumpz' => {
+                       'opcode' => 41,
                        'parms' => 1,
-                       'opcode' => 18,
+                       'func' => '0',
+                       'types' => 'r',
+                       'result' => undef
+                     },
+          'atan2' => {
+                       'opcode' => 12,
+                       'parms' => 2,
                        'func' => 1,
-                       'types' => 'p'
+                       'types' => 'rr',
+                       'result' => 'r'
                      },
           'subtractp' => {
-                           'result' => 'p',
-                           'parms' => 2,
                            'opcode' => 9,
-                           'func' => 0,
-                           'types' => 'pp'
+                           'parms' => 2,
+                           'func' => '0',
+                           'types' => 'pp',
+                           'result' => 'p'
                          },
-          'ge' => {
-                    'result' => 'r',
-                    'parms' => 2,
-                    'opcode' => 31,
-                    'func' => 0,
-                    'types' => 'rr'
-                  },
-          'sat' => {
-                     'result' => 'r',
+          'rgb' => {
+                     'opcode' => 25,
+                     'parms' => 3,
+                     'func' => 1,
+                     'types' => 'rrr',
+                     'result' => 'p'
+                   },
+          'red' => {
+                     'opcode' => 22,
                      'parms' => 1,
-                     'opcode' => 20,
                      'func' => 1,
-                     'types' => 'p'
+                     'types' => 'p',
+                     'result' => 'r'
                    },
+          'setp' => {
+                      'opcode' => 44,
+                      'parms' => 1,
+                      'func' => '0',
+                      'types' => 'p',
+                      'result' => 'p'
+                    },
           'jump' => {
-                      'result' => undef,
-                      'parms' => 0,
                       'opcode' => 40,
-                      'func' => 0,
-                      'types' => ''
+                      'parms' => '0',
+                      'func' => '0',
+                      'types' => '',
+                      'result' => undef
                     },
-          'if' => {
-                    'result' => 'r',
-                    'parms' => 3,
-                    'opcode' => 27,
-                    'func' => 1,
-                    'types' => 'rrr'
+          'value' => {
+                       'opcode' => 18,
+                       'parms' => 1,
+                       'func' => 1,
+                       'types' => 'p',
+                       'result' => 'r'
+                     },
+          'mod' => {
+                     'opcode' => 4,
+                     'parms' => 2,
+                     'func' => '0',
+                     'types' => 'rr',
+                     'result' => 'r'
+                   },
+          'lt' => {
+                    'opcode' => 30,
+                    'parms' => 2,
+                    'func' => '0',
+                    'types' => 'rr',
+                    'result' => 'r'
                   },
+          'mult' => {
+                      'opcode' => 2,
+                      'parms' => 2,
+                      'func' => '0',
+                      'types' => 'rr',
+                      'result' => 'r'
+                    },
+          'hue' => {
+                     'opcode' => 19,
+                     'parms' => 1,
+                     'func' => 1,
+                     'types' => 'p',
+                     'result' => 'r'
+                   },
           'div' => {
-                     'result' => 'r',
-                     'parms' => 2,
                      'opcode' => 3,
-                     'func' => 0,
-                     'types' => 'rr'
+                     'parms' => 2,
+                     'func' => '0',
+                     'types' => 'rr',
+                     'result' => 'r'
                    },
-          'ifp' => {
-                     'result' => 'p',
-                     'parms' => 3,
-                     'opcode' => 28,
+          'cos' => {
+                     'opcode' => 11,
+                     'parms' => 1,
                      'func' => 1,
-                     'types' => 'rpp'
+                     'types' => 'r',
+                     'result' => 'r'
                    },
-          'set' => {
-                     'result' => 'r',
+          'subtract' => {
+                          'opcode' => 1,
+                          'parms' => 2,
+                          'func' => '0',
+                          'types' => 'rr',
+                          'result' => 'r'
+                        },
+          'sat' => {
+                     'opcode' => 20,
                      'parms' => 1,
-                     'opcode' => 43,
-                     'func' => 0,
-                     'types' => 'r'
+                     'func' => 1,
+                     'types' => 'p',
+                     'result' => 'r'
+                   },
+          'add' => {
+                     'opcode' => '0',
+                     'parms' => 2,
+                     'func' => '0',
+                     'types' => 'rr',
+                     'result' => 'r'
                    },
-          'eq' => {
-                    'result' => 'r',
-                    'parms' => 2,
-                    'opcode' => 33,
-                    'func' => 0,
-                    'types' => 'rr'
-                  },
-          'multp' => {
-                       'result' => 'p',
-                       'parms' => 2,
-                       'opcode' => 7,
-                       'func' => 0,
-                       'types' => 'pr'
-                     },
           'sin' => {
-                     'result' => 'r',
-                     'parms' => 1,
                      'opcode' => 10,
+                     'parms' => 1,
                      'func' => 1,
-                     'types' => 'r'
+                     'types' => 'r',
+                     'result' => 'r'
                    },
           'sqrt' => {
-                      'result' => 'r',
-                      'parms' => 1,
                       'opcode' => 13,
+                      'parms' => 1,
                       'func' => 1,
-                      'types' => 'r'
+                      'types' => 'r',
+                      'result' => 'r'
                     },
+          'ret' => {
+                     'opcode' => 39,
+                     'parms' => 1,
+                     'func' => '0',
+                     'types' => 'p',
+                     'result' => undef
+                   },
           'distance' => {
-                          'result' => 'r',
-                          'parms' => 4,
                           'opcode' => 14,
+                          'parms' => 4,
                           'func' => 1,
-                          'types' => 'rrrr'
+                          'types' => 'rrrr',
+                          'result' => 'r'
                         },
-          'gt' => {
-                    'result' => 'r',
+          'set' => {
+                     'opcode' => 43,
+                     'parms' => 1,
+                     'func' => '0',
+                     'types' => 'r',
+                     'result' => 'r'
+                   },
+          'ge' => {
+                    'opcode' => 31,
                     'parms' => 2,
-                    'opcode' => 32,
-                    'func' => 0,
-                    'types' => 'rr'
+                    'func' => '0',
+                    'types' => 'rr',
+                    'result' => 'r'
                   },
-          'red' => {
-                     'result' => 'r',
+          'print' => {
+                       'opcode' => 45,
+                       'parms' => 1,
+                       'func' => '0',
+                       'types' => 'r',
+                       'result' => undef
+                     },
+          'if' => {
+                    'opcode' => 27,
+                    'parms' => 3,
+                    'func' => 1,
+                    'types' => 'rrr',
+                    'result' => 'r'
+                  },
+          'not' => {
+                     'opcode' => 37,
                      'parms' => 1,
-                     'opcode' => 22,
-                     'func' => 1,
-                     'types' => 'p'
+                     'func' => '0',
+                     'types' => 'r',
+                     'result' => 'r'
                    },
-          'rgb' => {
-                     'result' => 'p',
+          'hsv' => {
+                     'opcode' => 21,
                      'parms' => 3,
-                     'opcode' => 25,
-                     'func' => 1,
-                     'types' => 'rrr'
-                   },
-          'hue' => {
-                     'result' => 'r',
-                     'parms' => 1,
-                     'opcode' => 19,
                      'func' => 1,
-                     'types' => 'p'
+                     'types' => 'rrr',
+                     'result' => 'p'
                    },
-          'print' => {
-                       'result' => undef,
+          'green' => {
+                       'opcode' => 23,
                        'parms' => 1,
-                       'opcode' => 45,
-                       'func' => 0,
-                       'types' => 'r'
+                       'func' => 1,
+                       'types' => 'p',
+                       'result' => 'r'
                      },
-          'jumpnz' => {
-                        'result' => undef,
-                        'parms' => 1,
-                        'opcode' => 42,
-                        'func' => 0,
-                        'types' => 'r'
-                      },
-          'addp' => {
-                      'result' => 'p',
-                      'parms' => 2,
-                      'opcode' => 8,
-                      'func' => 0,
-                      'types' => 'pp'
-                    },
-          'int' => {
-                     'result' => 'r',
+          'and' => {
+                     'opcode' => 35,
+                     'parms' => 2,
+                     'func' => '0',
+                     'types' => 'rr',
+                     'result' => 'r'
+                   },
+          'abs' => {
+                     'opcode' => 38,
                      'parms' => 1,
-                     'opcode' => 26,
                      'func' => 1,
-                     'types' => 'r'
+                     'types' => 'r',
+                     'result' => 'r'
                    },
-          'op_count' => {
-                          'result' => undef,
-                          'parms' => 0,
-                          'opcode' => 46,
-                          'func' => 0,
-                          'types' => ''
-                        },
-          'or' => {
-                    'result' => 'r',
+          'eq' => {
+                    'opcode' => 33,
                     'parms' => 2,
-                    'opcode' => 36,
-                    'func' => 0,
-                    'types' => 'rr'
+                    'func' => '0',
+                    'types' => 'rr',
+                    'result' => 'r'
                   },
-          'jumpz' => {
-                       'result' => undef,
-                       'parms' => 1,
-                       'opcode' => 41,
-                       'func' => 0,
-                       'types' => 'r'
-                     },
-          'add' => {
-                     'result' => 'r',
+          'pow' => {
+                     'opcode' => 5,
                      'parms' => 2,
-                     'opcode' => 0,
-                     'func' => 0,
-                     'types' => 'rr'
-                   },
-          'subtract' => {
-                          'result' => 'r',
-                          'parms' => 2,
-                          'opcode' => 1,
-                          'func' => 0,
-                          'types' => 'rr'
-                        },
-          'ret' => {
-                     'result' => undef,
-                     'parms' => 1,
-                     'opcode' => 39,
-                     'func' => 0,
-                     'types' => 'p'
+                     'func' => '0',
+                     'types' => 'rr',
+                     'result' => 'r'
                    },
-          'hsv' => {
-                     'result' => 'p',
+          'addp' => {
+                      'opcode' => 8,
+                      'parms' => 2,
+                      'func' => '0',
+                      'types' => 'pp',
+                      'result' => 'p'
+                    },
+          'gt' => {
+                    'opcode' => 32,
+                    'parms' => 2,
+                    'func' => '0',
+                    'types' => 'rr',
+                    'result' => 'r'
+                  },
+          'ifp' => {
+                     'opcode' => 28,
                      'parms' => 3,
-                     'opcode' => 21,
                      'func' => 1,
-                     'types' => 'rrr'
-                   },
-          'uminus' => {
-                        'result' => 'r',
-                        'parms' => 1,
-                        'opcode' => 6,
-                        'func' => 0,
-                        'types' => 'r'
-                      }
+                     'types' => 'rpp',
+                     'result' => 'p'
+                   }
         );
 $MaxOperands = 4;
 $PackCode = "i";