Closed MetLob closed 7 years ago
That's a huge contribution thanks! Sorry for the delay, I am quite busy these days, I will review the code as soon as possible (really interested to see how it works).
I have been reviewing it. Awesome job! I have some comments:
Saturate
instead of saturate
). There are a few that don't follow this convention.Yes. Ok. I will refactor of the code in a nearest time. Vector3 from my oldest math-core library and has Russian comments, and the Nvidia code grabbed from C++ source without refactoring.
Can I put the Vector3 class file to Ekona.Helper namespase? .
I think that Vector3 class should be in Ekona.Images
class so we can reuse it for future 3D model implementations. And don't worry about the Russian comments, I understand, Tinke has still some Spanish comments from old times that I should translate.
I pushed with refactoring of this.
Hi, I implemented compression of 4x4 texels. Medium quality, but not long time.
Example of this algorythm on photo-quality image:
Example of this algorythm on NDS (not-compressed Color256 8-bit indexed) image:
## Using
Ekona.Images.NitroTextureCompressor.Compress(byte[] bgra, uint width, uint height, bool boundaryApprox, bool onlyInterpolatedPalettes, out byte[] palette)
Where: bgra - original 32BPP data in ARGB format (first byte - B, G, R, A - last byte) width, height - size of original image boundaryApprox - using mask, which ignored inside pixels in 4x4 block, using only boundary pixels onlyInterpolatedPalettes - generates palettes only in 1 or 3 Nitro-texture-palette formats (see code of TEX0 in plugins)
WARNING If output palettes length / 4 > 0x3FFF then some pixels has invalid palette index.