head	1.2;
access;
symbols
	bobbase:1.1
	bob:1.1.1
	r2_1:1.1;
locks
	thoth:1.1.1.2
	thoth:1.2; strict;
comment	@// @;


1.2
date	95.01.11.15.40.55;	author thoth;	state Exp;
branches;
next	1.1;

1.1
date	94.09.16.18.24.34;	author thoth;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	95.01.09.18.07.11;	author thoth;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	95.01.13.19.37.42;	author thoth;	state Exp;
branches;
next	;


desc
@value composition.
@


1.2
log
@Fixed missing include file.
@
text
@// Emacs: -*- C++ -*-

//
//	Copyright 1993, Center for Computer Vision and Visualization,
//	University of Florida.  All rights reserved.
//


//
// $Log: ImgComp.c,v $
// Revision 1.1  1994/09/16  18:24:34  thoth
// Initial revision
//

#include "ImgComp.h"
#include "ImageIter.h"

template <class P, class Q, class R, class S, class T>
IA_CoreImage<P,Q> compose(R (*f)(S), const IA_CoreImage<P,T> &i, const Q*, const R*, const S*)
{
    IA_IVIter<P,T>	iter(i);
    const int size = i.card();
    Q * const vals = new Q[size];

    {
	Q	*scan=vals;
	T	temp;
	while (iter(temp))
	    *(scan++) = f(temp);
    }

    return IA_CoreImage<P,Q>(i.domain(), vals, size, 1);
}

template <class P, class Q, class R, class S, class T>
IA_CoreImage<P,Q> compose(const IA_Closure<S,R>&f,
			  const IA_CoreImage<P,T> &i,
			  const Q*)
{
    IA_IVIter<P,T>	iter(i);
    const int size = i.card();
    Q * const vals = new Q[size];

    {
	Q	*scan=vals;
	T	temp;
	while (iter(temp))
	    *(scan++) = f(temp);
    }

    return IA_CoreImage<P,Q>(i.domain(), vals, size, 1);
}
@


1.1
log
@Initial revision
@
text
@d10 4
a13 1
// $Log: AuxImage.c,v $
d16 1
@


1.1.1.1
log
@We use ImageIter, let's include its header.
@
text
@d10 1
a10 4
// $Log: ImgComp.c,v $
// Revision 1.1  1994/09/16  18:24:34  thoth
// Initial revision
//
a12 1
#include "ImageIter.h"
@


1.1.1.2
log
@CoreImage has been re-merged with Image.  All special stuff should be
friends of FBI now.
@
text
@a10 3
// Revision 1.1.1.1  1995/01/09  18:07:11  thoth
// We use ImageIter, let's include its header.
//
d19 1
a19 1
IA_Image<P,Q> compose(R (*f)(S), const IA_Image<P,T> &i, const Q*, const R*, const S*)
d32 1
a32 1
    return IA_Image<P,Q>(i.domain(), vals, size, 1);
d36 2
a37 2
IA_Image<P,Q> compose(const IA_Closure<S,R>&f,
			  const IA_Image<P,T> &i,
d51 1
a51 1
    return IA_Image<P,Q>(i.domain(), vals, size, 1);
@
