GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
kd_tree_attributes_encoder.h
Go to the documentation of this file.
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_ATTRIBUTES_KD_TREE_ATTRIBUTES_ENCODER_H_
16#define DRACO_COMPRESSION_ATTRIBUTES_KD_TREE_ATTRIBUTES_ENCODER_H_
17
21
22namespace draco {
23
24// Encodes all attributes of a given PointCloud using one of the available
25// Kd-tree compression methods.
26// See compression/point_cloud/point_cloud_kd_tree_encoder.h for more details.
28 public:
30 explicit KdTreeAttributesEncoder(int att_id);
31
32 uint8_t GetUniqueId() const override { return KD_TREE_ATTRIBUTE_ENCODER; }
33
34 protected:
36 bool EncodePortableAttributes(EncoderBuffer *out_buffer) override;
37 bool EncodeDataNeededByPortableTransforms(EncoderBuffer *out_buffer) override;
38
39 private:
40 std::vector<AttributeQuantizationTransform>
41 attribute_quantization_transforms_;
42 // Min signed values are used to transform signed integers into unsigned ones
43 // (by subtracting the min signed value for each component).
44 std::vector<int32_t> min_signed_values_;
45 std::vector<std::unique_ptr<PointAttribute>> quantized_portable_attributes_;
46 int num_components_;
47};
48
49} // namespace draco
50
51#endif // DRACO_COMPRESSION_ATTRIBUTES_KD_TREE_ATTRIBUTES_ENCODER_H_
AttributesEncoder()
Definition attributes_encoder.cc:22
Definition encoder_buffer.h:29
bool EncodePortableAttributes(EncoderBuffer *out_buffer) override
Definition kd_tree_attributes_encoder.cc:128
bool EncodeDataNeededByPortableTransforms(EncoderBuffer *out_buffer) override
Definition kd_tree_attributes_encoder.cc:114
bool TransformAttributesToPortableFormat() override
Definition kd_tree_attributes_encoder.cc:31
uint8_t GetUniqueId() const override
Definition kd_tree_attributes_encoder.h:32
KdTreeAttributesEncoder()
Definition kd_tree_attributes_encoder.cc:26
Definition attribute_octahedron_transform.cc:21
@ KD_TREE_ATTRIBUTE_ENCODER
Definition compression_shared.h:66