| 38 | #include "laswritepoint.hpp" |
| 39 | |
| 40 | bool LASzipper::open(FILE* outfile, const LASzip* laszip) |
| 41 | { |
| 42 | if (!outfile) return return_error("FILE* outfile pointer is NULL"); |
| 43 | if (!laszip) return return_error("const LASzip* laszip pointer is NULL"); |
| 44 | count = 0; |
| 45 | if (writer) delete writer; |
| 46 | writer = new LASwritePoint(); |
| 47 | if (!writer) return return_error("alloc of LASwritePoint failed"); |
| 48 | if (!writer->setup(laszip->num_items, laszip->items, laszip)) return return_error("setup() of LASwritePoint failed"); |
| 49 | if (stream) delete stream; |
| 50 | if (IS_LITTLE_ENDIAN()) |
| 51 | stream = new ByteStreamOutFileLE(outfile); |
| 52 | else |
| 53 | stream = new ByteStreamOutFileBE(outfile); |
| 54 | if (!stream) return return_error("alloc of ByteStreamOutFile failed"); |
| 55 | if (!writer->init(stream)) return return_error("init() of LASwritePoint failed"); |
| 56 | return true; |
| 57 | } |
| 58 | |
| 59 | bool LASzipper::open(ostream& outstream, const LASzip* laszip) |
| 60 | { |