41 #ifdef OSSIM_ID_ENABLED 42 static const char OSSIM_ID[] =
"$Id: ossimImageRenderer.cpp 23663 2015-12-11 21:10:54Z dburken $";
45 static ossimTrace traceDebug(
"ossimImageRenderer:debug");
76 left.m_Vul = tempLeftRect.
ul();
77 left.m_Vur = tempLeftRect.
ur();
78 left.m_Vlr = tempLeftRect.
lr();
79 left.m_Vll = tempLeftRect.
ll();
81 right.m_Vul = tempRightRect.ul();
82 right.m_Vur = tempRightRect.ur();
83 right.m_Vlr = tempRightRect.lr();
84 right.m_Vll = tempRightRect.ll();
86 left.transformViewToImage();
87 right.transformViewToImage();
91 if(left.m_viewBounds->intersects(left.getViewRect()))
93 result.push_back(left);
98 result.push_back(left);
100 if(right.imageIsNan())
102 if(right.m_viewBounds->intersects(right.getViewRect()))
104 result.push_back(right);
109 result.push_back(right);
127 tempTopRect.
lr().
y+1,
135 bottom.m_viewBounds = m_viewBounds;
137 top.m_Vul = tempTopRect.
ul();
138 top.m_Vur = tempTopRect.
ur();
139 top.m_Vlr = tempTopRect.
lr();
140 top.m_Vll = tempTopRect.
ll();
142 bottom.m_Vul = tempBottomRect.ul();
143 bottom.m_Vur = tempBottomRect.ur();
144 bottom.m_Vlr = tempBottomRect.lr();
145 bottom.m_Vll = tempBottomRect.ll();
147 top.transformViewToImage();
148 bottom.transformViewToImage();
152 if(top.m_viewBounds->intersects(top.getViewRect()))
154 result.push_back(top);
159 result.push_back(top);
161 if(bottom.imageIsNan())
163 if(bottom.m_viewBounds->intersects(bottom.getViewRect()))
165 result.push_back(bottom);
170 result.push_back(bottom);
223 ur.m_viewBounds = m_viewBounds;
224 lr.m_viewBounds = m_viewBounds;
225 ll.m_viewBounds = m_viewBounds;
227 ul.transformViewToImage();
228 ur.transformViewToImage();
229 lr.transformViewToImage();
230 ll.transformViewToImage();
234 if(ul.m_viewBounds->intersects(ul.getViewRect()))
236 result.push_back(ul);
241 result.push_back(ul);
245 if(ur.m_viewBounds->intersects(ur.getViewRect()))
247 result.push_back(ur);
252 result.push_back(ur);
256 if(lr.m_viewBounds->intersects(lr.getViewRect()))
258 result.push_back(lr);
263 result.push_back(lr);
267 if(ll.m_viewBounds->intersects(ll.getViewRect()))
269 result.push_back(ll);
274 result.push_back(ll);
304 rect.transformViewToImage();
306 if(rect.imageHasNans())
308 if(rect.m_viewBounds->intersects(rect.getViewRect()))
310 result.push_back(rect);
316 else if((splitFlags==(UPPER_LEFT_SPLIT_FLAG|LOWER_LEFT_SPLIT_FLAG))||
317 (splitFlags==(UPPER_RIGHT_SPLIT_FLAG|LOWER_RIGHT_SPLIT_FLAG)))
322 splitHorizontal(result);
326 else if((splitFlags==(UPPER_LEFT_SPLIT_FLAG|UPPER_RIGHT_SPLIT_FLAG))||
327 (splitFlags==(LOWER_RIGHT_SPLIT_FLAG|LOWER_LEFT_SPLIT_FLAG)))
333 splitVertical(result);
340 splitVertical(result);
342 else if((w>1)&&(h<2))
344 splitHorizontal(result);
359 m_transform->imageToView(m_Iul,
361 m_transform->imageToView(m_Iur,
363 m_transform->imageToView(m_Ilr,
365 m_transform->imageToView(m_Ill,
378 return ((vRect.
width() > 32) || (vRect.
height() > 32));
392 if ( imageHasNans()||(vRect.
width() < 8 && vRect.
height() < 8) )
399 if(m_viewBounds->intersects(vRect))
434 if(result != SPLIT_ALL)
437 if(bias < 1.0) bias = 1.0/bias;
438 bias = std::sqrt(bias);
440 if(bias < 1) bias = 1.0;
462 if((result!=SPLIT_ALL)&&!canBilinearInterpolate(bias))
479 if(imageHasNans()||tooBig())
481 if(m_viewBounds->intersects(getViewRect()))
516 if(result != SPLIT_ALL)
518 ossim_float64 sensitivityScale = m_ImageToViewScale.length();
520 if(sensitivityScale < 1.0) sensitivityScale = 1.0/sensitivityScale;
543 if((result!=SPLIT_ALL)&&!canBilinearInterpolate(sensitivityScale))
567 m_transform->viewToImage(m_Vul, m_Iul);
568 m_transform->viewToImage(m_Vur, m_Iur);
569 m_transform->viewToImage(m_Vlr, m_Ilr);
570 m_transform->viewToImage(m_Vll, m_Ill);
578 m_VulScale = computeViewToImageScale(m_Vul,
ossimDpt( w, h));
579 m_VurScale = computeViewToImageScale(m_Vur,
ossimDpt(-w, h));
580 m_VlrScale = computeViewToImageScale(m_Vlr,
ossimDpt(-w,-h));
581 m_VllScale = computeViewToImageScale(m_Vll,
ossimDpt( w,-h));
584 m_ViewToImageScale.x = 0.0;
585 m_ViewToImageScale.y = 0.0;
587 if(!m_VulScale.hasNans())
589 m_ViewToImageScale += m_VulScale;
592 if(!m_VurScale.hasNans())
594 m_ViewToImageScale += m_VurScale;
597 if(!m_VlrScale.hasNans())
599 m_ViewToImageScale += m_VlrScale;
602 if(!m_VllScale.hasNans())
604 m_ViewToImageScale += m_VllScale;
609 m_ViewToImageScale.makeNan();
613 m_ViewToImageScale.x/=
n;
614 m_ViewToImageScale.y/=
n;
619 m_ViewToImageScale =
ossimDpt(1.0, 1.0);
622 ossimDpt rightDelta = m_Ilr - m_Iur;
623 ossimDpt bottomDelta = m_Ill - m_Ilr;
626 double topLen = topDelta.
length();
627 double bottomLen = bottomDelta.
length();
628 double rightLen = rightDelta.
length();
629 double leftLen = leftDelta.
length();
631 double averageHoriz = ((topLen) + (bottomLen))*.5;
632 double averageVert = ((leftLen) + (rightLen))*.5;
634 ossimDpt deltaViewP1P2 = m_Vul - m_Vur;
635 ossimDpt deltaViewP1P3 = m_Vul - m_Vll;
637 double lengthViewP1P2 = deltaViewP1P2.
length();
638 double lengthViewP1P3 = deltaViewP1P3.
length();
641 m_ViewToImageScale.x = averageHoriz/lengthViewP1P2;
643 m_ViewToImageScale.makeNan();
645 m_ViewToImageScale.y = averageVert/lengthViewP1P3;
647 m_ViewToImageScale.makeNan();
652 if(!m_ViewToImageScale.hasNans())
654 m_ImageToViewScale.x = 1.0/m_ViewToImageScale.x;
655 m_ImageToViewScale.y = 1.0/m_ViewToImageScale.y;
659 m_ImageToViewScale.makeNan();
668 if(viewPt.
hasNans())
return result;
670 m_transform->viewToImage(viewPt, ipt);
684 m_transform->viewToImage(viewPt +
ossimDpt(delta.
x,0.0), dx);
685 m_transform->viewToImage(viewPt +
ossimDpt(0.0,delta.
y), dy);
689 result.
x = dx.
length()/fabs(delta.
x);
690 result.
y = dy.
length()/fabs(delta.
y);
699 ossimDpt rightDelta = m_Ilr - m_Iur;
700 ossimDpt bottomDelta = m_Ill - m_Ilr;
703 topDelta = topDelta*(1.0/topDelta.
length());
704 rightDelta = rightDelta*(1.0/rightDelta.length());
705 bottomDelta = bottomDelta*(1.0/bottomDelta.length());
706 leftDelta = leftDelta*(1.0/leftDelta.length());
708 m_Iul = m_Iul + ((leftDelta - topDelta)*.5);
709 m_Iur = m_Iur + ((topDelta - rightDelta)*.5);
710 m_Ilr = m_Ilr + ((rightDelta - bottomDelta)*.5);
711 m_Ill = m_Ill + ((bottomDelta - leftDelta)*.5);
715 m_Iul =
ossimIpt(ossim::round<int>(m_Iul.x),
716 ossim::round<int>(m_Iul.y));
717 m_Iur =
ossimIpt(ossim::round<int>(m_Iur.x),
718 ossim::round<int>(m_Iur.y));
719 m_Ilr =
ossimIpt(ossim::round<int>(m_Ilr.x),
720 ossim::round<int>(m_Ilr.y));
721 m_Ill =
ossimIpt(ossim::round<int>(m_Ill.x),
722 ossim::round<int>(m_Ill.y));
749 double iulDelta = (m_Iul-m_Vul).length();
750 double iurDelta = (m_Iur-m_Vur).length();
751 double ilrDelta = (m_Ilr-m_Vlr).length();
752 double illDelta = (m_Ill-m_Vll).length();
766 ossimDpt imageToViewScale = getAbsValueImageToViewScales();
768 double testScale = imageToViewScale.
length();
791 if ((testScale > 256) ||
792 (testScale < 1.0 / 256.0))
797 if (m_VulScale.hasNans() ||
798 m_VurScale.hasNans() ||
799 m_VlrScale.hasNans() ||
800 m_VllScale.hasNans())
837 result = (((ratio1 < 2) && (ratio1 > 0.5)) &&
838 ((ratio2 < 2) && (ratio2 > 0.5)) &&
839 ((ratio3 < 2) && (ratio3 > 0.5)));
849 ossimDpt vUpper, vRight, vBottom, vLeft, vCenter;
850 ossimDpt iUpper, iRight, iBottom, iLeft, iCenter;
851 ossimDpt testUpper, testRight, testBottom, testLeft, testCenter;
853 getViewMids(vUpper, vRight, vBottom, vLeft, vCenter);
854 getImageMids(iUpper, iRight, iBottom, iLeft, iCenter);
857 m_transform->viewToImage(vCenter, testCenter);
864 m_transform->viewToImage(vUpper, testUpper);
869 m_transform->viewToImage(vRight, testRight);
874 m_transform->viewToImage(vBottom, testBottom);
879 m_transform->viewToImage(vLeft, testLeft);
886 double errorCheck1 = (testCenter - iCenter).length();
887 double errorCheck2 = (testUpper - iUpper).length();
888 double errorCheck3 = (testRight - iRight).length();
889 double errorCheck4 = (testBottom - iBottom).length();
890 double errorCheck5 = (testLeft - iLeft).length();
891 result = ((errorCheck1 < error) &&
892 (errorCheck2 < error) &&
893 (errorCheck3 < error) &&
894 (errorCheck4 < error) &&
895 (errorCheck5 < error));
905 ossimDpt vUpper, vRight, vBottom, vLeft, vCenter;
906 ossimDpt iUpper, iRight, iBottom, iLeft, iCenter;
909 getViewMids(vUpper, vRight, vBottom, vLeft, vCenter);
910 getImageMids(iUpper, iRight, iBottom, iLeft, iCenter);
912 ossimDpt iFullRes(iCenter.
x * imageToViewScale.
x,
913 iCenter.
y * imageToViewScale.
y);
915 m_transform->viewToImage(vCenter, testCenter);
921 ossimDpt testFullRes(testCenter.
x * imageToViewScale.
x,
922 testCenter.
y * imageToViewScale.
y);
924 double errorCheck1 = (testFullRes - iFullRes).length();
926 iFullRes =
ossimDpt(iUpper.
x * imageToViewScale.
x,
927 iUpper.
y * imageToViewScale.
y);
929 m_transform->viewToImage(vUpper, testCenter);
934 testFullRes =
ossimDpt(testCenter.
x * imageToViewScale.
x,
935 testCenter.
y * imageToViewScale.
y);
936 double errorCheck2 = (testFullRes - iFullRes).length();
938 iFullRes =
ossimDpt(iRight.
x * imageToViewScale.
x,
939 iRight.
y * imageToViewScale.
y);
941 m_transform->viewToImage(vRight, testCenter);
946 testFullRes =
ossimDpt(testCenter.
x * imageToViewScale.
x,
947 testCenter.
y * imageToViewScale.
y);
948 double errorCheck3 = (testFullRes - iFullRes).length();
950 iFullRes =
ossimDpt(iBottom.
x * imageToViewScale.
x,
951 iBottom.
y * imageToViewScale.
y);
953 m_transform->viewToImage(vBottom, testCenter);
958 testFullRes =
ossimDpt(testCenter.
x * imageToViewScale.
x,
959 testCenter.
y * imageToViewScale.
y);
960 double errorCheck4 = (testFullRes - iFullRes).length();
962 iFullRes =
ossimDpt(iLeft.
x * imageToViewScale.
x,
963 iLeft.
y * imageToViewScale.
y);
965 m_transform->viewToImage(vLeft, testCenter);
966 testFullRes =
ossimDpt(testCenter.
x * imageToViewScale.
x,
967 testCenter.
y * imageToViewScale.
y);
968 double errorCheck5 = (testFullRes - iFullRes).length();
970 std::cout <<
"__________________________\n" 971 <<
"ERROR1:" << errorCheck1 <<
"\n" 972 <<
"ERROR2:" << errorCheck2 <<
"\n" 973 <<
"ERROR3:" << errorCheck3 <<
"\n" 974 <<
"ERROR4:" << errorCheck4 <<
"\n" 975 <<
"ERROR5:" << errorCheck5 <<
"\n" 976 <<
"SENS: " << error <<
"\n";
978 result = ((errorCheck1 < error) &&
979 (errorCheck2 < error) &&
980 (errorCheck3 < error) &&
981 (errorCheck4 < error) &&
982 (errorCheck5 < error));
996 upperMid = (m_Vul + m_Vur)*.5;
997 rightMid = (m_Vur + m_Vlr)*.5;
998 bottomMid = (m_Vlr + m_Vll)*.5;
999 leftMid = (m_Vul + m_Vll)*.5;
1000 center = (m_Vul + m_Vur + m_Vlr + m_Vll)*.25;
1019 upperMid = (m_Iul + m_Iur)*.5;
1020 rightMid = (m_Iur + m_Ilr)*.5;
1021 bottomMid = (m_Ilr + m_Ill)*.5;
1022 leftMid = (m_Iul + m_Ill)*.5;
1023 center = (m_Iul + m_Iur + m_Ilr + m_Ill)*.25;
1033 ossimDpt centerTop = ul + top * .5;
1034 ossimDpt centerBottom = ll + bottom * .5;
1036 return centerBottom + (centerBottom - centerTop)*.5;
1068 m_TemporaryBuffer(0),
1069 m_StartingResLevel(0),
1070 m_ImageViewTransform(imageViewTrans),
1074 m_MaxRecursionLevel(5),
1075 m_AutoUpdateInputTransform(
true),
1076 m_MaxLevelsToCompute(999999)
1102 static const char MODULE[] =
"ossimImageRenderer::getTile";
1106 << MODULE <<
" Requesting view rect = " 1107 << tileRect << endl;
1121 <<
"ossimImageRenderer::getTile tile allocation failure!\n" 1165 << MODULE <<
"No intersection, Returning...." << endl;
1199 std::cout <<
"_____________________" << std::endl;
1200 std::cout <<
"viewRectClip = " << viewRectClip << std::endl;
1217 subRectInfo.transformViewToImage();
1227 << MODULE <<
" image rect = " << subRectInfo.getImageRect() << std::endl;
1245 << MODULE <<
"Returning...." << endl;
1256 std::stack<ossimRendererSubRectInfo> rectStack;
1257 rectStack.push(rectInfo);
1259 while(!rectStack.empty())
1266 if(tempViewRect.
width() <2 ||
1267 tempViewRect.
height() <2)
1278 std::vector<ossimRendererSubRectInfo> splitRects;
1280 if(!splitRects.empty())
1282 for(idx = 0; idx < splitRects.size();++idx)
1286 rectStack.push(splitRects[idx]);
1312 if(tempViewRect.
width() <2 ||
1313 tempViewRect.
height() <2)
1323 std::vector<ossimRendererSubRectInfo> splitRects;
1328 if(!splitRects.empty())
1331 for(idx = 0; idx < splitRects.size();++idx)
1346 #define RSET_SEARCH_THRESHHOLD 0.1 1359 if(imageToViewScale.
hasNans())
return;
1362 double kernelSupportX, kernelSupportY;
1364 double resLevelX = log( 1.0 / imageToViewScale.
x )/ log( 2.0 );
1365 double resLevelY = log( 1.0 / imageToViewScale.
y )/ log( 2.0 );
1366 double resLevel0 = resLevelX < resLevelY ? resLevelX : resLevelY;
1367 long closestFitResLevel = (long)floor( resLevel0 );
1372 ossim_uint32 resLevel = closestFitResLevel<0 ? 0:closestFitResLevel;
1381 if ( (NUM_LEVELS > 0) && (resLevel >= NUM_LEVELS) )
1383 resLevel = NUM_LEVELS - 1;
1394 double requestScale = 1.0 / (1<<resLevel);
1395 double closestScale = decimation.
hasNans() ? requestScale : decimation.
x;
1398 double differenceTest = 0.0;
1399 if (closestScale != 0.0)
1401 differenceTest = (1.0/closestScale) - (1.0/requestScale);
1414 (differenceTest < 0.0) ) )
1425 for( i=1; i<NUM_LEVELS; ++i )
1428 if(decimation.
hasNans() == false )
1430 double testDiscrepancy = decimation.
x - requestScale;
1431 if ( testDiscrepancy < 0.0 )
1437 closestScale = decimation.
x;
1443 closestScale = requestScale;
1444 resLevel = savedResLevel;
1451 rectInfo.
m_Iul.
y*closestScale);
1453 rectInfo.
m_Ill.
y*closestScale);
1455 rectInfo.
m_Ilr.
y*closestScale);
1457 rectInfo.
m_Iur.
y*closestScale);
1483 if((boundingRect.
width() <2)&&(boundingRect.
height()<2))
1491 inputRect = inputRect*
ossimDpt(closestScale, closestScale);
1494 double denominatorY = 1.0;
1497 denominatorY = tile_size.
y-1.0;
1500 ossimDpt newScale( imageToViewScale.
x / closestScale,
1501 imageToViewScale.
y / closestScale );
1515 ( (nll.
y - nul.
y)/denominatorY ) ),
1517 ( (nlr.
y - nur.
y)/denominatorY ) ),
1527 long upper = (long)decimationFactors.size();
1532 while((result < upper)&&!done)
1534 if(scale < decimationFactors[result].
x)
1594 <<
"ossimImageRenderer::getBoundingRect(rect, resLevel) debug:\nbounds = " 1618 std::vector<ossimDrect> boundList;
1642 scale = mpp.
y/vmpp.
y;
1643 if(scale > 1.0) scale = 1.0;
1658 if(divisor < 30) divisor = 30.0;
1665 if(maxEdgeSample < 1) maxEdgeSample = 1;
1666 ossim_uint32 testEdgeSample = ossim::round<ossim_uint32>((maxLen*scale*mpp.
y)/divisor);
1668 bool goodMatch = (testEdgeSample<=maxEdgeSample)||(testEdgeSample>=(maxLen>>1));
1671 ossim_uint32 finalSteps = ossim::round<ossim_uint32>(steps);
1672 if(finalSteps<1) finalSteps=1;
1675 if(finalSteps < maxEdgeSample) finalSteps = maxEdgeSample;
1679 if(boundList.size())
1692 for(idx=1;idx<boundList.size();++idx)
1729 <<
"ossimImageRenderer::initializeBoundingRects() debug:\n" 1778 const char* prefix)
const 1792 "max_levels_to_compute",
1804 <<
"ossimImageRenderer::loadState entered..." << endl;
1806 #ifdef OSSIM_ID_ENABLED 1808 <<
"OSSIM_ID: " << OSSIM_ID << endl;
1826 const char* maxLevelsToCompute = kwl.
find(prefix,
1827 "max_levels_to_compute");
1828 if(maxLevelsToCompute)
1855 bool new_view_set =
false;
1863 return new_view_set;
1899 for(idx = 0; idx < inputSize; ++idx)
1905 validVertices[idx] =
ossimIpt(viewPt);
1970 if((tempName ==
"Filter type")||
1971 (tempName ==
"filter_type"))
1995 if((tempName ==
"Filter type")||
1996 (tempName ==
"filter_type"))
1998 std::vector<ossimString> filterNames;
2030 propertyNames.push_back(
"Filter type");
2052 if(!ivpt || !inputSrc)
2066 "No input image geometry could be established for this renderer."<<endl;
2100 double GSD = (meters.
x + meters.
y)/2.0;
2154 decimations.push_back(
ossimDpt(1,1));
2183 upper = (upper*(1.0 / upper.
length()));
2184 upper.
x *= amount.
x;
2185 upper.
y *= amount.
y;
2186 right = (right*(1.0 / right.
length()));
2187 right.
x *= amount.
x;
2188 right.
y *= amount.
y;
2189 bottom = (bottom*(1.0 / bottom.
length()));
2190 bottom.
x *= amount.
x;
2191 bottom.
y *= amount.
y;
2192 left = (left*(1.0 / left.
length()));
2197 ul = ul - upper + left;
2198 ur = ur + upper - right;
2199 lr = lr + left - bottom;
2200 ll = ll - left + bottom;
2221 if(resLevel < levels)
2238 int decimations = (resLevel - (levels-1));
2250 if(multiplier > tileSize.x)
2252 tileSize.
x = multiplier;
2254 if(multiplier > tileSize.y)
2256 tileSize.y = multiplier;
2262 ossimIrect requestedRectAtValidRLevel = boundingRect;
2264 ossimIrect mappedRequestedRect = requestedRectAtValidRLevel;
2265 requestedRectAtValidRLevel = requestedRectAtValidRLevel*((double)multiplier);
2283 for(yIndex = requestedRectAtValidRLevel.
ul().
y;yIndex < requestedRectAtValidRLevel.
lr().
y; yIndex += tileSize.y)
2285 for(xIndex = requestedRectAtValidRLevel.
ul().
x; xIndex < requestedRectAtValidRLevel.
lr().
x; xIndex+=tileSize.x)
2289 xIndex + (tileSize.x-1),
2290 yIndex + (tileSize.y-1));
2396 for(i = 0; i < maxX; ++i)
2398 offsetX[i] = (i+tileOrigin.
x)/(
ossim_int32)multiplier - resultOrigin.
x;
2403 else if(offsetX[i] >= resultWidth)
2405 offsetX[i] = resultWidth-1;
2408 for(i = 0; i < maxY; ++i)
2410 offsetY[i] = ( ((i+tileOrigin.
y)/(
ossim_int32)multiplier) - resultOrigin.
y);
2415 else if(offsetY[i] >= resultHeight)
2417 offsetY[i] = resultHeight-1;
2419 offsetY[i] *= resultWidth;
2427 for(band = 0; band < numberOfBands; ++band)
2429 T* tileBuf =
static_cast<T*
>(tile->
getBuf(band));
2430 T* resultBuf =
static_cast<T*
>(result->
getBuf(band));
2435 for(dy = 0; dy < maxY; dy+=multiplier)
2437 for(dx = 0; dx < maxX; dx+=multiplier)
2440 for(boxAverageY = 0;
2442 ((boxAverageY+dy)<maxY)); ++boxAverageY)
2444 for(boxAverageX = 0;
2446 ((boxAverageX+dx)<maxX)); ++boxAverageX)
2448 sum += tileBuf[((boxAverageY+dy)*maxX + boxAverageX + dx)];
2451 sum /= (double)(multiplier*multiplier);
2452 resultBuf[ offsetX[dx] + offsetY[dy] ] = (T)sum;
2462 for(band = 0; band < numberOfBands; ++band)
2464 T* tileBuf =
static_cast<T*
>(tile->
getBuf(band));
2465 T* resultBuf =
static_cast<T*
>(result->
getBuf(band));
2466 T tileBufNp =
static_cast<T
>(tile->
getNullPix(band));
2471 for(dy = 0; dy < maxY; dy+=multiplier)
2473 for(dx = 0; dx < maxX; dx+=multiplier)
2476 if(tileBuf[((dy+(multiplier>>1))*maxX + dx+(multiplier>>1))] != tileBufNp)
2479 for(boxAverageY = 0;
2481 ((boxAverageY+dy)<maxY)); ++boxAverageY)
2483 for(boxAverageX = 0;
2485 ((boxAverageX+dx)<maxX)); ++boxAverageX)
2487 T value = tileBuf[((boxAverageY+dy)*maxX + boxAverageX + dx)];
2488 if(value != tileBufNp)
2499 sum /= (double)(area);
2500 if(nullCount!= area)
2502 resultBuf[ offsetX[dx] + offsetY[dy] ] = (T)sum;
16 bit unsigned integer (15 bits used)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
virtual void valueToString(ossimString &valueResult) const =0
virtual ossim_uint32 getWidth() const
virtual bool isSourceEnabled() const
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
void splitVertical(std::vector< ossimRendererSubRectInfo > &result) const
virtual ossimObject * dup() const =0
virtual ossimObject * getView()
virtual void setProperty(ossimRefPtr< ossimProperty > property)
virtual void setProperty(ossimRefPtr< ossimProperty > property)
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
m_Resampler will adjust the rect to whatever the view is.
ossimRefPtr< ossimImageViewTransform > m_transform
void setProjection(ossimProjection *projection)
Sets the projection to be used for local-to-world coordinate transformation.
virtual void getFilterTypes(std::vector< ossimString > &filterTypes) const
virtual ossim_uint32 getNumberOfBands() const
ossimRefPtr< ossimImageData > m_Tile
virtual void setImageRectangle(const ossimIrect &rect)
ossim_float64 width() const
void stretchQuadOut(const ossimDpt &amount, ossimDpt &ul, ossimDpt &ur, ossimDpt &lr, ossimDpt &ll)
ossimString getMinifyFilterTypeAsString() const
Represents serializable keyword/value map.
bool m_AutoUpdateInputTransform
void splitView(std::vector< ossimRendererSubRectInfo > &result) const
void setMaxLevelsToCompute(ossim_uint32 maxLevels)
long computeClosestResLevel(const std::vector< ossimDpt > &decimationFactors, double scale) const
const char * find(const char *key) const
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns instance to the input image geometry.
ossimDpt getAbsValueImageToViewScales() const
void getBoundingRect(ossimIrect &bounding_rect) const
Get the bounding rect of (0, 0) to (imageSize.x-1, imageSize.y-1).
const ossimDpt & ul() const
ossim_uint16 getSplitFlags() const
virtual void setOrigin(const ossimGpt &origin)
Sets theOrigin to origin.
ossim_uint32 height() const
void transformViewToImage()
virtual ossim_uint32 getTileHeight() const
Returns the default processing tile height.
void checkIVT()
this is called on a property event and on input connection changes.
ossimPolyArea2d m_viewArea
bool intersects(const ossimPolyArea2d &rhs) const
void splitHorizontal(std::vector< ossimRendererSubRectInfo > &result) const
void setScaleFactor(const ossimDpt &scale)
virtual void getDecimationFactor(ossim_uint32 resLevel, ossimDpt &result) const
Will return the decimation factor for the given resolution level.
const ossimIpt & ul() const
ossim_uint32 m_StartingResLevel
This is going to allow us to chain multiple renderers together.
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
ossim_uint32 toUInt32() const
16 bit unsigned integer (13 bits used)
virtual ossim_uint32 getNumberOfDecimationLevels() const
Will return the number of resolution levels.
virtual void setReadOnlyFlag(bool flag)
void getImageMids(ossimDpt &upperMid, ossimDpt &rightMid, ossimDpt &bottomMid, ossimDpt &leftMid, ossimDpt ¢er) const
bool intersects(const ossimIrect &rect) const
unsigned short ossim_uint16
void recursiveResample(ossimRefPtr< ossimImageData > outputData, const ossimRendererSubRectInfo &rectInfo, ossim_uint32 level)
void setImageSize(const ossimIpt &size)
const ossimIpt & ll() const
void propertyEvent(ossimPropertyEvent &event)
virtual ~ossimImageRenderer()
virtual ossimString getShortName() const
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &origin, ossim_uint32 resLevel=0)
the resampler will need the tile request to come from the view.
virtual void initialize()
Initialize the data buffer.
void setImageViewTransform(ossimImageViewTransform *transform)
void setFilterType(ossimFilterResamplerType filterType)
virtual ossim_uint32 getTileWidth() const
Returns the default processing tile width.
ossim_uint32 getMaxLevelsToCompute() const
virtual void setMetersPerPixel(const ossimDpt &gsd)
virtual ossimObject * dup() const
virtual void initialize()
virtual bool getEnableFlag() const
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
ossimFilterResampler * m_Resampler
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
void setBoundingInputRect(const ossimIrect &rect)
static ossimImageDataFactory * instance()
virtual void refreshEvent(ossimRefreshEvent &event)
const ossimObject * getObject() const
This is the originating object that originally produced the event.
virtual void getValidImageVertices(vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
ordering specifies how the vertices should be arranged.
void disconnectInputEvent(ossimConnectionEvent &event)
ossimRefPtr< ossimImageData > m_BlankTile
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
bool hasModelTransform() const
ossimRefPtr< ossimImageData > m_TemporaryBuffer
virtual ossimDataObjectStatus validate() const
virtual ossim_uint32 getNumberOfDecimationLevels() const
Will return the number of resolution levels.
signed short ossim_sint16
virtual void disableSource()
Disables source.
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
os2<< "> n<< " > nendobj n
virtual void getValidImageVertices(std::vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
ordering specifies how the vertices should be arranged.
ossimImageSource * theInputConnection
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
32 bit normalized floating point
ossimDpt getMetersPerPixel() const
Returns the GSD associated with this image in the active projection.
bool getCrossesDateline() const
ossimRefPtr< ossimImageData > getTileAtResLevel(const ossimIrect &boundingRect, ossim_uint32 resLevel)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
const ossimIpt & lr() const
ossim_uint32 m_MaxLevelsToCompute
bool canBilinearInterpolate(double error) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
void resampleTileToDecimation(T dummyVariable, ossimRefPtr< ossimImageData > result, ossimRefPtr< ossimImageData > tile, ossim_uint32 multiplier)
void getViewMids(ossimDpt &upperMid, ossimDpt &rightMid, ossimDpt &bottomMid, ossimDpt &leftMid, ossimDpt ¢er) const
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
ossim_uint32 width() const
ossimIrect clipToRect(const ossimIrect &rect) const
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
void add(const ossimPolyArea2d &rhs)
ossim_float64 height() const
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if not defined...
virtual void setEnableFlag(bool flag)
const ossimIpt & ur() const
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
RTTI_DEF2(ossimImageRenderer, "ossimImageRenderer", ossimImageSourceFilter, ossimViewInterface)
void deallocate()
Deletes all allocated tiles.
void transformImageToView()
virtual void getKernelSupport(double &x, double &y) const
ossimDpt getParametricCenter(const ossimDpt &ul, const ossimDpt &ur, const ossimDpt &lr, const ossimDpt &ll) const
virtual ossimScalarType getScalarType() const
virtual void makeBlank()
Initializes data to null pixel values.
64 bit normalized floating point
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).
16 bit unsigned integer (11 bits used)
void splitAll(std::vector< ossimRendererSubRectInfo > &result) const
virtual ossimGpt origin() const =0
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
virtual const void * getBuf() const
virtual bool setView(ossimObject *baseObject)=0
void fillTile(ossimRefPtr< ossimImageData > outputData, const ossimRendererSubRectInfo &rectInfo)
virtual ossimString getLongName() const
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
virtual void getDecimationFactors(vector< ossimDpt > &decimations) const
#define RSET_SEARCH_THRESHHOLD
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
void stretchToTileBoundary(const ossimIpt &tileWidthHeight)
virtual void resample(const ossimRefPtr< ossimImageData > &input, ossimRefPtr< ossimImageData > &output, const ossimDpt &ul, const ossimDpt &ur, const ossimDpt &deltaUl, const ossimDpt &deltaUr, const ossimDpt &length)
ossimDpt computeViewToImageScale(const ossimDpt &viewPt, const ossimDpt &delta=ossimDpt(1.0, 1.0)) const
virtual void setUlTiePoints(const ossimGpt &gpt)
void initializeBoundingRects()
Initializes m_inputR0Rect and m_viewBoundingRect and sets m_rectsDirty appropriately.
virtual ossimObject * getView()=0
ossimRefPtr< ossimImageViewTransform > m_ImageViewTransform
ossimDataObjectStatus
Definitions for data object status.
ossimDrect getViewRect() const
virtual void setEnableFlag(bool flag)
Sets the enable flag.
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
virtual void refreshEvent(ossimRefreshEvent &event)
void connectInputEvent(ossimConnectionEvent &event)
bool imageHasNans() const
void stretchImageOut(bool enableRound=false)
const ossimDpt & lr() const
virtual void getDecimationFactor(ossim_uint32 resLevel, ossimDpt &result) const
Will return the decimation factor for the given resolution level.
ossimIrect combine(const ossimIrect &rect) const
void allocate()
Called on first getTile, will initialize all data needed.
RefreshType getRefreshType() const
virtual const ossimIpt & getOrigin() const
virtual bool setView(ossimObject *baseObject)
virtual void enableSource()
Enables source.
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossim_uint32 m_MaxRecursionLevel
void setCacheRefreshBit()
virtual void getDecimationFactors(std::vector< ossimDpt > &decimations) const
Will return an array of all decimations for each resolution level.
virtual void initialize()
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)
const ossimPolyArea2d * m_viewBounds
16 bit unsigned integer (12 bits used)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)