Skip to content

encode4, decode4

encode four integers into a single integer, and vice-versa.

Syntax

iencoded encode4 iint1, iint2, iint3, iint4
iint1, iint2, iint3, iint4 decode4 iencoded
iencoded = encode4(iint1, iint2, iint3, iint4)
iint1, iint2, iint3, iint4 decode4 iencoded

Usage

decode4 combines four integers into a single integer. The four numbers can be extracted again using decode4. encode4 and decode4 are used internally in cslc for handling patch instances. decode4/encode4 is a convenient way to pass around bound values without using a structured object (such as an array or struct).


Outputs and arguments

iencoded -- The encoded integer (also an integer).

iint1, iint2, iint3, iint4 -- Input/output integers.