GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
sequential_normal_attribute_decoder.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_SEQUENTIAL_NORMAL_ATTRIBUTE_DECODER_H_
16#define DRACO_COMPRESSION_ATTRIBUTES_SEQUENTIAL_NORMAL_ATTRIBUTE_DECODER_H_
17
24
25namespace draco {
26
27// Decoder for attributes encoded with SequentialNormalAttributeEncoder.
30 public:
32 bool Init(PointCloudDecoder *decoder, int attribute_id) override;
33
34 protected:
35 int32_t GetNumValueComponents() const override {
36 return 2; // We quantize everything into two components.
37 }
38 bool DecodeIntegerValues(const std::vector<PointIndex> &point_ids,
39 DecoderBuffer *in_buffer) override;
41 const std::vector<PointIndex> &point_ids,
42 DecoderBuffer *in_buffer) override;
43 bool StoreValues(uint32_t num_points) override;
44
45 private:
46 AttributeOctahedronTransform octahedral_transform_;
47
48 std::unique_ptr<PredictionSchemeTypedDecoderInterface<int32_t>>
49 CreateIntPredictionScheme(
51 PredictionSchemeTransformType transform_type) override {
52 switch (transform_type) {
53#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
55 typedef PredictionSchemeNormalOctahedronDecodingTransform<int32_t>
56 Transform;
57 // At this point the decoder has not read the quantization bits,
58 // which is why we must construct the transform by default.
59 // See Transform.DecodeTransformData for more details.
61 method, attribute_id(), decoder());
62 }
63#endif
65 typedef PredictionSchemeNormalOctahedronCanonicalizedDecodingTransform<
66 int32_t>
67 Transform;
68 // At this point the decoder has not read the quantization bits,
69 // which is why we must construct the transform by default.
70 // See Transform.DecodeTransformData for more details.
72 method, attribute_id(), decoder());
73 }
74 default:
75 return nullptr; // Currently, we support only octahedron transform and
76 // octahedron transform canonicalized.
77 }
78 }
79};
80
81} // namespace draco
82
83#endif // DRACO_COMPRESSION_ATTRIBUTES_SEQUENTIAL_NORMAL_ATTRIBUTE_DECODER_H_
Definition attribute_octahedron_transform.h:26
Definition decoder_buffer.h:30
Definition point_cloud_decoder.h:28
int attribute_id() const
Definition sequential_attribute_decoder.h:55
PointCloudDecoder * decoder() const
Definition sequential_attribute_decoder.h:56
SequentialIntegerAttributeDecoder()
Definition sequential_integer_attribute_decoder.cc:23
SequentialNormalAttributeDecoder()
Definition sequential_normal_attribute_decoder.cc:21
int32_t GetNumValueComponents() const override
Definition sequential_normal_attribute_decoder.h:35
bool DecodeDataNeededByPortableTransform(const std::vector< PointIndex > &point_ids, DecoderBuffer *in_buffer) override
Definition sequential_normal_attribute_decoder.cc:56
bool StoreValues(uint32_t num_points) override
Definition sequential_normal_attribute_decoder.cc:70
bool DecodeIntegerValues(const std::vector< PointIndex > &point_ids, DecoderBuffer *in_buffer) override
Definition sequential_normal_attribute_decoder.cc:39
bool Init(PointCloudDecoder *decoder, int attribute_id) override
Definition sequential_normal_attribute_decoder.cc:23
Definition attribute_octahedron_transform.cc:21
PredictionSchemeTransformType
Definition compression_shared.h:96
@ PREDICTION_TRANSFORM_NORMAL_OCTAHEDRON_CANONICALIZED
Definition compression_shared.h:108
@ PREDICTION_TRANSFORM_NORMAL_OCTAHEDRON
Definition compression_shared.h:105
std::unique_ptr< PredictionSchemeDecoder< DataTypeT, TransformT > > CreatePredictionSchemeForDecoder(PredictionSchemeMethod method, int att_id, const PointCloudDecoder *decoder, const TransformT &transform)
Definition prediction_scheme_decoder_factory.h:153
PredictionSchemeMethod
Definition compression_shared.h:80