core/vil/vil_image_resource.cxx
Go to the documentation of this file.
00001 // This is core/vil/vil_image_resource.cxx
00002 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00003 #pragma implementation
00004 #endif
00005 //:
00006 // \file
00007 // \author Ian Scott  ISBE Manchester
00008 // \date   20 Sep 2002
00009 //
00010 //-----------------------------------------------------------------------------
00011 
00012 #include "vil_image_resource.h"
00013 #include <vil/vil_image_view_base.h>
00014 
00015 //--------------------------------------------------------------------------------
00016 
00017 //: the reference count starts at 0.
00018 vil_image_resource::vil_image_resource() : reference_count_(0) { }
00019 
00020 vil_image_resource::~vil_image_resource() { }
00021 
00022 
00023 bool vil_image_resource::get_property(char const *, void *) const
00024 {
00025   return false;
00026 }
00027 
00028 
00029 //: Check that a view will fit into the data at the given offset.
00030 // This includes checking that the pixel type is scalar.
00031 bool vil_image_resource::view_fits(const vil_image_view_base& im, unsigned i0, unsigned j0)
00032 {
00033   return i0 + im.ni() <= ni() &&
00034          j0 + im.nj() <= nj() &&
00035          im.nplanes() == nplanes() &&
00036          vil_pixel_format_num_components(im.pixel_format()) == 1;
00037 }
00038