# Include "cv. H"
# Include "highgui. H"
# Include "math. H"
Int main (INT argc, char ** argv)
{
Iplimage * SRC;
/* The first command line parameter must be image file name */
If (argc = 2 & (src = cvloadimage (argv [1],-1 ))! = 0)
{
Iplimage * DST = cvcloneimage (SRC );
Int Delta = 1;
Int angle = 0;
Cvnamedwindow ("src", 1 );
Cvshowimage ("src", Src );
For (;;)
{
Float M [6];
Double factor = (COS (angle * cv_pi/180.) + 1.1) * 3;
Cvmat M = cvmat (2, 3, cv_32f, M );
Int W = Src-> width;
Int H = Src-> height;
M [0] = (float) (factor * Cos (-angle * 2 * cv_pi/180 .));
M [1] = (float) (factor * sin (-angle * 2 * cv_pi/180 .));
M [2] = W * 0.5f;
M [3] =-M [1];
M [4] = m [0];
M [5] = H * 0.5f;
Cvgetquadranglesubpix (SRC, DST, & M, 1, cvscalarall (0 ));
Cvnamedwindow ("DST", 1 );
Cvshowimage ("DST", DST );
If (cvwaitkey (5) = 27)
Break;
Angle = (angle + delta) %360;
}
}
Return 0;
}