Vista     Main Page   Class List   Function List   File List   Examples  


CMotion2DPyramid.h

Go to the documentation of this file.
00001 /*
 00002 
 00003   Copyright (c) 1995-2005 by INRIA.
 00004   All Rights Reserved.
 00005 
 00006   This software was developed at:
 00007   IRISA/INRIA Rennes
 00008   Campus Universitaire de Beaulieu
 00009   35042 Rennes Cedex
 00010 
 00011   http://www.irisa.fr
 00012 
 00013 */
 00014 
 00020 #ifndef CMotion2DPyramid_h
 00021 #define CMotion2DPyramid_h
 00022 
 00023 //using namespace std;
 00024 
 00025 #ifdef __SunOS_
 00026 # include <iostream.h>
 00027 #else
 00028 # include <iostream>
 00029 #endif
 00030 
 00031 #include <Motion2D.h>
 00032 
 00033 using namespace std;
 00034 
 00035 #if defined (WIN32)
 00036 #  if defined MOTION2D_DLL_EXPORTS
 00037 #     define MOTION2D_API __declspec( dllexport )
 00038 #  elif defined MOTION2D_DLL_IMPORTS
 00039 #     define MOTION2D_API __declspec( dllimport )
 00040 #  else
 00041 #     define MOTION2D_API
 00042 #  endif
 00043 #else
 00044 #     define MOTION2D_API
 00045 #endif
 00046 
 00050 typedef enum {
 00051   PYR_NO_ERROR = 0, 
 00052   PYR_NOT_ALLOCATED = -1, 
 00053   PYR_LEVEL_NOT_ACCESSIBLE = -2, 
 00054   PYR_TOO_MUCH_LEVELS = -3, 
 00055   PYR_ALLOCATION_DONE = -4, 
 00056   PYR_NOT_ENOUGH_MEMORY = -5, 
 00057   PYR_NOT_BUILD = -6 
 00058 } TPyramidError;
 00059 
 00061 // For spatio-temporal pyramid images
 00063 class MOTION2D_API CMotion2DPyramid
 00064 {
 00065  public:
 00066   enum {
 00067     NLEVELS_MAX = 10 
 00068   };
 00069 
 00070  public:
 00071   CMotion2DPyramid();
 00072   CMotion2DPyramid(const CMotion2DPyramid & pyramid);
 00073   ~CMotion2DPyramid();
 00074 
 00075   TPyramidError allocate(int nrows, int ncols, int nlevels);
 00076   TPyramidError build(const unsigned char *image);
 00077   TPyramidError build(const unsigned char *image, int nrows, int ncols, int nlevels);
 00078   TPyramidError build(const short *image);
 00079   TPyramidError build(const short *image, int nrows, int ncols, int nlevels);
 00080   void destroy();
 00081 
 00082   int getNumberOfLevels() const ;
 00083   TPyramidError getNumberOfRows(int & rows,  int level=0) const ;
 00084   TPyramidError getNumberOfCols(int & ncols, int level=0) const ;
 00085 
 00086   float *getRowsSpatialGradientDataAddress(TPyramidError &error, int level=0);
 00087   float *getColsSpatialGradientDataAddress(TPyramidError &error, int level=0);
 00088   short *getGaussianImageDataAddress(TPyramidError &error, int level=0);
 00089 
 00090   CMotion2DPyramid & exchange(CMotion2DPyramid & pyramid);
 00091 
 00092  private:
 00093   void __panic(char *message);
 00094 
 00095  private:
 00096   int nlevels; // Number of pyramid levels.
 00097   int nrows;   // Number of rows for the floor level.
 00098   int ncols;   // Number of cols for the floor level.
 00099 
 00100  public:
 00101   // The maximum number of levels is given by NB_LEVELS_MAX
 00102   TImageShort pyr_ima[NLEVELS_MAX]; // Temporal gradiens
 00103   TImageFloat pyr_gx [NLEVELS_MAX]; // Spatial gradiens in x (cols)
 00104   TImageFloat pyr_gy [NLEVELS_MAX]; // Spatial gradiens in y (rows)
 00105 
 00106   bool allocated; // Indicates if memory is allocated
 00107 
 00108 };
 00109 
 00110 #endif
 

Motion2D is Copyright © 1995-2005 by Inria
This documentation was generated on 31 Jan 2005 by Fabien Spindler for Motion2D 1.3.11 using doxygen1.2.18 written by Dimitri van Heesch, © 1997-2005