core/vil1/vil1_clamp_image.cxx File Reference

#include "vil1_clamp_image.h"
#include <vil1/vil1_image.h>
#include <vil1/vil1_rgb.h>
#include <vxl_config.h>

Go to the source code of this file.


Defines

#define VIL1_CLAMP_IMAGE_THRESHOLD(V, L, H)
#define VIL1_INSTANTIATE_CLAMP_IMAGE(T)
#define VIL1_SPECIALIZE_CLAMP_IMAGE_RGB(T)

Functions

template<class T>
bool vil1_clamp_image (vil1_image const &base, double low, double high, T *buf, int x0, int y0, int w, int h)
 VIL1_INSTANTIATE_CLAMP_IMAGE (vxl_byte)
 VIL1_INSTANTIATE_CLAMP_IMAGE (float)
 VIL1_INSTANTIATE_CLAMP_IMAGE (double)
 VIL1_SPECIALIZE_CLAMP_IMAGE_RGB (vxl_byte)
 VIL1_SPECIALIZE_CLAMP_IMAGE_RGB (float)
 VIL1_SPECIALIZE_CLAMP_IMAGE_RGB (double)

Define Documentation

#define VIL1_CLAMP_IMAGE_THRESHOLD ( V,
L,
 ) 

Value:

if (V > H) V = H; \
  else if (V < L) V = L

Definition at line 12 of file vil1_clamp_image.cxx.

#define VIL1_INSTANTIATE_CLAMP_IMAGE (  ) 

Value:

template bool vil1_clamp_image(vil1_image const& base, double low, double high, \
                               T *buf, int x0, int y0, int w, int h)

Definition at line 32 of file vil1_clamp_image.cxx.

#define VIL1_SPECIALIZE_CLAMP_IMAGE_RGB (  ) 

Value:

VCL_DEFINE_SPECIALIZATION \
bool vil1_clamp_image(vil1_image const& base, double low, double high, \
                      vil1_rgb<T> *buf, int x0, int y0, int w, int h) \
{ \
  if (!base.get_section(buf, x0, y0, w, h)) return false; \
  unsigned size = w*h; \
  T low_thresh = T(low); \
  T high_thresh = T(high); \
  for (unsigned pos=0; pos < size; ++pos) { \
    VIL1_CLAMP_IMAGE_THRESHOLD(buf[pos].r, low_thresh, high_thresh); \
    VIL1_CLAMP_IMAGE_THRESHOLD(buf[pos].g, low_thresh, high_thresh); \
    VIL1_CLAMP_IMAGE_THRESHOLD(buf[pos].b, low_thresh, high_thresh); \
  } \
  return true; \
}

Definition at line 37 of file vil1_clamp_image.cxx.


Function Documentation

template<class T>
bool vil1_clamp_image ( vil1_image const &  base,
double  low,
double  high,
T *  buf,
int  x0,
int  y0,
int  w,
int  h 
)

Definition at line 17 of file vil1_clamp_image.cxx.

VIL1_INSTANTIATE_CLAMP_IMAGE ( double   ) 

VIL1_INSTANTIATE_CLAMP_IMAGE ( float   ) 

VIL1_INSTANTIATE_CLAMP_IMAGE ( vxl_byte   ) 

VIL1_SPECIALIZE_CLAMP_IMAGE_RGB ( double   ) 

VIL1_SPECIALIZE_CLAMP_IMAGE_RGB ( float   ) 

VIL1_SPECIALIZE_CLAMP_IMAGE_RGB ( vxl_byte   ) 


Generated on Sun Sep 7 05:08:28 2008 for core/vil1 by  doxygen 1.5.1