00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
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