37 imf_( filePath,
"w" ), root_( imf_.root() ), data3D_( imf_, true ), images2D_( imf_, true )
46 root_.
set(
"formatName",
StringNode( imf_,
"ASTM E57 3D Imaging Data File" ) );
57 root_.
set(
"e57LibraryVersion",
StringNode( imf_, libraryId ) );
61 if ( !coordinateMetadata.empty() )
63 root_.
set(
"coordinateMetadata",
StringNode( imf_, coordinateMetadata ) );
72 creationDateTime.
set(
"dateTimeValue",
FloatNode(imf_, GetGPSTime()));
73 creationDateTime.
set(
"isAtomicClockReferenced",
IntegerNode(imf_,0));
74 root_.
set(
"creationDateTime", creationDateTime);
77 root_.
set(
"data3D", data3D_ );
78 root_.
set(
"images2D", images2D_ );
133 if ( image2DHeader.
guid.empty() )
140 if ( !image2DHeader.
name.empty() )
171 image.set(
"acquisitionDateTime", acquisitionDateTime );
173 acquisitionDateTime.
set(
"isAtomicClockReferenced",
181 image.set(
"pose", pose );
184 pose.
set(
"rotation", rotation );
191 pose.
set(
"translation", translation );
201 image.set(
"visualReferenceRepresentation", visualReferenceRepresentation );
205 visualReferenceRepresentation.
set(
210 visualReferenceRepresentation.
set(
215 visualReferenceRepresentation.
set(
219 visualReferenceRepresentation.
set(
221 visualReferenceRepresentation.
set(
228 image.set(
"pinholeRepresentation", pinholeRepresentation );
232 pinholeRepresentation.
set(
"jpegImage",
241 pinholeRepresentation.
set(
"imageMask",
246 pinholeRepresentation.
set(
"imageHeight",
251 pinholeRepresentation.
set(
"principalPointX",
253 pinholeRepresentation.
set(
"principalPointY",
260 image.set(
"sphericalRepresentation", sphericalRepresentation );
264 sphericalRepresentation.
set(
"jpegImage",
269 sphericalRepresentation.
set(
"pngImage",
274 sphericalRepresentation.
set(
"imageMask",
278 sphericalRepresentation.
set(
"imageHeight",
280 sphericalRepresentation.
set(
"imageWidth",
282 sphericalRepresentation.
set(
"pixelHeight",
284 sphericalRepresentation.
set(
"pixelWidth",
291 image.set(
"cylindricalRepresentation", cylindricalRepresentation );
295 cylindricalRepresentation.
set(
"jpegImage",
300 cylindricalRepresentation.
set(
"pngImage",
305 cylindricalRepresentation.
set(
"imageMask",
309 cylindricalRepresentation.
set(
"imageHeight",
311 cylindricalRepresentation.
set(
"imageWidth",
313 cylindricalRepresentation.
set(
"pixelHeight",
315 cylindricalRepresentation.
set(
"pixelWidth",
317 cylindricalRepresentation.
set(
"principalPointY",
328 int64_t transferred = 0;
337 if (
image.isDefined(
"jpegImage" ) )
340 jpegImage.write( (uint8_t *)pBuffer, start, (
size_t)
count );
347 if (
image.isDefined(
"pngImage" ) )
350 pngImage.write( (uint8_t *)pBuffer, start, (
size_t)
count );
357 if (
image.isDefined(
"imageMask" ) )
360 imageMask.write( (uint8_t *)pBuffer, start, (
size_t)
count );
370 void *pBuffer, int64_t start, int64_t
count )
372 if ( ( imageIndex < 0 ) || ( imageIndex >= images2D_.
childCount() ) )
377 int64_t transferred = 0;
380 switch ( imageProjection )
385 if (
image.isDefined(
"visualReferenceRepresentation" ) )
387 StructureNode visualReferenceRepresentation(
image.get(
"visualReferenceRepresentation" ) );
388 transferred = WriteImage2DNode( visualReferenceRepresentation, imageType, pBuffer, start,
count );
392 if (
image.isDefined(
"pinholeRepresentation" ) )
395 transferred = WriteImage2DNode( pinholeRepresentation, imageType, pBuffer, start,
count );
399 if (
image.isDefined(
"sphericalRepresentation" ) )
402 transferred = WriteImage2DNode( sphericalRepresentation, imageType, pBuffer, start,
count );
406 if (
image.isDefined(
"cylindricalRepresentation" ) )
409 transferred = WriteImage2DNode( cylindricalRepresentation, imageType, pBuffer, start,
count );
420 if ( data3DHeader.
guid.empty() )
431 if ( !data3DHeader.
name.empty() )
446 for ( i = 0; i < (int)data3DHeader.
originalGuids.size(); i++ )
500 if ( ( data3DHeader.indexBounds.rowMinimum != 0 ) || ( data3DHeader.indexBounds.rowMaximum != 0 ) )
502 ibox.
set(
"rowMinimum",
IntegerNode( imf_, data3DHeader.indexBounds.rowMinimum ) );
503 ibox.
set(
"rowMaximum",
IntegerNode( imf_, data3DHeader.indexBounds.rowMaximum ) );
505 if ( ( data3DHeader.indexBounds.columnMinimum != 0 ) || ( data3DHeader.indexBounds.columnMaximum != 0 ) )
507 ibox.
set(
"columnMinimum",
IntegerNode( imf_, data3DHeader.indexBounds.columnMinimum ) );
508 ibox.
set(
"columnMaximum",
IntegerNode( imf_, data3DHeader.indexBounds.columnMaximum ) );
510 if ( ( data3DHeader.indexBounds.returnMinimum != 0 ) || ( data3DHeader.indexBounds.returnMaximum != 0 ) )
512 ibox.
set(
"returnMinimum",
IntegerNode( imf_, data3DHeader.indexBounds.returnMinimum ) );
513 ibox.
set(
"returnMaximum",
IntegerNode( imf_, data3DHeader.indexBounds.returnMaximum ) );
515 scan.set(
"indexBounds", ibox );
518 if ( ( data3DHeader.intensityLimits.intensityMaximum != 0. ) ||
519 ( data3DHeader.intensityLimits.intensityMinimum != 0. ) )
522 if ( data3DHeader.pointFields.intensityScaledInteger > 0. )
525 double scale = data3DHeader.pointFields.intensityScaledInteger;
527 int64_t rawIntegerMinimum =
528 (int64_t)
floor( ( data3DHeader.intensityLimits.intensityMinimum -
offset ) / scale + .5 );
529 int64_t rawIntegerMaximum =
530 (int64_t)
floor( ( data3DHeader.intensityLimits.intensityMaximum -
offset ) / scale + .5 );
532 intbox.set(
"intensityMaximum",
ScaledIntegerNode( imf_, rawIntegerMaximum, rawIntegerMinimum,
533 rawIntegerMaximum, scale,
offset ) );
535 intbox.set(
"intensityMinimum",
ScaledIntegerNode( imf_, rawIntegerMinimum, rawIntegerMinimum,
536 rawIntegerMaximum, scale,
offset ) );
538 else if ( data3DHeader.pointFields.intensityScaledInteger == 0. )
540 intbox.set(
"intensityMaximum",
FloatNode( imf_, data3DHeader.intensityLimits.intensityMaximum ) );
541 intbox.set(
"intensityMinimum",
FloatNode( imf_, data3DHeader.intensityLimits.intensityMinimum ) );
545 intbox.set(
"intensityMaximum",
546 IntegerNode( imf_, (int64_t)data3DHeader.intensityLimits.intensityMaximum ) );
547 intbox.set(
"intensityMinimum",
548 IntegerNode( imf_, (int64_t)data3DHeader.intensityLimits.intensityMinimum ) );
550 scan.set(
"intensityLimits", intbox );
553 if ( ( data3DHeader.colorLimits.colorRedMaximum != 0. ) || ( data3DHeader.colorLimits.colorRedMinimum != 0. ) )
556 colorbox.set(
"colorRedMaximum",
IntegerNode( imf_, (int64_t)data3DHeader.colorLimits.colorRedMaximum ) );
557 colorbox.set(
"colorRedMinimum",
IntegerNode( imf_, (int64_t)data3DHeader.colorLimits.colorRedMinimum ) );
558 colorbox.set(
"colorGreenMaximum",
IntegerNode( imf_, (int64_t)data3DHeader.colorLimits.colorGreenMaximum ) );
559 colorbox.set(
"colorGreenMinimum",
IntegerNode( imf_, (int64_t)data3DHeader.colorLimits.colorGreenMinimum ) );
560 colorbox.set(
"colorBlueMaximum",
IntegerNode( imf_, (int64_t)data3DHeader.colorLimits.colorBlueMaximum ) );
561 colorbox.set(
"colorBlueMinimum",
IntegerNode( imf_, (int64_t)data3DHeader.colorLimits.colorBlueMinimum ) );
562 scan.set(
"colorLimits", colorbox );
567 if ( ( data3DHeader.cartesianBounds.xMinimum != -E57_DOUBLE_MAX ) ||
568 ( data3DHeader.cartesianBounds.xMaximum != E57_DOUBLE_MAX ) )
571 bbox.set(
"xMinimum",
FloatNode( imf_, data3DHeader.cartesianBounds.xMinimum ) );
572 bbox.set(
"xMaximum",
FloatNode( imf_, data3DHeader.cartesianBounds.xMaximum ) );
573 bbox.set(
"yMinimum",
FloatNode( imf_, data3DHeader.cartesianBounds.yMinimum ) );
574 bbox.set(
"yMaximum",
FloatNode( imf_, data3DHeader.cartesianBounds.yMaximum ) );
575 bbox.set(
"zMinimum",
FloatNode( imf_, data3DHeader.cartesianBounds.zMinimum ) );
576 bbox.set(
"zMaximum",
FloatNode( imf_, data3DHeader.cartesianBounds.zMaximum ) );
577 scan.set(
"cartesianBounds", bbox );
580 if ( ( data3DHeader.sphericalBounds.rangeMinimum != 0. ) ||
581 ( data3DHeader.sphericalBounds.rangeMaximum != E57_DOUBLE_MAX ) )
584 sbox.set(
"rangeMinimum",
FloatNode( imf_, data3DHeader.sphericalBounds.rangeMinimum ) );
585 sbox.set(
"rangeMaximum",
FloatNode( imf_, data3DHeader.sphericalBounds.rangeMaximum ) );
586 sbox.set(
"elevationMinimum",
FloatNode( imf_, data3DHeader.sphericalBounds.elevationMinimum ) );
587 sbox.set(
"elevationMaximum",
FloatNode( imf_, data3DHeader.sphericalBounds.elevationMaximum ) );
588 sbox.set(
"azimuthStart",
FloatNode( imf_, data3DHeader.sphericalBounds.azimuthStart ) );
589 sbox.set(
"azimuthEnd",
FloatNode( imf_, data3DHeader.sphericalBounds.azimuthEnd ) );
590 scan.set(
"sphericalBounds", sbox );
596 if ( data3DHeader.pose != RigidBodyTransform{} )
599 scan.set(
"pose", pose );
602 rotation.set(
"w",
FloatNode( imf_, data3DHeader.pose.rotation.w ) );
603 rotation.set(
"x",
FloatNode( imf_, data3DHeader.pose.rotation.x ) );
604 rotation.set(
"y",
FloatNode( imf_, data3DHeader.pose.rotation.y ) );
605 rotation.set(
"z",
FloatNode( imf_, data3DHeader.pose.rotation.z ) );
606 pose.set(
"rotation", rotation );
609 translation.set(
"x",
FloatNode( imf_, data3DHeader.pose.translation.x ) );
610 translation.set(
"y",
FloatNode( imf_, data3DHeader.pose.translation.y ) );
611 translation.set(
"z",
FloatNode( imf_, data3DHeader.pose.translation.z ) );
612 pose.set(
"translation", translation );
618 if ( data3DHeader.acquisitionStart.dateTimeValue > 0. )
621 scan.set(
"acquisitionStart", acquisitionStart );
622 acquisitionStart.set(
"dateTimeValue",
FloatNode( imf_, data3DHeader.acquisitionStart.dateTimeValue ) );
623 acquisitionStart.set(
"isAtomicClockReferenced",
624 IntegerNode( imf_, data3DHeader.acquisitionStart.isAtomicClockReferenced ) );
626 if ( data3DHeader.acquisitionEnd.dateTimeValue > 0. )
629 scan.set(
"acquisitionEnd", acquisitionEnd );
630 acquisitionEnd.set(
"dateTimeValue",
FloatNode( imf_, data3DHeader.acquisitionEnd.dateTimeValue ) );
631 acquisitionEnd.set(
"isAtomicClockReferenced",
632 IntegerNode( imf_, data3DHeader.acquisitionEnd.isAtomicClockReferenced ) );
637 if ( !data3DHeader.pointGroupingSchemes.groupingByLine.idElementName.empty() )
640 scan.set(
"pointGroupingSchemes", pointGroupingSchemes );
645 pointGroupingSchemes.set(
"groupingByLine", groupingByLine );
648 bool byColumn =
true;
649 if ( data3DHeader.pointGroupingSchemes.groupingByLine.idElementName.compare(
"rowIndex" ) == 0 )
658 groupingByLine.set(
"idElementName",
StringNode( imf_,
"columnIndex" ) );
662 groupingByLine.set(
"idElementName",
StringNode( imf_,
"rowIndex" ) );
669 int64_t groupsSize = data3DHeader.pointGroupingSchemes.groupingByLine.groupsSize;
670 int64_t countSize = data3DHeader.pointGroupingSchemes.groupingByLine.pointCountSize;
671 int64_t pointsSize = data3DHeader.pointsSize;
674 lineGroupProto.set(
"startPointIndex",
IntegerNode( imf_, 0, 0, pointsSize - 1 ) );
675 lineGroupProto.set(
"idElementValue",
IntegerNode( imf_, 0, 0, groupsSize - 1 ) );
676 lineGroupProto.set(
"pointCount",
IntegerNode( imf_, 0, 0, countSize ) );
719 groupingByLine.set(
"groups", groups );
729 const double pointRangeScale = data3DHeader.pointFields.pointRangeScaledInteger;
730 const double pointRangeOffset = 0.;
731 int64_t pointRangeMinimum =
732 (int64_t)
floor( ( data3DHeader.pointFields.pointRangeMinimum - pointRangeOffset ) / pointRangeScale + .5 );
733 int64_t pointRangeMaximum =
734 (int64_t)
floor( ( data3DHeader.pointFields.pointRangeMaximum - pointRangeOffset ) / pointRangeScale + .5 );
736 const auto getPointProto = [=]() ->
Node {
739 return ScaledIntegerNode( imf_, 0, pointRangeMinimum, pointRangeMaximum, pointRangeScale,
745 data3DHeader.pointFields.pointRangeMinimum, data3DHeader.pointFields.pointRangeMaximum );
749 if ( data3DHeader.pointFields.cartesianXField )
751 proto.set(
"cartesianX", getPointProto() );
753 if ( data3DHeader.pointFields.cartesianYField )
755 proto.set(
"cartesianY", getPointProto() );
758 if ( data3DHeader.pointFields.cartesianZField )
760 proto.set(
"cartesianZ", getPointProto() );
763 if ( data3DHeader.pointFields.sphericalRangeField )
765 proto.set(
"sphericalRange", getPointProto() );
768 const double angleScale = data3DHeader.pointFields.angleScaledInteger;
769 const double angleOffset = 0.;
770 int64_t angleMinimum =
771 (int64_t)
std::floor( ( data3DHeader.pointFields.angleMinimum - angleOffset ) / angleScale + .5 );
772 int64_t angleMaximum =
773 (int64_t)
std::floor( ( data3DHeader.pointFields.angleMaximum - angleOffset ) / angleScale + .5 );
775 const auto getAngleProto = [=]() ->
Node {
778 return ScaledIntegerNode( imf_, 0, angleMinimum, angleMaximum, angleScale, angleOffset );
783 data3DHeader.pointFields.angleMinimum, data3DHeader.pointFields.angleMaximum );
787 if ( data3DHeader.pointFields.sphericalAzimuthField )
789 proto.set(
"sphericalAzimuth", getAngleProto() );
792 if ( data3DHeader.pointFields.sphericalElevationField )
794 proto.set(
"sphericalElevation", getAngleProto() );
797 if ( data3DHeader.pointFields.intensityField )
799 if ( data3DHeader.pointFields.intensityScaledInteger > 0. )
802 double scale = data3DHeader.pointFields.intensityScaledInteger;
803 int64_t rawIntegerMinimum =
804 (int64_t)
floor( ( data3DHeader.intensityLimits.intensityMinimum -
offset ) / scale + .5 );
805 int64_t rawIntegerMaximum =
806 (int64_t)
floor( ( data3DHeader.intensityLimits.intensityMaximum -
offset ) / scale + .5 );
811 proto.set(
"intensity",
FloatNode( imf_, 0.,
E57_SINGLE, data3DHeader.intensityLimits.intensityMinimum,
812 data3DHeader.intensityLimits.intensityMaximum ) );
816 proto.set(
"intensity",
IntegerNode( imf_, 0, (int64_t)data3DHeader.intensityLimits.intensityMinimum,
817 (int64_t)data3DHeader.intensityLimits.intensityMaximum ) );
821 if ( data3DHeader.pointFields.colorRedField )
823 proto.set(
"colorRed",
IntegerNode( imf_, 0, (int64_t)data3DHeader.colorLimits.colorRedMinimum,
824 (int64_t)data3DHeader.colorLimits.colorRedMaximum ) );
826 if ( data3DHeader.pointFields.colorGreenField )
828 proto.set(
"colorGreen",
IntegerNode( imf_, 0, (int64_t)data3DHeader.colorLimits.colorGreenMinimum,
829 (int64_t)data3DHeader.colorLimits.colorGreenMaximum ) );
831 if ( data3DHeader.pointFields.colorBlueField )
833 proto.set(
"colorBlue",
IntegerNode( imf_, 0, (int64_t)data3DHeader.colorLimits.colorBlueMinimum,
834 (int64_t)data3DHeader.colorLimits.colorBlueMaximum ) );
837 if ( data3DHeader.pointFields.returnIndexField )
839 proto.set(
"returnIndex",
IntegerNode( imf_, 0, E57_UINT8_MIN, data3DHeader.pointFields.returnMaximum ) );
841 if ( data3DHeader.pointFields.returnCountField )
843 proto.set(
"returnCount",
IntegerNode( imf_, 0, E57_UINT8_MIN, data3DHeader.pointFields.returnMaximum ) );
846 if ( data3DHeader.pointFields.rowIndexField )
848 proto.set(
"rowIndex",
IntegerNode( imf_, 0, E57_UINT32_MIN, data3DHeader.pointFields.rowIndexMaximum ) );
850 if ( data3DHeader.pointFields.columnIndexField )
852 proto.set(
"columnIndex",
853 IntegerNode( imf_, 0, E57_UINT32_MIN, data3DHeader.pointFields.columnIndexMaximum ) );
856 if ( data3DHeader.pointFields.timeStampField )
858 if ( data3DHeader.pointFields.timeScaledInteger > 0. )
861 double scale = data3DHeader.pointFields.timeScaledInteger;
862 int64_t rawIntegerMinimum =
863 (int64_t)
floor( ( data3DHeader.pointFields.timeMinimum -
offset ) / scale + .5 );
864 int64_t rawIntegerMaximum =
865 (int64_t)
floor( ( data3DHeader.pointFields.timeMaximum -
offset ) / scale + .5 );
870 if ( data3DHeader.pointFields.timeMaximum == E57_FLOAT_MAX )
874 else if ( data3DHeader.pointFields.timeMaximum == E57_DOUBLE_MAX )
876 proto.set(
"timeStamp",
FloatNode( imf_, 0.,
E57_DOUBLE, E57_DOUBLE_MIN, E57_DOUBLE_MAX ) );
881 proto.set(
"timeStamp",
IntegerNode( imf_, 0, (int64_t)data3DHeader.pointFields.timeMinimum,
882 (int64_t)data3DHeader.pointFields.timeMaximum ) );
886 if ( data3DHeader.pointFields.cartesianInvalidStateField )
888 proto.set(
"cartesianInvalidState",
IntegerNode( imf_, 0, 0, 2 ) );
890 if ( data3DHeader.pointFields.sphericalInvalidStateField )
892 proto.set(
"sphericalInvalidState",
IntegerNode( imf_, 0, 0, 2 ) );
894 if ( data3DHeader.pointFields.isIntensityInvalidField )
896 proto.set(
"isIntensityInvalid",
IntegerNode( imf_, 0, 0, 1 ) );
898 if ( data3DHeader.pointFields.isColorInvalidField )
900 proto.set(
"isColorInvalid",
IntegerNode( imf_, 0, 0, 1 ) );
902 if ( data3DHeader.pointFields.isTimeStampInvalidField )
904 proto.set(
"isTimeStampInvalid",
IntegerNode( imf_, 0, 0, 1 ) );
908 if ( data3DHeader.pointFields.normalX || data3DHeader.pointFields.normalY || data3DHeader.pointFields.normalZ )
912 if ( !imf_.extensionsLookupPrefix(
"nor", norExtUri ) )
914 imf_.extensionsAdd(
"nor",
"http://www.libe57.org/E57_NOR_surface_normals.txt" );
919 if ( data3DHeader.pointFields.normalX )
923 if ( data3DHeader.pointFields.normalY )
927 if ( data3DHeader.pointFields.normalZ )
940 scan.set(
"points",
points );
944 template <
typename COORDTYPE>
952 std::vector<SourceDestBuffer> sourceBuffers;
955 sourceBuffers.emplace_back( imf_,
"cartesianX", buffers.
cartesianX,
count,
true,
true );
959 sourceBuffers.emplace_back( imf_,
"cartesianY", buffers.
cartesianY,
count,
true,
true );
963 sourceBuffers.emplace_back( imf_,
"cartesianZ", buffers.
cartesianZ,
count,
true,
true );
968 sourceBuffers.emplace_back( imf_,
"sphericalRange", buffers.
sphericalRange,
count,
true,
true );
981 sourceBuffers.emplace_back( imf_,
"intensity", buffers.
intensity,
count,
true,
true );
986 sourceBuffers.emplace_back( imf_,
"colorRed", buffers.
colorRed,
count,
true );
990 sourceBuffers.emplace_back( imf_,
"colorGreen", buffers.
colorGreen,
count,
true );
994 sourceBuffers.emplace_back( imf_,
"colorBlue", buffers.
colorBlue,
count,
true );
999 sourceBuffers.emplace_back( imf_,
"returnIndex", buffers.
returnIndex,
count,
true );
1003 sourceBuffers.emplace_back( imf_,
"returnCount", buffers.
returnCount,
count,
true );
1008 sourceBuffers.emplace_back( imf_,
"rowIndex", buffers.
rowIndex,
count,
true );
1012 sourceBuffers.emplace_back( imf_,
"columnIndex", buffers.
columnIndex,
count,
true );
1017 sourceBuffers.emplace_back( imf_,
"timeStamp", buffers.
timeStamp,
count,
true,
true );
1034 sourceBuffers.emplace_back( imf_,
"isColorInvalid", buffers.
isColorInvalid,
count,
true );
1043 if ( imf_.extensionsLookupPrefix(
"nor", norExtUri ) )
1047 sourceBuffers.emplace_back( imf_,
"nor:normalX", buffers.
normalX,
count,
true,
true );
1051 sourceBuffers.emplace_back( imf_,
"nor:normalY", buffers.
normalY,
count,
true,
true );
1055 sourceBuffers.emplace_back( imf_,
"nor:normalZ", buffers.
normalZ,
count,
true,
true );
1073 bool WriterImpl::WriteData3DGroupsData( int64_t dataIndex, int64_t groupCount, int64_t *idElementValue,
1074 int64_t *startPointIndex, int64_t *pointCount )
1076 if ( ( dataIndex < 0 ) || ( dataIndex >= data3D_.childCount() ) )
1083 if ( !scan.
isDefined(
"pointGroupingSchemes" ) )
1089 if ( !pointGroupingSchemes.
isDefined(
"groupingByLine" ) )
1093 StructureNode groupingByLine( pointGroupingSchemes.
get(
"groupingByLine" ) );
1095 if ( !groupingByLine.
isDefined(
"groups" ) )
1101 std::vector<SourceDestBuffer> groupSDBuffers;
1102 groupSDBuffers.emplace_back( imf_,
"idElementValue", idElementValue, groupCount,
true );
1103 groupSDBuffers.emplace_back( imf_,
"startPointIndex", startPointIndex, groupCount,
true );
1104 groupSDBuffers.emplace_back( imf_,
"pointCount", pointCount, groupCount,
true );
1107 writer.
write( groupCount );
std::shared_ptr< core::Tensor > image
An E57 element encoding an fixed-length sequence of bytes with an opaque format.
An E57 element containing ordered vector of child nodes, stored in an efficient binary format.
An E57 element encoding a single or double precision IEEE floating point number.
An E57 element encoding an integer value.
Generic handle to any of the 8 types of E57 element objects.
An E57 element encoding a fixed point number.
An E57 element encoding a Unicode character string value.
An E57 element containing named child nodes.
An E57 element containing ordered vector of child nodes.
CompressedVectorWriter writer(std::vector< SourceDestBuffer > &sbufs)
Create an iterator object for writing a series of blocks of data to a CompressedVectorNode.
void write(const size_t recordCount)
Request transfer of blocks of data to CompressedVectorNode from previously designated source buffers.
void close()
End the write operation.
bool isOpen() const
Test whether ImageFile is still open for accessing.
void extensionsAdd(const ustring &prefix, const ustring &uri)
Declare the use of an E57 extension in an ImageFile being written.
void close()
Complete any write operations on an ImageFile, and close the file on the disk.
bool isDefined(const ustring &pathName) const
Is the given pathName defined relative to this node.
void set(const ustring &pathName, const Node &n)
Add a new child at a given path.
Node get(int64_t index) const
Get a child element by positional index.
Node get(int64_t index) const
Get a child element by positional index.
void append(const Node &n)
Append a child element to end of VectorNode.
int64_t childCount() const
Get number of child elements in this VectorNode.
int64_t NewData3D(Data3D &data3DHeader)
VectorNode GetRawData3D()
int64_t NewImage2D(Image2D &image2DHeader)
int64_t WriteImage2DData(int64_t imageIndex, Image2DType imageType, Image2DProjection imageProjection, void *pBuffer, int64_t start, int64_t count)
VectorNode GetRawImages2D()
WriterImpl(const ustring &filePath, const ustring &coordinateMetaData)
StructureNode GetRawE57Root()
MiniVec< float, N > floor(const MiniVec< float, N > &a)
E57_DLL void getVersions(int &astmMajor, int &astmMinor, std::string &libraryId)
Get the version of ASTM E57 standard that the API implementation supports, and library id string.
constexpr char E57_V1_0_URI[]
Verify all checksums. This is the default. (slow)
@ E57_SINGLE
32 bit IEEE floating point number format
@ E57_DOUBLE
64 bit IEEE floating point number format
Image2DProjection
Identifies the representation for the image data.
@ E57_SPHERICAL
SphericalRepresentation for the image data.
@ E57_CYLINDRICAL
CylindricalRepresentation for the image data.
@ E57_NO_PROJECTION
No representation for the image data is present.
@ E57_VISUAL
VisualReferenceRepresentation for the image data.
@ E57_PINHOLE
PinholeRepresentation for the image data.
Image2DType
Identifies the format representation for the image data.
@ E57_JPEG_IMAGE
JPEG format image data.
@ E57_PNG_IMAGE
PNG format image data.
@ E57_NO_IMAGE
No image data.
@ E57_PNG_IMAGE_MASK
PNG format image mask.
constexpr double E57_NOT_SCALED_USE_FLOAT
Indicates to use FloatNode instead of ScaledIntegerNode in fields that can use both.
std::string ustring
UTF-8 encodeded Unicode string.
std::string generateRandomGUID()
generates a new random GUID
double pixelHeight
The height of a pixel in the image (in meters). Shall be positive.
int32_t imageWidth
The image width (in pixels). Shall be positive.
int32_t imageHeight
The image height (in pixels). Shall be positive.
double pixelWidth
The width of a pixel in the image (in radians). Shall be positive.
int64_t jpegImageSize
Size of JPEG format image data in Blob.
int64_t pngImageSize
Size of PNG format image data in Blob.
int64_t imageMaskSize
Size of PNG format image mask in Blob.
Stores pointers to user-provided buffers.
float * normalZ
The Z component of a surface normal vector (E57_EXT_surface_normals).
COORDTYPE * cartesianX
pointer to a buffer with the X coordinate (in meters) of the point in Cartesian coordinates
float * normalX
The X component of a surface normal vector (E57_EXT_surface_normals).
int8_t * isColorInvalid
Value = 0 if the color is considered valid, 1 otherwise.
int8_t * cartesianInvalidState
Value = 0 if the point is considered valid, 1 otherwise.
float * normalY
The Y component of a surface normal vector (E57_EXT_surface_normals).
COORDTYPE * sphericalAzimuth
pointer to a buffer with the Azimuth angle (in radians) of point in spherical coordinates
COORDTYPE * sphericalElevation
pointer to a buffer with the Elevation angle (in radians) of point in spherical coordinates
COORDTYPE * cartesianY
pointer to a buffer with the Y coordinate (in meters) of the point in Cartesian coordinates
int8_t * sphericalInvalidState
Value = 0 if the range is considered valid, 1 otherwise.
uint8_t * colorRed
pointer to a buffer with the Red color coefficient. Unit is unspecified
float * intensity
pointer to a buffer with the Point response intensity. Unit is unspecified
int8_t * isIntensityInvalid
Value = 0 if the intensity is considered valid, 1 otherwise.
COORDTYPE * sphericalRange
pointer to a buffer with the range (in meters) of points in spherical coordinates....
int8_t * isTimeStampInvalid
Value = 0 if the timeStamp is considered valid, 1 otherwise.
COORDTYPE * cartesianZ
pointer to a buffer with the Z coordinate (in meters) of the point in Cartesian coordinates
uint8_t * colorGreen
pointer to a buffer with the Green color coefficient. Unit is unspecified
uint8_t * colorBlue
pointer to a buffer with the Blue color coefficient. Unit is unspecified
Stores the top-level information for a single lidar scan.
ustring guid
A globally unique identification string for the current version of the Data3D object.
ustring sensorHardwareVersion
The version number for the sensor hardware at the time of data collection.
ustring sensorFirmwareVersion
std::vector< ustring > originalGuids
ustring name
A user-defined name for the Data3D.
IndexBounds indexBounds
The bounds of the row, column, and return number of all the points in this Data3D.
ustring sensorSerialNumber
The serial number for the sensor.
ustring description
A user-defined description of the Image.
ustring sensorModel
The model name or number for the sensor.
float atmosphericPressure
ustring sensorVendor
The name of the manufacturer for the sensor used to collect the points in this Data3D.
ustring sensorSoftwareVersion
The version number for the software used for the data collection.
int32_t isAtomicClockReferenced
double dateTimeValue
The time, in seconds, since GPS time was zero. This time specification may include fractions of a sec...
Stores an image from a camera.
ustring sensorVendor
The name of the manufacturer for the sensor used to collect the points in this Data3D.
ustring guid
A globally unique identification string for the current version of the Image2D object.
ustring description
A user-defined description of the Image2D.
ustring name
A user-defined name for the Image2D.
PinholeRepresentation pinholeRepresentation
Representation for an image using the pinhole camera projection model.
ustring sensorModel
The model name or number for the sensor.
SphericalRepresentation sphericalRepresentation
Representation for an image using the spherical camera projection model.
ustring associatedData3DGuid
ustring sensorSerialNumber
The serial number for the sensor.
CylindricalRepresentation cylindricalRepresentation
Representation for an image using the cylindrical camera projection model.
DateTime acquisitionDateTime
The date and time that the image was taken.
VisualReferenceRepresentation visualReferenceRepresentation
Stores the minimum and maximum of rowIndex, columnIndex, and returnIndex fields for a set of points.
double principalPointY
The Y coordinate in the image of the principal point (in pixels).
int64_t imageMaskSize
Size of PNG format image mask in BlobNode.
int32_t imageHeight
The image height (in pixels). Shall be positive.
double focalLength
The camera's focal length (in meters). Shall be positive.
int64_t jpegImageSize
Size of JPEG format image data in BlobNode.
double pixelWidth
The width of the pixels in the camera (in meters). Shall be positive.
double pixelHeight
The height of the pixels in the camera (in meters). Shall be positive.
int32_t imageWidth
The image width (in pixels). Shall be positive.
int64_t pngImageSize
Size of PNG format image data in BlobNode.
double z
The k coefficient of the quaternion.
double y
The j coefficient of the quaternion.
double x
The i coefficient of the quaternion.
double w
The real part of the quaternion. Shall be nonnegative.
Defines a rigid body transform in cartesian coordinates.
Translation translation
The translation point vector, t, of the transform.
Quaternion rotation
A unit quaternion representing the rotation, R, of the transform.
int32_t imageHeight
The image height (in pixels). Shall be positive.
int64_t imageMaskSize
Size of PNG format image mask in BlobNode.
double pixelHeight
The height of a pixel in the image (in radians). Shall be positive.
int64_t jpegImageSize
Size of JPEG format image data in BlobNode.
double pixelWidth
The width of a pixel in the image (in radians). Shall be positive.
int32_t imageWidth
The image width (in pixels). Shall be positive.
int64_t pngImageSize
Size of PNG format image data in BlobNode.
double y
The Y coordinate of the translation (in meters)
double x
The X coordinate of the translation (in meters)
double z
The Z coordinate of the translation (in meters)
int32_t imageHeight
The image height (in pixels). Shall be positive.
int64_t imageMaskSize
Size of PNG format image mask in BlobNode.
int32_t imageWidth
The image width (in pixels). Shall be positive.
int64_t jpegImageSize
Size of JPEG format image data in BlobNode.
int64_t pngImageSize
Size of PNG format image data in BlobNode.