OSDN Git Service

fix cmake/Macros.cmake
[moflib/moflib.git] / moflib-1.0 / moflib / moflib / mof / stream / Filter.hpp
1 #pragma once
2 #include "mof/Vector2D.hpp"
3 #include "mof/stream/Manipulator.hpp"
4
5
6 namespace mof{
7
8     class Filter : public Manipulator< Vector2D >
9     {
10     public:
11         typedef std::shared_ptr<Filter> Handler;
12         
13         Filter
14         (
15                     const Manipulator<Vector2D>::Handler& body ,
16             const mof::Vector2D& filter
17                 )
18         : m_body( body ) , m_filter( filter)
19             {
20             }
21
22             virtual Vector2D value( FrameNumber frame ) const
23         {
24             mof::Vector2D value = m_body->value(frame);
25                     return mof::Vector2D( value.x * m_filter.x , value.y * m_filter.y);
26             }
27
28
29     private:
30             Manipulator< Vector2D >::Handler  m_body;
31             Vector2D m_filter;
32
33
34     };
35
36 //{{{ ヘルパ関数
37     inline Filter::Handler makeFilterHandler
38     (
39             const Manipulator< Vector2D >::Handler&  body ,
40         const Vector2D& filter
41     )
42         {
43         return Filter::Handler
44             (
45                 new Filter( body , filter  )
46             );
47         }
48 //}}}
49
50 } // namespace mof
51