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

Method ReadImage2D

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

Returns the Image2Ds header and positions the cursor

Source from the content-addressed store, hash-verified

273
274 // Returns the Image2Ds header and positions the cursor
275 bool ReaderImpl::ReadImage2D( int64_t imageIndex, Image2D &image2DHeader ) const
276 {
277 if ( !IsOpen() )
278 {
279 return false;
280 }
281 if ( ( imageIndex < 0 ) || ( imageIndex >= images2D_.childCount() ) )
282 {
283 return false;
284 }
285
286 image2DHeader = {};
287
288 const StructureNode image( images2D_.get( imageIndex ) );
289
290 image2DHeader.guid = StringNode( image.get( "guid" ) ).value();
291
292 if ( image.isDefined( "name" ) )
293 {
294 image2DHeader.name = StringNode( image.get( "name" ) ).value();
295 }
296
297 if ( image.isDefined( "description" ) )
298 {
299 image2DHeader.description = StringNode( image.get( "description" ) ).value();
300 }
301
302 if ( image.isDefined( "sensorVendor" ) )
303 {
304 image2DHeader.sensorVendor = StringNode( image.get( "sensorVendor" ) ).value();
305 }
306 if ( image.isDefined( "sensorModel" ) )
307 {
308 image2DHeader.sensorModel = StringNode( image.get( "sensorModel" ) ).value();
309 }
310 if ( image.isDefined( "sensorSerialNumber" ) )
311 {
312 image2DHeader.sensorSerialNumber = StringNode( image.get( "sensorSerialNumber" ) ).value();
313 }
314
315 if ( image.isDefined( "associatedData3DGuid" ) )
316 {
317 image2DHeader.associatedData3DGuid =
318 StringNode( image.get( "associatedData3DGuid" ) ).value();
319 }
320
321 if ( image.isDefined( "acquisitionDateTime" ) )
322 {
323 const StructureNode acquisitionDateTime( image.get( "acquisitionDateTime" ) );
324
325 image2DHeader.acquisitionDateTime.dateTimeValue =
326 FloatNode( acquisitionDateTime.get( "dateTimeValue" ) ).value();
327
328 if ( acquisitionDateTime.isDefined( "isAtomicClockReferenced" ) )
329 {
330 image2DHeader.acquisitionDateTime.isAtomicClockReferenced = static_cast<int32_t>(
331 IntegerNode( acquisitionDateTime.get( "isAtomicClockReferenced" ) ).value() );
332 }

Callers

nothing calls this directly

Calls 9

StringNodeClass · 0.85
FloatNodeClass · 0.85
IntegerNodeClass · 0.85
BlobNodeClass · 0.85
childCountMethod · 0.45
getMethod · 0.45
valueMethod · 0.45
isDefinedMethod · 0.45
byteCountMethod · 0.45

Tested by

no test coverage detected