#include "meshoptimizer.h"
#include <assert.h>
#include <string.h>
namespace meshopt
{
const unsigned char kIndexHeader = …;
const unsigned char kSequenceHeader = …;
static int gEncodeIndexVersion = …;
VertexFifo;
EdgeFifo;
static const unsigned int kTriangleIndexOrder[3][3] = …;
static const unsigned char kCodeAuxEncodingTable[16] = …;
static int rotateTriangle(unsigned int a, unsigned int b, unsigned int c, unsigned int next)
{ … }
static int getEdgeFifo(EdgeFifo fifo, unsigned int a, unsigned int b, unsigned int c, size_t offset)
{ … }
static void pushEdgeFifo(EdgeFifo fifo, unsigned int a, unsigned int b, size_t& offset)
{ … }
static int getVertexFifo(VertexFifo fifo, unsigned int v, size_t offset)
{ … }
static void pushVertexFifo(VertexFifo fifo, unsigned int v, size_t& offset, int cond = 1)
{ … }
static void encodeVByte(unsigned char*& data, unsigned int v)
{ … }
static unsigned int decodeVByte(const unsigned char*& data)
{ … }
static void encodeIndex(unsigned char*& data, unsigned int index, unsigned int last)
{ … }
static unsigned int decodeIndex(const unsigned char*& data, unsigned int last)
{ … }
static int getCodeAuxIndex(unsigned char v, const unsigned char* table)
{ … }
static void writeTriangle(void* destination, size_t offset, size_t index_size, unsigned int a, unsigned int b, unsigned int c)
{ … }
}
size_t meshopt_encodeIndexBuffer(unsigned char* buffer, size_t buffer_size, const unsigned int* indices, size_t index_count)
{ … }
size_t meshopt_encodeIndexBufferBound(size_t index_count, size_t vertex_count)
{ … }
void meshopt_encodeIndexVersion(int version)
{ … }
int meshopt_decodeIndexBuffer(void* destination, size_t index_count, size_t index_size, const unsigned char* buffer, size_t buffer_size)
{ … }
size_t meshopt_encodeIndexSequence(unsigned char* buffer, size_t buffer_size, const unsigned int* indices, size_t index_count)
{ … }
size_t meshopt_encodeIndexSequenceBound(size_t index_count, size_t vertex_count)
{ … }
int meshopt_decodeIndexSequence(void* destination, size_t index_count, size_t index_size, const unsigned char* buffer, size_t buffer_size)
{ … }