Image Component Library (ICL)
Namespaces | Macros | Functions
LocalThresholdOpHelpers.h File Reference
#include <stdint.h>

Go to the source code of this file.

Namespaces

 icl
 undocument this line if you encounter any issues!
 
 icl::filter
 

Macros

#define GET_II(x, y)   ii[(x)+(y)*w]
 
#define GET_A(rx, ry, rw, rh)   GET_II((rx+rw),(ry+rh))
 
#define GET_B(rx, ry, rw, rh)   GET_II((rx),(ry))
 
#define GET_C(rx, ry, rw, rh)   GET_II((rx+rw),(ry))
 
#define GET_D(rx, ry, rw, rh)   GET_II((rx),(ry+rh))
 
#define GET_RECT(rx, ry, rw, rh)   (GET_B((rx),(ry),(rw),(rh)) - GET_C((rx),(ry),(rw),(rh)) - GET_D((rx),(ry),(rw),(rh)) + GET_A((rx),(ry),(rw),(rh)) + t)
 
#define COMPLEX_STEP(rx, ry, rw, rh)
 
#define STEP
 
#define FAST_LT_DEFINITION
 
#define INST_FAST_LT(TS, TI, TD, WITH_GAMMA)
 
#define INST_FAST_LT_FOR_SRC_TYPE(SRC, WITH_GAMMA)
 

Functions

template<class TS , class TI , class TD , class TT , bool WITH_GAMMA>
void icl::filter::fast_lt (const TS *psrc, const TI *ii, TD *pdst, int w, int h, int r, TT t, float gs, int channel)
 Internally used helper function. More...
 
template<class TS , class TI , class TD , class TT , bool WITH_GAMMA>
void icl::filter::fast_lt_impl (const TS *psrc, const TI *ii, TD *pdst, int w, int h, int r, TT t, float gs, int channel)
 Internally used helper function. More...
 

Macro Definition Documentation

◆ COMPLEX_STEP

#define COMPLEX_STEP (   rx,
  ry,
  rw,
  rh 
)
Value:
pdst[x+w*y] = (!WITH_GAMMA) ? \
(255 * (psrc[x+w*y]*((rw)*(rh)) > (GET_RECT((rx),(ry),(rw),(rh)))) ) : \
((TD)lt_clip_float( gs * (psrc[x+w*y] - float(GET_RECT((rx),(ry),(rw),(rh)))/((rw)*(rh)) ) + 128))
#define GET_RECT(rx, ry, rw, rh)

◆ FAST_LT_DEFINITION

#define FAST_LT_DEFINITION
Value:
template<class TS, class TI, class TD, class TT, bool WITH_GAMMA> \
void fast_lt(const TS *psrc, const TI *iim, TD *pdst, int w, int h, \
int r, TT t, float gs, int channel){ \
fast_lt_impl<TS,TI,TD,TT,WITH_GAMMA>(psrc,iim,pdst,w,h,r,t,gs,channel); \
}
ICLQt_API ImgQ channel(const ImgQ &image, int channel)
picks a specific image channel
void fast_lt(const TS *psrc, const TI *ii, TD *pdst, int w, int h, int r, TT t, float gs, int channel)
Internally used helper function.

◆ GET_A

#define GET_A (   rx,
  ry,
  rw,
  rh 
)    GET_II((rx+rw),(ry+rh))

◆ GET_B

#define GET_B (   rx,
  ry,
  rw,
  rh 
)    GET_II((rx),(ry))

◆ GET_C

#define GET_C (   rx,
  ry,
  rw,
  rh 
)    GET_II((rx+rw),(ry))

◆ GET_D

#define GET_D (   rx,
  ry,
  rw,
  rh 
)    GET_II((rx),(ry+rh))

◆ GET_II

#define GET_II (   x,
 
)    ii[(x)+(y)*w]

◆ GET_RECT

#define GET_RECT (   rx,
  ry,
  rw,
  rh 
)    (GET_B((rx),(ry),(rw),(rh)) - GET_C((rx),(ry),(rw),(rh)) - GET_D((rx),(ry),(rw),(rh)) + GET_A((rx),(ry),(rw),(rh)) + t)

◆ INST_FAST_LT

#define INST_FAST_LT (   TS,
  TI,
  TD,
  WITH_GAMMA 
)
Value:
template void fast_lt<lt_icl##TS,lt_icl##TI,lt_icl##TD, \
ThreshType<lt_icl##TS>::T,WITH_GAMMA> \
(const lt_icl##TS*, const lt_icl##TI*, lt_icl##TD*, int, int, \
int, ThreshType<lt_icl##TS>::T,float,int)
void fast_lt(const TS *psrc, const TI *ii, TD *pdst, int w, int h, int r, TT t, float gs, int channel)
Internally used helper function.

◆ INST_FAST_LT_FOR_SRC_TYPE

#define INST_FAST_LT_FOR_SRC_TYPE (   SRC,
  WITH_GAMMA 
)
Value:
INST_FAST_LT(SRC,32s,8u,WITH_GAMMA); \
INST_FAST_LT(SRC,32f,8u,WITH_GAMMA); \
INST_FAST_LT(SRC,64f,8u,WITH_GAMMA); \
INST_FAST_LT(SRC,32s,16s,WITH_GAMMA); \
INST_FAST_LT(SRC,32f,16s,WITH_GAMMA); \
INST_FAST_LT(SRC,64f,16s,WITH_GAMMA); \
INST_FAST_LT(SRC,32s,32s,WITH_GAMMA); \
INST_FAST_LT(SRC,32f,32s,WITH_GAMMA); \
INST_FAST_LT(SRC,64f,32s,WITH_GAMMA); \
INST_FAST_LT(SRC,32s,32f,WITH_GAMMA); \
INST_FAST_LT(SRC,32f,32f,WITH_GAMMA); \
INST_FAST_LT(SRC,64f,32f,WITH_GAMMA); \
INST_FAST_LT(SRC,32s,64f,WITH_GAMMA); \
INST_FAST_LT(SRC,32f,64f,WITH_GAMMA); \
INST_FAST_LT(SRC,64f,64f,WITH_GAMMA);
#define INST_FAST_LT(TS, TI, TD, WITH_GAMMA)
Definition: LocalThresholdOpHelpers.h:183

◆ STEP

#define STEP
Value:
*d = (!WITH_GAMMA) ? \
(255 * ( (*s*dim) > (*B - *C - *D + *A + t))) : \
((TD)lt_clip_float( gs * (*s - float(*B - *C - *D + *A + t)/dim ) + 128)) \
; ++B; ++C; ++D; ++A; ++s; ++d;