Initial commit: Final state of the master project

This commit is contained in:
2017-09-16 09:41:37 +02:00
commit 696180d43b
832 changed files with 169717 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
#pragma once
#include <map>
#include <vector>
#include "../SmallNormal.h"
#include "BaseQuantizer.h"
// Super simple quantizer: takes the original value, sets some bits to zero so that only the given number of bits remain
class NormalQuantizer : public BaseQuantizer<SmallNormal, NormalCompare>, public QuickQuantizer<SmallNormal>
{
public:
NormalQuantizer(unsigned8 bits);
std::map<SmallNormal, SmallNormal, NormalCompare>* QuantizeMaterials(std::vector<SmallNormal> materials) const override;
std::string GetQuantizerDescriptor() const override;
SmallNormal Quantize(const SmallNormal& normal) const override;
private:
// if the number of bits is smaller than or equal to this number, all possible quantization values will be added.
static const unsigned8 QUANTIZE_ALL_UP_TO = 14;
unsigned8 mBits;
unsigned32 mChannelMask;
};