sub_arctic.constraints
Interface std_encoding_consts

All Known Implementing Classes:
op3_impl, ext_objpart_encoding, op0_impl, std_function, std_objpart_encoding, std_constraint_impl, op1_impl, ext_maker, op2_impl, ext_test

public abstract interface std_encoding_consts

Interface to define standard constraint encoding constants. Important note: you don't normally need to know or use these internal encodings. Instead you can use the std_constraint_consts interface and std_function class which hides all the internals behind a nicer API.

Constraints with 0, 1, 2, or 3 operands are supported. Operands (depended upon object parts) are encoded in 6 bits with a code indicating which object in the upper 3 bits and a part code in the lower 3. Objects that can be depended upon include: self, parent, previous sibling, next sibling, first child, last child, min child, and max child. Parts of those objects that can be depended upon include: x, y, x2 (right), y2 (bottom), w, h, horizontal center, vertical center, visible, enabled, part_a (object specific), and part_b (object specific).

Constraints are internally encoded as follows:

      8        6      6      6       5
   KKKKKKKK AAAAAA BBBBBB CCCCCC 0 00000   clip(A, B+K, C-K) 
   KKKKKKKK AAAAAA BBBBBB CCCCCC 1 00000   wrap(A, B+K, C-K) 
                                             [K is 8 bit unsigned]

             16          6     5     5
     KKKKKKKKKKKKKKKK XXXXXX 00000 00001   64 0 operand operations
                                             [K is 16 bit signed]
             16          6     5     5
     KKKKKKKKKKKKKKKK AAAAAA 00001 00001   31 1 operand operations
                              ...            [K is 16 bit signed]
     KKKKKKKKKKKKKKKK AAAAAA 11111 00001   

            15          6      6     5
     KKKKKKKKKKKKKKK AAAAAA BBBBBB 00010   30 2 operand operations 
                              ...            [K is 15 bit signed]
     KKKKKKKKKKKKKKK AAAAAA BBBBBB 11111   
 
Where KKK represents a constant, AAA, BBB, and CCC represent parameter objects, and XXX represents bits used to encode an op code.


Field Summary
static int EXTERNAL_TEST_MASK
          Mask for testing external.
static int EXTERNAL_TEST_VAL
          Value for testing external.
static int HORIZONTAL
          Orientation code indicating horizontal constraint.
static int NONE_TEST_MASK
          Mask for testing none.
static int NONE_TEST_VAL
          Value for testing none.
static int NOT_ORIENTED
          Orientation code indicating constraint that is neither horizontal or vertical in nature.
static int OBJCODE_FIRST_CHILD
          Code to reference local neighborhood object: first child
static int OBJCODE_LAST_CHILD
          Code to reference local neighborhood object: last child
static int OBJCODE_MASK
          Mask for accessing object code in object/part encoding.
static int OBJCODE_MAX
          Largest valid object code.
static int OBJCODE_MAX_CHILD
          Code to compute the maximum of some part among child objects
static int OBJCODE_MIN_CHILD
          Code to compute the minimum of some part among child objects
static int OBJCODE_NEXT_SIBLING
          Code to reference local neighborhood object: next sibling
static int OBJCODE_PARENT
          Code to reference local neighborhood object: parent
static int OBJCODE_PREV_SIBLING
          Code to reference local neighborhood object: previous sibling
static int OBJCODE_SELF
          Code to reference local neighborhood object: self
static int OBJCODE_SHIFT
          Shift value for accessing object code in object/part encoding.
static int OBJCODE_SOME_CHILD
          Special object code to designate some child object during mark out-of-date phase.
static java.lang.String[] OBJCODE_strings
          Table of strings for object code names.
static java.lang.String[] OBJCODE_tags
          Table of very terse strings for object code names.
