head	1.1;
access
	monica
	thoth;
symbols;
locks
	monica:1.1; strict;
comment	@// @;


1.1
date	94.10.25.20.52.54;	author monica;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@// Emacs: -*- C++ -*-
static char test111_rcsid[] = "$Id: test111.c,v 1.2 1994/08/24 18:08:28 thoth Exp monica $";

//
// magnify and rotate an image
//

//
// $Log: test111.c,v $
// Revision 1.2  1994/08/24  18:08:28  thoth
// updating to new library conventions.
//
// Revision 1.1  1994/02/18  18:58:33  thoth
// Initial revision
//

#include <math.h>

#include "IntDI.h"
#include "DblPoint.h"

typedef IA_Image<IA_Point<int>,int>	IntDI;

const double	mag=3;

const double	rfact = 50.0/180*M_PI;
const double	srf = sin(rfact);
const double	crf = cos(rfact);
IA_Point<int> rot50(const IA_Point<int>&p)
{
  return nint(IA_Point<double>(p[0]*crf+p[1]*srf, -p[0]*srf+p[1]*crf)/mag);
}

int main()
{
  IntDI	im(IntDI::read_PGM("/cis/research/iac++/depot/src/test_image/RCS/sr71.pgm"));

  int	len = (int)(im.domain().sup().enorm()/2);

  im = im.translate(im.domain().sup()/-2);

  IA_Point<int>	bound = nint(mag*extend_to_point(len, im.domain().dim()));
  im = compose(im, rot50).restrict(IA_Set<IA_Point<int> >(-bound, bound));

  im.write_PGM(cout);
}
@
