Back to Aurora Vision Library website

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

DrawRegions_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 regions on an image with multiple colors.

Syntax

void avs::DrawRegions_MultiColor
(
	const avl::Image& inImage,
	atl::Conditional<const atl::Array<atl::Conditional<avl::Region>>&> inRegions,
	atl::Optional<const avl::CoordinateSystem2D&> inRegionAlignment,
	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 inRegions Conditional<const Array<Conditional<Region>>&> { }
Input value inRegionAlignment Optional<const CoordinateSystem2D&> NIL
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 regions on the inImage using common drawing parameters for all of them. Regions may exceed the image dimensions - those will be drawn partially or not at all, but the filter execution will succeed.

Hints

  • If you want to draw on an empty background, use EmptyImage function before.
  • Define inRegions 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 array 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 DrawRegions_MultiColor on an empty image.

Errors

List of possible exceptions:

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

See Also

  • DrawBox – Draws a box on an image.