iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Cut/Paste Operations

Methods used for cutting and pasting Images

See Also
Image Drawing
Image class template and related classes and functions

Functions

template<class PixType >
void nrt::paste (Image< PixType > &destination, Image< PixType > const source, Point2D< int32 > const &pos)
 Paste a source Image into the destination at the given position. More...
 
template<class PixType >
Image< PixType > const nrt::concatX (Image< PixType > const left, Image< PixType > const right, PixType const bgColor=PixType(0))
 Horizontally concatenate two Images. More...
 
template<class PixType >
Image< PixType > const nrt::concatY (Image< PixType > const top, Image< PixType > const bottom, PixType const bgColor=PixType(0))
 Vertically concatenate two Images. More...
 
template<class PixType >
Image< PixType > const nrt::crop (Image< PixType > const source, Rectangle< int32 > const &rect)
 Extract a sub-image from the source Image. More...
 
template<class PixType >
ImageSet< PixType > const nrt::crop (ImageSet< PixType > const source, Rectangle< int32 > const &rect)
 Extract a sub-ImageSet from the source ImageSet.
 
GenericImage const nrt::crop (GenericImage const source, Rectangle< int32 > const &rect)
 Extract a sub-image from the source Image, GenericImage version.
 
template<class PixType >
Image< PixType > const nrt::cropAndFill (Image< PixType > const source, Rectangle< int32 > const &rect, PixType const bgColor=PixType(0))
 Extract a subImage from the source Image. More...
 
GenericImage const nrt::cropAndFill (GenericImage const source, Rectangle< int32 > const &rect, PixRGB< float > const bgColor=PixRGB< float >(0.0F))
 Extract a subImage from the source Image, GenericImage version. More...
 
template<class PixType >
Image< PixType > const nrt::warpedCrop (Image< PixType > const source, Rectangle< int32 > const &rect, Eigen::AffineCompact2f const &m, PixType const bgColor=PixType(0))
 Extract a warped sub-image from the source Image using the provided warping matrix. More...
 

Function Documentation

template<class PixType >
void nrt::paste ( nrt::Image< PixType > &  destination,
nrt::Image< PixType > const  source,
Point2D< int32 > const &  pos 
)
inline

Paste a source Image into the destination at the given position.

Only the overlapping portions of the source Image will actually be copied into the destination.

Definition at line 42 of file CutPasteImpl.H.

References nrt::Image< T, Flags >::begin(), nrt::Image< T, Flags >::const_begin(), nrt::Image< T, Flags >::dims(), nrt::Image< T, Flags >::height(), nrt::Image< T, Flags >::size(), nrt::Image< T, Flags >::width(), nrt::Point2D< T >::x(), and nrt::Point2D< T >::y().

Referenced by nrt::Layout< T >::renderInto().

template<class PixType >
Image<PixType> const nrt::concatX ( Image< PixType > const  left,
Image< PixType > const  right,
PixType const  bgColor = PixType(0) 
)

Horizontally concatenate two Images.

The resulting Image will have height equal to the larger of the left and right Images' heights.

template<class PixType >
Image<PixType> const nrt::concatY ( Image< PixType > const  top,
Image< PixType > const  bottom,
PixType const  bgColor = PixType(0) 
)

Vertically concatenate two Images.

The resulting Image will have width equal to the larger of the top and bottom Images' widths.

template<class PixType >
Image<PixType> const nrt::crop ( Image< PixType > const  source,
Rectangle< int32 > const &  rect 
)

Extract a sub-image from the source Image.

The resulting Image will have a size of the intersection between the requested Rectangle and the source Image.

template<class PixType >
Image<PixType> const nrt::cropAndFill ( Image< PixType > const  source,
Rectangle< int32 > const &  rect,
PixType const  bgColor = PixType(0) 
)

Extract a subImage from the source Image.

Any portion of the Rectangle that lies outside of the source Image will be filled with bgColor in the crop.

nrt::GenericImage const nrt::cropAndFill ( nrt::GenericImage const  source,
Rectangle< int32 > const &  rect,
nrt::PixRGB< float > const  bgColor = PixRGB<float>(0.0F) 
)
inline

Extract a subImage from the source Image, GenericImage version.

Because the image is generic, we don't know what its pixel type is, which is a problem for specifying the bgColor. Here we just specity it as PixRGB<float> which will then be converted to whatever the actual GenericImage's content PixType is.

Definition at line 207 of file CutPasteImpl.H.

References nrt::GenericImage::apply_visitor().

template<class PixType >
Image<PixType> const nrt::warpedCrop ( Image< PixType > const  source,
Rectangle< int32 > const &  rect,
Eigen::AffineCompact2f const &  m,
PixType const  bgColor = PixType(0) 
)

Extract a warped sub-image from the source Image using the provided warping matrix.

The resulting Image will have a size of the intersection between the requested Rectangle and the source Image. Pixels falling outside the source image will be filled-in with value bgColor.