VEC_UNPACKH(ARG1)

Purpose

Unpacks the most significant ("high") half of a vector into a vector with larger elements.

Class

Elemental function

Argument type and attributes

ARG1
An INTENT(IN) INTEGER(1) vector, INTEGER(2) vector, or pixel vector.

Result type and attributes

If ARG1 is an INTEGER(1) vector, then the result is an INTEGER(2) vector. If ARG1 is an INTEGER(2) vector, then the result is an INTEGER(4) vector. If ARG1 is a pixel vector, then the result is an UNSIGNED(4) vector.

Result value

If ARG1 is an integer vector, then the value of each element of the result is the value of the corresponding element of the most significant half of ARG1. If ARG1 is a pixel vector, then the value of each element of the result is taken from the corresponding element of the most significant half of ARG1 as follows: all bits in the first byte of the element of the result are set to the value of the first bit of the element of ARG1; the least significant 5 bits of the second byte of the element of the result are set to the value of the next 5 bits in the element of ARG1; the least significant 5 bits of the third byte of the element of the result are set to the value of the next 5 bits in the element of ARG1; the least significant 5 bits of the fourth byte of the element of the result are set to the value of the next 5 bits in the element of ARG1.