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

⟦e9119fc48⟧ TextFile

    Length: 2018 (0x7e2)
    Types: TextFile
    Names: »var_image.c++«

Derivation

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

TextFile

/*
    This the support for generic images using the mv image file format
*/

#include <stream.h>
#include <stdio.h>
#include <string.h>
#include "for.h++"
#include "var.h++"
#include "error.h++"
#include "image.h++"

/*
    Reads in the data type independent header information from the
    mv file and stores it in the relevant places
*/
image_class::image_class
    ( 
    const read_image_type rit , 	// marker that the image is being read
    const FILE * image_file ,	// file for image
    const card w_width  ,	// window width
    const card w_length 	// window length
    )
    {
    /* check that the constructor is called correctly */
    if ( rit != READ )
	{
	cerr << "Generic constructor for image being called in obscure way\n";
	abort();
	}

    /* initialize using arguments */
    file = image_file;
    window_width = w_width;
    window_length = w_length;

    /* the header for the var file */
    /* read in the header for the var file */
    /* put the annotation in as comments */
    struct var_header *vh = var_read_header(image_file);
    /* check if error occured */
    if (error_occured)
	{
	cerr << "Error when reading in header for image";
	print_errors_and_abort();
	}
    /* place the header in the header slot */
    header_info = vh;

    /* a priori initializations */
    /* status */
    image_status = UNINITIALIZED;
    window_status = UNINITIALIZED;
    prot = CAN_READ;
    }

/*
    Sets up the data type independent header information to be read 
    out to the mv file.
*/
void
image_class::write ()
    {
    /* check that the protection allows the image to be written */
    if ( (prot != CAN_WRITE) && (prot != CAN_READ_AND_WRITE))
	{
	cerr << "Trying to write image that is write protected to file";
	abort();
	}

    }
/*
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.
*/