5#include "../_cexports/c_foundation.h"
7#include "../global.hpp"
9#include "../exception.hpp"
66 return Internal::DoResCallObjectOut<Image>([&](
void* & resimg)
68 return CVB_CALL_CAPI(ApplyLUT8Bit (plane.Parent().Handle (), plane.Plane (),
69 reinterpret_cast<CExports::cvbval_t *
>(MakeRangeAdapter<int> (values, 256).Data ()),
88 std::copy (std::begin (values), std::end (values), std::back_inserter (values_int));
101template <
class RANGE>
107 for (
auto &&lutLevel : levels)
109 levelData.push_back (lutLevel.Level);
110 valueData.push_back (lutLevel.Value);
113 return Internal::DoResCallObjectOut<Image>([&](
void* & resimg)
115 switch (interpolation)
118 return CVB_CALL_CAPI(ApplyLUTGeneric (plane.Parent().Handle (), plane.Plane (),
static_cast<CExports::cvbval_t
>(levelData.size()),
119 const_cast<double*
>(levelData.data()),
const_cast<double*
>(valueData.data ()), resimg));
121 return CVB_CALL_CAPI(ApplyLUTLinear (plane.Parent().Handle (), plane.Plane (),
static_cast<CExports::cvbval_t
>(levelData.size()),
122 const_cast<double*
>(levelData.data()),
const_cast<double*
>(valueData.data ()), resimg));
124 return CVB_CALL_CAPI(ApplyLUTCubic (plane.Parent().Handle (), plane.Plane (),
static_cast<CExports::cvbval_t
>(levelData.size()),
125 const_cast<double*
>(levelData.data()),
const_cast<double*
>(valueData.data ()), resimg));
Image plane information container.
Definition: decl_image_plane.hpp:33
LutInterpolation
Different approaches for interpolating between lookup table (LUT) values and levels.
Definition: lut.hpp:35
@ Linear
Linear interpolation between two adjacent LUT levels.
@ Constant
LUT values are constant between two LUT levels.
@ Cubic
Cubic interpolation between two adjacent LUT levels.
TypedRange< std::unique_ptr< Image >, int, RANGE >::type ApplyLut(const ImagePlane &plane, const RANGE &values)
Apply a lookup table to an 8 bit per pixel input image plane.
Definition: lut.hpp:64
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24
Struct that combines a LUT (lookup table) level and the value assigned to this level.
Definition: lut.hpp:48
double Level
Gray value level at which the value applies.
Definition: lut.hpp:50
double Value
Transformed gray value, that applies to the associated gray level.
Definition: lut.hpp:52