GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
attributes_decoder_interface.h
Go to the documentation of this file.
1// Copyright 2017 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_ATTRIBUTES_DECODER_INTERFACE_H_
16#define DRACO_COMPRESSION_ATTRIBUTES_ATTRIBUTES_DECODER_INTERFACE_H_
17
18#include <vector>
19
22
23namespace draco {
24
26
27// Interface class for decoding one or more attributes that were encoded with a
28// matching AttributesEncoder. It provides only the basic interface
29// that is used by the PointCloudDecoder. The actual decoding must be
30// implemented in derived classes using the DecodeAttributes() method.
32 public:
34 virtual ~AttributesDecoderInterface() = default;
35
36 // Called after all attribute decoders are created. It can be used to perform
37 // any custom initialization.
38 virtual bool Init(PointCloudDecoder *decoder, PointCloud *pc) = 0;
39
40 // Decodes any attribute decoder specific data from the |in_buffer|.
41 virtual bool DecodeAttributesDecoderData(DecoderBuffer *in_buffer) = 0;
42
43 // Decode attribute data from the source buffer. Needs to be implemented by
44 // the derived classes.
45 virtual bool DecodeAttributes(DecoderBuffer *in_buffer) = 0;
46
47 virtual int32_t GetAttributeId(int i) const = 0;
48 virtual int32_t GetNumAttributes() const = 0;
49 virtual PointCloudDecoder *GetDecoder() const = 0;
50
51 // Returns an attribute containing data processed by the attribute transform.
52 // (see TransformToPortableFormat() method). This data is guaranteed to be
53 // same for encoder and decoder and it can be used by predictors.
55 int32_t /* point_attribute_id */) {
56 return nullptr;
57 }
58};
59
60} // namespace draco
61
62#endif // DRACO_COMPRESSION_ATTRIBUTES_ATTRIBUTES_DECODER_INTERFACE_H_
virtual int32_t GetAttributeId(int i) const =0
virtual ~AttributesDecoderInterface()=default
virtual const PointAttribute * GetPortableAttribute(int32_t)
Definition attributes_decoder_interface.h:54
virtual PointCloudDecoder * GetDecoder() const =0
virtual int32_t GetNumAttributes() const =0
virtual bool Init(PointCloudDecoder *decoder, PointCloud *pc)=0
virtual bool DecodeAttributes(DecoderBuffer *in_buffer)=0
virtual bool DecodeAttributesDecoderData(DecoderBuffer *in_buffer)=0
Definition decoder_buffer.h:30
Definition point_attribute.h:33
Definition point_cloud_decoder.h:28
Definition point_cloud.h:29
Definition attribute_octahedron_transform.cc:21