texturec: Added alpha to coverage mip map generation.

This commit is contained in:
Branimir Karadžić
2017-05-22 17:29:33 -07:00
parent a495171fda
commit 612eebbeeb
5 changed files with 249 additions and 41 deletions

View File

@@ -9,7 +9,7 @@
#include <stdint.h> // uint32_t
#include <stdlib.h> // NULL
#define BIMG_API_VERSION UINT32_C(2)
#define BIMG_API_VERSION UINT32_C(3)
namespace bx
{
@@ -335,6 +335,12 @@ namespace bimg
, const void* _src
);
///
PackFn getPack(TextureFormat::Enum _format);
///
UnpackFn getUnpack(TextureFormat::Enum _format);
///
bool imageConvert(
TextureFormat::Enum _dstFormat
@@ -408,7 +414,7 @@ namespace bimg
);
///
void imageWriteTga(
int32_t imageWriteTga(
bx::WriterI* _writer
, uint32_t _width
, uint32_t _height
@@ -420,7 +426,7 @@ namespace bimg
);
///
void imageWriteKtx(
int32_t imageWriteKtx(
bx::WriterI* _writer
, TextureFormat::Enum _format
, bool _cubeMap
@@ -433,7 +439,7 @@ namespace bimg
);
///
void imageWriteKtx(
int32_t imageWriteKtx(
bx::WriterI* _writer
, ImageContainer& _imageContainer
, const void* _data

View File

@@ -79,6 +79,28 @@ namespace bimg
, const ImageContainer* _src
);
///
float imageAlphaTestCoverage(
TextureFormat::Enum _format
, uint32_t _width
, uint32_t _height
, uint32_t _srcPitch
, const void* _src
, float _alphaRef
, float _scale = 1.0f
);
///
void imageScaleAlphaToCoverage(
TextureFormat::Enum _format
, uint32_t _width
, uint32_t _height
, uint32_t _srcPitch
, void* _src
, float _coverage
, float _alphaRef
);
} // namespace bimg
#endif // BIMG_ENCODE_H_HEADER_GUARD