Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TCG_IMAGE_OPS_H
Toshihiro Shimizu 890ddd
#define TCG_IMAGE_OPS_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// tcg includes
Toshihiro Shimizu 890ddd
#include "pixel_ops.h"
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
namespace tcg {
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//***********************************************************************
Toshihiro Shimizu 890ddd
//    Image Traits  definition
Toshihiro Shimizu 890ddd
//***********************************************************************
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
template <typename img=""></typename>
Toshihiro Shimizu 890ddd
struct image_traits_types {
Shinya Kitaoka 120a6e
  typedef Img image_type;
Shinya Kitaoka 120a6e
  typedef typename Img::pixel_type pixel_type;
Shinya Kitaoka 120a6e
  typedef typename Img::pixel_ptr_type pixel_ptr_type;
Shinya Kitaoka 120a6e
  typedef typename Img::pixel_category pixel_category;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
template <typename img=""></typename>
Shinya Kitaoka 120a6e
class image_traits : public image_traits_types {
Shinya Kitaoka 120a6e
  typedef image_traits_types tr;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  static int width(const typename tr::image_type &img);
Shinya Kitaoka 120a6e
  static int height(const typename tr::image_type &img);
Shinya Kitaoka 120a6e
  static int wrap(const typename tr::image_type &img);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  static typename tr::pixel_ptr_type pixel(const typename tr::image_type &img,
Shinya Kitaoka 120a6e
                                           int x, int y);
Shinya Kitaoka 120a6e
  static typename tr::pixel_type outsideColor(
Shinya Kitaoka 120a6e
      const typename tr::image_type &img);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
namespace image_ops {
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//***********************************************************************
Toshihiro Shimizu 890ddd
//    Image Functions
Toshihiro Shimizu 890ddd
//***********************************************************************
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
template <typename imgin,="" imgout,="" scalar="" typename=""></typename>
Toshihiro Shimizu 890ddd
void blurRows(const ImgIn &imgIn, ImgOut &imgOut, int radius, Scalar = 0);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
template 
Shinya Kitaoka 120a6e
          typename Scalar>
Shinya Kitaoka 120a6e
void blurRows(const ImgIn &imgIn, ImgOut &imgOut, int radius, SelectorFunc func,
Shinya Kitaoka 120a6e
              Scalar = 0);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
template <typename imgin,="" imgout,="" scalar="" typename=""></typename>
Toshihiro Shimizu 890ddd
void blurCols(const ImgIn &imgIn, ImgOut &imgOut, int radius, Scalar = 0);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
template 
Shinya Kitaoka 120a6e
          typename Scalar>
Shinya Kitaoka 120a6e
void blurCols(const ImgIn &imgIn, ImgOut &imgOut, int radius, SelectorFunc func,
Shinya Kitaoka 120a6e
              Scalar = 0);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
template <typename img,="" scalar="" typename=""></typename>
Toshihiro Shimizu 890ddd
void blur(const Img &imgIn, Img &imgOut, int radius, Scalar = 0);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
template <typename img,="" scalar="" selectorfunc,="" typename=""></typename>
Shinya Kitaoka 120a6e
void blur(const Img &imgIn, Img &imgOut, int radius, SelectorFunc func,
Shinya Kitaoka 120a6e
          Scalar = 0);
Toshihiro Shimizu 890ddd
}
Shinya Kitaoka 120a6e
}  // namespace tcg::image_ops
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
#endif  // TCG_IMAGE_OPS_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//===================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifdef INCLUDE_HPP
Toshihiro Shimizu 890ddd
#include "hpp/image_ops.hpp"
Shinya Kitaoka 120a6e
#endif  // INCLUDE_HPP