15#ifndef DRACO_COMPRESSION_ATTRIBUTES_PREDICTION_SCHEMES_MESH_PREDICTION_SCHEME_GEOMETRIC_NORMAL_DECODER_H_
16#define DRACO_COMPRESSION_ATTRIBUTES_PREDICTION_SCHEMES_MESH_PREDICTION_SCHEME_GEOMETRIC_NORMAL_DECODER_H_
26template <
typename DataTypeT,
class TransformT,
class MeshDataT>
44 int size,
int num_components,
45 const PointIndex *entry_to_point_id_map)
override;
54 if (!predictor_.IsInitialized()) {
60 if (!octahedron_tool_box_.IsInitialized()) {
81 predictor_.SetPositionAttribute(*att);
85 octahedron_tool_box_.SetQuantizationBits(q);
96template <
typename DataTypeT,
class TransformT,
class MeshDataT>
97bool MeshPredictionSchemeGeometricNormalDecoder<
98 DataTypeT, TransformT,
100 DataTypeT *out_data,
int ,
104 predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
110 const int corner_map_size =
111 static_cast<int>(this->
mesh_data().data_to_corner_map()->size());
114 int32_t pred_normal_oct[2];
116 for (
int data_id = 0; data_id < corner_map_size; ++data_id) {
118 this->
mesh_data().data_to_corner_map()->at(data_id);
119 predictor_.ComputePredictedValue(corner_id, pred_normal_3d.
data());
122 octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.
data());
124 octahedron_tool_box_.center_value());
125 if (flip_normal_bit_decoder_.DecodeNextBit()) {
126 pred_normal_3d = -pred_normal_3d;
128 octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
129 pred_normal_3d.
data(), pred_normal_oct, pred_normal_oct + 1);
131 const int data_offset = data_id * 2;
133 pred_normal_oct, in_corr + data_offset, out_data + data_offset);
135 flip_normal_bit_decoder_.EndDecoding();
139template <
typename DataTypeT,
class TransformT,
class MeshDataT>
144 if (!this->
transform().DecodeTransformData(buffer)) {
148#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
150 uint8_t prediction_mode;
151 if (!buffer->
Decode(&prediction_mode)) {
155 if (!predictor_.SetNormalPredictionMode(
163 if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
Definition decoder_buffer.h:30
uint16_t bitstream_version() const
Definition decoder_buffer.h:120
bool Decode(T *out_val)
Definition decoder_buffer.h:68
uint8_t num_components() const
Definition geometry_attribute.h:263
Type attribute_type() const
Definition geometry_attribute.h:256
Type
Definition geometry_attribute.h:46
@ POSITION
Definition geometry_attribute.h:52
const MeshData & mesh_data() const
Definition mesh_prediction_scheme_decoder.h:38
MeshPredictionSchemeDecoder(const PointAttribute *attribute, const TransformT &transform, const MeshDataT &mesh_data)
Definition mesh_prediction_scheme_decoder.h:31
Definition mesh_prediction_scheme_geometric_normal_decoder.h:28
PredictionSchemeMethod GetPredictionMethod() const override
Definition mesh_prediction_scheme_geometric_normal_decoder.h:49
int GetNumParentAttributes() const override
Definition mesh_prediction_scheme_geometric_normal_decoder.h:66
void SetQuantizationBits(int q)
Definition mesh_prediction_scheme_geometric_normal_decoder.h:84
GeometryAttribute::Type GetParentAttributeType(int i) const override
Definition mesh_prediction_scheme_geometric_normal_decoder.h:68
bool DecodePredictionData(DecoderBuffer *buffer) override
Definition mesh_prediction_scheme_geometric_normal_decoder.h:141
bool IsInitialized() const override
Definition mesh_prediction_scheme_geometric_normal_decoder.h:53
MeshPredictionSchemeGeometricNormalDecoder(const PointAttribute *attribute, const TransformT &transform, const MeshDataT &mesh_data)
Definition mesh_prediction_scheme_geometric_normal_decoder.h:32
typename MeshPredictionSchemeDecoder< DataTypeT, TransformT, MeshDataT >::CorrType CorrType
Definition mesh_prediction_scheme_geometric_normal_decoder.h:30
bool ComputeOriginalValues(const CorrType *in_corr, DataTypeT *out_data, int size, int num_components, const PointIndex *entry_to_point_id_map) override
Definition mesh_prediction_scheme_geometric_normal_decoder.h:99
bool SetParentAttribute(const PointAttribute *att) override
Definition mesh_prediction_scheme_geometric_normal_decoder.h:74
Definition mesh_prediction_scheme_geometric_normal_predictor_area.h:27
Definition point_attribute.h:33
const Transform & transform() const
Definition prediction_scheme_decoder.h:80
const PointAttribute * attribute() const
Definition prediction_scheme_decoder.h:79
Definition rans_bit_decoder.h:28
Scalar AbsSum() const
Definition vector_d.h:237
Scalar * data()
Definition vector_d.h:282
#define DRACO_DCHECK_EQ(a, b)
Definition macros.h:81
#define DRACO_DCHECK(x)
Definition macros.h:80
#define DRACO_BITSTREAM_VERSION(MAJOR, MINOR)
Definition macros.h:114
n< br > font size
Definition meshpage.php:3536
Definition attribute_octahedron_transform.cc:21
NormalPredictionMode
Definition compression_shared.h:138
CornerIndex CornerIndex
Definition mesh_edgebreaker_encoder_impl.cc:35
PredictionSchemeMethod
Definition compression_shared.h:80
@ MESH_PREDICTION_GEOMETRIC_NORMAL
Definition compression_shared.h:91
Definition GameApi_pl.cc:29382