Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vimt_crop.h

Go to the documentation of this file.
00001 // This is mul/vimt/vimt_crop.h
00002 #ifndef vimt_crop_h_
00003 #define vimt_crop_h_
00004 
00005 //:
00006 //  \file
00007 //  \brief Create windows into vimt_images.
00008 //  \author Tim Cootes, Ian Scott
00009 
00010 #include <vimt/vimt_image_2d_of.h>
00011 #include <vil/vil_crop.h>
00012 
00013 //: Create windowed view of given image
00014 //  The parameters should be in image co-ords.
00015 //  The world2im transform is set to match
00016 //  so this appears identical to im when addressed
00017 //  in world co-ords. O(1).
00018 template<class T>
00019 vimt_image_2d_of<T> vimt_crop(const vimt_image_2d_of<T>& im,
00020                               unsigned x0, unsigned nx,
00021                               unsigned y0, unsigned ny)
00022 {
00023   vimt_transform_2d trans;
00024   trans.set_translation(-double(x0),-double(y0));
00025   return vimt_image_2d_of<T>(vil_crop(im.image(),x0,nx,y0,ny),trans*im.world2im());
00026 }
00027 
00028 
00029 
00030 #endif // vimt_crop_h_

Generated on Thu Jan 10 14:43:58 2008 for contrib/mul/vimt by  doxygen 1.4.4