www.pudn.com > firev0.01.rar > interpolimg.hpp


/*
This file is part of the FIRE -- Flexible Image Retrieval System

FIRE is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

FIRE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with FIRE; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
#ifndef _INTERPOLBASEIMG_H
#define _INTERPOLBASEIMG_H
#include "image.hpp" 

#ifdef __HAVE_INTERPOLATION_STUFF__
#include "interpol.h"
#include "coeff.h"
#endif

#include "diag.hpp"

using namespace std;
using namespace diag;
namespace img {
  
  ///class to give interpolated values for between pixel points.
/** 
 * A class to calculate interpolated values of images. e.g. the
 * value at the point (0.5, 0.75).
 *
 * This class is based on some methods from Philippe Thevanaz
 * 
 */
class InterpolBaseImage {
public:
  /** 
   * The one and only constructor. Give an image to it and let it
   * calculate the values needed to be later able to retrieve
   * interpolated values. This might take some time due to some
   * mathemagical calculations.
   * 
   * @param inputimage give here the image which shall be processed
   * @param splineDegree is a value to change the interpolation
   */
  InterpolBaseImage(const BaseImage &inputimage, int splineDegree=3) {
    width=inputimage.xDim();
    height=inputimage.yDim();
    degree=splineDegree;
    splineImage=(double*)malloc(height*width*sizeof(double));
    memtest(splineImage);
    for(unsigned int i=0;i