static int OBJPART_MASK
          Mask to limit an encode to just the low order 6 bits (for an object/part encoding.
static int OP_add
          Op code for A + B + K
static int OP_and
          Op code for A & B & (K | 0xffff8000)
static int OP_ave
          Op code for (A + B)/2 + K
static int OP_centered
          Op code for (A-self.wh)/2 + K
static int OP_clip
          Op code for clip(A, B+K, C-K)
static int OP_div
          Op code for A / B + K
static int OP_external
          Op code that indicates a separate external (or heavyweight) constraint is being applied.
static int OP_far_edge_just
          Op code for A - self.wh - K
static int OP_fill
          Op code for B - A - K
static int OP_if_enabled
          Op code for (if enabled then A else B) + K
static int OP_if_visible
          Op code for (if visible then A else B) + K
static int OP_konst
          Op code for a constant constraint
static int OP_mask
          Op code for A & (K|0xffff0000)
static int OP_max
          Op code for max(A, B) + K
static int OP_min
          Op code for min(A, B) + K
static int OP_mod
          Op code for A % B + K
static int OP_mult
          Op code for A * B + K
static int OP_NONE
          Special op code that indicates that no constraint should be applied
static int OP_not_mask
          Op code for ~A & (K|0xffff0000)
static int OP_offset
          Op code for A + K
static int OP_or
          Op code for (A | B) & (K | 0xffff8000)
static int OP_parent_fun1
          Op code for parent.fun1(A,K)
static int OP_parent_fun2
          Op code for parent.fun2(A, B, K)
static int OP_rotx
          Op code for rotate_x(theta, B)+K
static int OP_roty
          Op code for rotate_y(theta, B)+K
static int OP_self_fun1
          Op code for self.fun1(A,K)
static int OP_self_fun2
          Op code for self.fun2(A, B, K)
static int OP_subtract
          Op code for A - B + K
static int OP_wrap
          Op code for wrap(A, B+K, C-K)
static int OP_xor
          Op code for A ^ B) & (K | 0xffff8000)
static int OP0_LOBITS
          Fixed low order bits for 0-op constraint encoding.
static int OP0_MASK
          Mask value for extracting op codes from 0-op constraints.
static int OP0_MAX
          Largest valid 0-op op code
static int OP0_MIN
          Lowest valid 0-op op code
static int OP0_SHIFT
          Shift value for extracting op codes from 0-op constraints.
static java.lang.String[] OP0_strings
          Table of strings for 0-op op code names
static java.lang.String[] OP0_tags
          Table of terse strings for 0-op op code names
static int OP1_LOBITS
          Fixed low order bits for 1-op constraint encoding.
static int OP1_MASK
          Mask value for extracting op codes from 1-op constraints.
static int OP1_MAX
          Largest valid 1-op op code
static int OP1_MIN
          Lowest valid 1-op op code
static int OP1_SHIFT
          Shift value for extracting op codes from 1-op constraints.
static java.lang.String[] OP1_strings
          Table of op code name strings
static java.lang.String[] OP1_tags
          Table of terse op code name strings
static int OP2_LOBITS
          Fixed low order bits for 2-op constraint encoding.
static int OP2_MASK
          Mask value for extracting op codes from 2-op constraints.
static int OP2_MAX
          The largest valid 2-op op code
static int OP2_MIN
          Lowest valid 2-op op code
static int OP2_SHIFT
          Shift value for extracting op codes from 2-op constraints.
static java.lang.String[] OP2_strings
          Table of op code name strings.
static java.lang.String[] OP2_tags
          Table of terse op code name strings.
static int OP3_LOBITS
          Fixed low order bits for 3-op constraint encoding.
static int OP3_MASK
          Mask value for extracting op codes from 3-op constraints.
static int OP3_MAX
          Highest valid 3-op op code
static int OP3_MIN
          Lowest valid 3-op op code
static int OP3_SHIFT
          Shift value for extracting op codes from 3-op constraints.
static java.lang.String[] OP3_strings
          Table of op code name strings
static java.lang.String[] OP3_tags
          Table of terse op code name strings
static int PARTCODE_CENTER
          Code to reference the horizontal or vertical center of an object (which is x+w/2 or y+h/2).
static int PARTCODE_ENABLED
          Code to reference the enabled part of an object
static int PARTCODE_MASK
          Mask to extract part code from object/part encoding.
