MCPcopy Create free account
hub / github.com/PDAL/PDAL / _readColourRanges

Function _readColourRanges

plugins/e57/libE57Format/src/ReaderImpl.cpp:154–190  ·  view source on GitHub ↗

Possibly get min/max from the colour node itself instead of the colorLimits.

Source from the content-addressed store, hash-verified

152
153 /// Possibly get min/max from the colour node itself instead of the colorLimits.
154 void _readColourRanges( const std::string &protoName, const StructureNode &proto,
155 double &colourMin, double &colourMax )
156 {
157 // IF the colorLimits are not set
158 // AND our colour node is
159 // THEN get our min/max from the colour node itself.
160 if ( ( colourMax == 0.0 ) && proto.isDefined( protoName ) )
161 {
162 const auto colourProto = proto.get( protoName );
163
164 if ( colourProto.type() == TypeInteger )
165 {
166 const IntegerNode integerColour( colourProto );
167
168 colourMin = static_cast<uint16_t>( integerColour.minimum() );
169 colourMax = static_cast<uint16_t>( integerColour.maximum() );
170 }
171 else if ( colourProto.type() == TypeScaledInteger )
172 {
173 const ScaledIntegerNode scaledColour( colourProto );
174 const double scale = scaledColour.scale();
175 const double offset = scaledColour.offset();
176 const int64_t minimum = scaledColour.minimum();
177 const int64_t maximum = scaledColour.maximum();
178
179 colourMin = static_cast<uint16_t>( minimum ) * scale + offset;
180 colourMax = static_cast<uint16_t>( maximum ) * scale + offset;
181 }
182 else if ( colourProto.type() == TypeFloat )
183 {
184 const FloatNode floatColour( colourProto );
185
186 colourMin = static_cast<uint16_t>( floatColour.minimum() );
187 colourMax = static_cast<uint16_t>( floatColour.maximum() );
188 }
189 }
190 }
191
192 ReaderImpl::ReaderImpl( const ustring &filePath, const ReaderOptions &options ) :
193 imf_( filePath, "r", options.checksumPolicy ), root_( imf_.root() ),

Callers 1

ReadData3DMethod · 0.85

Calls 7

isDefinedMethod · 0.45
getMethod · 0.45
typeMethod · 0.45
minimumMethod · 0.45
maximumMethod · 0.45
scaleMethod · 0.45
offsetMethod · 0.45

Tested by

no test coverage detected