head	1.2;
access;
symbols;
locks; strict;
comment	@ * @;


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

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


desc
@Generates one of the test patterns from Dr. Ritter's Euler section.
@


1.2
log
@Added standard header, deleted old references, changed exit to return.
@
text
@// euler.pattern.4.c    Section 11.6, Euler Number
//      Copyright 1993, Center for Computer Vision and Visualization,
//      University of Florida.  All rights reserved.

#include "UcharDI.h"
#include "ImageIter.h"

int  main() {

    const int  W=4;  // The width
    const int  Z=10; // result from <-Z,-Z> to <Z,Z>

    IA_Set<IA_Point<int> >
        s_ps = IA_boxy_pset( IA_Point<int>( 0, 0), IA_Point<int>(W-1,W-1) ),
        o_ps = IA_boxy_pset( IA_Point<int>(-Z,-Z), IA_Point<int>(Z,  Z) );

    IA_Image<IA_Point<int>,u_char>
	o_im( o_ps, u_char(0) );

    IA_IPIter<IA_Point<int>,u_char>
	iter(IA_Image<IA_Point<int>,u_char>(s_ps,1));

    u_char  val;
    IA_Point<int> ip;

    while ( iter(ip, val) ) {
	o_im[ip + IA_Point<int>( 0, W)] = val;  // Top line

	o_im[ip + IA_Point<int>(-W, 0)] = val;  // Middle line
	o_im[ip + IA_Point<int>( W, 0)] = val;

	o_im[ip + IA_Point<int>( 0,-W)] = val;  // Bottom line
    }

    o_im.write_PGM(cout);

    return 0;
}
@


1.1
log
@Initial revision
@
text
@d1 1
a1 1
// File: euler.pattern.4.c
d8 1
a8 1
static char IA_euler_pattern_4_c_rcsid[] = "$Id$";
a9 25
// $Log:


/////////////////////////////////////////////////////////////////////////////
//
// 7.3  Generate the No. 4 Euler test pattern
//
// Reference:  Image Algebra Handbook (IAH)
//             Contract Number F08635-89-C-0134
//             Center for Computer Vision and Visualization
//             Room E335 CSE Building
//             University of Florida
//             Gainesville, FL 32611
//
// Assumptions:
//    o  Ouput image is written to standard out
//    o  Image format is PGM
//    o  The image range is [0..1]
//
/////////////////////////////////////////////////////////////////////////////



main() {

d36 2
@
