FDPICDECODE(3H) — Pixar Programmer’s Manual — libfdpicio
NAME
FdpicPreDecodeScanline − start decoding a picture tile of a fast disk picio file
FdpicDecodeScanline − decode a picture scanline of a fast disk picio file
FdpicPostDecodeScanline − finish decoding a picture tile of a fast disk picio file
SYNOPSIS
#include <fdpicio.h>
FdpicPreDecodeScanline(channel, tilenumber)
PFILE ∗channel;
long tilenumber;
char ∗
FdpicDecodeScanline(channel, ptr)
PFILE ∗channel;
RGBAPixelType ∗ptr;
FdpicPostDecodeScanline(channel)
PFILE ∗channel;
DESCRIPTION
These routines are offered as an alternative to the FdPicReadBuffer routine, described elsewhere, which converts one entire tile from disk to memory buffer. These routines allow the sequential decoding of individual scanlines of a tile from disk to a scanline memory buffer. These routines are fragile in the sense that the described order must be followed exactly to produce a correctly decoded picture. If a tile has width w and height h, there should be an RGBAPixelType buffer of w pixels. There should be one call to FdpicPreDecodeScanline, h calls to FdpicDecodeScanline, and one call to FdpicPostDecodeScanline.
FdpicPreDecodeScanline initiates the decoding of a tile with tile number tilenumber in the picture header. Note that tile numbers begin at zero. Zero is returned if the tile does not exist. It is very possible to create pictures with some tiles missing. Whether this means “all pixels black” or “no picture at all” is your choice. FdpicDecodeScanline decodes the next scanline of the named picture output channel into a scanline RGBA buffer beginning at ptr. A global variable FdpicDecodeEmpty is set non-zero if the decoded scanline has an alpha channel that is zero everywhere. A global variable FdpicDecodeFull is set non-zero if the decoded scanline has an alpha channel that is unity everywhere. Because the alpha channel defaults to unity, the decoding of any picture not including alpha will force picDecodeFull on at every scanline. FdpicDecodeScanline returns a char pointer, which should point beyond the last pixel of the scanline buffer.
FdpicPostDecodeScanline ends the decoding of this tile.
LIBRARY
libfdpicio.a
SEE ALSO
libfdpicio (3H)− overview of the picio library
FdPicClose (3H), FdPicCreat (3H), FdPicLabel (3H), FdPicRead (3H), FdPicEncode (3H).
BUGS
Abuse of the lseek pointer into the open picture file may wreak havoc.
DIAGNOSTICS
FdpicPreDecodeScanline will return 0 if the tilenumber is bad or internal buffer space cannot be allocated. FdpicDecodeScanline will return 0 if FdpicPreDecodeScanline has not been called or if we reach the end of file in the midst of decoding. FdpicPostDecodeScanline will return 0 if the number of calls to picDecodeScanline is not equal to the height of the tile.
Release β — Last change: 8/3/88