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


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

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

1.1
date	94.09.01.00.11.08;	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
@// image_example.05.c   Image composition with point-to-point function

#include "UcharDI.h"
#include "FloatCI.h"
#include "BLInterp.h"


// Instances of class rot  represent functions that rotate an
//    IA_Point<double>   through a fixed rotation.
// NOTE: the angle of rotation is defined at instance
//    creation time.  Hence different instances of class  rot
//    may represent different rotation functions.

class rot : public IA_Closure<IA_Point<double> , IA_Point<double> > {
    const double	S,C;
  public:
    rot(double	theta)
    :S(sin(theta)), C(cos(theta)) { }
    IA_Closure<IA_Point<double> , IA_Point<double> >* clone_self() const {
	return new rot(*this);
    }
    IA_Point<double>  operator()(const IA_Point<double>  &p) const {
	return IA_Point<double> (p[0]*C + p[1]*S, p[1]*C-p[0]*S);
    }
};


int main()
{
    IA_Image<IA_Point<int>,u_char>
	im1 = read_uchar_PGM(cin);

    IA_Image<IA_Point<double>,float>
	im2(IA_BLInterp<float>(IA_Image<IA_Point<int>,float>(im1)));


    // Rotate 40 degrees
    im2 = IA_Image<IA_Point<double>,float>(
	compose(im2, rot(M_PI*40.0/180))
	);
 

    IA_Image<IA_Point<int>,u_char>
	udi(to_uchar(im2.restrict(im1.domain())));

    display( udi );

    return 0;
}
@


1.2
log
@Modified to be iac++ 2.0 compliant.
Changed references to imagealgebra.h to include approapriate image .h files.
Deleted commented out source lines.
Added exit() to main().
@
text
@a2 1
#include <stdlib.h>
d48 1
a48 1
    exit( 0 );
@


1.1
log
@Initial revision
@
text
@a0 2
// Emacs: -*- C++ -*-

d3 2
a4 1
#include "imagealgebra.h"
d29 1
a29 1
main()
a31 1
//	im1 = IA_Image<IA_Point<int>,u_char>::read_PGM(cin);
d48 2
@
