tahoma2d/toonz/sources/include/tcg/image_ops.h

78 lines
2.4 KiB
C
Raw Normal View History

2016-03-19 06:57:51 +13:00
#ifndef TCG_IMAGE_OPS_H
#define TCG_IMAGE_OPS_H
// tcg includes
#include "pixel_ops.h"
2016-06-15 18:43:10 +12:00
namespace tcg {
2016-03-19 06:57:51 +13:00
//***********************************************************************
// Image Traits definition
//***********************************************************************
template <typename Img>
struct image_traits_types {
2016-06-15 18:43:10 +12:00
typedef Img image_type;
typedef typename Img::pixel_type pixel_type;
typedef typename Img::pixel_ptr_type pixel_ptr_type;
typedef typename Img::pixel_category pixel_category;
2016-03-19 06:57:51 +13:00
};
//-------------------------------------------------------------------
template <typename Img>
2016-06-15 18:43:10 +12:00
class image_traits : public image_traits_types<Img> {
typedef image_traits_types<Img> tr;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
static int width(const typename tr::image_type &img);
static int height(const typename tr::image_type &img);
static int wrap(const typename tr::image_type &img);
static typename tr::pixel_ptr_type pixel(const typename tr::image_type &img,
int x, int y);
static typename tr::pixel_type outsideColor(
const typename tr::image_type &img);
2016-03-19 06:57:51 +13:00
};
2016-06-15 18:43:10 +12:00
namespace image_ops {
2016-03-19 06:57:51 +13:00
//***********************************************************************
// Image Functions
//***********************************************************************
template <typename ImgIn, typename ImgOut, typename Scalar>
void blurRows(const ImgIn &imgIn, ImgOut &imgOut, int radius, Scalar = 0);
2016-06-15 18:43:10 +12:00
template <typename ImgIn, typename ImgOut, typename SelectorFunc,
typename Scalar>
void blurRows(const ImgIn &imgIn, ImgOut &imgOut, int radius, SelectorFunc func,
Scalar = 0);
2016-03-19 06:57:51 +13:00
template <typename ImgIn, typename ImgOut, typename Scalar>
void blurCols(const ImgIn &imgIn, ImgOut &imgOut, int radius, Scalar = 0);
2016-06-15 18:43:10 +12:00
template <typename ImgIn, typename ImgOut, typename SelectorFunc,
typename Scalar>
void blurCols(const ImgIn &imgIn, ImgOut &imgOut, int radius, SelectorFunc func,
Scalar = 0);
2016-03-19 06:57:51 +13:00
template <typename Img, typename Scalar>
void blur(const Img &imgIn, Img &imgOut, int radius, Scalar = 0);
template <typename Img, typename SelectorFunc, typename Scalar>
2016-06-15 18:43:10 +12:00
void blur(const Img &imgIn, Img &imgOut, int radius, SelectorFunc func,
Scalar = 0);
2016-03-19 06:57:51 +13:00
}
2016-06-15 18:43:10 +12:00
} // namespace tcg::image_ops
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
#endif // TCG_IMAGE_OPS_H
2016-03-19 06:57:51 +13:00
//===================================================================
#ifdef INCLUDE_HPP
#include "hpp/image_ops.hpp"
2016-06-15 18:43:10 +12:00
#endif // INCLUDE_HPP