00001
00002 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00003 #pragma implementation
00004 #endif
00005
00006
00007
00008 #include "vil1_clamp_image_impl.h"
00009 #include <vil1/vil1_clamp_image.h>
00010 #include <vil1/vil1_pixel.h>
00011 #include <vil1/vil1_rgb.h>
00012 #include <vxl_config.h>
00013
00014 vil1_image vil1_clamp_image_impl::get_plane(unsigned int p) const
00015 {
00016 vil1_image_impl *i = new vil1_clamp_image_impl(base.get_plane(p), low_, high_);
00017 return i;
00018 }
00019
00020 bool vil1_clamp_image_impl::put_section(void const * , int, int, int, int)
00021 {
00022 return false;
00023 }
00024
00025 bool vil1_clamp_image_impl::get_section(void * buf, int x0, int y0, int w, int h) const
00026 {
00027 switch (vil1_pixel_format(base) ) {
00028 case VIL1_BYTE:
00029 return vil1_clamp_image(base, low_, high_, (vxl_byte*)buf, x0, y0, w, h);
00030 case VIL1_RGB_BYTE:
00031 return vil1_clamp_image(base, low_, high_, (vil1_rgb<vxl_byte>*)buf, x0, y0, w, h);
00032 case VIL1_FLOAT:
00033 return vil1_clamp_image(base, low_, high_, (float*)buf, x0, y0, w, h);
00034 case VIL1_DOUBLE:
00035 return vil1_clamp_image(base, low_, high_, (double*)buf, x0, y0, w, h);
00036 case VIL1_RGB_FLOAT:
00037 return vil1_clamp_image(base, low_, high_, (vil1_rgb<float>*)buf, x0, y0, w, h);
00038 case VIL1_RGB_DOUBLE:
00039 return vil1_clamp_image(base, low_, high_, (vil1_rgb<double>*)buf, x0, y0, w, h);
00040 default:
00041 vcl_cerr << __FILE__ ": not implemented for this pixel type\n";
00042 return false;
00043 }
00044 }