Giter VIP home page Giter VIP logo

Comments (4)

solidpixel avatar solidpixel commented on August 26, 2024

No, this isn't possible via something simple like a header look up. The color endpoint format may vary on a per-block basis in the compressed data, so to determine this you'd have to read the entire file and decode all blocks.

from astc-encoder.

gearvrf avatar gearvrf commented on August 26, 2024

Yeah, parsing all the endpoints is what i ended up doing. Slows down loading of the file, but then i at least have the information i need. please keep this need in mind when designing future iterations of this format or other formats in the future.

from astc-encoder.

drummerchin avatar drummerchin commented on August 26, 2024

use KTX container format instead. here's astc header:

typedef struct __attribute__((packed))
{
    uint8_t magic[4];
    uint8_t blockDimX;
    uint8_t blockDimY;
    uint8_t blockDimZ;
    uint8_t xSize[3];
    uint8_t ySize[3];
    uint8_t zSize[3];
} astc_header;

and here's ktx header:

typedef struct __attribute__((packed))
{
    uint8_t identifier[12];
    uint32_t endianness;
    uint32_t glType;
    uint32_t glTypeSize;
    uint32_t glFormat;
    uint32_t glInternalFormat;
    uint32_t glBaseInternalFormat;
    uint32_t pixelWidth;
    uint32_t pixelHeight;
    uint32_t pixelDepth;
    uint32_t arrayElementCount;
    uint32_t faceCount;
    uint32_t mipmapLevelCount;
    uint32_t keyValueDataLength;
} ktx_header;

Note, astc is an encoding, also is a file format.
KTX is a container format it can contains various of pixel format such as astc.
you can use ktx container to store astc content. original format is in it's header (glFormat , glInternalFormat , glBaseInternalFormat )

from astc-encoder.

solidpixel avatar solidpixel commented on August 26, 2024

Closing - original question was answered.

from astc-encoder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.