GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
prediction_scheme_interface.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_PREDICTION_SCHEMES_PREDICTION_SCHEME_INTERFACE_H_
16#define DRACO_COMPRESSION_ATTRIBUTES_PREDICTION_SCHEMES_PREDICTION_SCHEME_INTERFACE_H_
17
20
21// Prediction schemes can be used during encoding and decoding of attributes
22// to predict attribute values based on the previously encoded/decoded data.
23// See prediction_scheme.h for more details.
24namespace draco {
25
26// Abstract interface for all prediction schemes used during attribute encoding.
28 public:
29 virtual ~PredictionSchemeInterface() = default;
31
32 // Returns the encoded attribute.
33 virtual const PointAttribute *GetAttribute() const = 0;
34
35 // Returns true when the prediction scheme is initialized with all data it
36 // needs.
37 virtual bool IsInitialized() const = 0;
38
39 // Returns the number of parent attributes that are needed for the prediction.
40 virtual int GetNumParentAttributes() const = 0;
41
42 // Returns the type of each of the parent attribute.
44
45 // Sets the required parent attribute.
46 // Returns false if the attribute doesn't meet the requirements of the
47 // prediction scheme.
48 virtual bool SetParentAttribute(const PointAttribute *att) = 0;
49
50 // Method should return true if the prediction scheme guarantees that all
51 // correction values are always positive (or at least non-negative).
52 virtual bool AreCorrectionsPositive() = 0;
53
54 // Returns the transform type used by the prediction scheme.
56};
57
58} // namespace draco
59
60#endif // DRACO_COMPRESSION_ATTRIBUTES_PREDICTION_SCHEMES_PREDICTION_SCHEME_INTERFACE_H_
Type
Definition geometry_attribute.h:46
Definition point_attribute.h:33
Definition prediction_scheme_interface.h:27
virtual const PointAttribute * GetAttribute() const =0
virtual bool IsInitialized() const =0
virtual bool SetParentAttribute(const PointAttribute *att)=0
virtual PredictionSchemeMethod GetPredictionMethod() const =0
virtual PredictionSchemeTransformType GetTransformType() const =0
virtual int GetNumParentAttributes() const =0
virtual GeometryAttribute::Type GetParentAttributeType(int i) const =0
virtual bool AreCorrectionsPositive()=0
virtual ~PredictionSchemeInterface()=default
Definition attribute_octahedron_transform.cc:21
PredictionSchemeTransformType
Definition compression_shared.h:96
PredictionSchemeMethod
Definition compression_shared.h:80