Previous: x/ zvhost Up: Miscellaneous Routines Next: x/ zvpixsizeb
status = xvpixsize(pixsize, type, ihost, rhost) status = zvpixsize(pixsize, type, ihost, rhost);
Returns the size of a pixel in bytes given the data type and host representation. One of the pixsize routines should be used to figure out the size of a pixel. Do not assume any particular size, like 4 bytes for a REAL. It may be different on other machines. It is valid to use sizeof() in C to get the size of a pixel in the native representation only, but the pixsize routines are the only valid way to get the size of a pixel on any other hosts.
Arguments:
Returns the size of a pixel in bytes. If an error occurs (such as an invalid data type), PIXSIZE is returned as 0.
TYPE is the data type of the pixel. It corresponds to the FORMAT label item in a file. It may be one of the standard VICAR data types: ``BYTE'', ``HALF'', ``FULL'', ``REAL'', ``DOUB'', or ``COMP''. The types ``WORD'', ``LONG'', and ``COMPLEX'' are also accepted, but are obsolete and should not be used.
IHOST is the integral host representation for the pixel. It corresponds to the INTFMT label item in a file. It may be any of the supported integer data types, which are listed in Table . It may also be ``NATIVE'' or ``LOCAL'', both of which mean the native host INTFMT. Note that IHOST should be given even if you are dealing with floating-point data types.
RHOST is the floating-point host representation for the pixel. It corresponds to the REALFMT label item in a file. It may be any of the supported floating-point data types, which are listed in Table . It may also be ``NATIVE'' or ``LOCAL'', both of which mean the native host REALFMT. Note that RHOST should be given even if you are dealing with integral data types.