static int PARTCODE_MAX
          Largest valid part code
static int PARTCODE_PART_A
          Code to reference the part_a part of an object
static int PARTCODE_PART_B
          Code to reference the part_b part of an object
static int PARTCODE_SHIFT
          Shift value to extract part code from object/part encoding.
static java.lang.String[] PARTCODE_strings_h
          Table of strings for horizontal part names.
static java.lang.String[] PARTCODE_strings_v
          Table of strings for vertical part names.
static java.lang.String[] PARTCODE_tags_h
          Table of very terse strings for horizontal part names.
static java.lang.String[] PARTCODE_tags_v
          Table of very terse strings for vertical part names.
static int PARTCODE_VISIBLE
          Code to reference the visible part of an object
static int PARTCODE_WH
          Code to reference the w or h part of an object
static int PARTCODE_XY
          Code to reference the x or y part of an object.
static int PARTCODE_XY2
          Code to reference the x2 or y2 part of an object (which is x+w or y+h).
static int VERTICAL
          Orientation code indicating vertical constraint.
 

Field Detail

HORIZONTAL

public static final int HORIZONTAL
Orientation code indicating horizontal constraint.

VERTICAL

public static final int VERTICAL
Orientation code indicating vertical constraint.

NOT_ORIENTED

public static final int NOT_ORIENTED
Orientation code indicating constraint that is neither horizontal or vertical in nature.

OBJCODE_SELF

public static final int OBJCODE_SELF
Code to reference local neighborhood object: self

OBJCODE_PARENT

public static final int OBJCODE_PARENT
Code to reference local neighborhood object: parent

OBJCODE_FIRST_CHILD

public static final int OBJCODE_FIRST_CHILD
Code to reference local neighborhood object: first child

OBJCODE_LAST_CHILD

public static final int OBJCODE_LAST_CHILD
Code to reference local neighborhood object: last child

OBJCODE_MAX_CHILD

public static final int OBJCODE_MAX_CHILD
Code to compute the maximum of some part among child objects

OBJCODE_MIN_CHILD

public static final int OBJCODE_MIN_CHILD
Code to compute the minimum of some part among child objects

OBJCODE_PREV_SIBLING

public static final int OBJCODE_PREV_SIBLING
Code to reference local neighborhood object: previous sibling

OBJCODE_NEXT_SIBLING

public static final int OBJCODE_NEXT_SIBLING
Code to reference local neighborhood object: next sibling

OBJCODE_MAX

public static final int OBJCODE_MAX
Largest valid object code.

OBJCODE_MASK

public static final int OBJCODE_MASK
Mask for accessing object code in object/part encoding. Object is accessed as (enc >> OBJCODE_SHIFT) & OBJCODE_MASK.

OBJCODE_SHIFT

public static final int OBJCODE_SHIFT
Shift value for accessing object code in object/part encoding. Object is accessed as (enc >> OBJCODE_SHIFT) & OBJCODE_MASK.

OBJCODE_SOME_CHILD

public static final int OBJCODE_SOME_CHILD
Special object code to designate some child object during mark out-of-date phase. This in not used in encoding of constraints.

OBJCODE_strings

public static final java.lang.String[] OBJCODE_strings
Table of strings for object code names.

OBJCODE_tags

public static final java.lang.String[] OBJCODE_tags
Table of very terse strings for object code names.

PARTCODE_XY

public static final int PARTCODE_XY
Code to reference the x or y part of an object.

PARTCODE_XY2

public static final int PARTCODE_XY2
Code to reference the x2 or y2 part of an object (which is x+w or y+h).

PARTCODE_WH

public static final int PARTCODE_WH
Code to reference the w or h part of an object

PARTCODE_CENTER

public static final int PARTCODE_CENTER
Code to reference the horizontal or vertical center of an object (which is x+w/2 or y+h/2).

PARTCODE_VISIBLE

public static final int PARTCODE_VISIBLE
Code to reference the visible part of an object

PARTCODE_ENABLED

public static final int PARTCODE_ENABLED
Code to reference the enabled part of an object

