#pragma once
#include <cstdint>
#include <vector>

namespace bmp2tile
{

// Ported from bmp2tilecompressors' gfxcomp_1bppraw.cpp/gfxcomp_2bppraw.cpp
// ("1bpp raw (uncompressed) binary" / "2bpp raw (uncompressed) binary").
// Not compression at all -- each takes devkitSMS's standard 32-byte
// separated-bitplane tile format (PackTilePlanar's output: 8 rows, 4
// bitplane bytes per row) and keeps only the first 1 or 2 bitplanes of
// each row, discarding the rest. Useful for tiles that only actually
// need 2 (1bpp) or 4 (2bpp) colours -- e.g. text/UI graphics -- to avoid
// spending ROM space on always-zero bitplanes.
//
// Whichever bitplanes are dropped are simply gone: if the source image
// actually uses colours needing bit 1 (for 1bpp) or bits 2-3 (for 2bpp)
// of the palette index, that information is silently lost, exactly as in
// the reference -- making sure the source only uses that many colours is
// the caller's responsibility, the same way the GG palette mode expects
// you to have prepared the image correctly rather than validating it for
// you.
std::vector<uint8_t> CompressRaw1Bpp(const std::vector<uint8_t>& input);
std::vector<uint8_t> CompressRaw2Bpp(const std::vector<uint8_t>& input);

}  // namespace bmp2tile
