| 204 | } |
| 205 | |
| 206 | std::optional<ColorChannels> getColorChannels( const char* buf, int format ) |
| 207 | { |
| 208 | // TODO: fix endianness |
| 209 | switch ( format ) |
| 210 | { |
| 211 | case 0: |
| 212 | case 1: |
| 213 | case 4: |
| 214 | case 6: |
| 215 | case 9: |
| 216 | return std::nullopt; |
| 217 | case 2: |
| 218 | return *reinterpret_cast<const LasPoint2*>( buf ); |
| 219 | case 3: |
| 220 | case 5: |
| 221 | return *reinterpret_cast<const LasPoint3*>( buf ); |
| 222 | case 7: |
| 223 | case 8: |
| 224 | case 10: |
| 225 | return *reinterpret_cast<const LasPoint7*>( buf ); |
| 226 | default: |
| 227 | return std::nullopt; |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | using namespace MR; |
| 232 |