|
iLab Neuromorphic Robotics Toolkit
0.1
|
Methods used for cutting and pasting Images
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. | |
| 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. | |
| 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. | |
| template<class PixType > | |
| Image< PixType > const | nrt::crop (Image< PixType > const source, Rectangle< int32 > const &rect) |
| Extract a sub-image from the source Image. | |
| 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. | |
| 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. | |
| 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. | |
| 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::Dims< T >::contains(), 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::concatX(), nrt::concatY(), nrt::cropAndFill(), nrt::Layout< T >::renderInto(), and nrt::rotate().
| nrt::Image< PixType > const nrt::concatX | ( | nrt::Image< PixType > const | left, |
| nrt::Image< PixType > const | right, | ||
| PixType const | bgColor = PixType(0) |
||
| ) | [inline] |
Horizontally concatenate two Images.
The resulting Image will have height equal to the larger of the left and right Images' heights.
Definition at line 77 of file CutPasteImpl.H.
References nrt::Image< T, Flags >::height(), nrt::paste(), and nrt::Image< T, Flags >::width().
| nrt::Image< PixType > const nrt::concatY | ( | nrt::Image< PixType > const | top, |
| nrt::Image< PixType > const | bottom, | ||
| PixType const | bgColor = PixType(0) |
||
| ) | [inline] |
Vertically concatenate two Images.
The resulting Image will have width equal to the larger of the top and bottom Images' widths.
Definition at line 96 of file CutPasteImpl.H.
References nrt::Image< T, Flags >::height(), nrt::paste(), and nrt::Image< T, Flags >::width().
| nrt::Image< PixType > const nrt::crop | ( | nrt::Image< PixType > const | source, |
| Rectangle< int32 > const & | rect | ||
| ) | [inline] |
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.
Definition at line 114 of file CutPasteImpl.H.
References nrt::Rectangle< T >::area(), nrt::Image< T, Flags >::begin(), nrt::Image< T, Flags >::const_begin(), nrt::Rectangle< T >::dims(), nrt::Image< T, Flags >::dims(), nrt::Rectangle< T >::intersected(), nrt::Rectangle< T >::left(), nrt::Rectangle< T >::top(), and nrt::Image< T, Flags >::width().
Referenced by nrt::crop(), and nrt::cropAndFill().
| nrt::Image< PixType > const nrt::cropAndFill | ( | nrt::Image< PixType > const | source, |
| Rectangle< int32 > const & | rect, | ||
| PixType const | bgColor = PixType(0) |
||
| ) | [inline] |
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.
Definition at line 168 of file CutPasteImpl.H.
References nrt::Rectangle< T >::area(), nrt::crop(), nrt::Rectangle< T >::dims(), nrt::Image< T, Flags >::dims(), nrt::Rectangle< T >::intersected(), nrt::Rectangle< T >::left(), nrt::paste(), and nrt::Rectangle< T >::top().
| 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().
| nrt::Image< PixType > const nrt::warpedCrop | ( | nrt::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.
Definition at line 213 of file CutPasteImpl.H.
References nrt::Image< T, Flags >::begin(), nrt::Rectangle< T >::bottomO(), nrt::Rectangle< T >::center(), nrt::Image< T, Flags >::coordsOk(), nrt::Rectangle< T >::dims(), nrt::Image< T, Flags >::interpolate(), nrt::Rectangle< T >::left(), nrt::None, nrt::Rectangle< T >::rightO(), and nrt::Rectangle< T >::top().