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


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


desc
@@


1.1
log
@Initial revision
@
text
@#include "test.h"

int main ()
{
    IA::abort_on_throw=0;
    
    // declare images

    IA_Image<IA_Point<int>,IA_RGB> rgb;
    IA_Image<IA_Point<int>,u_char> red_image;
    IA_Image<IA_Point<int>,u_char> blue_image;
    IA_Image<IA_Point<int>,u_char> green_image;

    cout << "\nimage has "<<rgb.card()<<" values\n";

    rgb=IA_Image<IA_Point<int>, IA_RGB> (read_uchar_PGM("/cis/research/iac++/depot/src/test_image/RCS/sr71.pgm"));


    cout << "\nimage has "<<rgb.card()<<" values\n";

    red_image = red(rgb);
    blue_image = blue(rgb);
    green_image = green(rgb);

    cout << "\nimage has "<< red_image.card()<<" values\n";
    cout << "\nimage has "<< sum(red_image) <<" values\n";

    cout << "\nimage has "<< blue_image.card()<<" values\n";
    cout << "\nimage has "<< sum(blue_image)<<" values\n";

    cout << "\nimage has "<< green_image.card()<<" values\n";
    cout << "\nimage has "<< sum(green_image)<<" values\n";

    IA_Image<IA_Point<int>, int> int_image;
    IA_Image<IA_Point<int>, float> float_image;

    int_image = to_int(rgb);
    float_image = to_float(rgb);

    rgb = 5;

    IA_Image<IA_Point<int>, IA_RGB> rgb2 = rgb;

    if (rgb == rgb2) 
	cout << "\npass\n";
    else
	cout << "\nfail\n";

    rgb.write_PPM("foo_rgb.ppm");
    rgb2.read_PPM("foo_rgb.ppm");

    if (rgb == rgb2) 
	cout << "\npass\n";
    else
	cout << "\nfail\n";
    exit(0);
}

@
