-
-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple Reader/Writer PointRecord Representation Issues #157
Comments
Hi, The old las2e57 tool writes E57 files that contain 16-bit color data. Currently E57SimpleReader throws an error, if a color element value is greater than 255:
To fix these, I would like to suggest a new type definition for color data elements in E57SimpleData.h, something like:
Substituting uint16_t for uint8_t would require application code changes. Regards, |
@ollira I'm not opposed to this change, though I'll have to look at it a bit more carefully. I will create a new issue to track it and receive other input.
Version 3 is the time to do it! 😄 Do you have a small (<10k) example you can send me to contribute to the testing data (under CC0 public domain license)? |
Here is a small test file, down-sampled and converted ColouredCubeFloat.e57 : |
Excellent - thank you. |
After digging around the Simple API read/write code, here are some findings about type selection of various nodes.
The standard has the following info about node types for various PointRecord fields (abbreviated table 14):
uint16_t
, but can only write using Integer.✅ = supported by Simple API
❌ = not supported by Simple API
n/a = not supported by standard
There are 4 fields in Simple API's
PointStandardizedFieldsAvailable
for setting information about how to write this data. These are:pointRangeScaledInteger
applies to cartesianX, cartesianY, cartesianZ, & sphericalRange, and allowsFloatNode/ScaledIntegerNode
angleScaledInteger
applies to sphericalAzimuth & sphericalElevation, and allowsFloatNode/ScaledIntegerNode
timeScaledInteger
applies to timeStamp and allowsFloatNode/ScaledIntegerNode/IntegerNode
intensityScaledInteger
applies to intensity and allowsFloatNode/ScaledIntegerNode/IntegerNode
Setting
pointRangeScaledInteger
orangleScaledInteger
to:E57_NOT_SCALED_USE_FLOAT
)timeScaledInteger
handles node type selection differently since it allows IntegerNode. So:intensity
handles node type selection differently still (no option to write doubles):There are several issues with the current code:
(Fixed by #178)intensity
doesn't allow writing FloatNode w/doubles which is allowed by the standard.intensityMaximum
andintensityMinimum
(which are derived fromintensity
) to be different types (table 13), but the Simple API does not. Presumably the types are the same, but it's only recommended, not required by the standard.uint8_t
uint16_t
(#167).All colours are stored as uint8_t, so files using uint16_t will fail to load.(Fixed by #167)intensityLimits
doesn't give us enough information to setintensityScaledInteger
properly since the scale can be different betweenintensityMaximum
andintensityMinimum
(it's written using the same scale in the Simple API, but that's not a requirement by the standard).(Related to #126.)
Edit: Expanded table to show what Simple API supports.
The text was updated successfully, but these errors were encountered: