To ensure value is in a range appropriate for the data type (e.g. 0-255 for bytes).
Definition in file vil1_clamp.h.
#include <vil1/vil1_image.h>
Go to the source code of this file.
Functions | |
| vil1_image | vil1_clamp (vil1_image src, double range_min, double range_max) |
| Adaptor which returns a vil1_image with pixel components clamped to given range. | |
| template<class V> | |
| V | vil1_clamp_pixel (V const &b, double range_min, double range_max) |
| Convenience templated functions for clamping of a single pixel. | |
| unsigned char | vil1_clamp (const float &d, unsigned char *) |
| unsigned char | vil1_clamp (const double &d, unsigned char *) |
| unsigned char vil1_clamp | ( | const double & | d, | |
| unsigned char * | ||||
| ) | [inline] |
Definition at line 65 of file vil1_clamp.h.
| unsigned char vil1_clamp | ( | const float & | d, | |
| unsigned char * | ||||
| ) | [inline] |
Definition at line 54 of file vil1_clamp.h.
| vil1_image vil1_clamp | ( | vil1_image | src, | |
| double | range_min, | |||
| double | range_max | |||
| ) |
Adaptor which returns a vil1_image with pixel components clamped to given range.
Fits nicely into the functional composition and lazy evaluation scheme provided by the other vil1 adaptors. Old code can be implemented in the new style as vil1_image_as_byte(vil1_clamp(img, 0, 255)); vil1_image_as_rgb_byte(vil1_clamp(img, 0, 255));
Definition at line 15 of file vil1_clamp.cxx.
| V vil1_clamp_pixel | ( | V const & | b, | |
| double | range_min, | |||
| double | range_max | |||
| ) | [inline] |
Convenience templated functions for clamping of a single pixel.
(vxl_byte)vil1_clamp_pixel(g, 0, 255); (vil1_rgb<vxl_byte>)vil1_clamp_pixel(rgb, 0, 255);
Definition at line 31 of file vil1_clamp.h.
1.5.1