OwnedImage.cpp
Go to the documentation of this file.
00001 #include "EdgeDetection/OwnedImage.h"
00002 #include "EdgeDetection/MemoryImage.h"
00003 
00004 namespace EdgeDetection
00005 {
00006         Image* OwnedImage::GetRegion(int left, int right, int top, int bottom)
00007         {
00008                 if (left < 0 || left >= GetWidth()) throw "The parameter 'left' was out of range.";
00009                 if (right < 0 || right >= GetWidth()) throw "The parameter 'right' was out of range.";
00010                 if (top < 0 || top >= GetHeight()) throw "The parameter 'top' was out of range.";
00011                 if (bottom < 0 || bottom >= GetHeight()) throw "The parameter 'bottom' was out of range.";
00012                 if (right - left < 0) throw "The parameters 'left' and 'right' were out of range.";
00013                 if (bottom - top < 0) throw "The parameters 'top' and 'bottom' were out of range.";
00014 
00015                 return new GrayDoubleMemoryImage(right - left, bottom - top, values + left * 1 + top * GetWidth(), GetWidth());
00016         }
00017 };


aruco_pose
Author(s): Julian Brunner
autogenerated on Mon Oct 6 2014 08:32:33