/* Quicktex Texture Compression Library Copyright (C) 2021 Andrew Cassidy Partially derived from rgbcx.h written by Richard Geldreich and licenced under the public domain This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #pragma once #include #include "../bc4/BC4Block.h" namespace quicktex::s3tc { class alignas(8) BC5Block { public: static constexpr int Width = 4; static constexpr int Height = 4; using BlockPair = std::pair; BC4Block chan0_block; BC4Block chan1_block; constexpr BC5Block() : chan0_block(BC4Block()), chan1_block(BC4Block()) { static_assert(sizeof(BC5Block) == 16); static_assert(sizeof(std::array) == 16 * 10); static_assert(alignof(BC5Block) >= 8); } BC5Block(const BC4Block &chan0, const BC4Block &chan1) { chan0_block = chan0; chan1_block = chan1; } BlockPair GetBlocks() const { return BlockPair(chan0_block, chan1_block); } void SetBlocks(const BlockPair &pair) { chan0_block = pair.first; chan1_block = pair.second; } bool operator==(const BC5Block &other) const = default; bool operator!=(const BC5Block &other) const = default; }; } // namespace quicktex::s3tc