Example #1
0
QSize MovieUpdater::getTilesArea(const uint lod, const uint channel) const
{
    Q_UNUSED(lod);
    Q_UNUSED(channel);

    return getTileRect(0).size();
}
Example #2
0
void SFMLMap::setSprite(int iTile, position at, int layer)
{
   Sprite spr;
   spr.SetImage(*tilesetImage);
   spr.SetPosition(to2<float>(getPixPosition(at)));
   spr.SetSubRect(getTileRect(iTile));
   spriteOnLayer[layer][at.x][at.y] = spr;
}
ossimRefPtr<ossimImageData> ossimImageSourceSequencer::getTile(
   ossim_int64 id, ossim_uint32 resLevel)
{
   static const char* MODULE= "ossimImageSourceSequencer::getTile(id, resLevel)";
   if(traceDebug())
   {
      CLOG << "entering.."<<endl;
   }

   ossimRefPtr<ossimImageData> result = 0;

   if(theInputConnection)
   {
      // if we have no tiles try to initialize.
      if(getNumberOfTiles() == 0)
      {
         initialize();
      }

      ossimIrect tileRect;
      if ( getTileRect( id, tileRect ) )
      {
         result = theInputConnection->getTile(tileRect, resLevel);
         if( !result.valid() || !result->getBuf() )
         {	 
            theBlankTile->setImageRectangle(tileRect);
            result = theBlankTile;
         }
      }
      else // getTileRect failed...
      {
         if(traceDebug())
         {
            CLOG << "was not able to get an origin for id = " << id << endl;
         }
      }
   }
   else // no connection...
   {
      if(traceDebug())
      {
         CLOG << "No input connection so returing NULL" << endl;
      }
   }
   if(traceDebug())
   {
      CLOG << "leaving.."<<endl;
   }
   
   return result;
}
ossimRefPtr<ossimImageData> ossimImageSourceSequencer::getNextTile( ossim_uint32 resLevel )
{
   ossimRefPtr<ossimImageData> result = 0;
   if ( theInputConnection )
   {
      ossimIrect tileRect;
      if ( getTileRect( theCurrentTileNumber, tileRect ) )
      {
         ++theCurrentTileNumber;
         result = theInputConnection->getTile(tileRect, resLevel);
         if( !result.valid() || !result->getBuf() )
         {	 
            theBlankTile->setImageRectangle(tileRect);
            result = theBlankTile;
         }
      }
   }
   return result;
}
Example #5
0
QImage SVGTiler::getCachableTileImage(const uint tileId) const
{
    const QRect imageRect = getTileRect(tileId);
    const QRectF zoomRect = getNormalizedTileRect(tileId);

#if TIDE_USE_CAIRO && TIDE_USE_RSVG
    // The SvgCairoRSVGBackend is called from multiple threads
    SVG* svg = nullptr;
    {
        const auto id = QThread::currentThreadId();
        const QMutexLocker lock(&_threadMapMutex);
        if (!_perThreadSVG.count(id))
            _perThreadSVG[id] = std::make_unique<SVG>(_svg.getData());
        svg = _perThreadSVG[id].get();
    }
#else
    // The SvgQtGpuBackend is always called from the GPU thread
    const SVG* svg = &_svg;
#endif
    return svg->renderToImage(imageRect.size(), zoomRect);
}
Example #6
0
//! Returns true if the passed tile is compatible, and it can be downloaded
//! entirely.
bool TCacheResource::canDownloadAll(const TTile &tile) const
{
	return checkTile(tile) && contains(m_region, getTileRect(tile));
}
Example #7
0
//! Returns true if the passed tile is compatible with the complex, and some
//! part of it is downloadable.
bool TCacheResource::canDownloadSome(const TTile &tile) const
{
	return checkTile(tile) && m_region.intersects(toQRect(getTileRect(tile)));
}