PARTCODE_PART_A

public static final int PARTCODE_PART_A
Code to reference the part_a part of an object

PARTCODE_PART_B

public static final int PARTCODE_PART_B
Code to reference the part_b part of an object

PARTCODE_MAX

public static final int PARTCODE_MAX
Largest valid part code

PARTCODE_MASK

public static final int PARTCODE_MASK
Mask to extract part code from object/part encoding. The part is found using (enc>>PARTCODE_SHIFT) & PARTCODE_MASK.

PARTCODE_SHIFT

public static final int PARTCODE_SHIFT
Shift value to extract part code from object/part encoding. The part is found using (enc>>PARTCODE_SHIFT) & PARTCODE_MASK.

PARTCODE_strings_h

public static final java.lang.String[] PARTCODE_strings_h
Table of strings for horizontal part names.

PARTCODE_strings_v

public static final java.lang.String[] PARTCODE_strings_v
Table of strings for vertical part names.

PARTCODE_tags_h

public static final java.lang.String[] PARTCODE_tags_h
Table of very terse strings for horizontal part names.

PARTCODE_tags_v

public static final java.lang.String[] PARTCODE_tags_v
Table of very terse strings for vertical part names.

OBJPART_MASK

public static final int OBJPART_MASK
Mask to limit an encode to just the low order 6 bits (for an object/part encoding.

OP3_SHIFT

public static final int OP3_SHIFT
Shift value for extracting op codes from 3-op constraints. An op code of this type can be accessed via: (enc & OP3_MASK) >> OP3_SHIFT.

OP3_MASK

public static final int OP3_MASK
Mask value for extracting op codes from 3-op constraints. An op code of this type can be accessed via: (enc & OP3_MASK) >> OP3_SHIFT.

OP3_LOBITS

public static final int OP3_LOBITS
Fixed low order bits for 3-op constraint encoding.

OP3_MIN

public static final int OP3_MIN
Lowest valid 3-op op code

OP_clip

public static final int OP_clip
Op code for clip(A, B+K, C-K)

OP_wrap

public static final int OP_wrap
Op code for wrap(A, B+K, C-K)

OP3_MAX

public static final int OP3_MAX
Highest valid 3-op op code

OP3_strings

public static final java.lang.String[] OP3_strings
Table of op code name strings

OP3_tags

public static final java.lang.String[] OP3_tags
Table of terse op code name strings

OP0_SHIFT

public static final int OP0_SHIFT
Shift value for extracting op codes from 0-op constraints. An op code of this type can be accessed via: (enc & OP0_MASK) >> OP0_SHIFT.

OP0_MASK

public static final int OP0_MASK
Mask value for extracting op codes from 0-op constraints. An op code of this type can be accessed via: (enc & OP0_MASK) >> OP0_SHIFT.

OP0_LOBITS

public static final int OP0_LOBITS
Fixed low order bits for 0-op constraint encoding.

OP0_MIN

public static final int OP0_MIN
Lowest valid 0-op op code

OP_NONE

public static final int OP_NONE
Special op code that indicates that no constraint should be applied

OP_external

public static final int OP_external
Op code that indicates a separate external (or heavyweight) constraint is being applied.

OP_konst

public static final int OP_konst
Op code for a constant constraint

OP0_MAX

public static final int OP0_MAX
Largest valid 0-op op code

OP0_strings

public static final java.lang.String[] OP0_strings
Table of strings for 0-op op code names

OP0_tags

public static final java.lang.String[] OP0_tags
Table of terse strings for 0-op op code names

NONE_TEST_MASK

public static final int NONE_TEST_MASK
Mask for testing none. Test is "(enc & NONE_TEST_MASK)==NONE_TEST_VAL"

NONE_TEST_VAL

public static final int NONE_TEST_VAL
Value for testing none. Test is "(enc & NONE_TEST_MASK)==NONE_TEST_VAL"

EXTERNAL_TEST_MASK

public static final int EXTERNAL_TEST_MASK
Mask for testing external. Test is "(enc & EXTERNAL_TEST_MASK) == EXTERNAL_TEST_VAL

EXTERNAL_TEST_VAL

public static final int EXTERNAL_TEST_VAL
Value for testing external. Test is "(enc & EXTERNAL_TEST_MASK) == EXTERNAL_TEST_VAL"

OP1_SHIFT

public static final int OP1_SHIFT
Shift value for extracting op codes from 1-op constraints. An op code of this type can be accessed via: (enc & OP1_MASK) >> OP1_SHIFT.

OP1_MASK

public static final int OP1_MASK
Mask value for extracting op codes from 1-op constraints. An op code of this type can be accessed via: (enc & OP1_MASK) >> OP1_SHIFT.

OP1_LOBITS

public static final int OP1_LOBITS
Fixed low order bits for 1-op constraint encoding.

OP1_MIN

public static final int OP1_MIN
Lowest valid 1-op op code

OP_self_fun1

public static final int OP_self_fun1
Op code for self.fun1(A,K)

OP_parent_fun1

public static final int OP_parent_fun1
Op code for parent.fun1(A,K)

OP_not_mask

public static final int OP_not_mask
Op code for ~A & (K|0xffff0000)

OP_mask

public static final int OP_mask
Op code for A & (K|0xffff0000)

OP_centered

public static final int OP_centered
Op code for (A-self.wh)/2 + K

OP_offset

public static final int OP_offset
Op code for A + K

OP_far_edge_just

public static final int OP_far_edge_just
Op code for A - self.wh - K

OP1_MAX

public static final int OP1_MAX
Largest valid 1-op op code

OP1_strings

public static final java.lang.String[] OP1_strings
Table of op code name strings

OP1_tags

public static final java.lang.String[] OP1_tags
Table of terse op code name strings

OP2_SHIFT

public static final int OP2_SHIFT
Shift value for extracting op codes from 2-op constraints. An op code of this type can be accessed via: (enc & OP2_MASK) >> OP2_SHIFT.

OP2_MASK

public static final int OP2_MASK
Mask value for extracting op codes from 2-op constraints. An op code of this type can be accessed via: (enc & OP2_MASK) >> OP2_SHIFT.

OP2_LOBITS

public static final int OP2_LOBITS
Fixed low order bits for 2-op constraint encoding.

OP2_MIN

public static final int OP2_MIN
Lowest valid 2-op op code

OP_add

public static final int OP_add
Op code for A + B + K

OP_subtract

public static final int OP_subtract
Op code for A - B + K

OP_mult

public static final int OP_mult
Op code for A * B + K

OP_div

public static final int OP_div
Op code for A / B + K

OP_mod

public static final int OP_mod
Op code for A % B + K

OP_and

public static final int OP_and
Op code for A & B & (K | 0xffff8000)

OP_or

public static final int OP_or
Op code for (A | B) & (K | 0xffff8000)

OP_xor

public static final int OP_xor
Op code for A ^ B) & (K | 0xffff8000)

OP_min

public static final int OP_min
Op code for min(A, B) + K

OP_max

public static final int OP_max
Op code for max(A, B) + K

OP_ave

public static final int OP_ave
Op code for (A + B)/2 + K

OP_rotx

public static final int OP_rotx
Op code for rotate_x(theta, B)+K

OP_roty

public static final int OP_roty
Op code for rotate_y(theta, B)+K

OP_if_enabled

public static final int OP_if_enabled
Op code for (if enabled then A else B) + K

OP_if_visible

public static final int OP_if_visible
Op code for (if visible then A else B) + K

OP_self_fun2

public static final int OP_self_fun2
Op code for self.fun2(A, B, K)

OP_parent_fun2

public static final int OP_parent_fun2
Op code for parent.fun2(A, B, K)

OP_fill

public static final int OP_fill
Op code for B - A - K

OP2_MAX

public static final int OP2_MAX
The largest valid 2-op op code

OP2_strings

public static final java.lang.String[] OP2_strings
Table of op code name strings.

OP2_tags

public static final java.lang.String[] OP2_tags
Table of terse op code name strings.