Back to Adaptive Vision Library website

You are here: Start » Function Reference » Image » Image Look Up Tables » CreateCustomLut


Header: AVL.h
Namespace: avl
Module: FoundationBasic

Creates Look Up Table for user provided operation on image pixels.


void avl::CreateCustomLut
	const LutOperatorType& inLutFunction,
	const avl::PlainType::Type& inOutputType,
	atl::Optional<void*> inUserData,
	avl::PixelLut& outLut


Name Type Default Description
inLutFunction const LutOperatorType&
inOutputType const PlainType::Type&
inUserData Optional<void*> NIL Data passed as the second parameter to inLutFunction
outLut PixelLut&


This function creates custom Look Up Table from function provided by user in form of callable.

Function to use can be passed as pointer to function, callable object (object with operator() defined) or lambda expression. Only requirement for such callable is for it to accept single parameter of type float and return value of type float.

Value passed to provided function is value of pixel. Value returned from provided function is value demanded from LUT being created.

CreateCustomLut will apply provided function on all possible values of inOutputType type and cache them in internal structure. Such PixelLut object can be then passed to ApplyPixelLut.

CreateCustomLut can create Look Up Tables for the following types: Int8, UInt8, Int16, UInt16.


Standard operations like PowerImage, CorrectGamma and LogarithmImage for images of type Int32 and Real are available in Image Point Transforms category.


List of possible exceptions:

Error type Description
DomainError Cannot create LUT with empty operator in CreateCustomLut.

See Also

  • ApplyPixelLut – Applies previously created Look Up transformation to provided image.
  • CreatePowerLut – Creates Look Up Table for power operation on image pixels.