The Machine Perception Toolbox

[Introduction]- [News]- [Download]- [Screenshots]- [Manual (pdf)]- [Forums]- [API Reference]- [Repository ]

 

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

MPColorTrackerFilter.h

Go to the documentation of this file.
00001 //==========================================================================;
00002 //
00003 //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
00004 //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
00005 //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
00006 //  PURPOSE.
00007 //
00008 //  Copyright (c) 1992 - 1998  Microsoft Corporation.  All Rights Reserved.
00009 //
00010 //--------------------------------------------------------------------------;
00011 #ifndef __MPCOLORTRACKERFILTER_H__
00012 #define __MPCOLORTRACKERFILTER_H__
00013 
00014 #include "FilterInterface.h"
00015 
00016 class MPColorTrackerFilter
00017 : public CTransformFilter
00018 , public IIPEffect
00019 , public ISpecifyPropertyPages
00020 , public CPersistStream
00021 {
00022 public:
00023 
00024         DECLARE_IUNKNOWN;
00025         static CUnknown * WINAPI CreateInstance(LPUNKNOWN punk, HRESULT *phr);
00026 
00027         // Reveals IEZMPColorTrackerFilter and ISpecifyPropertyPages
00028         STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void ** ppv);
00029 
00030         // CPersistStream stuff
00031         HRESULT ScribbleToStream(IStream *pStream);
00032         HRESULT ReadFromStream(IStream *pStream);
00033 
00034         // Overrriden from CTransformFilter base class
00035 
00036         HRESULT Transform(IMediaSample *pIn, IMediaSample *pOut);
00037         HRESULT CheckInputType(const CMediaType *mtIn);
00038         HRESULT CheckTransform(const CMediaType *mtIn, const CMediaType *mtOut);
00039         HRESULT DecideBufferSize(IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *pProperties);
00040         HRESULT GetMediaType(int iPosition, CMediaType *pMediaType);
00041 
00042         virtual HRESULT StartStreaming(); // frame dependent initialization
00043         virtual HRESULT StopStreaming();
00044 
00045         // These implement the custom IIPEffect interface
00046 
00047         STDMETHODIMP get_IPEffect(int *IPEffect); //, REFTIME *StartTime, REFTIME *Length);
00048         STDMETHODIMP put_IPEffect(int IPEffect); //, REFTIME StartTime, REFTIME Length);
00049 
00050         // ISpecifyPropertyPages interface
00051         STDMETHODIMP GetPages(CAUUID *pPages);
00052 
00053         // CPersistStream override
00054         STDMETHODIMP GetClassID(CLSID *pClsid);
00055 
00056 private:
00057 
00058         MPColorTrackerFilter(TCHAR *tszName, LPUNKNOWN punk, HRESULT *phr);    // Constructor
00059         ~MPColorTrackerFilter();        // Destructor
00060 
00061         // Look after doing the special effect
00062         BOOL CanPerformMPColorTrackerFilter(const CMediaType *pMediaType) const;
00063         HRESULT Copy(IMediaSample *pSource, IMediaSample *pDest);
00064         HRESULT Transform(IMediaSample *pMediaSample);
00065 
00066         CCritSec        m_MPColorTrackerFilterLock;          // Private play critical section
00067         int m_effect;               // Which effect are we processing
00068         const long m_lBufferRequest;    // The number of buffers to use
00069         int m_imgWidth;
00070         int m_imgHeight;
00071 
00072         CRefTime    m_currentTime;      // time of currently executing filter.
00073         CRefTime    m_lastValidTime;    // last time something valid was tracked
00074         CRefTime    m_resetInterval;    // when this much time passes since last valid
00075 
00076         FilterInterface m_interface;
00077 
00078 }; // EZMPColorTrackerFilter
00079 
00080 #endif __MPCOLORTRACKERFILTER_H__

Generated on Mon Nov 8 17:07:43 2004 for MPT by  doxygen 1.3.9.1