inline
void convert_scale_abs( View_Src&     src
                      , View_Dst&     dst
                      , const double& scale = 1.0
                      , const double& shift = 0.0
                      )
{
    // color spaces must be equal
    BOOST_STATIC_ASSERT(( boost::is_same< typename color_space_type< View_Src >::type
                                        , typename color_space_type< View_Dst >::type
                                        >::type::value
                       ));

    // destination image should have 8 bit unsigned channels
    BOOST_STATIC_ASSERT(( boost::is_same< bits8
                                        , typename channel_type< View_Dst >::type
                                        >::type::value
                       ));

    ipl_image_wrapper src_ipl = create_ipl_image( src );
    ipl_image_wrapper dst_ipl = create_ipl_image( dst );

    convert_scale_abs_( src_ipl
                      , dst_ipl
                      , scale
                      , shift
                      );
}
예제 #2
0
inline
void cvtcolor( View_Src src
               , View_Dst dst
               , const boost::mpl::false_& // is bit aligned
             )
{
    typedef typename channel_type< View_Src >::type src_channel_t;
    typedef typename channel_type< View_Dst >::type dst_channel_t;

    // Only 8u, 16u, and 32f is allowed.
    BOOST_STATIC_ASSERT(( boost::mpl::or_< allowed_channel_type< src_channel_t >
                          , allowed_channel_type< dst_channel_t >
                          >::value ));

    // Channel depths need to match.
    BOOST_STATIC_ASSERT(( boost::is_same< src_channel_t
                          , dst_channel_t >::value ));

    typedef typename View_Src::value_type::layout_t SrcLayout;
    typedef typename View_Dst::value_type::layout_t DstLayout;

    ipl_image_wrapper src_ipl = create_ipl_image( src );
    ipl_image_wrapper dst_ipl = create_ipl_image( dst );

    cvtcolor_impl( src_ipl
                   , dst_ipl
                   , is_supported< SrcLayout
                   , DstLayout
                   >()
                 );
}
void resize( View                 src
           , View                 dst
           , const Interpolation& interpolation
           , typename boost::enable_if< typename boost::is_base_of< interpolation_base 
                                                                  , Interpolation
                                                                  >::type
                                      >::type* ptr = 0
           )
{
    ipl_image_wrapper src_ipl = create_ipl_image( src );
    ipl_image_wrapper dst_ipl = create_ipl_image( dst );

    resize( src_ipl
          , dst_ipl
          , interpolation
          );
}
예제 #4
0
void drawFillPoly( VIEW&                  view
                   , const curve_vec_t&     curves
                   , typename VIEW::pixel_t color   )
{
    drawFillPoly( create_ipl_image( view )
                  , curves
                  , color                    );
}
예제 #5
0
void drawLine( VIEW&                  view
               , point_t                start
               , point_t                end
               , typename VIEW::pixel_t color
               , std::size_t            line_width )
{
    drawLine( create_ipl_image( view )
              , start
              , end
              , color
              , line_width               );
}
예제 #6
0
void drawCircle( VIEW&                  view
                 , point_t                center
                 , std::size_t            radius
                 , typename VIEW::pixel_t color
                 , std::size_t            line_width )
{
    drawCircle( create_ipl_image( view )
                , center
                , radius
                , color
                , line_width                );
}
예제 #7
0
void drawRectangle( VIEW&                  view
                    , point_t                start
                    , point_t                end
                    , typename VIEW::pixel_t pixel
                    , std::size_t            line_width )
{
    drawRectangle( create_ipl_image( view )
                   , start
                   , end
                   , pixel
                   , line_width                 );
}
예제 #8
0
void drawPolyLine( VIEW&                  view
                   , const curve_vec_t&     curves
                   , bool                   is_closed
                   , typename VIEW::pixel_t color
                   , std::size_t            line_width )
{
    drawPolyLine( create_ipl_image( view )
                  , curves
                  , is_closed
                  , color
                  , line_width               );
}
예제 #9
0
inline
void drawRectangle( View                      view
                  , point_t                   start
                  , point_t                   end
                  , typename View::value_type color
                  , std::size_t               thickness
                  , const Line_Type&          line_type )
{
   drawRectangle( create_ipl_image( view )
                , start
                , end
                , color
                , thickness
                , line_type
                );
}