filter.h

00001 
00002 /***************************************************************************
00003  *  filter.h - Abstract class defining a filter
00004  *
00005  *  Created: Tue May 03 19:50:02 2005
00006  *  Copyright  2005-2007  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023 
00024 #ifndef __FIREVISION_FILTER_H_
00025 #define __FIREVISION_FILTER_H_
00026 
00027 #include <fvutils/base/types.h>
00028 #include <fvutils/base/roi.h>
00029 
00030 namespace firevision {
00031 #if 0 /* just to make Emacs auto-indent happy */
00032 }
00033 #endif
00034 
00035 class Filter
00036 {
00037  public:
00038   Filter(const char *name, unsigned int max_num_buffers = 1);
00039   virtual ~Filter();
00040 
00041   virtual void set_src_buffer(unsigned char *buf, ROI *roi,
00042                               orientation_t ori = ORI_HORIZONTAL,
00043                               unsigned int buffer_num = 0);
00044 
00045   virtual void set_src_buffer(unsigned char *buf, ROI *roi,
00046                               unsigned int buffer_num);
00047 
00048   virtual void set_dst_buffer(unsigned char *buf, ROI *roi);
00049 
00050 
00051   virtual void set_orientation(orientation_t ori, unsigned int buffer_num);
00052   virtual const char * name();
00053 
00054   virtual void apply() = 0 ;
00055 
00056   void shrink_region(ROI *r, unsigned int n);
00057 
00058  protected:
00059   /** Maximum number of buffers */
00060   unsigned int    _max_num_buffers;
00061   /** Filter name */
00062   char           *_name;
00063 
00064   /** Source buffers, dynamically allocated by Filter ctor. */
00065   unsigned char  **src;
00066   /** Destination buffer */
00067   unsigned char  *dst;
00068 
00069   /** Source ROIs, dynamically allocated by Filter ctor. */
00070   ROI            **src_roi;
00071   /** Destination ROI */
00072   ROI            *dst_roi;
00073 
00074   /** Orientations, one for each source image */
00075   orientation_t  *ori;
00076 };
00077 
00078 } // end namespace firevision
00079 
00080 #endif

Generated on Tue Feb 22 13:31:16 2011 for Fawkes API by  doxygen 1.4.7