RCODE_DEPTH

NAME
SYNOPSIS
DESCRIPTION
EXAMPLES
AUTHOR
SEE ALSO

NAME

rcode_depth - encode/decode 16-bit depth map

SYNOPSIS

rcode_depth [ -d ref_depth/unit ][ -h[io] ][ -H[io] ][ -f[afd] ][ -x xr -y yr ] [ input [output.dpt] ]
rcode_depth
{ -r | -p } [ -i ][ -u ][ -h[io] ][ -H[io] ][ -f[afd] ] [ input.dpt [output] ]

DESCRIPTION

Rcode_depth reads a map of depth values from 0 to infinity and encodes them in an efficient 16-bit/pixel format for storage. Input is taken from the first named file, or standard input if no files are given. Output is sent to the second named file, or standard output if none.

The -d option specifies a reference distance with an optional unit after a slash separator (’/’). (E.g., "1/meter" for diopters.) This distance should roughly correspond to the average depths on the input, as it sets the threshold between a linear near-field and a reciprocal far-field range. The default value is 1.0, with no specified units.

The -hi option tells rcode_depth not to expect an information header on its input. The -ho option tells rcode_depth not to produce an information header on its output. Specifying -h turns both input and output headers off. Similarly, the -Hi option says not to expect an image resolution string on input, the -Ho option says not to produce one on output, and -H applies both. The -x and -y options give the horizontal and vertical map dimensions, respectively. If provided, then an input resolution string will not be expected.

The default input format is ASCII (user-readable) real values, corresponding to the -fa option. The -ff option tells rcode_depth to expect binary, 32-bit floating-point values per depth on its input, instead. The -fd option tells it to expect 64-bit/pixel binary input.

The second form applies either the -r option to decode from 16-bit depths to the desired format, or the -p option to compute world intersection points from view parameters in the encoded depth file header. The output format is specified with the -f option as described above. The -h and -H options have the same behavior as before.

When decoding, the -i option further tells rcode_depth to produce one depth or world point for each integer input pair specifying the horizontal and vertical coordinates of a particular pixel, where x is measured from 0 on the left and y from 0 at the bottom in the standard orientation. Note that -i requires that an encoded depth file name be given on the command line, since the pixel coordinates are read from the standard input. Also, the -H option is not supported with -i, since the map dimensions are required on the input and not copied to the output. If the -u option is also given, output will be flushed after each coordinate pair.

EXAMPLES

To store first surface intersection distances out of rtrace:

rtrace -ff < rays.flt -x 512 -y 400 -oL octree | rcode_depth -ff > first.dpt

To query world intersection points using ximage with the ’t’ command:

ximage -op render.hdr | rcode_depth -i -p first.dpt

AUTHOR

Greg Ward

SEE ALSO

rcalc(1), rcode_ident(1), rcode_norm(1), rcode2bmp(1), rcrop(1), rlam(1), rsplit(1), rtpict(1)