You are here: Start » AVL.NET » Function Reference » Image » Image Conversions » AVL.AddChannels_Saturation

AVL.AddChannels_Saturation

Creates a monochromatic image by summing the values of the input image channels with saturation.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void AddChannels_Saturation
(
	AvlNet.Image inImage,
	NullableRef<AvlNet.Region> inRoi,
	AvlNet.Image outImage
)

Parameters

Name Type Range Default Description
inImageAvlNet.ImageInput image.
inRoiAvlNet.NullableRef<AvlNet.Region>Range of pixels to be processed. Default value: atl::NIL.
outImageAvlNet.Imageoutput mono image.

Description

This operation sums with saturation values of the given inImage image channels to obtain a monochromatic image.

Firstly, the filter performs ordinary addition of pixel values from each channel. Then, comparison with maximal allowable value for single channel is performed. Such value depends on the pixel type - for example, if the pixel type is UInt8, maximal allowable value for each single channel is 255. The result of addition with saturation is chosen as a minimal value of computed sum and allowable maximum - for example, if the input image has three R, G, B channels and pixel type of UInt8, the result of addition with saturation is chosen as min(R + G + B, 255).

Examples

Image with one channel on the input of the filter (on the left) doesn't affect the image - see the image on the right.

Input RGB image (on the left) converted to single-channel image (on the right) with pixel values obtained from summing with saturation values of input image channels. In the picture on the left-hand side, pixel values in the colorful squares are {255, 255, 0}, {255, 0, 255} and {0, 255, 255}, and their type is UInt8. After addition with saturation, values of corresponding pixels in the output image will be {255} - because maximal value for UInt8 pixels is 255 and min(255 + 0 + 255, 255) is 255.

Hardware Acceleration

This operation is optimized for AVX2 technology for pixels of types: 2xUINT8, 3xUINT8, 4xUINT8, 2xUINT16, 3xUINT16, 4xUINT16.

This operation is optimized for SSSE3 technology for pixels of types: 2xUINT8, 3xUINT8, 4xUINT8, 2xUINT16, 3xUINT16, 4xUINT16.

This operation supports automatic parallelization for multicore and multiprocessor systems.

Hardware acceleration settings may be manipulated with Settings class.

Errors

List of possible exceptions:

Error type Description
DomainError Region exceeds an input image in AddChannels_Saturation.

Function Overrides

See also