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

Method ReadImage2DData

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

Reads the image data block

Source from the content-addressed store, hash-verified

554
555 // Reads the image data block
556 size_t ReaderImpl::ReadImage2DData( int64_t imageIndex, Image2DProjection imageProjection,
557 Image2DType imageType, uint8_t *pBuffer, int64_t start,
558 size_t count ) const
559 {
560 if ( ( imageIndex < 0 ) || ( imageIndex >= images2D_.childCount() ) )
561 {
562 return 0;
563 }
564
565 const StructureNode image( images2D_.get( imageIndex ) );
566
567 switch ( imageProjection )
568 {
569 case ProjectionNone:
570 return 0;
571
572 case ProjectionVisual:
573 if ( image.isDefined( "visualReferenceRepresentation" ) )
574 {
575 const StructureNode visualReferenceRepresentation(
576 image.get( "visualReferenceRepresentation" ) );
577
578 return _readImage2DNode( visualReferenceRepresentation, imageType, pBuffer, start,
579 count );
580 }
581 break;
582
583 case ProjectionPinhole:
584 if ( image.isDefined( "pinholeRepresentation" ) )
585 {
586 const StructureNode pinholeRepresentation( image.get( "pinholeRepresentation" ) );
587
588 return _readImage2DNode( pinholeRepresentation, imageType, pBuffer, start, count );
589 }
590 break;
591
592 case ProjectionSpherical:
593 if ( image.isDefined( "sphericalRepresentation" ) )
594 {
595 const StructureNode sphericalRepresentation(
596 image.get( "sphericalRepresentation" ) );
597
598 return _readImage2DNode( sphericalRepresentation, imageType, pBuffer, start, count );
599 }
600 break;
601
602 case ProjectionCylindrical:
603 if ( image.isDefined( "cylindricalRepresentation" ) )
604 {
605 const StructureNode cylindricalRepresentation(
606 image.get( "cylindricalRepresentation" ) );
607
608 return _readImage2DNode( cylindricalRepresentation, imageType, pBuffer, start,
609 count );
610 }
611 break;
612 }
613

Callers

nothing calls this directly

Calls 4

_readImage2DNodeFunction · 0.85
childCountMethod · 0.45
getMethod · 0.45
isDefinedMethod · 0.45

Tested by

no test coverage detected