head	1.3;
access;
symbols;
locks; strict;
comment	@// @;


1.3
date	94.10.11.00.33.56;	author rjj;	state Exp;
branches;
next	1.2;

1.2
date	94.09.02.01.47.51;	author rjj;	state Exp;
branches;
next	1.1;

1.1
date	94.09.01.00.12.56;	author rjj;	state Exp;
branches;
next	;


desc
@Placing under RCS.  This should be the source corresponding to UM 1.0
@


1.3
log
@Modified to use 'return 0;' rather than 'exit(0);'.
@
text
@// template_example.02.c

//
// FloatDI magnification -- non closure version
//

#include "FloatDI.h"
#include "UcharDI.h"           // Needed for display()
#include "DDTempl.h"
#include "FloatConv.h"


const int  ident = 1;
const int  factor = 3;

IA_Image<IA_Point<int>,float> magnify(const IA_Point<int> &p)
{
    IA_Point<int>		inf_ = p*factor;
    IA_Point<int>		sup_ = (p+1)*factor - 1;

    IA_Set<IA_Point<int> >
	ps(inf_, sup(inf_,sup_));

    return IA_Image<IA_Point<int>,float>( ps, 1.0/ps.card() );
}


int main() {

    IA_Image<IA_Point<int>,float>
	im = read_int_PGM(cin);

    IA_Set<IA_Point<int> >
	ps = im.domain();

    IA_DDTemplate<IA_Image<IA_Point<int>,float> >
	mag( IA_universal_ipset(2), magnify );  // Function constructor

    IA_Set<IA_Point<int> >
	destPS( ps.inf()/factor, ps.sup()/factor );

    IA_Image<IA_Point<int>,int>
	im2 = to_int( linear_product( im, mag, destPS ));

    display(to_uchar(im));
    display(to_uchar(im2));

    return 0;
}
@


1.2
log
@Modified to be iac++ v2.0 compliant.
@
text
@a6 1
#include <stdlib.h>
d48 1
a48 1
    exit( 0 );
@


1.1
log
@Initial revision
@
text
@a0 1
// Emacs -*- C++ -*-
d7 1
d11 1
a11 1
#include "FloatConvolutions.h"
d29 1
a29 1
main() {
d48 2
@
