5# include "../_cexports/c_foundation.h"
7# include "../global.hpp"
8# include "../image.hpp"
9# include "../exception.hpp"
63 template <
class RANGE>
64 inline typename TypedRange<std::unique_ptr<Image>, int, RANGE>::type
ApplyLut(
const ImagePlane &plane,
67 return Internal::DoResCallObjectOut<Image>([&](
void *&resimg) {
70 reinterpret_cast<CExports::cvbval_t *
>(MakeRangeAdapter<int>(values, 256).Data()), resimg));
64 inline typename TypedRange<std::unique_ptr<Image>, int, RANGE>::type
ApplyLut(
const ImagePlane &plane, {
…}
82 template <
class RANGE>
103 template <
class RANGE>
104 inline typename TypedRange<std::unique_ptr<Image>,
LutLevel, RANGE>::type
111 for (
auto &&lutLevel : levels)
113 levelData.push_back(lutLevel.Level);
114 valueData.push_back(lutLevel.Value);
117 return Internal::DoResCallObjectOut<Image>([&](
void *&resimg) {
118 switch (interpolation)
122 plane.
Parent().
Handle(), plane.
Plane(),
static_cast<CExports::cvbval_t
>(levelData.size()),
123 const_cast<double *
>(levelData.data()),
const_cast<double *
>(valueData.data()), resimg));
126 plane.
Parent().
Handle(), plane.
Plane(),
static_cast<CExports::cvbval_t
>(levelData.size()),
127 const_cast<double *
>(levelData.data()),
const_cast<double *
>(valueData.data()), resimg));
130 plane.
Parent().
Handle(), plane.
Plane(),
static_cast<CExports::cvbval_t
>(levelData.size()),
131 const_cast<double *
>(levelData.data()),
const_cast<double *
>(valueData.data()), resimg));
T back_inserter(T... args)
void * Handle() const noexcept
Classic API image handle.
Definition decl_image.hpp:232
Image plane information container.
Definition decl_image_plane.hpp:29
int Plane() const noexcept
Plane index in the image, to which this plane refers to.
Definition decl_image_plane.hpp:147
const Image & Parent() const noexcept
Image to which this plane descriptor refers to.
Definition detail_image_plane.hpp:87
cvbres_t ApplyLUTGeneric(IMG ImgIn, long Index, long NumLevels, double Levels[], double Values[], IMG &ImgOut)
cvbres_t ApplyLUTLinear(IMG ImgIn, long Index, long NumLevels, double Levels[], double Values[], IMG &ImgOut)
cvbres_t ApplyLUT8Bit(IMG ImgIn, long Index, long Values[256], IMG &ImgOut)
cvbres_t ApplyLUTCubic(IMG ImgIn, long Index, long NumLevels, double Levels[], double Values[], IMG &ImgOut)
Namespace for collection of lookup table functions from the Foundation package.
Definition lut.hpp:30
LutInterpolation
Different approaches for interpolating between lookup table (LUT) values and levels.
Definition lut.hpp:34
@ Linear
Linear interpolation between two adjacent LUT levels.
Definition lut.hpp:38
@ Constant
LUT values are constant between two LUT levels.
Definition lut.hpp:36
@ Cubic
Cubic interpolation between two adjacent LUT levels.
Definition lut.hpp:40
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
Namespace for the Foundation package.
Definition decl_metric_aqs12_calibration_piece.hpp:11
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17
Struct that combines a LUT (lookup table) level and the value assigned to this level.
Definition lut.hpp:47
double Level
Gray value level at which the value applies.
Definition lut.hpp:49
double Value
Transformed gray value, that applies to the associated gray level.
Definition lut.hpp:51