ivl 679
ivl::image< T, OPTS > Class Template Reference

A single or multi channel image of type T based on array. More...

#include <image.hpp>

Inherits ivl::array_common_base< C >.

List of all members.

Public Types

typedef ivl::color< T, OPTS::Ch > color_type
 color type
typedef types::t_if
< types::t_expr< N!=1 >, array
< T, data::ref_iterator
< const_iterator_nd,
types::term, N > >, typename
const_iterator::reference >
::type 
const_pixel
 const pixel type

Public Member Functions

color_type black () const
 predefined colors
size_t channels () const
 color channels
const_pixel col (const const_iterator &it) const
 const pixel from iterator
pixel col (size_t row, size_t col)
 pixel access
pixel col (const best_iterator &it)
 pixel from iterator
const_pixel col (size_t row, size_t col) const
 const pixel access
size_t cols () const
 image columns
size_t height () const
 image height. same as rows
iplimage_t * ipl () const
 Conversion to IplImage.
size_t rows () const
 image rows
size_t width () const
 image width. same as columns
Constructors
 image ()
 Default constructor. always assign at least 1 channel to the image.
 image (size_t rows, size_t cols, size_t channels=(!N?3:N))
 Create an empty image.
 image (size_t rows, size_t cols, size_t channels, const T &value)
 Create an image with initial value.
template<class J , class D >
 image (size_t rows, size_t cols, size_t channels, const array< J, D > &a)
 Create an image with size and pointer to data.
template<class S >
 image (const array< size_t, S > &sz)
 Create an image with size array.
template<class S >
 image (const array< size_t, S > &sz, const T &value)
 Create an image with size array and initial value.
template<class S >
 image (const array< size_t, S > &sz, const T *ptr)
 Create an image with size array and pointer to data.
template<class S >
 image (const array< size_t, S > &sz, const data_init_arg &data)
 Create an image with size array and a data_init_arg.
template<class S , class J , class D >
 image (const array< size_t, S > &sz, const array< J, D > &a)
 Create an image with size array and ivl::array or value.
 image (const std::string &filename, image_channels channels=ic_auto)
 Create an image from filename.
 image (const iplimage_t *ipl)
 Create an image from an IplImage.
template<class J , class S >
 image (const array_nd< J, S > &a)
 Construct from array_nd.
template<class J , class S >
 image (array_nd< J, S > &a)
 (special for ref_iterator) Construct from array_nd
 image (const this_type &a)
 Copy constructor.
Assignment operators
template<class K >
derived_type & operator= (const K &k)
this_typeoperator= (const this_type &a)
derived_type & operator= (const iplimage_t *src)
 assign from an OpenCV IplImage
derived_type & operator= (iplimage_t *src)
 assign from an OpenCV IplImage
Basic plotting (not fast implementations)
derived_type & put_pixel (double_point< 2 > a, color_type col=ivl::white< T, rgb >())
 Draws a single pixel.
color_type get_pixel (double_point< 2 > a)
 Retrieves the color of a single pixel.
derived_type & line (double_point< 2 > a, double_point< 2 > b, color_type col=ivl::white< T, rgb >(), double thickness=1.5, double opacity=1.)
 Draws line from a => b, using the given color, thickness and opacity. anti-aliasing is performed.
derived_type & circle (double_point< 2 > a, double radius, color_type col=ivl::white< T, rgb >(), double thickness=1.5, double opacity=1.)
 Draws circle on a with given radius, using the given color, thickness and opacity. anti-aliasing is performed.
derived_type & rect (double_point< 2 > a, double_point< 2 > b, color_type col=ivl::white< T, rgb >(), double thickness=1.5, double opacity=1.)
 Draws a rectangle from corner a to corner b, using the given color, thickness and opacity. anti-aliasing is performed.
derived_type & ellipse (double_point< 2 > a, double_point< 2 > b, double radius, color_type col=ivl::white< T, rgb >(), double thickness=1.5, double opacity=1.)
 Draws an ellipse using centers and and total radius radius, using the given color, thickness and opacity. anti-aliasing is performed.
derived_type & ellipse (double_point< 2 > c, double radius1, double radius2, double angle, color_type col=ivl::white< T, rgb >(), double thickness=1.5, double opacity=1.)
derived_type & fill_circle (double_point< 2 > a, double radius, color_type col=ivl::white< T, rgb >(), double opacity=1.)
derived_type & fill_rect (double_point< 2 > a, double_point< 2 > b, color_type col=ivl::white(ivl::color_type< T, rgb >()), double opacity=1.)
 Fills circle on a with given radius, using the given color and opacity. anti-aliasing is performed.
derived_type & fill_ellipse (double_point< 2 > a, double_point< 2 > b, double radius, color_type col=ivl::white(ivl::color_type< T, rgb >()), double opacity=1.)
 Fills an ellipse using centers and and total radius radius, using the given color and opacity. anti-aliasing is performed.
derived_type & fill_ellipse (double_point< 2 > c, double radius1, double radius2, double angle, color_type col=ivl::white(ivl::color_type< T, rgb >()), double opacity=1.)
derived_type & fill_triangle (double_point< 2 > a, double_point< 2 > b, double_point< 2 > c, color_type col=ivl::white(ivl::color_type< T, rgb >()), double opacity=1.)
 Fills a triangle (a, b, c) using the given color and opacity. anti-aliasing is performed.
derived_type & fill_quad (double_point< 2 > a, double_point< 2 > b, double_point< 2 > c, double_point< 2 > d, color_type col=ivl::white(ivl::color_type< T, rgb >()), double opacity=1.)
 Fills a quad (a, b, c, d) using the given color and opacity. anti-aliasing is performed.

Detailed Description

template<class T, class OPTS = data::normal_image<0>>
class ivl::image< T, OPTS >

A single or multi channel image of type T based on array.

This class defines an image based on an array.


Constructor & Destructor Documentation

template<class T, class OPTS = data::normal_image<0>>
template<class J , class D >
ivl::image< T, OPTS >::image ( size_t  rows,
size_t  cols,
size_t  channels,
const array< J, D > &  a 
) [inline]

Create an image with size and pointer to data.

Create an empty image with similar initial value or array

template<class T , class S >
image< T, S >::image ( const std::string &  filename,
image_channels  channels = ic_auto 
)

Create an image from filename.

Construct from filename.

template<class T , class S >
image< T, S >::image ( const iplimage_t *  ipl)

Create an image from an IplImage.

Construct from IplImage.


Member Function Documentation

template<class T, class OPTS = data::normal_image<0>>
derived_type& ivl::image< T, OPTS >::ellipse ( double_point< 2 >  c,
double  radius1,
double  radius2,
double  angle,
color_type  col = ivl::white<T, rgb>(),
double  thickness = 1.5,
double  opacity = 1. 
) [inline]

Draws an ellipse using center , a given and radius1, radius2 of the two axis, horizontal and vertical. using the given color, thickness and opacity. anti-aliasing is performed

template<class T, class OPTS = data::normal_image<0>>
derived_type& ivl::image< T, OPTS >::fill_ellipse ( double_point< 2 >  c,
double  radius1,
double  radius2,
double  angle,
color_type  col = ivl::white(ivl::color_type<T, rgb>()),
double  opacity = 1. 
) [inline]

Fills an ellipse using center , a given and radius1, radius2 of the two axis, horizontal and vertical. using the given color and opacity. anti-aliasing is performed


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations