Haio 0.2.X
Homebrew Asset IO/CDN
Loading...
Searching...
No Matches
Detect

Concepts

concept  Haio::Codecs::Detectable

Functions

template<>
bool Haio::Codecs::Detect< Format::DDS, Color::RGB565 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::DDS, Color::RGBA8888 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::GIF, Color::RGBA8888 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::GIF, Color::RGB888 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::JPEG, Color::YUV420 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::KTX, Color::ETC1 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::KTX, Color::RGB565 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::KTX, Color::RGBA8888 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::KTX2, Color::ETC1 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::KTX2, Color::RGB565 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::KTX2, Color::RGBA8888 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::PNG, Color::RGBA8888 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::PNG, Color::RGB888 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::PNG, Color::GRAY8 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::PPM, Color::RGB888 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::PPM, Color::GRAY8 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::PVR, Color::ETC1 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::PVR, Color::RGB565 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::PVR, Color::RGBA8888 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::ROM, Color::CHR_NES > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::TGA, Color::BGRA8888 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::TGA, Color::BGR888 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::TGA, Color::RGBA5551 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::TGA, Color::RGB555 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::TGA, Color::PALETTE > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::TGA, Color::GRAY8 > (Bytes data)
template<>
bool Haio::Codecs::Detect< Format::ZCIS, Color::RGBA8888 > (Bytes data)

Detailed Description

every container and colour pair this build can recognise. these are exactly the specialisations that satisfy Detectable, so a codec dropped from the build leaves this page and the concept together, while its format keeps its name in the enum.

Function Documentation

◆ Detect< Format::DDS, Color::RGB565 >()

template<>
bool Haio::Codecs::Detect< Format::DDS, Color::RGB565 > ( Bytes data)

Definition at line 40 of file detect.cpp.

◆ Detect< Format::DDS, Color::RGBA8888 >()

Definition at line 52 of file detect.cpp.

◆ Detect< Format::GIF, Color::RGB888 >()

template<>
bool Haio::Codecs::Detect< Format::GIF, Color::RGB888 > ( Bytes data)

GIF has a palette rather than an RGB colour type, but the decoder expands it directly to RGB888.

Definition at line 45 of file detect.cpp.

◆ Detect< Format::GIF, Color::RGBA8888 >()

Definition at line 31 of file detect.cpp.

◆ Detect< Format::JPEG, Color::YUV420 >()

start of image, then the first marker. every jpeg opens FF D8 FF whatever follows, be it a jfif header, an exif block or a bare quantisation table.

Todo
detect only: there is no jpeg decoder, so this answers "jpeg yuv420" and then Decode refuses. that refusal naming the format is the point, and it is what let describeForeignMagic go away.

Definition at line 22 of file detect.cpp.

◆ Detect< Format::KTX, Color::ETC1 >()

template<>
bool Haio::Codecs::Detect< Format::KTX, Color::ETC1 > ( Bytes data)

Definition at line 25 of file detect.cpp.

Here is the call graph for this function:

◆ Detect< Format::KTX, Color::RGB565 >()

template<>
bool Haio::Codecs::Detect< Format::KTX, Color::RGB565 > ( Bytes data)

Definition at line 37 of file detect.cpp.

Here is the call graph for this function:

◆ Detect< Format::KTX, Color::RGBA8888 >()

Definition at line 49 of file detect.cpp.

Here is the call graph for this function:

◆ Detect< Format::KTX2, Color::ETC1 >()

template<>
bool Haio::Codecs::Detect< Format::KTX2, Color::ETC1 > ( Bytes data)

Definition at line 25 of file detect.cpp.

Here is the call graph for this function:

◆ Detect< Format::KTX2, Color::RGB565 >()

Definition at line 37 of file detect.cpp.

Here is the call graph for this function:

◆ Detect< Format::KTX2, Color::RGBA8888 >()

Definition at line 49 of file detect.cpp.

Here is the call graph for this function:

◆ Detect< Format::PNG, Color::GRAY8 >()

template<>
bool Haio::Codecs::Detect< Format::PNG, Color::GRAY8 > ( Bytes data)

recognised on purpose with no decoder behind it: the error names the format.

Todo
palette (colour type 3) and gray+alpha (type 4) are not recognised at all, because neither has a Color to name it. before this refactor wuffs expanded both to rgba and they simply worked, so this is a regression until Color grows a PALETTE8 and a GRAY_ALPHA – and palette drags a colour table along with it.

Definition at line 61 of file detect.cpp.

◆ Detect< Format::PNG, Color::RGB888 >()

template<>
bool Haio::Codecs::Detect< Format::PNG, Color::RGB888 > ( Bytes data)

Definition at line 43 of file detect.cpp.

◆ Detect< Format::PNG, Color::RGBA8888 >()

Definition at line 33 of file detect.cpp.

◆ Detect< Format::PPM, Color::GRAY8 >()

template<>
bool Haio::Codecs::Detect< Format::PPM, Color::GRAY8 > ( Bytes data)

the rest of the family is one sample a pixel: P1 and P4 bitmaps, P2 and P5 graymaps. they answer as grey so the decoder that gets them is the right one.

Definition at line 39 of file detect.cpp.

◆ Detect< Format::PPM, Color::RGB888 >()

template<>
bool Haio::Codecs::Detect< Format::PPM, Color::RGB888 > ( Bytes data)

P3 is ascii pixmap and P6 binary pixmap: three samples a pixel

Definition at line 25 of file detect.cpp.

◆ Detect< Format::PVR, Color::ETC1 >()

template<>
bool Haio::Codecs::Detect< Format::PVR, Color::ETC1 > ( Bytes data)

Definition at line 25 of file detect.cpp.

Here is the call graph for this function:

◆ Detect< Format::PVR, Color::RGB565 >()

template<>
bool Haio::Codecs::Detect< Format::PVR, Color::RGB565 > ( Bytes data)

Definition at line 37 of file detect.cpp.

Here is the call graph for this function:

◆ Detect< Format::PVR, Color::RGBA8888 >()

Definition at line 49 of file detect.cpp.

Here is the call graph for this function:

◆ Detect< Format::ROM, Color::CHR_NES >()

the ines header, which every nes rom on the internet starts with

Definition at line 15 of file detect.cpp.

◆ Detect< Format::TGA, Color::BGR888 >()

template<>
bool Haio::Codecs::Detect< Format::TGA, Color::BGR888 > ( Bytes data)

twenty four bits a pixel, blue first

Definition at line 44 of file detect.cpp.

◆ Detect< Format::TGA, Color::BGRA8888 >()

thirty two bits a pixel, blue first, with the last byte an alpha

Definition at line 33 of file detect.cpp.

◆ Detect< Format::TGA, Color::GRAY8 >()

template<>
bool Haio::Codecs::Detect< Format::TGA, Color::GRAY8 > ( Bytes data)

one byte a pixel and no colour at all

Definition at line 92 of file detect.cpp.

◆ Detect< Format::TGA, Color::PALETTE >()

an index a pixel and the colours it points at, which is the format's own palette

Definition at line 81 of file detect.cpp.

◆ Detect< Format::TGA, Color::RGB555 >()

template<>
bool Haio::Codecs::Detect< Format::TGA, Color::RGB555 > ( Bytes data)

the same sixteen bits with nobody claiming the top one

Definition at line 70 of file detect.cpp.

◆ Detect< Format::TGA, Color::RGBA5551 >()

sixteen bits a pixel whose top bit the file says is an alpha. the bytes are the same as the pair below; the attribute bits in the descriptor are the difference, and they are a claim the writer made rather than anything visible in the pixels.

Definition at line 59 of file detect.cpp.

◆ Detect< Format::ZCIS, Color::RGBA8888 >()

Todo
zcis has no decoder at all, so a .zcis round trip is impossible. it also cannot say which colour is inside without reading the member names.

Definition at line 18 of file detect.cpp.

Here is the call graph for this function: