Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

trilinear.cpp

Go to the documentation of this file.
00001 // $Id: trilinear.cpp,v 1.1 2003/06/06 23:13:08 sarang Exp $
00002 //
00003 // OpenVL - A Library for working with volumetric datasets.
00004 //          http://openvl.sf.net
00005 //
00006 // Copyright (C) 2003  Sarang Lakare <sarang#users.sf.net>
00007 //
00008 // This library is free software; you can redistribute it and/or
00009 // modify it under the terms of the GNU Library General Public
00010 // License as published by the Free Software Foundation; either
00011 // version 2 of the License, or (at your option) any later version.
00012 //
00013 // This library is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016 // Library General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU Library General Public
00019 // License along with this library; if not, write to the Free Software
00020 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00021 // USA.
00022 //
00023 // Please report all bugs and problems to openvl-devel@lists.sf.net or
00024 // at the OpenVL website.
00025 //
00026 
00027 #include <iostream>
00028 #include "vlinterpolator.h"
00029 #include "vlipolator_trilinear.h"
00030 #include "vlgenericfactory.h"
00031 #include "trilinear.h"
00032 
00033 typedef vlGenericFactory<vlInterpolatorTriLinPlugin> vlInterpolatorTriLinPluginFactory;
00034 VL_EXPORT_COMPONENT_FACTORY( trilinear, vlInterpolatorTriLinPluginFactory );
00035 
00036 
00040 vlInterpolatorTriLinPlugin::vlInterpolatorTriLinPlugin()
00041   : m_interpolationType(vlInterpolation::NearestNeighbor)
00042 {
00043   infoRef().setVersion(0, 0, 1);
00044   infoRef().setName("TriLinear");
00045   infoRef().setService("TriLinear", "Tri-Linear interpolation");
00046   infoRef().addAuthor("Sarang Lakare");
00047   infoRef().setCopyrightText("2003 Sarang Lakare");
00048 
00049   m_supportedLayouts = vlLayout::supported();
00050 }
00051 
00052 
00056 vlInterpolatorTriLinPlugin::~vlInterpolatorTriLinPlugin()
00057 {
00058 
00059 }
00060 
00061 
00063 vlInterpolationType vlInterpolatorTriLinPlugin::interpolationType() const
00064 {
00065   return (m_interpolationType);
00066 }
00067 
00069 std::vector<vlLayoutType> vlInterpolatorTriLinPlugin::getSupportedLayouts() const
00070 {
00071   return (m_supportedLayouts);
00072 }
00073 
00074 vlInterpolatorSuperBase * vlInterpolatorTriLinPlugin::getNativeInterpolator(const vlDataType & datatype, const vlLayoutType type)
00075 {
00076   vlInterpolatorSuperBase * ret;
00077   callFunctionOnDataType(datatype, ret, getNativeInterpolatorT, type);
00078   return (ret);
00079 }
00080 
00081 template <typename DataType>
00082 vlInterpolatorSuperBase * vlInterpolatorTriLinPlugin::getNativeInterpolatorT(DataType & dummy, const vlLayoutType type)
00083 {
00084   vlInterpolatorSuperBase * ret;
00085   callFunctionOnLayoutWithDataTypeNoArgs(type, DataType, ret, getNativeInterpolatorTT);
00086   return (ret);
00087 }
00088 
00090 template <typename DataType, vlLayoutType Layout>
00091 vlInterpolatorSuperBase * vlInterpolatorTriLinPlugin::getNativeInterpolatorTT()
00092 {
00093   vlInterpolatorSuperBase * ptr = new vlInterpolatorTriLinear<DataType, Layout>();
00094   return (ptr);
00095 }
00096 
00097 
00098 vlInterpolatorSuperBase * vlInterpolatorTriLinPlugin::getVirtualInterpolator(const vlDataType & datatype)
00099 {
00100   vlInterpolatorSuperBase * ret;
00101   callFunctionOnDataTypeNoArgs(datatype, ret, getVirtualInterpolatorT);
00102   return (ret);
00103 }
00104 
00106 template <typename DataType>
00107 vlInterpolatorSuperBase * vlInterpolatorTriLinPlugin::getVirtualInterpolatorT(DataType & dummy)
00108 {
00109   vlInterpolatorSuperBase * ptr = new vlInterpolatorTriLinear<DataType, vlLayout::VirtualCall>();
00110   return (ptr);
00111 }
00112 
00113 
00114 

Generated on Fri Mar 18 11:33:13 2005 for OpenVL by doxygen 1.3.3