Back to Aurora Vision Library website

You are here: Start » Function Reference » All Functions » Image Drawing » DrawBoxes_MultiColor

DrawBoxes_MultiColor


This is Filter Equivalent. This function may be present in generated code, but should not be used in hand-written code.

Header: AVL.h
Namespace: avs
Module: FoundationLite

Draws boxes on an image with multiple colors.

Syntax

void avs::DrawBoxes_MultiColor
(
	const avl::Image& inImage,
	atl::Conditional<const atl::Array<atl::Conditional<avl::Box>>&> inBoxes,
	atl::Optional<const atl::Array<atl::Conditional<avl::Hash>>&> inColorIds,
	atl::Optional<const atl::Array<avl::Pixel>&> inPalette,
	const float inOpacity,
	const bool inForceRgb,
	avl::Image& outImage
)

Parameters

Name Type Range Default Description
Input value inImage const Image& Input image
Input value inBoxes Conditional<const Array<Conditional<Box>>&> { }
Input value inColorIds Optional<const Array<Conditional<Hash>>&> NIL
Input value inPalette Optional<const Array<Pixel>&> { Pixel ( X: 200.0f Y: 0.0f Z: 0.0f W: 0.0f ), Pixel ( X: 0.0f Y: 200.0f Z: 0.0f W: 0.0f ) }
Input value inOpacity const float 0.0 - 1.0 1.0f
Input value inForceRgb const bool True Filter will convert monochromatic image to RGB if needed
Output value outImage Image& Output image

In-place Processing

This function supports in-place data processing - you can pass the same reference to inImage and outImage

Read more about In-place Computation.

Description

The operation draws an array of boxes on the inImage using common drawing parameters for all of them. Boxes may exceed the image dimensions - those will be drawn partially or not at all, but the filter execution will succeed. Note that drawing is conducted in a pixel-precise way as the Box type is pixel-precise.

Hints

  • Connect an image source to the inImage input. Drawing will be done on this image.
  • If you want to draw on an empty background, use EmptyImage function before.
  • Define inBoxes. This will be the primitives to be drawn.
  • Leave inPalette and inColorIds not set to have all the primitives drawn with random colors. Set a custom palette of colors here to decide explicitly how each of the primitives should be drawn using inColorIds.
  • Set inForceRgb to True, if you want to get a 3-channel output regardless of what is on the input.

Examples

Example usage of the DrawBoxes_MultiColor on an empty image.

Errors

List of possible exceptions:

Error type Description
DomainError Empty inPalette while inBoxes has objects to draw in DrawBoxes_MultiColor.
DomainError No palette defined with inPalette for specified inColorIds in DrawBoxes_MultiColor.
DomainError The sizes inBoxes and inColorIds do not match in DrawBoxes_MultiColor.

See Also