F_VN_GenerateColorMap

F_VN_GenerateColorMap 1:

Generates a pre-defined color map.

Syntax

Definition:

FUNCTION F_VN_GenerateColorMap : HRESULT
VAR_INPUT
    ipColorMap    : Reference To ITcVnContainer;
    eColorMap     : ETcVnColorMap;
    eColorMapSize : ETcVnColorMapSize;
    hrPrev        : HRESULT;
END_VAR

F_VN_GenerateColorMap 2: Inputs

Name

Type

Description

ipColorMap

Reference To ITcVnContainer

Returns the color map (ContainerType_Vector_TcVnVector3_REAL with 256 or 65536 elements)

eColorMap

ETcVnColorMap

Selects a color map (similar to GNU Octave/MATLAB types)

eColorMapSize

ETcVnColorMapSize

Defines how many elements the generated color map should have

hrPrev

HRESULT

HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.)

F_VN_GenerateColorMap 3: Return value

HRESULT

Further information

The function F_VN_GenerateColorMap creates a color table that can be applied to an image with the function F_VN_ApplyColorMap.

Parameter

Color Map

The parameter ipColorMap returns the color table created.

Color gradient

The color gradient eColorMap of the color table is defined via the enum ETcVnColorMap. If you wish to define a color gradient manually, use the function F_VN_GenerateCustomColorMap.

Size of the color table

The size eColorMapSize is specified via the enum ETcVnColorMapSize and defines whether the color table is created for 8-bit images (TCVN_CMS_256) or for 16-bit images (TCVN_CMS_65536).

Application

VAR
    ipColorMap      :   ITcVnColorMap;
END_VAR

hr := F_VN_GenerateColorMap(
    ipColorMap      :=  ipColorMap,
    eColorMap       :=  TCVN_CM_HOT,
    eColorMapSize   :=  TCVN_CMS_256,
    hrPrev          :=  hr
);

Required License

TC3 Vision Base

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1.4024.54 or later

PC or CX (x64) with PL50, e.g. Intel 4-core Atom CPU

Tc3_Vision