MAN page from Mandrake Other XITE-3.3-3.i386.rpm
COLORFILE
Section: C Library Functions (3)
Updated: 16 Mar 1998
Index
NAME
colorfile, color_convertfromimg, color_create, color_read,color_write, PrintColortable, read_colormap - Read, write andcreate colortables and colormaps
SYNTAX
#include <
xite/color.h>
IMAGE color_create( Color_tab coltab,
char* name, int len );
BiffStatus color_read( char* file_name,
Color_tab coltab, char** name, int* len );
BiffStatus color_write( char* file_name,
Color_tab coltab, char* name, int len );
BiffStatus color_convertfromimg( IMAGE img,
Color_tab coltab, char** name, int* len );
void PrintColortable( Color_cell* col, int len,
int hex, FILE* fileptr );
void read_colormap( FILE *file, Color_cell *ctab,
int *len );
DESCRIPTION
color_createreturns an IMAGE containing thecolortab (or NULL if error).
color_readreads a colortable from file file_nameinto coltab.The name of the colortable is returnedin name,and the length of the colortable is returnedin len.The routine returns Iok,IopenerrorIcolpixerr.The pixelvalue for each colorcell in the fileis tripled in the returned colortable by shifting andOR-ing the original pixelvalue so that the colortable canalso be used by 24-bit composite-colormap visuals (DirectColorand TrueColor).
color_writewrites a colortable coltabof lengthlento file file_namewith title name.The routine returns Iok,Iopenerror Ibifferr.Only the PseudoColor part of the pixelvalue (maximum 8 bits)is stored in the file.
color_convertfromimgconverts a color table from IMAGEformat to colortable format. The pixelvalue for each colorcellis tripled in the returned colortable by shiftingand OR-ing the original pixelvalue so that the colortable canalso be used by composite-colormap visuals (DirectColor andTrueColor).
PrintColortableprints colin an ascii format which can begiven as input to read_colormap(and the program mct(1)).The output consists of 4 columns which are colortablepixelvalue, red, green and blue (in this order).
The pixelvalue column printed by PrintColortablecan begiven as decimals or hexadecimals (hexnonzero).Only the PseudoColor part of the pixelvalue is printed.
read_colormapcan read the ascii formatted colormap printedby PrintColortable.The resulting colortable may beused on 8-bit PseudoColor visuals as well as on 24-bitcomposite-colormap visuals (DirectColor and TrueColor).
Each line in the file describes a color in the colortable. Theline-format is
<colornumber> <red-val> <green-val> <blue-val>
colornumberis an unsigned integer. It is used as an index tolookup red-val,green-valand blue-val.
red-val,green-valand blue-valare the intensities ofthe colors in the range 0 - 65535. A special notation
c1 r1 g1 b1
:
c2 r2 g2 b2
defines a linear stretch in the range c1to c2,i.e.the colornumbers in the range c1to c2will get redintensities in the range r1to r2,green in the range g1to g2and blue in the range b1to b2.The ranges arelinearly interpolated.
Lines with a # in coloumn 1 are treated as comments.
SEE ALSO
mct(1),
color2ascii(1),
color2ascii(3)
AUTHOR
Otto Milvang and Svein Bøe
BUG FIX
24.07.92 Knut-Andreas Lie
EXAMPLES
ID
$Id: colorfile.c,v 1.38 1996/11/29 15:11:42 svein Exp $
Index
- NAME
- SYNTAX
- DESCRIPTION
- SEE ALSO
- AUTHOR
- BUG FIX
- EXAMPLES
- ID
This document was created byman2html,using the manual pages.