| 324 | } |
| 325 | |
| 326 | bool LASzip::setup(const U8 point_type, const U16 point_size, const U16 compressor) |
| 327 | { |
| 328 | if (!check_compressor(compressor)) return false; |
| 329 | this->num_items = 0; |
| 330 | if (this->items) delete [] this->items; |
| 331 | this->items = 0; |
| 332 | if (!setup(&num_items, &items, point_type, point_size, compressor)) return false; |
| 333 | if (compressor) |
| 334 | { |
| 335 | if (items[0].type == LASitem::POINT14) |
| 336 | { |
| 337 | if (compressor != LASZIP_COMPRESSOR_LAYERED_CHUNKED) |
| 338 | { |
| 339 | return false; |
| 340 | } |
| 341 | this->compressor = LASZIP_COMPRESSOR_LAYERED_CHUNKED; |
| 342 | } |
| 343 | else |
| 344 | { |
| 345 | if (compressor == LASZIP_COMPRESSOR_LAYERED_CHUNKED) |
| 346 | { |
| 347 | this->compressor = LASZIP_COMPRESSOR_CHUNKED; |
| 348 | } |
| 349 | else |
| 350 | { |
| 351 | this->compressor = compressor; |
| 352 | } |
| 353 | } |
| 354 | if (compressor != LASZIP_COMPRESSOR_POINTWISE) |
| 355 | { |
| 356 | if (chunk_size == 0) chunk_size = LASZIP_CHUNK_SIZE_DEFAULT; |
| 357 | } |
| 358 | } |
| 359 | else |
| 360 | { |
| 361 | this->compressor = LASZIP_COMPRESSOR_NONE; |
| 362 | } |
| 363 | return true; |
| 364 | } |
| 365 | |
| 366 | bool LASzip::setup(const U16 num_items, const LASitem* items, const U16 compressor) |
| 367 | { |
no test coverage detected