mirror of
https://github.com/drewcassidy/quicktex.git
synced 2024-09-13 06:37:34 +00:00
IWYU pass
This commit is contained in:
parent
db2d5dbe61
commit
628ad558d8
@ -19,14 +19,12 @@
|
|||||||
|
|
||||||
#include "BC1Decoder.h"
|
#include "BC1Decoder.h"
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <cassert>
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
#include "../BlockView.h"
|
#include "../BlockView.h"
|
||||||
#include "../Color.h"
|
#include "../Color.h"
|
||||||
#include "../Interpolator.h"
|
|
||||||
#include "../ndebug.h"
|
#include "../ndebug.h"
|
||||||
#include "BC1Block.h"
|
#include "BC1Block.h"
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "../BC4/BC4Decoder.h"
|
#include "../BC4/BC4Decoder.h"
|
||||||
#include "../BlockView.h"
|
#include "../BlockView.h"
|
||||||
#include "../ndebug.h"
|
#include "../ndebug.h"
|
||||||
|
#include "BC3Block.h"
|
||||||
|
|
||||||
namespace rgbcx {
|
namespace rgbcx {
|
||||||
|
|
||||||
|
@ -19,12 +19,10 @@
|
|||||||
|
|
||||||
#include "BC4Decoder.h"
|
#include "BC4Decoder.h"
|
||||||
|
|
||||||
#include <assert.h> // for assert
|
#include <array> // for array
|
||||||
|
#include <cassert> // for assert
|
||||||
#include <array> // for array
|
|
||||||
|
|
||||||
#include "../BlockView.h" // for ColorBlock
|
#include "../BlockView.h" // for ColorBlock
|
||||||
#include "../Color.h" // for Color
|
|
||||||
#include "../ndebug.h" // for ndebug
|
#include "../ndebug.h" // for ndebug
|
||||||
#include "BC4Block.h"
|
#include "BC4Block.h"
|
||||||
|
|
||||||
|
@ -19,7 +19,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <cassert>
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
#include "../BlockDecoder.h"
|
#include "../BlockDecoder.h"
|
||||||
#include "../BlockView.h"
|
#include "../BlockView.h"
|
||||||
|
@ -19,7 +19,12 @@
|
|||||||
|
|
||||||
#include "BC4Encoder.h"
|
#include "BC4Encoder.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm> // for minmax_element
|
||||||
|
#include <array> // for array
|
||||||
|
#include <cstdint> // for uint8_t
|
||||||
|
#include <utility> // for pair
|
||||||
|
|
||||||
|
#include "BC4Block.h" // for BC4Block
|
||||||
|
|
||||||
namespace rgbcx {
|
namespace rgbcx {
|
||||||
void BC4Encoder::EncodeBlock(Byte4x4 pixels, BC4Block *const dest) const noexcept(ndebug) {
|
void BC4Encoder::EncodeBlock(Byte4x4 pixels, BC4Block *const dest) const noexcept(ndebug) {
|
||||||
@ -38,7 +43,7 @@ void BC4Encoder::EncodeBlock(Byte4x4 pixels, BC4Block *const dest) const noexcep
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::array<uint8_t, 16> selectors = {};
|
std::array<uint8_t, 16> selectors = {};
|
||||||
const static std::array<uint8_t, 8> Levels = {1U, 7U, 6U, 5U, 4U, 3U, 2U, 0U}; // selector value options in linear order
|
const static std::array<uint8_t, 8> Levels = {1U, 7U, 6U, 5U, 4U, 3U, 2U, 0U}; // selector value options in linear order
|
||||||
|
|
||||||
// BC4 floors in its divisions, which we compensate for with the 4 bias.
|
// BC4 floors in its divisions, which we compensate for with the 4 bias.
|
||||||
// This function is optimal for all possible inputs (i.e. it outputs the same results as checking all 8 values and choosing the closest one).
|
// This function is optimal for all possible inputs (i.e. it outputs the same results as checking all 8 values and choosing the closest one).
|
||||||
@ -52,7 +57,7 @@ void BC4Encoder::EncodeBlock(Byte4x4 pixels, BC4Block *const dest) const noexcep
|
|||||||
|
|
||||||
// iterate over all values and calculate selectors
|
// iterate over all values and calculate selectors
|
||||||
for (unsigned i = 0; i < 16; i++) {
|
for (unsigned i = 0; i < 16; i++) {
|
||||||
int value = flattened[i] * 14; // multiply by demonimator
|
int value = flattened[i] * 14; // multiply by demonimator
|
||||||
|
|
||||||
// level = number of thresholds this value is greater than
|
// level = number of thresholds this value is greater than
|
||||||
unsigned level = 0;
|
unsigned level = 0;
|
||||||
|
@ -19,8 +19,14 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
#include "../BlockEncoder.h"
|
#include "../BlockEncoder.h"
|
||||||
|
#include "../BlockView.h"
|
||||||
|
#include "../ndebug.h"
|
||||||
#include "BC4Block.h"
|
#include "BC4Block.h"
|
||||||
|
|
||||||
namespace rgbcx {
|
namespace rgbcx {
|
||||||
|
|
||||||
class BC4Encoder : public BlockEncoder<BC4Block, 4, 4> {
|
class BC4Encoder : public BlockEncoder<BC4Block, 4, 4> {
|
||||||
|
@ -19,9 +19,9 @@
|
|||||||
|
|
||||||
#include "BC5Decoder.h"
|
#include "BC5Decoder.h"
|
||||||
|
|
||||||
#include "../BC4/BC4Decoder.h"
|
|
||||||
#include "../BlockView.h"
|
#include "../BlockView.h"
|
||||||
#include "../ndebug.h"
|
#include "../ndebug.h"
|
||||||
|
#include "BC5Block.h"
|
||||||
|
|
||||||
namespace rgbcx {
|
namespace rgbcx {
|
||||||
|
|
||||||
|
@ -19,8 +19,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <cassert>
|
||||||
|
#include <cstddef>
|
||||||
|
#include <cstdint>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "../BC4/BC4Decoder.h"
|
#include "../BC4/BC4Decoder.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user