Fix last commit

This commit is contained in:
Andrew Cassidy 2021-03-19 01:46:33 -07:00
parent 5a272c954f
commit 7a81bbb58d
4 changed files with 8 additions and 13 deletions

View File

@ -71,6 +71,9 @@ py::bytes DecodeImage(const BlockDecoder &self, py::bytes encoded, unsigned imag
PYBIND11_MODULE(_quicktex, m) {
m.doc() = "More Stuff";
py::options options;
// options.disable_function_signatures();
// BlockDecoder
py::class_<BlockDecoder> block_decoder(m, "BlockDecoder");

View File

@ -30,7 +30,7 @@
#include "../bc4/BC4Decoder.h"
#include "BC5Block.h"
namespace quicktex::s3tc {
namespace quicktex::s3tc {
class BC5Decoder : public BlockDecoderTemplate<BC5Block, 4, 4> {
public:
@ -44,10 +44,6 @@ class BC5Decoder : public BlockDecoderTemplate<BC5Block, 4, 4> {
void DecodeBlock(Color4x4 dest, BC5Block *const block) const noexcept(ndebug) override;
ChannelPair GetChannels() const { return ChannelPair(_chan0_decoder->GetChannel(), _chan1_decoder->GetChannel()); }
void SetChannels(ChannelPair channels) {
_chan0_decoder->SetChannel(std::get<0>(channels));
_chan1_decoder->SetChannel(std::get<1>(channels));
}
BC4DecoderPair GetBC4Decoders() const { return BC4DecoderPair(_chan0_decoder, _chan1_decoder); }

View File

@ -30,7 +30,7 @@
#include "../bc4/BC4Encoder.h"
#include "BC5Block.h"
namespace quicktex::s3tc {
namespace quicktex::s3tc {
class BC5Encoder : public BlockEncoderTemplate<BC5Block, 4, 4> {
public:
@ -44,10 +44,6 @@ class BC5Encoder : public BlockEncoderTemplate<BC5Block, 4, 4> {
void EncodeBlock(Color4x4 pixels, BC5Block *dest) const override;
ChannelPair GetChannels() const { return ChannelPair(_chan0_encoder->GetChannel(), _chan1_encoder->GetChannel()); }
void SetChannels(ChannelPair channels) {
_chan0_encoder->SetChannel(std::get<0>(channels));
_chan1_encoder->SetChannel(std::get<1>(channels));
}
BC4EncoderPair GetBC4Encoders() const { return BC4EncoderPair(_chan0_encoder, _chan1_encoder); }

View File

@ -31,7 +31,7 @@ namespace py = pybind11;
namespace quicktex::bindings {
using namespace quicktex::s3tc;
using namespace quicktex::s3tc ;
using namespace quicktex::s3tc;
void InitBC5(py::module_ &s3tc) {
auto bc5 = s3tc.def_submodule("_bc5", "BC5 encoding/decoding module");
@ -42,14 +42,14 @@ void InitBC5(py::module_ &s3tc) {
py::class_<BC5Encoder> bc5_encoder(bc5, "BC5Encoder", block_encoder);
bc5_encoder.def(py::init<uint8_t, uint8_t>(), py::arg("chan0") = 0, py::arg("chan1") = 1);
bc5_encoder.def_property("channels", &BC5Encoder::GetChannels, &BC5Encoder::SetChannels);
bc5_encoder.def_property_readonly("channels", &BC5Encoder::GetChannels);
bc5_encoder.def_property_readonly("bc4_decoders", &BC5Encoder::GetBC4Encoders);
// BC5Decoder
py::class_<BC5Decoder> bc5_decoder(bc5, "BC5Decoder", block_decoder);
bc5_decoder.def(py::init<uint8_t, uint8_t>(), py::arg("chan0") = 0, py::arg("chan1") = 1);
bc5_decoder.def_property("channels", &BC5Decoder::GetChannels, &BC5Decoder::SetChannels);
bc5_decoder.def_property_readonly("channels", &BC5Decoder::GetChannels);
bc5_decoder.def_property_readonly("bc4_decoders", &BC5Decoder::GetBC4Decoders);
}
} // namespace quicktex::bindings