| 69 | } |
| 70 | |
| 71 | bool basis_compressor::init(const basis_compressor_params ¶ms) |
| 72 | { |
| 73 | debug_printf("basis_compressor::init\n"); |
| 74 | |
| 75 | if (!g_library_initialized) |
| 76 | { |
| 77 | error_printf("basis_compressor::init: basisu_encoder_init() MUST be called before using any encoder functionality!\n"); |
| 78 | return false; |
| 79 | } |
| 80 | |
| 81 | if (!params.m_pJob_pool) |
| 82 | { |
| 83 | error_printf("basis_compressor::init: A non-null job_pool pointer must be specified\n"); |
| 84 | return false; |
| 85 | } |
| 86 | |
| 87 | m_params = params; |
| 88 | |
| 89 | if (m_params.m_debug) |
| 90 | { |
| 91 | debug_printf("basis_compressor::init:\n"); |
| 92 | |
| 93 | #define PRINT_BOOL_VALUE(v) debug_printf("%s: %u %u\n", BASISU_STRINGIZE2(v), static_cast<int>(m_params.v), m_params.v.was_changed()); |
| 94 | #define PRINT_INT_VALUE(v) debug_printf("%s: %i %u\n", BASISU_STRINGIZE2(v), static_cast<int>(m_params.v), m_params.v.was_changed()); |
| 95 | #define PRINT_UINT_VALUE(v) debug_printf("%s: %u %u\n", BASISU_STRINGIZE2(v), static_cast<uint32_t>(m_params.v), m_params.v.was_changed()); |
| 96 | #define PRINT_FLOAT_VALUE(v) debug_printf("%s: %f %u\n", BASISU_STRINGIZE2(v), static_cast<float>(m_params.v), m_params.v.was_changed()); |
| 97 | |
| 98 | debug_printf("Source images: %u, source filenames: %u, source alpha filenames: %i, Source mipmap images: %u\n", |
| 99 | m_params.m_source_images.size(), m_params.m_source_filenames.size(), m_params.m_source_alpha_filenames.size(), m_params.m_source_mipmap_images.size()); |
| 100 | |
| 101 | if (m_params.m_source_mipmap_images.size()) |
| 102 | { |
| 103 | debug_printf("m_source_mipmap_images array sizes:\n"); |
| 104 | for (uint32_t i = 0; i < m_params.m_source_mipmap_images.size(); i++) |
| 105 | debug_printf("%u ", m_params.m_source_mipmap_images[i].size()); |
| 106 | debug_printf("\n"); |
| 107 | } |
| 108 | |
| 109 | PRINT_BOOL_VALUE(m_uastc); |
| 110 | PRINT_BOOL_VALUE(m_use_opencl); |
| 111 | PRINT_BOOL_VALUE(m_y_flip); |
| 112 | PRINT_BOOL_VALUE(m_debug); |
| 113 | PRINT_BOOL_VALUE(m_validate_etc1s); |
| 114 | PRINT_BOOL_VALUE(m_debug_images); |
| 115 | PRINT_INT_VALUE(m_compression_level); |
| 116 | PRINT_BOOL_VALUE(m_perceptual); |
| 117 | PRINT_BOOL_VALUE(m_no_endpoint_rdo); |
| 118 | PRINT_BOOL_VALUE(m_no_selector_rdo); |
| 119 | PRINT_BOOL_VALUE(m_read_source_images); |
| 120 | PRINT_BOOL_VALUE(m_write_output_basis_files); |
| 121 | PRINT_BOOL_VALUE(m_compute_stats); |
| 122 | PRINT_BOOL_VALUE(m_check_for_alpha); |
| 123 | PRINT_BOOL_VALUE(m_force_alpha); |
| 124 | debug_printf("swizzle: %d,%d,%d,%d\n", |
| 125 | m_params.m_swizzle[0], |
| 126 | m_params.m_swizzle[1], |
| 127 | m_params.m_swizzle[2], |
| 128 | m_params.m_swizzle[3]); |
nothing calls this directly
no test coverage detected