SDS_WRITE_GIF(3)
NAME
sds_write_gif
write the data from a SDS in GIF.
SYNOPSIS
#include <stdio.h>
#include <soi_sds.h>
int sds_write_gif (SDS *sds, char *filename, int interlace,
double scale, double offset, int transparent, int delay)
DESCRIPTION
sds_write_gif() creates a GIF file filename from the data
values in a sds. The data are internally converted to
floats, then converted to unsigned bytes using the scale and
offset values according to the rule
pixel[n] = scale * data[n] +
Missing data values are set to pixel value of 0, all others
are limited to the range [1,255]. The color table and
number of bits per pixel must be part of the sds structure
in the SDS_COLOR struct.
If the flag transparent < 0 and the rank of the dataset is 2
the encoding will be according to the GIF87a spec; otherwise
the GIF89a spec is used. If the rank of the dataset is
greater than 2 a GIF89a file incorporating the Netscaper
Navigator Application Extension controlling looping will be
written; the value delay controls the delay between frames,
in units of 0.1 sec. All dimensions above the second are
compressed: each 2-dimensional subset is rendered in a
separate frame in storage order.
DIAGNOSTICS
If the rank of the data set is less than 2 or if the data
cannot be converted to floats, the function returns 1 and no
output file is created; otherwise the function returns 0.
FILES
~CM/include/soi_sds.h
~CM/src/libsds.d/sds_gif.c
SEE ALSO
Graphics Interchange Format Specification Version 89a
http://rick.stanford.edu/gif89a.html
sds(4)
BUGS
The code is untested and probably fails for cases in which
the number of bits per pixel is not 8.
The transparency flag is unimplemented except to set the
file type to GIF89a.
HISTORY
1999-07-23 SOI V 4.3