Color Components

Functional Guide | Reference: Compose, ConvertFromRgb, GetComponent

//////////////////////////////////////////////////////////
// This code snippet shows how to create a color image //
// from 3 grayscale images and extract the luminance //
// component from a color image. //
//////////////////////////////////////////////////////////
// Images constructor
EImageBW8 red, green, blue;
EImageC24 colorImage;
EImageBW8 luminance;
// ...
// Source and destination images must have the same size
colorImage.SetSize(&red);
// Combine the color planes into a color image
EasyColor::Compose(&red, &green, &blue, &colorImage);
// Prepare a lookup table for
// the RGB to LSH conversion
EColorLookup lookup;
lookup.ConvertFromRgb(EColorSystem_Lsh);
// Source and destination images must have the same size
luminance.SetSize(&colorImage);
// Get the Luminance component
EasyColor::GetComponent(&colorImage, &luminance, 0, &lookup);
'//////////////////////////////////////////////////////////
'// This code snippet shows how to create a color image //
'// from 3 grayscale images and extract the luminance //
'// component from a color image. //
'//////////////////////////////////////////////////////////
' EasyColor context constructor
Dim EasyColor As New EasyColor
' Images constructor
Dim red As New EImageBW8
Dim green As New EImageBW8
Dim blue As New EImageBW8
Dim colorImage As New EImageC24
Dim luminance As New EImageBW8
' ...
' Combine the color planes into a color image
EasyColor.Compose red, green, blue, colorImage
' Prepare a lookup table for
' the RGB to LSH conversion
Dim lookup As New EColorLookup
lookup.ConvertFromRgb EColorSystem_Lsh
' Get the Luminance component
EasyColor.GetComponent colorImage, luminance, 0, lookup
//////////////////////////////////////////////////////////
// This code snippet shows how to create a color image //
// from 3 grayscale images and extract the luminance //
// component from a color image. //
//////////////////////////////////////////////////////////
// Images constructor
EImageBW8 red= new EImageBW8();
EImageBW8 green= new EImageBW8();
EImageBW8 blue= new EImageBW8();
EImageC24 colorImage= new EImageC24();
EImageBW8 luminance= new EImageBW8();
// ...
// Source and destination images must have the same size
colorImage.SetSize(red);
// Combine the color planes into a color image
EasyColor.Compose(red, green, blue, colorImage);
// Prepare a lookup table for
// the RGB to LSH conversion
EColorLookup lookup= new EColorLookup();
lookup.ConvertFromRgb(EColorSystem.Lsh);
// Source and destination images must have the same size
luminance.SetSize(colorImage);
// Get the Luminance component
EasyColor.GetComponent(colorImage, luminance, 0, lookup);