Esempio n. 1
0
//*****************************************************************************
//  METHOD: ossimDblGrid::initialize()
//  
//  Permits initialization after construction
//  
//*****************************************************************************
void ossimDblGrid::initialize(const ossimDrect&  uv_rect, 
                              const ossimDpt&    spacing,
                              double null_value)
{
   static const char MODULE[] = "ossimDblGrid::initialize()";
   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";

   ossimIpt size ((int) (uv_rect.width()/spacing.x)  + 1,
      (int) (uv_rect.height()/spacing.y) + 1);

   initialize(size, uv_rect.ul(), spacing, null_value);

   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
   return;
}
Esempio n. 2
0
/*!****************************************************************************
*  CONSTRUCTOR: ossimDblGrid
*  
*****************************************************************************/
ossimDblGrid::ossimDblGrid(const ossimDrect&  rect, 
                           const ossimDpt&    spacing,
                           double             null_value)
                           :
theGridData   (0),
theMinValue   (OSSIM_DEFAULT_MIN_PIX_DOUBLE),
theMaxValue   (OSSIM_DEFAULT_MAX_PIX_DOUBLE),
theExtrapIsEnabled (true),
theDomainType (CONTINUOUS)
{
   static const char MODULE[] = "ossimDblGrid Constructor";
   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";

   ossimIpt size ((int) (rect.width()/spacing.x)  + 1,
      (int) (rect.height()/spacing.y) + 1);

   initialize(size, rect.ul(), spacing, null_value);

   if (traceExec())  ossimNotify(ossimNotifyLevel_WARN) << MODULE << " returning...\n";
}
void ossimImageViewTransform::getScaleChangeImageToView(ossimDpt& result,
        const ossimDrect& imageRect)
{
    result.makeNan();
    if(!imageRect.hasNans())
    {
        ossimDpt vul;
        ossimDpt vur;
        ossimDpt vlr;
        ossimDpt vll;

        imageToView(imageRect.ul(),
                    vul);
        imageToView(imageRect.ur(),
                    vur);
        imageToView(imageRect.lr(),
                    vlr);
        imageToView(imageRect.ll(),
                    vll);

        if(!vul.hasNans()&&
                !vur.hasNans()&&
                !vlr.hasNans()&&
                !vll.hasNans())
        {

            double deltaTop    = (vul - vur).length();
            double deltaBottom = (vll - vlr).length();
            double deltaRight  = (vur - vlr).length();

            double w = imageRect.width();
            double h = imageRect.height();
            result.x = (deltaTop/w + deltaBottom/w)*.5;
            result.y = (deltaRight/h + deltaRight/h)*.5;
        }
    }
}
void ossimImageViewTransform::getScaleChangeViewToImage(ossimDpt& result,
        const ossimDrect& viewRect)
{
    result.makeNan();
    if(!viewRect.hasNans())
    {
        ossimDpt iul;
        ossimDpt iur;
        ossimDpt ilr;
        ossimDpt ill;

        imageToView(viewRect.ul(),
                    iul);
        imageToView(viewRect.ur(),
                    iur);
        imageToView(viewRect.lr(),
                    ilr);
        imageToView(viewRect.ll(),
                    ill);

        if(!iul.hasNans()&&
                !iur.hasNans()&&
                !ilr.hasNans()&&
                !ill.hasNans())
        {

            double deltaTop    = (iul - iur).length();
            double deltaBottom = (ill - ilr).length();
            double deltaRight  = (iur - ilr).length();

            double w = viewRect.width();
            double h = viewRect.height();
            result.x = (deltaTop/w + deltaBottom/w)*.5;
            result.y = (deltaRight/h + deltaRight/h)*.5;
        }
    }
}