#include "basisu_comp.h"
#include "basisu_enc.h"
#include <unordered_set>
#include <atomic>
#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES
#include "basisu_miniz.h"
#include "basisu_opencl.h"
#if !BASISD_SUPPORT_KTX2
#error BASISD_SUPPORT_KTX2 must be enabled (set to 1).
#endif
#if BASISD_SUPPORT_KTX2_ZSTD
#include <zstd.h>
#endif
#define BASISU_DISABLE_KTX2_ALIGNMENT_WORKAROUND …
#define BASISU_DISABLE_KTX2_KEY_VALUES …
usingnamespacebuminiz;
#define BASISU_USE_STB_IMAGE_RESIZE_FOR_MIPMAP_GEN …
#define DEBUG_CROP_TEXTURE_TO_64x64 …
#define DEBUG_RESIZE_TEXTURE …
#define DEBUG_EXTRACT_SINGLE_BLOCK …
namespace basisu
{
basis_compressor::basis_compressor() : … { … }
basis_compressor::~basis_compressor()
{ … }
bool basis_compressor::init(const basis_compressor_params ¶ms)
{ … }
basis_compressor::error_code basis_compressor::process()
{ … }
basis_compressor::error_code basis_compressor::encode_slices_to_uastc()
{ … }
bool basis_compressor::generate_mipmaps(const image &img, basisu::vector<image> &mips, bool has_alpha)
{ … }
bool basis_compressor::read_source_images()
{ … }
bool basis_compressor::validate_texture_type_constraints()
{ … }
bool basis_compressor::extract_source_blocks()
{ … }
bool basis_compressor::process_frontend()
{ … }
bool basis_compressor::extract_frontend_texture_data()
{ … }
bool basis_compressor::process_backend()
{ … }
bool basis_compressor::create_basis_file_and_transcode()
{ … }
bool basis_compressor::write_output_files_and_compute_stats()
{ … }
bool basis_compressor::validate_ktx2_constraints()
{ … }
static uint8_t g_ktx2_etc1s_nonalpha_dfd[44] = …;
static uint8_t g_ktx2_etc1s_alpha_dfd[60] = …;
static uint8_t g_ktx2_uastc_nonalpha_dfd[44] = …;
static uint8_t g_ktx2_uastc_alpha_dfd[44] = …;
void basis_compressor::get_dfd(uint8_vec &dfd, const basist::ktx2_header &header)
{ … }
bool basis_compressor::create_ktx2_file()
{ … }
bool basis_parallel_compress(
uint32_t total_threads,
const basisu::vector<basis_compressor_params>& params_vec,
basisu::vector< parallel_results >& results_vec)
{ … }
void* basis_compress(
const basisu::vector<image>& source_images,
uint32_t flags_and_quality, float uastc_rdo_quality,
size_t* pSize,
image_stats* pStats)
{ … }
void* basis_compress(
const uint8_t* pImageRGBA, uint32_t width, uint32_t height, uint32_t pitch_in_pixels,
uint32_t flags_and_quality, float uastc_rdo_quality,
size_t* pSize,
image_stats* pStats)
{ … }
void basis_free_data(void* p)
{ … }
bool basis_benchmark_etc1s_opencl(bool* pOpenCL_failed)
{ … }
}