|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T t
Length: 1291 (0x50b)
Types: TextFile
Names: »trunc.c++«
└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
└─⟦this⟧ »EUUGD11/euug-87hel/sec1/image/vartools/trunc.c++«
/*
This is the routine that takes in a double image and truncates
it to a long image
*/
#include <stdio.h>
#include <string.h>
#include <long_image.h++>
#include <double_image.h++>
#include "vartools.h++"
/*
Truncates an input image needs a file to be output to
but does not write to file
*/
long_image&
trunc2( double_image& input , FILE *outfile )
{
long_image *output_p = new long_image(CREATE,input.n_rows(),input.n_cols(),outfile);
long_image& output = *output_p;
while(++input,++output)
{
output() = input();
}
return output;
}
/*
Takes two files and reads from one to write to the other
*/
void
trunc( FILE *infile , FILE *outfile, char *comment)
{
double_image input(READ,infile);
long_image& output = trunc2(input,outfile);
output.set_comments(comment,strlen(comment));
output.add_comment("The file being truncated is:\n",strlen("The file being truncated is:\n"));
output.add_comment((char *) input.the_comments(),input.c_length());
output.write();
}
/*
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.
*/