GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
sequential_attribute_decoders_controller.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_ATTRIBUTE_DECODERS_CONTROLLER_H_
16#define DRACO_COMPRESSION_ATTRIBUTES_SEQUENTIAL_ATTRIBUTE_DECODERS_CONTROLLER_H_
17
21
22namespace draco {
23
24// A basic implementation of an attribute decoder that decodes data encoded by
25// the SequentialAttributeEncodersController class. The
26// SequentialAttributeDecodersController creates a single
27// AttributeIndexedValuesDecoder for each of the decoded attribute, where the
28// type of the values decoder is determined by the unique identifier that was
29// encoded by the encoder.
31 public:
33 std::unique_ptr<PointsSequencer> sequencer);
34
35 bool DecodeAttributesDecoderData(DecoderBuffer *buffer) override;
36 bool DecodeAttributes(DecoderBuffer *buffer) override;
38 int32_t point_attribute_id) override {
39 const int32_t loc_id = GetLocalIdForPointAttribute(point_attribute_id);
40 if (loc_id < 0) {
41 return nullptr;
42 }
43 return sequential_decoders_[loc_id]->GetPortableAttribute();
44 }
45
46 protected:
47 bool DecodePortableAttributes(DecoderBuffer *in_buffer) override;
50 virtual std::unique_ptr<SequentialAttributeDecoder> CreateSequentialDecoder(
51 uint8_t decoder_type);
52
53 private:
54 std::vector<std::unique_ptr<SequentialAttributeDecoder>> sequential_decoders_;
55 std::vector<PointIndex> point_ids_;
56 std::unique_ptr<PointsSequencer> sequencer_;
57};
58
59} // namespace draco
60
61#endif // DRACO_COMPRESSION_ATTRIBUTES_SEQUENTIAL_ATTRIBUTE_DECODERS_CONTROLLER_H_
int32_t GetLocalIdForPointAttribute(int32_t point_attribute_id) const
Definition attributes_decoder.h:69
AttributesDecoder()
Definition attributes_decoder.cc:21
Definition decoder_buffer.h:30
Definition point_attribute.h:33
bool DecodeAttributesDecoderData(DecoderBuffer *buffer) override
Definition sequential_attribute_decoders_controller.cc:28
bool TransformAttributesToOriginalFormat() override
Definition sequential_attribute_decoders_controller.cc:95
bool DecodePortableAttributes(DecoderBuffer *in_buffer) override
Definition sequential_attribute_decoders_controller.cc:70
bool DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) override
Definition sequential_attribute_decoders_controller.cc:83
bool DecodeAttributes(DecoderBuffer *buffer) override
Definition sequential_attribute_decoders_controller.cc:53
virtual std::unique_ptr< SequentialAttributeDecoder > CreateSequentialDecoder(uint8_t decoder_type)
Definition sequential_attribute_decoders_controller.cc:125
SequentialAttributeDecodersController(std::unique_ptr< PointsSequencer > sequencer)
Definition sequential_attribute_decoders_controller.cc:24
const PointAttribute * GetPortableAttribute(int32_t point_attribute_id) override
Definition sequential_attribute_decoders_controller.h:37
Definition attribute_octahedron_transform.cc:21