You are here: Start » Function Reference » Image Combinators » ComposeImages
Takes pixels from the first image within the specified region and from the other one elsewhere.
Header: | AVL.h |
---|
Syntax
void avl::ComposeImages ( const avl::Image& inImage1, const avl::Image& inImage2, const avl::Region& inRegion, atl::Optional<const avl::Region&> inRoi, avl::Image& outImage )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
inImage1 | const Image& | First source of pixels marked in inRegion | ||
inImage2 | const Image& | Background image | ||
inRegion | const Region& | Region which describes which pixels should be taken from inImage1 | ||
inRoi | Optional<const Region&> | NIL | Region in which pixels should be processed otherwise black pixels are placed | |
outImage | Image& | Image composed of tho input images |
Description
The operation computes the composition of two images. Each outImage pixel is equal to the corresponding pixel of inImage1 iff its location lies inside the inRegion; otherwise the pixel is equal to the corresponding pixel of the inImage2.
The operation requires that the images being processed have equal format and dimensions, otherwise an error with appropriate description occurs. To obtain an image of desired dimensions one can use ResizeImage or CropImage filter. To alter the pixel type of an image one can use ConvertPixelType filter. ConvertToMultichannel and AverageChannels filters allow to alter the number of image channels.
Examples
In-place Processing
This function supports in-place data processing - you can pass the same reference to inImage1 and outImage, inImage2 and outImage
Errors
Error type | Description |
---|---|
DomainError | Image sizes are not equal in ComposeImages. |
DomainError | Image formats are not the same in ComposeImages. |
DomainError | inRegion frame exceeds image in ComposeImages. |
See Also
- DrawGridImage – Draws an image as a tile on an image considered to be a grid of tiles.
- JoinImages – Creates a single image by glueing together the two input images in horizontal or vertical direction.