JNIEXPORT void JNICALL Java_com_uwemeding_connectivity_CompareAPI_setDeduceNeighbors( JNIEnv * env, jobject obj, jint j_number) { IMEnv *imEnv = getIMEnv(env, obj, FALSE); int number = (int) j_number; if (number > DEDUCEHTSIZE) { fireProgressEvent(imEnv, "Deduce neighborhood value too large, using default value: %d\n", DEDUCEHTSIZE / 10); imEnv->deduceNeighbors = DEDUCEHTSIZE / 10; } else imEnv->deduceNeighbors = number; }
rspfRefPtr<rspfImageData> rspfCacheTileSource::fillTile( rspf_uint32 resLevel) { rspfRefPtr<rspfImageData> tempTile = 0; fireProgressEvent(0.0); rspfIrect boundingRect = getBoundingRect(resLevel); rspfIrect tileRect = theTile->getImageRectangle(); rspfIrect allignedRect = tileRect.clipToRect(boundingRect); rspfAppFixedTileCache::rspfAppFixedCacheId cacheId = getCacheId(resLevel); rspfIpt cacheTileSize = rspfAppFixedTileCache::instance()->getTileSize(cacheId); if ( !allignedRect.hasNans() ) { allignedRect.stretchToTileBoundary(cacheTileSize); // rspfAppFixedTileCache::rspfAppFixedCacheId cacheId = theCacheId; // check to see if we need to loop if((allignedRect == tileRect)&& (static_cast<rspf_int32>(tileRect.width()) == cacheTileSize.x)&& (static_cast<rspf_int32>(tileRect.height()) == cacheTileSize.y)) { rspfIpt origin = tileRect.ul(); if(theCachingEnabled) { tempTile = rspfAppFixedTileCache::instance()->getTile(cacheId, origin); } if(!tempTile.valid()) { tempTile = theInputConnection->getTile(tileRect, resLevel); if(tempTile.valid()) { if((tempTile->getBuf())&& (tempTile->getDataObjectStatus()!=RSPF_EMPTY)&& theCachingEnabled) { rspfAppFixedTileCache::instance()->addTile(cacheId, tempTile); } } } // else // { // std::cout << "FOUND IN CACHE AT RES " << resLevel << "\n"; // } if(tempTile.valid()) { if((tempTile->getDataObjectStatus() != RSPF_NULL)&& (tempTile->getDataObjectStatus() != RSPF_EMPTY)) { theTile->setDataObjectStatus(tempTile->getDataObjectStatus()); theTile->loadTile(tempTile.get()); } } fireProgressEvent(100.0); } else { rspf_int32 boundaryHeight = allignedRect.height(); rspf_int32 boundaryWidth = allignedRect.width(); rspfIpt origin(allignedRect.ul()); rspf_int32 totalTiles = (boundaryHeight/cacheTileSize.y)* (boundaryWidth/theFixedTileSize.x); rspf_int32 currentTile = 0; for(rspf_int32 row = 0; row < boundaryHeight; row+=theFixedTileSize.y) { origin.x = allignedRect.ul().x; for(rspf_int32 col = 0; col < boundaryWidth; col+=theFixedTileSize.x) { ++currentTile; if(theCachingEnabled) { tempTile = rspfAppFixedTileCache::instance()->getTile(cacheId, origin); } else { tempTile = 0; } if(!tempTile.valid()) { rspfIrect rect(origin.x, origin.y, origin.x + cacheTileSize.x-1, origin.y + cacheTileSize.y-1); tempTile = theInputConnection->getTile(rect, resLevel); if(tempTile.valid()) { // drb if(theTile->getBuf()&& if(tempTile->getBuf()&& (tempTile->getDataObjectStatus()!=RSPF_EMPTY)&& theCachingEnabled) { rspfAppFixedTileCache::instance()-> addTile(cacheId, tempTile); } } } // else // { // std::cout << "FOUND IN CACHE AT RES " << resLevel << "\n"; // } if(tempTile.valid()) { if(tempTile->getBuf()&& (tempTile->getDataObjectStatus()!=RSPF_EMPTY)) { theTile->loadTile(tempTile.get()); } } double percent = 100.0*((double)currentTile/(double)totalTiles); fireProgressEvent(percent); origin.x += theFixedTileSize.x; } origin.y += theFixedTileSize.y; } theTile->validate(); fireProgressEvent(100); } } // End of: if ( !allignedRect.hasNans() ) return theTile; }