/usr/include/OTB-6.4/otbNonOptGlImageActor.h is in libotb-dev 6.4.0+dfsg-1.
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 | /*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otb_NonOptGlImageActor_h
#define otb_NonOptGlImageActor_h
#include "otbVectorImage.h"
#include "otbMultiChannelExtractROI.h"
#include "otbVectorRescaleIntensityImageFilter.h"
#include "otbImageFileReader.h"
#include "otbGenericRSTransform.h"
#include "otbGlActor.h"
namespace otb
{
class OTBIce_EXPORT NonOptGlImageActor
: public GlActor
{
public:
typedef NonOptGlImageActor Self;
typedef GlActor Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
itkNewMacro(Self);
typedef VectorImage<float> VectorImageType;
typedef VectorImageType::ImageKeywordlistType ImageKeywordlistType;
typedef VectorImageType::SizeType SizeType;
typedef VectorImageType::IndexType IndexType;
typedef VectorImageType::RegionType RegionType;
typedef VectorImageType::SpacingType SpacingType;
typedef VectorImageType::PointType PointType;
// Initialize with a new image
void Initialize(const std::string & filename);
// Retrieve the full extent of the actor
virtual void GetExtent(double & ulx, double & uly, double & lrx, double & lry) const;
// Update internal actor state with respect to ViewSettings
virtual void ProcessViewSettings();
// Heavy load/unload operations of data
virtual void UpdateData();
// Gl rendering of current state
virtual void Render();
const PointType & GetOrigin() const;
const SpacingType & GetSpacing() const;
std::string GetWkt() const;
ImageKeywordlistType GetKwl() const;
itkSetMacro(UseShader,bool);
itkGetConstReferenceMacro(UseShader,bool);
itkBooleanMacro(UseShader);
itkSetMacro(MinRed,double);
itkSetMacro(MinGreen,double);
itkSetMacro(MinBlue,double);
itkGetMacro(MinRed,double);
itkGetMacro(MinGreen,double);
itkGetMacro(MinBlue,double);
itkSetMacro(MaxRed,double);
itkSetMacro(MaxGreen,double);
itkSetMacro(MaxBlue,double);
itkGetMacro(MaxRed,double);
itkGetMacro(MaxGreen,double);
itkGetMacro(MaxBlue,double);
itkSetMacro(RedIdx,unsigned int);
itkGetMacro(RedIdx,unsigned int);
itkSetMacro(GreenIdx,unsigned int);
itkGetMacro(GreenIdx,unsigned int);
itkSetMacro(BlueIdx,unsigned int);
itkGetMacro(BlueIdx,unsigned int);
itkGetMacro(NumberOfComponents,unsigned int);
protected:
NonOptGlImageActor();
virtual ~NonOptGlImageActor();
typedef ImageFileReader<VectorImageType> ReaderType;
typedef MultiChannelExtractROI<float,float> ExtractROIFilterType;
typedef VectorRescaleIntensityImageFilter<VectorImageType,VectorImageType> RescaleFilterType;
typedef otb::GenericRSTransform<> RSTransformType;
typedef std::vector<unsigned int> ResolutionVectorType;
// Internal class to hold tiles
class Tile
{
public:
Tile()
: m_Loaded(false),
m_TextureId(0),
m_ImageRegion(),
m_UL(),
m_UR(),
m_LL(),
m_LR(),
m_Resolution(1),
m_RedIdx(1),
m_GreenIdx(2),
m_BlueIdx(3),
m_UseShader(false),
m_MinRed(0),
m_MaxRed(0),
m_MinGreen(0),
m_MaxGreen(0),
m_MinBlue(0),
m_MaxBlue(0)
{
m_UL.Fill(0);
m_UR.Fill(0);
m_LL.Fill(0);
m_LR.Fill(0);
}
bool m_Loaded;
unsigned int m_TextureId;
RegionType m_ImageRegion;
PointType m_UL;
PointType m_UR;
PointType m_LL;
PointType m_LR;
unsigned int m_Resolution;
unsigned int m_RedIdx;
unsigned int m_GreenIdx;
unsigned int m_BlueIdx;
bool m_UseShader;
double m_MinRed;
double m_MaxRed;
double m_MinGreen;
double m_MaxGreen;
double m_MinBlue;
double m_MaxBlue;
};
typedef std::vector<Tile> TileVectorType;
private:
// prevent implementation
NonOptGlImageActor(const Self&);
void operator=(const Self&);
// Load tile to GPU
void LoadTile(Tile& tile);
// Unload tile from GPU
void UnloadTile(Tile& tile);
// Clean the loaded tiles, getting rid of unnecessary ones
void CleanLoadedTiles();
// Clear all loaded tiles
void ClearLoadedTiles();
// Is tile loaded ?
bool TileAlreadyLoaded(const Tile& tile);
void ImageRegionToViewportExtent(const RegionType& region, double & ulx, double & uly, double & lrx, double& lry) const;
void ImageRegionToViewportQuad(const RegionType & region, PointType & ul, PointType & ur, PointType & ll, PointType & lr) const;
void ViewportExtentToImageRegion(const double& ulx, const double & uly, const double & lrx, const double & lry, RegionType & region) const;
void UpdateResolution();
void UpdateTransforms();
static void InitShaders();
unsigned int m_TileSize;
std::string m_FileName;
ReaderType::Pointer m_FileReader;
TileVectorType m_LoadedTiles;
unsigned int m_RedIdx;
unsigned int m_GreenIdx;
unsigned int m_BlueIdx;
double m_MinRed;
double m_MaxRed;
double m_MinGreen;
double m_MaxGreen;
double m_MinBlue;
double m_MaxBlue;
unsigned int m_CurrentResolution;
ResolutionVectorType m_AvailableResolutions;
PointType m_Origin;
SpacingType m_Spacing;
RegionType m_LargestRegion;
unsigned int m_NumberOfComponents;
bool m_UseShader;
static unsigned int m_StandardShader;
static unsigned int m_StandardShaderProgram;
static bool m_ShaderInitialized;
RSTransformType::Pointer m_ViewportToImageTransform;
RSTransformType::Pointer m_ImageToViewportTransform;
}; // End class NonOptGlImageActor
} // End namespace otb
#endif
|