DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T v

⟦694bdb5da⟧ TextFile

    Length: 3868 (0xf1c)
    Types: TextFile
    Names: »var.h++«

Derivation

└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
    └─ ⟦this⟧ »EUUGD11/euug-87hel/sec1/image/varc++/var.h++« 

TextFile

/*
    This file contains the definitions necessary to use
    vision archive based stuff.
*/
#ifndef VAR_H
#define VAR_H 1

/*
    Structure for a list of positions filenames and 
    file types
*/
struct band
    {
    int b_position;			// The position of a band in the pixel
    char * b_file_name;		// The name of the file
    char * b_file_type;		// The type of the file
    };

/*
    header structure for archive files
*/
struct var_header
    {
    char *		vh_file_type;	// type of entire file
    int			vh_bytes_per_pixel;
    int			vh_number_bands;
    struct band *	vh_bands;	// bands to store image
    int 		vh_length;	// length of image
    int 		vh_width;	// width of image
    char * 		vh_comments;	// the comments on the image
    char *		vh_header;	// the contents of the _.HEADER file
    };

/*
    structure for storing color info.
    Overlay field is in for compatibility with 
    ikonas.  Also it rounds out the data structure
    so it is an integral number of words long.
*/
struct color_pixel
    {
    unsigned char red;		// red pixel
    unsigned char green;	// green pixel
    unsigned char blue;		// blue pixel
    unsigned char overlay;	// overlay pixel
    };

/*
    Reads in the beginning of 
    an archive and parses the Header file
*/
struct var_header *
var_read_header(FILE * var_file);

/*
    This is the general data reading routine that reads in any kind
    of data
*/
void *
var_read_data(FILE * var_file , struct var_header * vh );

/*
    Returns an array of doubles given a file that
    can be used otherwise fails
    also fills in comment field
*/
double *
var_read_doubles(FILE * var_file , struct var_header * vh );

/*
    Returns an array of longs given a file that can be
    used that way otherwise fails
    also fills in comment field
*/
long *
var_read_longs (FILE * var_file , struct var_header * vh );

/*
    Returns an array of color structures for 
    color images
    also fills in comment field
*/
struct color_pixel *
var_read_color (FILE * var_file , struct var_header * vh );

/*
    Creates the beginning of 
    an archive 
*/
struct var_header *
var_create_header
    (
    char * file_type, 
    char * comments, 
    int bytes_per_pixel,
    int number_bands,
    struct band * bands,
    int length,
    int width
    );

/*
    sets up the header for an array of doubles
*/
struct var_header *
var_create_double_header ( int length , int width );

/*
    sets up the header for an array of longs
*/
struct var_header *
var_create_long_header ( int length , int width );

/*
    sets up the header for an array of color pixels
*/
struct var_header *
var_create_color_header ( int length , int width );

/*
    Writes the header and comments for a file
    otherwise fails
    also fills in comment field
*/
void
var_write_header(FILE * var_file , struct var_header * vh);

/*
    Writes the data out to the file as directed by the header
*/
void
var_write_data(FILE * var_file ,  struct var_header * vh , void * data );

/*
    Writes an array of doubles given a file that
    can be used otherwise fails
    also fills in comment field
*/
void
var_write_doubles(FILE * var_file , struct var_header * vh, double * array );

/*
    Writes an array of longs given a file that can be
    used that way otherwise fails
    also fills in comment field
*/
void
var_write_longs (FILE * var_file , struct var_header * vh, long * array );

/*
    Writes an array of color structures for 
    color images
    also fills in comment field
*/
void
var_write_color (FILE * var_file , struct var_header * vh, struct color_pixel * array );


#endif VAR_H
/*
Copyright (C) 1986, David Sher in the University of Rochester
Permission is granted to any individual or institution to use, copy, or
redistribute this software so long as it is not sold for profit, provided
this copyright notice is retained.
*/