head	1.5;
access;
symbols
	bobbase:1.2
	bob:1.2
	r2_1:1.2
	r2_0:1.2
	r1_1_beta:1.2
	r1_1_alpha:1.1
	r1_0:1.1
	r0_11:1.1
	r0_10:1.1
	r0_9:1.1;
locks
	fjsoria:1.5; strict;
comment	@// @;


1.5
date	95.01.16.22.14.40;	author fjsoria;	state Exp;
branches;
next	1.4;

1.4
date	95.01.11.15.43.46;	author fjsoria;	state Exp;
branches;
next	1.3;

1.3
date	94.12.30.19.18.07;	author fjsoria;	state Exp;
branches;
next	1.2;

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

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


desc
@Lazy Translation image.
@


1.5
log
@fixing operator<< overload problem for IA_Point<int>
@
text
@// Emacs: -*- C++ -*-

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


//
// $Log: LazyXlationI.h,v $
// Revision 1.4  1995/01/11  15:43:46  fjsoria
// patched problem with operator<< with dummy_op()
//
// Revision 1.3  1994/12/30  19:18:07  fjsoria
// guard around static member data template
//
// Revision 1.2  1994/07/25  17:26:39  thoth
// Name sanitization
//
// Revision 1.1  1993/11/29  22:24:52  thoth
// Initial revision
//

#ifndef LazyXlationI_h_
#define LazyXlationI_h_

#include <iostream.h>
#include "BaseI.h"


#ifdef IA_UNRESOLVED_OPERATOR

//ostream &operator << (ostream &stream, const IA_Point<int>& point);
/*
template <class T>
static ostream& dummy_op (ostream& o, T val)
{
  return o << val;
}*/

#endif


template < class P,class T>
class IA_LazyXlationI: public IA_BaseImage<P,T> {
  private:
    static char	dummy;

    const P	offset;
    IA_BaseImage<P,T>	* base;
  public:
    IA_LazyXlationI(const IA_BaseImage<P,T> *base_, P offset_)
    :IA_BaseImage<P,T>(base_->domain() + offset_)
#if 1
	, offset(offset_)
	, base((IA_BaseImage<P,T>*)base_) 
#endif
    {
#if 0
	*(P*)&offset = offset_;
	base = (IA_BaseImage<P,T>*)base_;
#endif
	base->incr_ref();
    }
    ~IA_LazyXlationI() {
	if (base->decr_ref()<=0)
	    delete base;
    }
    int extensive() const { return 0; }
    T operator() (const P &p) const {
	return (*base)(p-offset);
    }
    IA::Type type() const { return &dummy; }
    IA_BaseImage<P,T> * xlated_by(const P &p) const {
	return new IA_LazyXlationI<P,T>(base, p+offset);
    }
    ostream& print_this(ostream&o) const {
#ifdef   IA_UNRESOLVED_OPERATOR
	dummy_op(o<< "translation by ", offset) << " of \n";
#else
	 o<< "translation by " << offset << " of \n";
#endif
	 return base->print_this(o);
    }
};

#ifndef IA_NO_AUTOINST_OF_STATIC_DATA
template < class P,class T>
char IA_LazyXlationI<P,T>::dummy;
#endif

#endif // LazyXlationI_h_
@


1.4
log
@patched problem with operator<< with dummy_op()
@
text
@d11 3
d29 14
@


1.3
log
@guard around static member data template
@
text
@d11 3
d61 6
a66 2
	o<< "translation by " << offset << " of \n";
	return base->print_this(o);
@


1.2
log
@Name sanitization
@
text
@d11 3
d63 1
d66 1
@


1.1
log
@Initial revision
@
text
@d10 4
a13 1
// $Log: BaseI.h,v $
d50 1
a50 1
    IA_ImageType type() const { return &dummy; }
@
