Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

VxFrmFtorLocSecMax.h

00001 /*
00002  *
00003  *  Copyright (c) 2001, TNO TPD, The Netherlands.
00004  *  All rights reserved. No part of this software may be handed to or used by persons 
00005  *  or organisation outside Kenniscentrum Watergraafsmeer (UvA-ISIS, TNO TPD) without 
00006  *  the written permission of TNO TPD.
00007  *
00008  *  Author(s):
00009  *      Jan Baan (baan@tpd.tno.nl)
00010  *      Jeroen Vendrig
00011  *
00012  * 
00013  */
00014 
00015 #ifndef VxFrmFtorLocSecMax_h
00016 #define VxFrmFtorLocSecMax_h
00017 
00018 #include "VxFrmFtorNgb.h"
00019 
00020 template<class T>
00021 class VxFrmFtorLocSecMax : public VxFrmFtorNgb {
00022 public:
00023     VxFrmFtorLocSecMax(int kernelSize, int dF = 1) {
00024         for(int i=-kernelSize*dF; i<=kernelSize*dF; i+=dF) {
00025             _kernel.push_back(i);
00026         }
00027     }
00028     
00029     VxFrmFtorLocSecMax(std::vector<int> kernel) {
00030         _kernel = kernel;
00031     }
00032 
00033     virtual void        Init(int frame) {
00034         _frameNr = frame;
00035         _output = 0;
00036     };
00037 
00038     virtual void        pushInput(int frame, const VxValue& input) {
00039         if(frame == _frameNr)
00040             return;
00041         T inp;
00042         input.get(inp);
00043         if(inp>_output) {
00044             _output = inp;
00045         }
00046     }
00047 
00048     virtual VxValue     getOutput() {
00049         return VxValue((T) _output);
00050     }
00051 
00052     virtual std::vector<int> getKernel(int frame) {
00053         return _kernel;
00054     }
00055         
00056     virtual HxString    getInputClass() const {
00057         return HxClassName<T>();
00058     }
00059     virtual HxString    getOutputClass() const {
00060         return HxClassName<T>();
00061     }
00062 
00063     virtual HxString    name() const {
00064         return HxString("LocalSecMax");
00065     }
00066 
00067     virtual VxFrmFtorNgb* clone() const {
00068         return new VxFrmFtorLocSecMax(_kernel);
00069     }
00070     
00071 private:
00072 
00073     std::vector<int>    _kernel;
00074     int                 _frameNr;
00075     T                   _output;
00076     
00077 };
00078 #endif

Generated on Tue Feb 3 14:18:45 2004 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001