/usr/include/ossim/imaging/ossimImageRenderer.h is in libossim-dev 1.7.21-3ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 | //*******************************************************************
// Copyright (C) 2001 ImageLinks Inc.
//
// License: LGPL
//
// See LICENSE.txt file in the top level directory for more details.
//
// Author: Garrett Potts
//
//*******************************************************************
// $Id: ossimImageRenderer.h 13330 2008-07-28 18:04:40Z dburken $
#ifndef ossimImageRenderer_HEADER
#define ossimImageRenderer_HEADER
#include <ossim/imaging/ossimImageSourceFilter.h>
#include <ossim/base/ossimDrect.h>
#include <ossim/base/ossimViewInterface.h>
#include <ossim/base/ossimRationalNumber.h>
class ossimImageViewTransform;
class ossimImageData;
class ossimDiscreteConvolutionKernel;
class ossimFilterResampler;
class OSSIMDLLEXPORT ossimImageRenderer : public ossimImageSourceFilter,
public ossimViewInterface
{
public:
ossimImageRenderer();
ossimImageRenderer(ossimImageSource* inputSource,
ossimImageViewTransform* imageViewTrans = NULL);
virtual ~ossimImageRenderer();
virtual ossimString getLongName() const;
virtual ossimString getShortName() const;
virtual void enableSource();
/**
* the resampler will need the tile request to come from the view.
* It will use the view to transoform this to world and then use the
* image's projection to get it into final line sample. This way
* the resampler can fill a tile width by height on the screen
* correctly.
*/
virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
ossim_uint32 resLevel=0);
virtual void initialize();
/**
* TheResampler will adjust the rect to whatever the view is. So it
* will project the full image rect onto the view and return the upright
* bounding rect.
*/
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
/**
* Method to save the state of an object to a keyword list.
* Return true if ok or false on error.
*/
virtual bool saveState(ossimKeywordlist& kwl,
const char* prefix=0)const;
/**
* Method to the load (recreate) the state of an object from a keyword
* list. Return true if ok or false on error.
*/
virtual bool loadState(const ossimKeywordlist& kwl,
const char* prefix=0);
void setImageViewTransform(ossimImageViewTransform* transform);
ossimImageViewTransform* getImageViewTransform(){return theImageViewTransform;}
virtual bool getImageGeometry(ossimKeywordlist& kwl,
const char* prefix=0);
virtual bool setView(ossimObject* baseObject,
bool ownsTheView = false);
ossimFilterResampler* getResampler()
{
return theResampler;
}
virtual ossimObject* getView();
virtual const ossimObject* getView()const;
virtual void getDecimationFactor(ossim_uint32 resLevel,
ossimDpt& result)const;
virtual void getDecimationFactors(vector<ossimDpt>& decimations)const;
virtual ossim_uint32 getNumberOfDecimationLevels()const;
virtual void setAutoUpdateInputTransformFlag(bool flag)
{
theAutoUpdateInputTransform = flag;
}
/**
* ordering specifies how the vertices should be arranged.
* valid image vertices is basically the tightly fit convex hull
* of the image. Usually an image has NULL values and are
* internally not upright rectangular. This can cause
* problems some spatial filters.
*
* We need to make sure that the resampler overrides this method.
* it needs to transform the vertices to the view's side.
*/
virtual void getValidImageVertices(vector<ossimIpt>& validVertices,
ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
ossim_uint32 resLevel=0)const;
void setMaxLevelsToCompute(ossim_uint32 maxLevels);
ossim_uint32 getMaxLevelsToCompute()const;
void connectInputEvent(ossimConnectionEvent& event);
void disconnectInputEvent(ossimConnectionEvent& event);
void propertyEvent(ossimPropertyEvent& event);
virtual void setProperty(ossimRefPtr<ossimProperty> property);
virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
private:
class ossimRendererSubRectInfo
{
public:
friend std::ostream& operator <<(std::ostream& out,
const ossimRendererSubRectInfo& rhs)
{
return out << "vul: " << rhs.theVul << endl
<< "vur: " << rhs.theVur << endl
<< "vlr: " << rhs.theVlr << endl
<< "vll: " << rhs.theVll << endl
<< "iul: " << rhs.theIul << endl
<< "iur: " << rhs.theIur << endl
<< "ilr: " << rhs.theIlr << endl
<< "ill: " << rhs.theIll << endl
<< "scale: " << rhs.theViewToImageScale << endl;
}
ossimRendererSubRectInfo()
{
theVul.makeNan();
theVur.makeNan();
theVlr.makeNan();
theVll.makeNan();
theIul.makeNan();
theIur.makeNan();
theIlr.makeNan();
theIll.makeNan();
theViewToImageScale.makeNan();
theImageToViewScale.makeNan();
}
ossimRendererSubRectInfo(const ossimDpt& vul,
const ossimDpt& vur,
const ossimDpt& vlr,
const ossimDpt& vll)
:theVul(vul),
theVur(vur),
theVlr(vlr),
theVll(vll)
{
theIul.makeNan();
theIur.makeNan();
theIlr.makeNan();
theIll.makeNan();
theViewToImageScale.makeNan();
theImageToViewScale.makeNan();
}
bool imageHasNans()const
{
return ( theIul.hasNans()||
theIur.hasNans()||
theIlr.hasNans()||
theIll.hasNans());
}
bool imageIsNan()const
{
return ( theIul.hasNans()&&
theIur.hasNans()&&
theIlr.hasNans()&&
theIll.hasNans());
}
bool viewHasNans()const
{
return ( theVul.hasNans()||
theVur.hasNans()||
theVlr.hasNans()||
theVll.hasNans());
}
bool viewIsNan()const
{
return ( theVul.hasNans()&&
theVur.hasNans()&&
theVlr.hasNans()&&
theVll.hasNans());
}
void splitView(ossimImageViewTransform* transform,
ossimRendererSubRectInfo& ulRect,
ossimRendererSubRectInfo& urRect,
ossimRendererSubRectInfo& lrRect,
ossimRendererSubRectInfo& llRect)const;
void transformViewToImage(ossimImageViewTransform* transform);
void transformImageToView(ossimImageViewTransform* transform);
void roundToInteger()
{
theIul = ossimIpt(theIul);
theIur = ossimIpt(theIur);
theIlr = ossimIpt(theIlr);
theIll = ossimIpt(theIll);
theVul = ossimIpt(theVul);
theVur = ossimIpt(theVur);
theVlr = ossimIpt(theVlr);
theVll = ossimIpt(theVll);
}
void stretchImageOut(bool enableRound=false);
ossimDrect getViewRect()const
{
return ossimDrect(theVul,
theVur,
theVlr,
theVll);
}
ossimDrect getImageRect()const
{
return ossimDrect(theIul,
theIur,
theIlr,
theIll);
}
void roundImageToInteger()
{
theIul = ossimIpt(theIul);
theIur = ossimIpt(theIur);
theIlr = ossimIpt(theIlr);
theIll = ossimIpt(theIll);
}
void roundViewToInteger()
{
theVul = ossimIpt(theVul);
theVur = ossimIpt(theVur);
theVlr = ossimIpt(theVlr);
theVll = ossimIpt(theVll);
}
bool isViewEqual(const ossimRendererSubRectInfo& infoRect)const
{
return ( (theVul == infoRect.theVul)&&
(theVur == infoRect.theVur)&&
(theVlr == infoRect.theVlr)&&
(theVll == infoRect.theVll));
}
bool isViewEqual(const ossimDrect& viewRect)const
{
return ( (theVul == viewRect.ul())&&
(theVur == viewRect.ur())&&
(theVlr == viewRect.lr())&&
(theVll == viewRect.ll()));
}
ossimDpt getAbsValueViewToImageScales()const
{
if(theViewToImageScale.hasNans())
{
return theImageToViewScale;
}
return ossimDpt(fabs(theViewToImageScale.x),
fabs(theViewToImageScale.y));
}
ossimDpt getAbsValueImageToViewScales()const
{
if(theImageToViewScale.hasNans())
{
return theImageToViewScale;
}
return ossimDpt(fabs(theImageToViewScale.x),
fabs(theImageToViewScale.y));
}
bool isViewAPoint()const
{
return ((theVul == theVur)&&
(theVul == theVlr)&&
(theVul == theVll));
}
bool isIdentity()const;
bool canBilinearInterpolate(ossimImageViewTransform* transform,
double error)const;
ossimDpt getParametricCenter(const ossimDpt& ul, const ossimDpt& ur,
const ossimDpt& lr, const ossimDpt& ll)const;
void getViewMids(ossimDpt& upperMid,
ossimDpt& rightMid,
ossimDpt& bottomMid,
ossimDpt& leftMid,
ossimDpt& center)const;
void getImageMids(ossimDpt& upperMid,
ossimDpt& rightMid,
ossimDpt& bottomMid,
ossimDpt& leftMid,
ossimDpt& center)const;
ossimDpt theIul;
ossimDpt theIur;
ossimDpt theIlr;
ossimDpt theIll;
ossimIpt theVul;
ossimIpt theVur;
ossimIpt theVlr;
ossimIpt theVll;
ossimDpt theViewToImageScale;
ossimDpt theImageToViewScale;
};
void recursiveResample(ossimRefPtr<ossimImageData> outputData,
const ossimRendererSubRectInfo& rectInfo,
ossim_uint32 level);
void fillTile(ossimRefPtr<ossimImageData> outputData,
const ossimRendererSubRectInfo& rectInfo);
ossimIrect getBoundingImageRect()const;
/**
*this is called on a property event and on input connection changes.
*/
void checkTransform();
void computeRects();
ossimRefPtr<ossimImageData> getTileAtResLevel(const ossimIrect& boundingRect,
ossim_uint32 resLevel);
template <class T>
void resampleTileToDecimation(T dummyVariable,
ossimRefPtr<ossimImageData> result,
ossimRefPtr<ossimImageData> tile,
ossim_uint32 multiplier);
long computeClosestResLevel(const std::vector<ossimDpt>& decimationFactors,
double scale)const;
void stretchQuadOut(const ossimDpt& amount,
ossimDpt& ul,
ossimDpt& ur,
ossimDpt& lr,
ossimDpt& ll);
/**
* Called on first getTile, will initialize all data needed.
*/
void allocate();
/**
* Deletes all allocated tiles.
*/
void deallocate();
virtual void fireProgressEvent(double percentComplete);
ossimFilterResampler* theResampler;
ossimRefPtr<ossimImageData> theBlankTile;
ossimRefPtr<ossimImageData> theTile;
ossimRefPtr<ossimImageData> theTemporaryBuffer;
/**
* This is going to allow us to chain multiple
* renderers together. So if we have one
* renderer doing a scale and they pass an r-level
* down and we have another renderer within the
* chain he will be starting at a different r-level.
* The default will be r-level 0 request coming
* from the right.
*/
ossim_uint32 theStartingResLevel;
ossimImageViewTransform *theImageViewTransform;
mutable ossimIrect theBoundingRect;
mutable ossimIrect theBoundingViewRect;
/**
* Holds a pre-computed input rect.
*/
// ossimIrect theInputRect;
/**
* Holds a precomputed output rect.
*/
// ossimIrect theOutputRect;
ossim_uint32 theMaxRecursionLevel;
bool theAutoUpdateInputTransform;
vector<ossimDpt> theInputDecimationFactors;
ossim_uint32 theMaxLevelsToCompute;
TYPE_DATA
};
#endif
|