dracox 0.0.1__cp39-cp39-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bin/draco_decoder.exe +0 -0
- bin/draco_encoder.exe +0 -0
- dracox/__init__.py +252 -0
- dracox/dracox_ext.cp39-win_amd64.pyd +0 -0
- dracox-0.0.1.dist-info/METADATA +14 -0
- dracox-0.0.1.dist-info/RECORD +214 -0
- dracox-0.0.1.dist-info/WHEEL +5 -0
- include/draco/animation/keyframe_animation.h +107 -0
- include/draco/animation/keyframe_animation_decoder.h +34 -0
- include/draco/animation/keyframe_animation_encoder.h +39 -0
- include/draco/attributes/attribute_octahedron_transform.h +81 -0
- include/draco/attributes/attribute_quantization_transform.h +102 -0
- include/draco/attributes/attribute_transform.h +76 -0
- include/draco/attributes/attribute_transform_data.h +71 -0
- include/draco/attributes/attribute_transform_type.h +30 -0
- include/draco/attributes/geometry_attribute.h +541 -0
- include/draco/attributes/geometry_indices.h +54 -0
- include/draco/attributes/point_attribute.h +196 -0
- include/draco/compression/attributes/attributes_decoder.h +97 -0
- include/draco/compression/attributes/attributes_decoder_interface.h +62 -0
- include/draco/compression/attributes/attributes_encoder.h +154 -0
- include/draco/compression/attributes/kd_tree_attributes_decoder.h +50 -0
- include/draco/compression/attributes/kd_tree_attributes_encoder.h +51 -0
- include/draco/compression/attributes/kd_tree_attributes_shared.h +28 -0
- include/draco/compression/attributes/linear_sequencer.h +51 -0
- include/draco/compression/attributes/mesh_attribute_indices_encoding_data.h +58 -0
- include/draco/compression/attributes/normal_compression_utils.h +372 -0
- include/draco/compression/attributes/point_d_vector.h +288 -0
- include/draco/compression/attributes/points_sequencer.h +63 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_constrained_multi_parallelogram_decoder.h +236 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_constrained_multi_parallelogram_encoder.h +413 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_constrained_multi_parallelogram_shared.h +34 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_data.h +72 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_decoder.h +46 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_encoder.h +46 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_geometric_normal_decoder.h +176 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_geometric_normal_encoder.h +180 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_geometric_normal_predictor_area.h +117 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_geometric_normal_predictor_base.h +96 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_multi_parallelogram_decoder.h +128 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_multi_parallelogram_encoder.h +133 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_parallelogram_encoder.h +111 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_parallelogram_shared.h +78 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_decoder.h +372 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_encoder.h +318 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_portable_decoder.h +143 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_portable_encoder.h +136 -0
- include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_portable_predictor.h +282 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_decoder.h +90 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_decoder_factory.h +194 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_decoder_interface.h +53 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_decoding_transform.h +65 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_delta_decoder.h +65 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_delta_encoder.h +69 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_encoder.h +90 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_encoder_factory.h +134 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_encoder_interface.h +55 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_encoding_transform.h +77 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_factory.h +85 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_interface.h +60 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_decoding_transform.h +118 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_encoding_transform.h +116 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_transform_base.h +102 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_decoding_transform.h +115 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_encoding_transform.h +105 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_transform_base.h +90 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_wrap_decoding_transform.h +88 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_wrap_encoding_transform.h +81 -0
- include/draco/compression/attributes/prediction_schemes/prediction_scheme_wrap_transform_base.h +120 -0
- include/draco/compression/attributes/sequential_attribute_decoder.h +86 -0
- include/draco/compression/attributes/sequential_attribute_decoders_controller.h +61 -0
- include/draco/compression/attributes/sequential_attribute_encoder.h +134 -0
- include/draco/compression/attributes/sequential_attribute_encoders_controller.h +115 -0
- include/draco/compression/attributes/sequential_integer_attribute_decoder.h +76 -0
- include/draco/compression/attributes/sequential_integer_attribute_encoder.h +67 -0
- include/draco/compression/attributes/sequential_normal_attribute_decoder.h +83 -0
- include/draco/compression/attributes/sequential_normal_attribute_encoder.h +82 -0
- include/draco/compression/attributes/sequential_quantization_attribute_decoder.h +52 -0
- include/draco/compression/attributes/sequential_quantization_attribute_encoder.h +52 -0
- include/draco/compression/bit_coders/adaptive_rans_bit_coding_shared.h +43 -0
- include/draco/compression/bit_coders/adaptive_rans_bit_decoder.h +54 -0
- include/draco/compression/bit_coders/adaptive_rans_bit_encoder.h +61 -0
- include/draco/compression/bit_coders/direct_bit_decoder.h +89 -0
- include/draco/compression/bit_coders/direct_bit_encoder.h +89 -0
- include/draco/compression/bit_coders/folded_integer_bit_decoder.h +77 -0
- include/draco/compression/bit_coders/folded_integer_bit_encoder.h +82 -0
- include/draco/compression/bit_coders/rans_bit_decoder.h +55 -0
- include/draco/compression/bit_coders/rans_bit_encoder.h +57 -0
- include/draco/compression/bit_coders/symbol_bit_decoder.h +36 -0
- include/draco/compression/bit_coders/symbol_bit_encoder.h +36 -0
- include/draco/compression/config/compression_shared.h +155 -0
- include/draco/compression/config/decoder_options.h +34 -0
- include/draco/compression/config/draco_options.h +249 -0
- include/draco/compression/config/encoder_options.h +101 -0
- include/draco/compression/config/encoding_features.h +39 -0
- include/draco/compression/decode.h +80 -0
- include/draco/compression/draco_compression_options.h +141 -0
- include/draco/compression/encode.h +139 -0
- include/draco/compression/encode_base.h +131 -0
- include/draco/compression/entropy/ans.h +526 -0
- include/draco/compression/entropy/rans_symbol_coding.h +53 -0
- include/draco/compression/entropy/rans_symbol_decoder.h +171 -0
- include/draco/compression/entropy/rans_symbol_encoder.h +290 -0
- include/draco/compression/entropy/shannon_entropy.h +110 -0
- include/draco/compression/entropy/symbol_decoding.h +29 -0
- include/draco/compression/entropy/symbol_encoding.h +47 -0
- include/draco/compression/expert_encode.h +160 -0
- include/draco/compression/mesh/mesh_decoder.h +68 -0
- include/draco/compression/mesh/mesh_edgebreaker_decoder.h +54 -0
- include/draco/compression/mesh/mesh_edgebreaker_decoder_impl.h +228 -0
- include/draco/compression/mesh/mesh_edgebreaker_decoder_impl_interface.h +47 -0
- include/draco/compression/mesh/mesh_edgebreaker_encoder.h +73 -0
- include/draco/compression/mesh/mesh_edgebreaker_encoder_impl.h +209 -0
- include/draco/compression/mesh/mesh_edgebreaker_encoder_impl_interface.h +57 -0
- include/draco/compression/mesh/mesh_edgebreaker_shared.h +129 -0
- include/draco/compression/mesh/mesh_edgebreaker_traversal_decoder.h +201 -0
- include/draco/compression/mesh/mesh_edgebreaker_traversal_encoder.h +139 -0
- include/draco/compression/mesh/mesh_edgebreaker_traversal_predictive_decoder.h +134 -0
- include/draco/compression/mesh/mesh_edgebreaker_traversal_predictive_encoder.h +172 -0
- include/draco/compression/mesh/mesh_edgebreaker_traversal_valence_decoder.h +219 -0
- include/draco/compression/mesh/mesh_edgebreaker_traversal_valence_encoder.h +226 -0
- include/draco/compression/mesh/mesh_encoder.h +84 -0
- include/draco/compression/mesh/mesh_sequential_decoder.h +39 -0
- include/draco/compression/mesh/mesh_sequential_encoder.h +56 -0
- include/draco/compression/mesh/traverser/depth_first_traverser.h +172 -0
- include/draco/compression/mesh/traverser/max_prediction_degree_traverser.h +226 -0
- include/draco/compression/mesh/traverser/mesh_attribute_indices_encoding_observer.h +76 -0
- include/draco/compression/mesh/traverser/mesh_traversal_sequencer.h +113 -0
- include/draco/compression/mesh/traverser/traverser_base.h +87 -0
- include/draco/compression/point_cloud/algorithms/dynamic_integer_points_kd_tree_decoder.h +369 -0
- include/draco/compression/point_cloud/algorithms/dynamic_integer_points_kd_tree_encoder.h +372 -0
- include/draco/compression/point_cloud/algorithms/float_points_tree_decoder.h +141 -0
- include/draco/compression/point_cloud/algorithms/float_points_tree_encoder.h +126 -0
- include/draco/compression/point_cloud/algorithms/point_cloud_compression_method.h +34 -0
- include/draco/compression/point_cloud/algorithms/point_cloud_types.h +76 -0
- include/draco/compression/point_cloud/algorithms/quantize_points_3.h +84 -0
- include/draco/compression/point_cloud/algorithms/queuing_policy.h +75 -0
- include/draco/compression/point_cloud/point_cloud_decoder.h +118 -0
- include/draco/compression/point_cloud/point_cloud_encoder.h +158 -0
- include/draco/compression/point_cloud/point_cloud_kd_tree_decoder.h +31 -0
- include/draco/compression/point_cloud/point_cloud_kd_tree_encoder.h +45 -0
- include/draco/compression/point_cloud/point_cloud_sequential_decoder.h +33 -0
- include/draco/compression/point_cloud/point_cloud_sequential_encoder.h +43 -0
- include/draco/core/bit_utils.h +127 -0
- include/draco/core/bounding_box.h +77 -0
- include/draco/core/constants.h +6 -0
- include/draco/core/cycle_timer.h +51 -0
- include/draco/core/data_buffer.h +82 -0
- include/draco/core/decoder_buffer.h +216 -0
- include/draco/core/divide.h +42 -0
- include/draco/core/draco_index_type.h +184 -0
- include/draco/core/draco_index_type_vector.h +90 -0
- include/draco/core/draco_types.h +52 -0
- include/draco/core/draco_version.h +25 -0
- include/draco/core/encoder_buffer.h +152 -0
- include/draco/core/hash_utils.h +64 -0
- include/draco/core/macros.h +124 -0
- include/draco/core/math_utils.h +79 -0
- include/draco/core/options.h +151 -0
- include/draco/core/quantization_utils.h +82 -0
- include/draco/core/status.h +83 -0
- include/draco/core/status_or.h +81 -0
- include/draco/core/varint_decoding.h +81 -0
- include/draco/core/varint_encoding.h +61 -0
- include/draco/core/vector_d.h +355 -0
- include/draco/draco_features.h +25 -0
- include/draco/io/file_reader_factory.h +34 -0
- include/draco/io/file_reader_interface.h +32 -0
- include/draco/io/file_utils.h +86 -0
- include/draco/io/file_writer_factory.h +34 -0
- include/draco/io/file_writer_interface.h +26 -0
- include/draco/io/file_writer_utils.h +38 -0
- include/draco/io/mesh_io.h +107 -0
- include/draco/io/obj_decoder.h +147 -0
- include/draco/io/obj_encoder.h +107 -0
- include/draco/io/parser_utils.h +66 -0
- include/draco/io/ply_decoder.h +69 -0
- include/draco/io/ply_encoder.h +54 -0
- include/draco/io/ply_property_reader.h +96 -0
- include/draco/io/ply_property_writer.h +94 -0
- include/draco/io/ply_reader.h +155 -0
- include/draco/io/point_cloud_io.h +89 -0
- include/draco/io/stdio_file_reader.h +48 -0
- include/draco/io/stdio_file_writer.h +42 -0
- include/draco/io/stl_decoder.h +38 -0
- include/draco/io/stl_encoder.h +52 -0
- include/draco/mesh/corner_table.h +397 -0
- include/draco/mesh/corner_table_iterators.h +309 -0
- include/draco/mesh/mesh.h +378 -0
- include/draco/mesh/mesh_are_equivalent.h +71 -0
- include/draco/mesh/mesh_attribute_corner_table.h +202 -0
- include/draco/mesh/mesh_cleanup.h +61 -0
- include/draco/mesh/mesh_features.h +93 -0
- include/draco/mesh/mesh_indices.h +37 -0
- include/draco/mesh/mesh_misc_functions.h +105 -0
- include/draco/mesh/mesh_stripifier.h +258 -0
- include/draco/mesh/triangle_soup_mesh_builder.h +134 -0
- include/draco/mesh/valence_cache.h +142 -0
- include/draco/metadata/geometry_metadata.h +142 -0
- include/draco/metadata/metadata.h +209 -0
- include/draco/metadata/metadata_decoder.h +42 -0
- include/draco/metadata/metadata_encoder.h +41 -0
- include/draco/metadata/property_attribute.h +107 -0
- include/draco/metadata/property_table.h +222 -0
- include/draco/metadata/structural_metadata.h +78 -0
- include/draco/metadata/structural_metadata_schema.h +118 -0
- include/draco/point_cloud/point_cloud.h +289 -0
- include/draco/point_cloud/point_cloud_builder.h +101 -0
- lib/draco.lib +0 -0
- lib/pkgconfig/draco.pc +6 -0
- share/cmake/draco/draco-config-version.cmake +43 -0
- share/cmake/draco/draco-config.cmake +27 -0
- share/cmake/draco/draco-targets-release.cmake +19 -0
- share/cmake/draco/draco-targets.cmake +107 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Copyright 2016 The Draco Authors.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
//
|
|
15
|
+
#ifndef DRACO_COMPRESSION_POINT_CLOUD_ALGORITHMS_POINT_CLOUD_TYPES_H_
|
|
16
|
+
#define DRACO_COMPRESSION_POINT_CLOUD_ALGORITHMS_POINT_CLOUD_TYPES_H_
|
|
17
|
+
|
|
18
|
+
#include <inttypes.h>
|
|
19
|
+
|
|
20
|
+
#include <vector>
|
|
21
|
+
|
|
22
|
+
#include "draco/core/vector_d.h"
|
|
23
|
+
|
|
24
|
+
namespace draco {
|
|
25
|
+
|
|
26
|
+
// Using Eigen as this is favored by project Cartographer.
|
|
27
|
+
typedef Vector3f Point3f;
|
|
28
|
+
typedef Vector4f Point4f;
|
|
29
|
+
typedef Vector3ui Point3ui;
|
|
30
|
+
typedef Vector4ui Point4ui;
|
|
31
|
+
typedef Vector5ui Point5ui;
|
|
32
|
+
typedef Vector6ui Point6ui;
|
|
33
|
+
typedef Vector7ui Point7ui;
|
|
34
|
+
|
|
35
|
+
typedef std::vector<Point3f> PointCloud3f;
|
|
36
|
+
|
|
37
|
+
template <class PointDT>
|
|
38
|
+
struct PointDLess;
|
|
39
|
+
|
|
40
|
+
template <class CoeffT, int dimension_t>
|
|
41
|
+
struct PointDLess<VectorD<CoeffT, dimension_t>> {
|
|
42
|
+
bool operator()(const VectorD<CoeffT, dimension_t> &a,
|
|
43
|
+
const VectorD<CoeffT, dimension_t> &b) const {
|
|
44
|
+
return a < b;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
template <class PointDT>
|
|
49
|
+
class PointTraits {};
|
|
50
|
+
|
|
51
|
+
template <class CoordinateTypeT, int dimension_t>
|
|
52
|
+
class PointTraits<VectorD<CoordinateTypeT, dimension_t>> {
|
|
53
|
+
public:
|
|
54
|
+
typedef VectorD<CoordinateTypeT, dimension_t> PointD;
|
|
55
|
+
typedef CoordinateTypeT CoordinateType;
|
|
56
|
+
|
|
57
|
+
static constexpr uint32_t Dimension() { return dimension_t; }
|
|
58
|
+
static PointD Origin() {
|
|
59
|
+
PointD origin;
|
|
60
|
+
for (uint32_t i = 0; i < dimension_t; i++) {
|
|
61
|
+
origin(i) = 0;
|
|
62
|
+
}
|
|
63
|
+
return origin;
|
|
64
|
+
}
|
|
65
|
+
static std::array<uint32_t, dimension_t> ZeroArray() {
|
|
66
|
+
std::array<uint32_t, dimension_t> zero;
|
|
67
|
+
for (uint32_t i = 0; i < dimension_t; i++) {
|
|
68
|
+
zero[i] = 0;
|
|
69
|
+
}
|
|
70
|
+
return zero;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
} // namespace draco
|
|
75
|
+
|
|
76
|
+
#endif // DRACO_COMPRESSION_POINT_CLOUD_ALGORITHMS_POINT_CLOUD_TYPES_H_
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Copyright 2016 The Draco Authors.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
//
|
|
15
|
+
#ifndef DRACO_COMPRESSION_POINT_CLOUD_ALGORITHMS_QUANTIZE_POINTS_3_H_
|
|
16
|
+
#define DRACO_COMPRESSION_POINT_CLOUD_ALGORITHMS_QUANTIZE_POINTS_3_H_
|
|
17
|
+
|
|
18
|
+
#include <inttypes.h>
|
|
19
|
+
|
|
20
|
+
#include "draco/compression/point_cloud/algorithms/point_cloud_types.h"
|
|
21
|
+
#include "draco/core/quantization_utils.h"
|
|
22
|
+
|
|
23
|
+
namespace draco {
|
|
24
|
+
|
|
25
|
+
// TODO(b/199760123): Make this a stable bounding box.
|
|
26
|
+
struct QuantizationInfo {
|
|
27
|
+
uint32_t quantization_bits;
|
|
28
|
+
float range;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
template <class PointIterator, class OutputIterator>
|
|
32
|
+
OutputIterator QuantizePoints3(const PointIterator &begin,
|
|
33
|
+
const PointIterator &end, QuantizationInfo *info,
|
|
34
|
+
OutputIterator oit) {
|
|
35
|
+
DRACO_DCHECK_GE(info->quantization_bits, 0);
|
|
36
|
+
|
|
37
|
+
float max_range = 0;
|
|
38
|
+
for (auto it = begin; it != end; ++it) {
|
|
39
|
+
max_range = std::max(std::fabs((*it)[0]), max_range);
|
|
40
|
+
max_range = std::max(std::fabs((*it)[1]), max_range);
|
|
41
|
+
max_range = std::max(std::fabs((*it)[2]), max_range);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const uint32_t max_quantized_value((1u << info->quantization_bits) - 1);
|
|
45
|
+
Quantizer quantize;
|
|
46
|
+
quantize.Init(max_range, max_quantized_value);
|
|
47
|
+
info->range = max_range;
|
|
48
|
+
|
|
49
|
+
Point3ui qpoint;
|
|
50
|
+
for (auto it = begin; it != end; ++it) {
|
|
51
|
+
// Quantize and all positive.
|
|
52
|
+
qpoint[0] = quantize((*it)[0]) + max_quantized_value;
|
|
53
|
+
qpoint[1] = quantize((*it)[1]) + max_quantized_value;
|
|
54
|
+
qpoint[2] = quantize((*it)[2]) + max_quantized_value;
|
|
55
|
+
*oit++ = (qpoint);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return oit;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
template <class QPointIterator, class OutputIterator>
|
|
62
|
+
void DequantizePoints3(const QPointIterator &begin, const QPointIterator &end,
|
|
63
|
+
const QuantizationInfo &info, OutputIterator &oit) {
|
|
64
|
+
DRACO_DCHECK_GE(info.quantization_bits, 0);
|
|
65
|
+
DRACO_DCHECK_GE(info.range, 0);
|
|
66
|
+
|
|
67
|
+
const uint32_t quantization_bits = info.quantization_bits;
|
|
68
|
+
const float range = info.range;
|
|
69
|
+
const uint32_t max_quantized_value((1u << quantization_bits) - 1);
|
|
70
|
+
Dequantizer dequantize;
|
|
71
|
+
dequantize.Init(range, max_quantized_value);
|
|
72
|
+
|
|
73
|
+
for (auto it = begin; it != end; ++it) {
|
|
74
|
+
const float x = dequantize((*it)[0] - max_quantized_value);
|
|
75
|
+
const float y = dequantize((*it)[1] - max_quantized_value);
|
|
76
|
+
const float z = dequantize((*it)[2] - max_quantized_value);
|
|
77
|
+
*oit = Point3f(x, y, z);
|
|
78
|
+
++oit;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
} // namespace draco
|
|
83
|
+
|
|
84
|
+
#endif // DRACO_COMPRESSION_POINT_CLOUD_ALGORITHMS_QUANTIZE_POINTS_3_H_
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Copyright 2016 The Draco Authors.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
//
|
|
15
|
+
// File defining a coherent interface for different queuing strategies.
|
|
16
|
+
|
|
17
|
+
#ifndef DRACO_COMPRESSION_POINT_CLOUD_ALGORITHMS_QUEUING_POLICY_H_
|
|
18
|
+
#define DRACO_COMPRESSION_POINT_CLOUD_ALGORITHMS_QUEUING_POLICY_H_
|
|
19
|
+
|
|
20
|
+
#include <queue>
|
|
21
|
+
#include <stack>
|
|
22
|
+
#include <utility>
|
|
23
|
+
|
|
24
|
+
namespace draco {
|
|
25
|
+
|
|
26
|
+
template <class T>
|
|
27
|
+
class Queue {
|
|
28
|
+
public:
|
|
29
|
+
bool empty() const { return q_.empty(); }
|
|
30
|
+
typename std::queue<T>::size_type size() const { return q_.size(); }
|
|
31
|
+
void clear() { return q_.clear(); }
|
|
32
|
+
void push(const T &value) { q_.push(value); }
|
|
33
|
+
void push(T &&value) { q_.push(std::move(value)); }
|
|
34
|
+
void pop() { q_.pop(); }
|
|
35
|
+
typename std::queue<T>::const_reference front() const { return q_.front(); }
|
|
36
|
+
|
|
37
|
+
private:
|
|
38
|
+
std::queue<T> q_;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
template <class T>
|
|
42
|
+
class Stack {
|
|
43
|
+
public:
|
|
44
|
+
bool empty() const { return s_.empty(); }
|
|
45
|
+
typename std::stack<T>::size_type size() const { return s_.size(); }
|
|
46
|
+
void clear() { return s_.clear(); }
|
|
47
|
+
void push(const T &value) { s_.push(value); }
|
|
48
|
+
void push(T &&value) { s_.push(std::move(value)); }
|
|
49
|
+
void pop() { s_.pop(); }
|
|
50
|
+
typename std::stack<T>::const_reference front() const { return s_.top(); }
|
|
51
|
+
|
|
52
|
+
private:
|
|
53
|
+
std::stack<T> s_;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
template <class T, class Compare = std::less<T> >
|
|
57
|
+
class PriorityQueue {
|
|
58
|
+
typedef std::priority_queue<T, std::vector<T>, Compare> QType;
|
|
59
|
+
|
|
60
|
+
public:
|
|
61
|
+
bool empty() const { return s_.empty(); }
|
|
62
|
+
typename QType::size_type size() const { return s_.size(); }
|
|
63
|
+
void clear() { return s_.clear(); }
|
|
64
|
+
void push(const T &value) { s_.push(value); }
|
|
65
|
+
void push(T &&value) { s_.push(std::move(value)); }
|
|
66
|
+
void pop() { s_.pop(); }
|
|
67
|
+
typename QType::const_reference front() const { return s_.top(); }
|
|
68
|
+
|
|
69
|
+
private:
|
|
70
|
+
QType s_;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
} // namespace draco
|
|
74
|
+
|
|
75
|
+
#endif // DRACO_COMPRESSION_POINT_CLOUD_ALGORITHMS_QUEUING_POLICY_H_
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// Copyright 2016 The Draco Authors.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
//
|
|
15
|
+
#ifndef DRACO_COMPRESSION_POINT_CLOUD_POINT_CLOUD_DECODER_H_
|
|
16
|
+
#define DRACO_COMPRESSION_POINT_CLOUD_POINT_CLOUD_DECODER_H_
|
|
17
|
+
|
|
18
|
+
#include "draco/compression/attributes/attributes_decoder_interface.h"
|
|
19
|
+
#include "draco/compression/config/compression_shared.h"
|
|
20
|
+
#include "draco/compression/config/decoder_options.h"
|
|
21
|
+
#include "draco/core/status.h"
|
|
22
|
+
#include "draco/point_cloud/point_cloud.h"
|
|
23
|
+
|
|
24
|
+
namespace draco {
|
|
25
|
+
|
|
26
|
+
// Abstract base class for all point cloud and mesh decoders. It provides a
|
|
27
|
+
// basic functionality that is shared between different decoders.
|
|
28
|
+
class PointCloudDecoder {
|
|
29
|
+
public:
|
|
30
|
+
PointCloudDecoder();
|
|
31
|
+
virtual ~PointCloudDecoder() = default;
|
|
32
|
+
|
|
33
|
+
virtual EncodedGeometryType GetGeometryType() const { return POINT_CLOUD; }
|
|
34
|
+
|
|
35
|
+
// Decodes a Draco header int other provided |out_header|.
|
|
36
|
+
// Returns false on error.
|
|
37
|
+
static Status DecodeHeader(DecoderBuffer *buffer, DracoHeader *out_header);
|
|
38
|
+
|
|
39
|
+
// The main entry point for point cloud decoding.
|
|
40
|
+
Status Decode(const DecoderOptions &options, DecoderBuffer *in_buffer,
|
|
41
|
+
PointCloud *out_point_cloud);
|
|
42
|
+
|
|
43
|
+
bool SetAttributesDecoder(
|
|
44
|
+
int att_decoder_id, std::unique_ptr<AttributesDecoderInterface> decoder) {
|
|
45
|
+
if (att_decoder_id < 0) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
if (att_decoder_id >= static_cast<int>(attributes_decoders_.size())) {
|
|
49
|
+
attributes_decoders_.resize(att_decoder_id + 1);
|
|
50
|
+
}
|
|
51
|
+
attributes_decoders_[att_decoder_id] = std::move(decoder);
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Returns an attribute containing decoded data in their portable form that
|
|
56
|
+
// is guaranteed to be the same for both encoder and decoder. I.e., it returns
|
|
57
|
+
// an attribute before it was transformed back into its final form which may
|
|
58
|
+
// be slightly different (non-portable) across platforms. For example, for
|
|
59
|
+
// attributes encoded with quantization, this method returns an attribute
|
|
60
|
+
// that contains the quantized values (before the dequantization step).
|
|
61
|
+
const PointAttribute *GetPortableAttribute(int32_t point_attribute_id);
|
|
62
|
+
|
|
63
|
+
uint16_t bitstream_version() const {
|
|
64
|
+
return DRACO_BITSTREAM_VERSION(version_major_, version_minor_);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const AttributesDecoderInterface *attributes_decoder(int dec_id) {
|
|
68
|
+
return attributes_decoders_[dec_id].get();
|
|
69
|
+
}
|
|
70
|
+
int32_t num_attributes_decoders() const {
|
|
71
|
+
return static_cast<int32_t>(attributes_decoders_.size());
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Get a mutable pointer to the decoded point cloud. This is intended to be
|
|
75
|
+
// used mostly by other decoder subsystems.
|
|
76
|
+
PointCloud *point_cloud() { return point_cloud_; }
|
|
77
|
+
const PointCloud *point_cloud() const { return point_cloud_; }
|
|
78
|
+
|
|
79
|
+
DecoderBuffer *buffer() { return buffer_; }
|
|
80
|
+
const DecoderOptions *options() const { return options_; }
|
|
81
|
+
|
|
82
|
+
protected:
|
|
83
|
+
// Can be implemented by derived classes to perform any custom initialization
|
|
84
|
+
// of the decoder. Called in the Decode() method.
|
|
85
|
+
virtual bool InitializeDecoder() { return true; }
|
|
86
|
+
|
|
87
|
+
// Creates an attribute decoder.
|
|
88
|
+
virtual bool CreateAttributesDecoder(int32_t att_decoder_id) = 0;
|
|
89
|
+
virtual bool DecodeGeometryData() { return true; }
|
|
90
|
+
virtual bool DecodePointAttributes();
|
|
91
|
+
|
|
92
|
+
virtual bool DecodeAllAttributes();
|
|
93
|
+
virtual bool OnAttributesDecoded() { return true; }
|
|
94
|
+
|
|
95
|
+
Status DecodeMetadata();
|
|
96
|
+
|
|
97
|
+
private:
|
|
98
|
+
// Point cloud that is being filled in by the decoder.
|
|
99
|
+
PointCloud *point_cloud_;
|
|
100
|
+
|
|
101
|
+
std::vector<std::unique_ptr<AttributesDecoderInterface>> attributes_decoders_;
|
|
102
|
+
|
|
103
|
+
// Map between attribute id and decoder id.
|
|
104
|
+
std::vector<int32_t> attribute_to_decoder_map_;
|
|
105
|
+
|
|
106
|
+
// Input buffer holding the encoded data.
|
|
107
|
+
DecoderBuffer *buffer_;
|
|
108
|
+
|
|
109
|
+
// Bit-stream version of the encoder that encoded the input data.
|
|
110
|
+
uint8_t version_major_;
|
|
111
|
+
uint8_t version_minor_;
|
|
112
|
+
|
|
113
|
+
const DecoderOptions *options_;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
} // namespace draco
|
|
117
|
+
|
|
118
|
+
#endif // DRACO_COMPRESSION_POINT_CLOUD_POINT_CLOUD_DECODER_H_
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
// Copyright 2016 The Draco Authors.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
//
|
|
15
|
+
#ifndef DRACO_COMPRESSION_POINT_CLOUD_POINT_CLOUD_ENCODER_H_
|
|
16
|
+
#define DRACO_COMPRESSION_POINT_CLOUD_POINT_CLOUD_ENCODER_H_
|
|
17
|
+
|
|
18
|
+
#include "draco/compression/attributes/attributes_encoder.h"
|
|
19
|
+
#include "draco/compression/config/compression_shared.h"
|
|
20
|
+
#include "draco/compression/config/encoder_options.h"
|
|
21
|
+
#include "draco/core/encoder_buffer.h"
|
|
22
|
+
#include "draco/core/status.h"
|
|
23
|
+
#include "draco/point_cloud/point_cloud.h"
|
|
24
|
+
|
|
25
|
+
namespace draco {
|
|
26
|
+
|
|
27
|
+
// Abstract base class for all point cloud and mesh encoders. It provides a
|
|
28
|
+
// basic functionality that's shared between different encoders.
|
|
29
|
+
class PointCloudEncoder {
|
|
30
|
+
public:
|
|
31
|
+
PointCloudEncoder();
|
|
32
|
+
virtual ~PointCloudEncoder() = default;
|
|
33
|
+
|
|
34
|
+
// Sets the point cloud that is going be encoded. Must be called before the
|
|
35
|
+
// Encode() method.
|
|
36
|
+
void SetPointCloud(const PointCloud &pc);
|
|
37
|
+
|
|
38
|
+
// The main entry point that encodes provided point cloud.
|
|
39
|
+
Status Encode(const EncoderOptions &options, EncoderBuffer *out_buffer);
|
|
40
|
+
|
|
41
|
+
virtual EncodedGeometryType GetGeometryType() const { return POINT_CLOUD; }
|
|
42
|
+
|
|
43
|
+
// Returns the unique identifier of the encoding method (such as Edgebreaker
|
|
44
|
+
// for mesh compression).
|
|
45
|
+
virtual uint8_t GetEncodingMethod() const = 0;
|
|
46
|
+
|
|
47
|
+
// Returns the number of points that were encoded during the last Encode()
|
|
48
|
+
// function call. Valid only if "store_number_of_encoded_points" flag was set
|
|
49
|
+
// in the provided EncoderOptions.
|
|
50
|
+
size_t num_encoded_points() const { return num_encoded_points_; }
|
|
51
|
+
|
|
52
|
+
int num_attributes_encoders() const {
|
|
53
|
+
return static_cast<int>(attributes_encoders_.size());
|
|
54
|
+
}
|
|
55
|
+
AttributesEncoder *attributes_encoder(int i) {
|
|
56
|
+
return attributes_encoders_[i].get();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Adds a new attribute encoder, returning its id.
|
|
60
|
+
int AddAttributesEncoder(std::unique_ptr<AttributesEncoder> att_enc) {
|
|
61
|
+
attributes_encoders_.push_back(std::move(att_enc));
|
|
62
|
+
return static_cast<int>(attributes_encoders_.size() - 1);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Marks one attribute as a parent of another attribute. Must be called after
|
|
66
|
+
// all attribute encoders are created (usually in the
|
|
67
|
+
// AttributeEncoder::Init() method).
|
|
68
|
+
bool MarkParentAttribute(int32_t parent_att_id);
|
|
69
|
+
|
|
70
|
+
// Returns an attribute containing portable version of the attribute data that
|
|
71
|
+
// is guaranteed to be encoded losslessly. This attribute can be used safely
|
|
72
|
+
// as predictor for other attributes.
|
|
73
|
+
const PointAttribute *GetPortableAttribute(int32_t point_attribute_id);
|
|
74
|
+
|
|
75
|
+
EncoderBuffer *buffer() { return buffer_; }
|
|
76
|
+
const EncoderOptions *options() const { return options_; }
|
|
77
|
+
const PointCloud *point_cloud() const { return point_cloud_; }
|
|
78
|
+
|
|
79
|
+
protected:
|
|
80
|
+
// Can be implemented by derived classes to perform any custom initialization
|
|
81
|
+
// of the encoder. Called in the Encode() method.
|
|
82
|
+
virtual bool InitializeEncoder() { return true; }
|
|
83
|
+
|
|
84
|
+
// Should be used to encode any encoder-specific data.
|
|
85
|
+
virtual bool EncodeEncoderData() { return true; }
|
|
86
|
+
|
|
87
|
+
// Encodes any global geometry data (such as the number of points).
|
|
88
|
+
virtual Status EncodeGeometryData() { return OkStatus(); }
|
|
89
|
+
|
|
90
|
+
// encode all attribute values. The attribute encoders are sorted to resolve
|
|
91
|
+
// any attribute dependencies and all the encoded data is stored into the
|
|
92
|
+
// |buffer_|.
|
|
93
|
+
// Returns false if the encoding failed.
|
|
94
|
+
virtual bool EncodePointAttributes();
|
|
95
|
+
|
|
96
|
+
// Generate attribute encoders that are going to be used for encoding
|
|
97
|
+
// point attribute data. Calls GenerateAttributesEncoder() for every attribute
|
|
98
|
+
// of the encoded PointCloud.
|
|
99
|
+
virtual bool GenerateAttributesEncoders();
|
|
100
|
+
|
|
101
|
+
// Creates attribute encoder for a specific point attribute. This function
|
|
102
|
+
// needs to be implemented by the derived classes. The derived classes need
|
|
103
|
+
// to either 1. Create a new attribute encoder and add it using the
|
|
104
|
+
// AddAttributeEncoder method, or 2. add the attribute to an existing
|
|
105
|
+
// attribute encoder (using AttributesEncoder::AddAttributeId() method).
|
|
106
|
+
virtual bool GenerateAttributesEncoder(int32_t att_id) = 0;
|
|
107
|
+
|
|
108
|
+
// Encodes any data that is necessary to recreate a given attribute encoder.
|
|
109
|
+
// Note: this is called in order in which the attribute encoders are going to
|
|
110
|
+
// be encoded.
|
|
111
|
+
virtual bool EncodeAttributesEncoderIdentifier(int32_t /* att_encoder_id */) {
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Encodes all the attribute data using the created attribute encoders.
|
|
116
|
+
virtual bool EncodeAllAttributes();
|
|
117
|
+
|
|
118
|
+
// Computes and sets the num_encoded_points_ for the encoder.
|
|
119
|
+
virtual void ComputeNumberOfEncodedPoints() = 0;
|
|
120
|
+
|
|
121
|
+
void set_num_encoded_points(size_t num_points) {
|
|
122
|
+
num_encoded_points_ = num_points;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
private:
|
|
126
|
+
// Encodes Draco header that is the same for all encoders.
|
|
127
|
+
Status EncodeHeader();
|
|
128
|
+
|
|
129
|
+
// Encode metadata.
|
|
130
|
+
Status EncodeMetadata();
|
|
131
|
+
|
|
132
|
+
// Rearranges attribute encoders and their attributes to reflect the
|
|
133
|
+
// underlying attribute dependencies. This ensures that the attributes are
|
|
134
|
+
// encoded in the correct order (parent attributes before their children).
|
|
135
|
+
bool RearrangeAttributesEncoders();
|
|
136
|
+
|
|
137
|
+
const PointCloud *point_cloud_;
|
|
138
|
+
std::vector<std::unique_ptr<AttributesEncoder>> attributes_encoders_;
|
|
139
|
+
|
|
140
|
+
// Map between attribute id and encoder id.
|
|
141
|
+
std::vector<int32_t> attribute_to_encoder_map_;
|
|
142
|
+
|
|
143
|
+
// Encoding order of individual attribute encoders (i.e., the order in which
|
|
144
|
+
// they are processed during encoding that may be different from the order
|
|
145
|
+
// in which they were created because of attribute dependencies.
|
|
146
|
+
std::vector<int32_t> attributes_encoder_ids_order_;
|
|
147
|
+
|
|
148
|
+
// This buffer holds the final encoded data.
|
|
149
|
+
EncoderBuffer *buffer_;
|
|
150
|
+
|
|
151
|
+
const EncoderOptions *options_;
|
|
152
|
+
|
|
153
|
+
size_t num_encoded_points_;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
} // namespace draco
|
|
157
|
+
|
|
158
|
+
#endif // DRACO_COMPRESSION_POINT_CLOUD_POINT_CLOUD_ENCODER_H_
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright 2016 The Draco Authors.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
//
|
|
15
|
+
#ifndef DRACO_COMPRESSION_POINT_CLOUD_POINT_CLOUD_KD_TREE_DECODER_H_
|
|
16
|
+
#define DRACO_COMPRESSION_POINT_CLOUD_POINT_CLOUD_KD_TREE_DECODER_H_
|
|
17
|
+
|
|
18
|
+
#include "draco/compression/point_cloud/point_cloud_decoder.h"
|
|
19
|
+
|
|
20
|
+
namespace draco {
|
|
21
|
+
|
|
22
|
+
// Decodes PointCloud encoded with the PointCloudKdTreeEncoder.
|
|
23
|
+
class PointCloudKdTreeDecoder : public PointCloudDecoder {
|
|
24
|
+
protected:
|
|
25
|
+
bool DecodeGeometryData() override;
|
|
26
|
+
bool CreateAttributesDecoder(int32_t att_decoder_id) override;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
} // namespace draco
|
|
30
|
+
|
|
31
|
+
#endif // DRACO_COMPRESSION_POINT_CLOUD_POINT_CLOUD_KD_TREE_DECODER_H_
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Copyright 2016 The Draco Authors.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
//
|
|
15
|
+
#ifndef DRACO_COMPRESSION_POINT_CLOUD_POINT_CLOUD_KD_TREE_ENCODER_H_
|
|
16
|
+
#define DRACO_COMPRESSION_POINT_CLOUD_POINT_CLOUD_KD_TREE_ENCODER_H_
|
|
17
|
+
|
|
18
|
+
#include "draco/compression/point_cloud/point_cloud_encoder.h"
|
|
19
|
+
|
|
20
|
+
namespace draco {
|
|
21
|
+
|
|
22
|
+
// Encodes a PointCloud using one of the available Kd-tree compression methods.
|
|
23
|
+
// See FloatPointsKdTreeEncoder and DynamicIntegerPointsKdTreeEncoder for more
|
|
24
|
+
// details. Currently, the input PointCloud must satisfy the following
|
|
25
|
+
// requirements to use this encoder:
|
|
26
|
+
// 1. PointCloud has only one attribute of type GeometryAttribute::POSITION.
|
|
27
|
+
// 2. The position attribute has three components (x,y,z).
|
|
28
|
+
// 3. The position values are stored as either DT_FLOAT32 or DT_UINT32.
|
|
29
|
+
// 4. If the position values are stored as DT_FLOAT32, quantization needs to
|
|
30
|
+
// be enabled for the position attribute.
|
|
31
|
+
class PointCloudKdTreeEncoder : public PointCloudEncoder {
|
|
32
|
+
public:
|
|
33
|
+
uint8_t GetEncodingMethod() const override {
|
|
34
|
+
return POINT_CLOUD_KD_TREE_ENCODING;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
protected:
|
|
38
|
+
Status EncodeGeometryData() override;
|
|
39
|
+
bool GenerateAttributesEncoder(int32_t att_id) override;
|
|
40
|
+
void ComputeNumberOfEncodedPoints() override;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
} // namespace draco
|
|
44
|
+
|
|
45
|
+
#endif // DRACO_COMPRESSION_POINT_CLOUD_POINT_CLOUD_KD_TREE_ENCODER_H_
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright 2016 The Draco Authors.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
//
|
|
15
|
+
#ifndef DRACO_COMPRESSION_POINT_CLOUD_POINT_CLOUD_SEQUENTIAL_DECODER_H_
|
|
16
|
+
#define DRACO_COMPRESSION_POINT_CLOUD_POINT_CLOUD_SEQUENTIAL_DECODER_H_
|
|
17
|
+
|
|
18
|
+
#include "draco/compression/point_cloud/point_cloud_decoder.h"
|
|
19
|
+
|
|
20
|
+
namespace draco {
|
|
21
|
+
|
|
22
|
+
// Point cloud decoder for data encoded by the PointCloudSequentialEncoder.
|
|
23
|
+
// All attribute values are decoded using an identity mapping between point ids
|
|
24
|
+
// and attribute value ids.
|
|
25
|
+
class PointCloudSequentialDecoder : public PointCloudDecoder {
|
|
26
|
+
protected:
|
|
27
|
+
bool DecodeGeometryData() override;
|
|
28
|
+
bool CreateAttributesDecoder(int32_t att_decoder_id) override;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
} // namespace draco
|
|
32
|
+
|
|
33
|
+
#endif // DRACO_COMPRESSION_POINT_CLOUD_POINT_CLOUD_SEQUENTIAL_DECODER_H_
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Copyright 2016 The Draco Authors.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
//
|
|
15
|
+
#ifndef DRACO_COMPRESSION_POINT_CLOUD_POINT_CLOUD_SEQUENTIAL_ENCODER_H_
|
|
16
|
+
#define DRACO_COMPRESSION_POINT_CLOUD_POINT_CLOUD_SEQUENTIAL_ENCODER_H_
|
|
17
|
+
|
|
18
|
+
#include "draco/compression/point_cloud/point_cloud_encoder.h"
|
|
19
|
+
|
|
20
|
+
namespace draco {
|
|
21
|
+
|
|
22
|
+
// A basic point cloud encoder that iterates over all points and encodes all
|
|
23
|
+
// attribute values for every visited point. The attribute values encoding
|
|
24
|
+
// can be controlled using provided encoding option to enable features such
|
|
25
|
+
// as quantization or prediction schemes.
|
|
26
|
+
// This encoder preserves the order and the number of input points, but the
|
|
27
|
+
// mapping between point ids and attribute values may be different for the
|
|
28
|
+
// decoded point cloud.
|
|
29
|
+
class PointCloudSequentialEncoder : public PointCloudEncoder {
|
|
30
|
+
public:
|
|
31
|
+
uint8_t GetEncodingMethod() const override {
|
|
32
|
+
return POINT_CLOUD_SEQUENTIAL_ENCODING;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
protected:
|
|
36
|
+
Status EncodeGeometryData() override;
|
|
37
|
+
bool GenerateAttributesEncoder(int32_t att_id) override;
|
|
38
|
+
void ComputeNumberOfEncodedPoints() override;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
} // namespace draco
|
|
42
|
+
|
|
43
|
+
#endif // DRACO_COMPRESSION_POINT_CLOUD_POINT_CLOUD_SEQUENTIAL_ENCODER_H_
|