MeVisLab Toolbox Reference
mlLUTBasic.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef ML_LUTBASIC_H
14#define ML_LUTBASIC_H
15
16
18
19#include "mlLUTSystem.h"
20
21// ML includes
22#include <mlTypeTraits.h>
23
24
26
27
30typedef enum {
31 LUT_L = 0,
35
36 // Reordered variants of the above, used in LUTData
39
40 // Constant counts
43
44} LUTVisualType;
45
46
48MLLUT_EXPORT extern const char *LUTVisualTypeName[LUT_NUM_VISUAL_TYPE_LAYOUTS];
49
50
53
56
59
61MLLUT_EXPORT double LUTConvertRGBtoL (double r, double g, double b);
62
63
66template <typename T>
67inline T LUTCastFromDouble(double value) {
69 return static_cast<T>(floor(value+0.5));
70 } else {
71 return static_cast<T>(value);
72 }
73}
74
75
76
78typedef enum {
79 LUT_1D = 1,
81 LUT_3D
82} LUTDimensionality;
83
84
86
87
88#endif
89// __mlLUTBasic_H
90
@ T
#define MLLUT_EXPORT
System specific macro definitions.
Definition mlLUTSystem.h:25
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
MLLUT_EXPORT double LUTConvertRGBtoL(double r, double g, double b)
Convert RGB to luminance.
@ LUT_1D
1D-LUT, consists of a single row
Definition mlLUTBasic.h:79
@ LUT_3D
3D-LUT, consists of multiple layers
Definition mlLUTBasic.h:81
@ LUT_2D
2D-LUT, consists of multiple rows in a single layer
Definition mlLUTBasic.h:80
MLLUT_EXPORT int LUTNumberOfChannels(LUTVisualType visualType)
Get number of channels for given LUTVisualType, or 0 if unknown.
LUTVisualType
LUT visual type constants to identify the visual interpretation of the individual LUT channels.
Definition mlLUTBasic.h:30
@ LUT_ABGR
Alpha, Blue, Green, Red.
Definition mlLUTBasic.h:38
@ LUT_BGR
Blue, Green, Red.
Definition mlLUTBasic.h:37
@ LUT_RGBA
Red, Green, Blue, Alpha.
Definition mlLUTBasic.h:34
@ LUT_NUM_VISUAL_TYPES
Number of visual types, ignoring layout variants.
Definition mlLUTBasic.h:42
@ LUT_NUM_VISUAL_TYPE_LAYOUTS
Number of visual types, including layout variants.
Definition mlLUTBasic.h:41
@ LUT_L
Luminance (Gray)
Definition mlLUTBasic.h:31
@ LUT_LA
Luminance and Alpha.
Definition mlLUTBasic.h:32
@ LUT_RGB
Red, Green, Blue.
Definition mlLUTBasic.h:33
MLLUT_EXPORT int LUTAlphaChannelIndex(LUTVisualType visualType)
Get index of alpha channel, or -1 if none.
T LUTCastFromDouble(double value)
Helper template function to cast from double to type T, performing a proper round operation in case o...
Definition mlLUTBasic.h:67
MLLUT_EXPORT LUTVisualType LUTReducedVisualType(LUTVisualType visualType)
Get reduced visual type, i.e. ignoring layout variants.
TypeTraits for scalar ML Datatypes.