NAME
get_target_lut - Gets target lut for "building block" routines
SYNOPSIS
#include "m/m_lut.h"
Example compile flags (system dependent):
-DLINUX_X86_64 -DLINUX_X86_64_OPTERON -DGNU_COMPILER
-I/home/kobus/include
-L/home/kobus/misc/load/linux_x86_64_opteron -L/usr/lib/x86_64-linux-gnu
-lKJB -lfftw3 -lgsl -lgslcblas -ljpeg -lSVM -lstdc++ -lpthread -lSLATEC -lg2c -lacml -lacml_mv -lblas -lg2c -lncursesw
int get_target_lut
(
Lut **out_lp_ptr,
int lut_len,
double offset,
double step
);
DESCRIPTION
This routine implements the creation/over-writing symantics used in the KJB
library. If *target_lp_ptr is NULL, then this routine creates the lut. If
it is not null, and it is the right size, then this routine does nothing. If
it is the wrong size, then it is resized.
If an actual resize is needed, then a new lut of the required size is
first created. If the creation is successful, then the old lut is free'd.
The reason is that if the new allocation fails, a calling application should
have use of the old lut. The alternate is to free the old lut first.
This is more memory efficient. A more sophisticated alternative is to free
the old lut if it can be deterimined that the subsequent allocation will
succeed. Although such approaches have merit, it is expected that
resizing will occur infrequently enought that it is not worth implementing
them. Thus the simplest method with good symantics under most conditions
has been used.
RETURNS
On success, NO_ERROR is returned. On failure, ERROR is returned, with an
error message being set.
RELATED
Lut
DISCLAIMER
This software is not adequatedly tested. It is recomended that
results are checked independantly where appropriate.
AUTHOR
Kobus Barnard
DOCUMENTER
Kobus Barnard
SEE ALSO
create_lut
,
free_lut
,
copy_lut
,
convert_lut
,
read_lut_from_config_file
,
read_lut
,
fp_read_lut
,
write_lut
,
fp_write_lut
,
apply_lut_inverse