Represents tiled layouts of arbitrary numbers of images of different sizes. More...
#include <Image/Layout.H>
Public Types | |
enum | Dir { H, V } |
Public Member Functions | |
Layout (const Image< T > &p) | |
Layout (const Layout< T > &p1, const Layout< T > &p2, Dir d) | |
Layout (const Image< T > *imgs, const size_t nimgs, Dir d) | |
Layout (const ImageSet< T > &imgs, Dir d) | |
Layout (const Layout< T > *imgs, const size_t nimgs, Dir d) | |
bool | initialized () const |
Dims | getDims () const |
int | getWidth () const |
int | getHeight () const |
Dir | getDir () const |
size_t | numParts () const |
const Layout< T > & | part (size_t i) const |
const Image< T > & | leafImage () const |
Image< T > | render () const |
Image< T > | render (const T &bgcol) const |
void | renderInto (Image< T > &x, const Point2D< int > p) const |
Represents tiled layouts of arbitrary numbers of images of different sizes.
Previously, when we wanted to build up a big image of different individual images (e.g. for display), we had two choices:
Now, with the Layout class, we get both efficiency and syntactical convenience. Instead of concatX() and concatY(), we use hcat() and vcat() which construct Layout objects (with arbitrary nesting); none of these calls involves any pixel copying. Instead we just keep track of the tile structure that is desired. Then when the final Layout has been constructed, it can be rendered into an Image in a single pass with the render() call.
For example, where previously you would have done
Image<byte> = concatX(e, concatY(concatX(a,b), concatX(c,d)));
now you would do
Image<byte> = hcat(e, vcat(hcat(a,b), hcat(c,d))).render();
Definition at line 76 of file Layout.H.