head	1.3;
access;
symbols
	r0_10:1.3
	Eglin_alpha_1:1.3;
locks; strict;
comment	@// @;


1.3
date	93.05.27.11.28.18;	author thoth;	state Exp;
branches;
next	1.2;

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

1.1
date	93.03.18.11.02.14;	author thoth;	state Exp;
branches;
next	;


desc
@common features of all Discrete Templates.
@


1.3
log
@Copyright Notices
@
text
@// Emacs: -*- C++ -*-

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


static char DDTempl_rcsid[] = "$Id: DDTempl.c,v 1.2 93/04/08 13:10:04 thoth Exp Locker: thoth $";

//
// $Log:	DDTempl.c,v $
// Revision 1.2  93/04/08  13:10:04  thoth
// Templates are now separate from images.
// 
// Revision 1.1  93/03/18  11:02:14  thoth
// Initial revision
// 

#include "DDTempl.h"
#include "IntPointSet.h"
#include "InvariantDT.h"
#include "FunctionDT.h"
#include "OtherDT.h"



template <class I>
void IA_DDTemplate<I>::set_and_reference_template(IA_BaseDT<I> *t)
{
    t->incr_ref();
    this->bdtp = t;
}

template <class I>
void IA_DDTemplate<I>::disassociate_template()
{
    if (this->bdtp->decr_ref() <= 0)
	delete this->bdtp;
    this->bdtp = 0;
}

template <class I>
IA_DDTemplate<I>::IA_DDTemplate(const IA_IntPointSet &ps, const I &i)
{
    set_and_reference_template(new IA_InvariantDT<I>(ps, i));
}

template <class I>
IA_DDTemplate<I>::IA_DDTemplate(const IA_IntPointSet &ps,
				I (*f)(const IA_IntPoint&))
{
    set_and_reference_template(new IA_FunctionDT<I>(ps, f));
}

template <class I>
IA_DDTemplate<I>::IA_DDTemplate(const IA_OtherDT<I> &o)
{
    set_and_reference_template(o.clone_self());
}

template <class I>
IA_DDTemplate<I>::~IA_DDTemplate()
{
    disassociate_template();
}
@


1.2
log
@Templates are now separate from images.
@
text
@d3 4
a6 1
static char DDTempl_rcsid[] = "$Id: DDTempl.c,v 1.1 93/03/18 11:02:14 thoth Exp Locker: thoth $";
d8 3
d13 3
@


1.1
log
@Initial revision
@
text
@d3 1
a3 1
static char DDTempl_rcsid[] = "$Id: DiscreteImage.c,v 1.7 93/02/23 14:10:14 thoth Exp $";
d6 4
a9 1
// $Log:	DiscreteImage.h,v $
d14 1
a14 1
#include "FunctionRefDI.h"
d17 2
d20 15
d37 1
a37 1
    set_and_reference_image(new IA_InvariantDT<I>(ps, i));
d44 1
a44 1
    set_and_reference_image(new IA_FunctionRefDI<I>(ps, f));
d50 7
a56 1
    set_and_reference_image(o.clone_self());
@
