center.cpp

Go to the documentation of this file.
00001 #include "image.h"
00002 #include "runtime.h"
00003 
00007 Value * Runtime::center(Value * image, Value * newcenter)
00008 {
00009   // input checks
00010   if (image==NULL)  return NULL;
00011   if (newcenter==NULL) return NULL;
00012   if (typeid(*image)!=typeid(ImageValue)) return NULL;
00013   if (typeid(*newcenter)!=typeid(PointValue)) return NULL;
00014   ImageValue * I = (ImageValue*)image;
00015   PointValue * nc = (PointValue*)newcenter;
00016   ImageValue * O = I->deepCopy();
00017   O->center = O->ocsToDcs(*nc);
00018   return O;
00019 }
00020 
00021 Value * Runtime::center(vector<Value*> v)
00022 {
00023   if (v.size()!=2) return NULL;
00024   return center(v[0],v[1]);
00025 }
00026 

Generated on Mon Jun 5 22:08:41 2006 for iis by  doxygen 1.4.6