bkaradzic / bimg

Image library.
BSD 2-Clause "Simplified" License
333 stars 271 forks source link

ASTC encoding #15

Closed andrewwillmott closed 6 years ago

andrewwillmott commented 6 years ago

This PR adds ASTC encoding support via -t astc4x4 etc. There's also #ifdef'd support for ASTC decoding in image.cpp, which, going by the in-file style of the existing decoders, is not really appropriate to be in the core lib, as it requires a significant amount of code from 3rdparty/astc. You might want to just exclude it, I was using it for testing, as there wasn't a clean way to inject it as part of image_decode (say).

The ASTC codec is originally from https://github.com/ARM-software/astc-encoder, I've modified it so it can be used in library form.

bkaradzic commented 6 years ago

There is some issue with VS build: referenced in function "class vtype4 __cdecl eigenvector(struct mat4,float)" (?eigenvector@@YA?AV?$vtype4@M@@Umat4@@M@

andrewwillmott commented 6 years ago

Yup, I forgot to re-apply the usual Windows compile fixes when updating to the latest astc-encoder that's now on github. 85e79c2 fixed some of it, 3bcf40f should be the final, famous last words.

bkaradzic commented 6 years ago

I disabled it for now until I have time to figure out decoding and 3rdparty dependencies.

andrewwillmott commented 6 years ago

Thanks. I was wondering about a decoder function hook that defaulted to the checkerboard, but could be overridden by texturec.

I'll try to remember tabs v spaces next time :)

bkaradzic commented 6 years ago

I'll try to remember tabs v spaces next time :)

Just install EditorConfig https://editorconfig.org/ for your favourite editor and you don't have to worry about it.