Skip to content

Commit 049faf7

Browse files
c: bind up vtfpp
1 parent 27e53f0 commit 049faf7

File tree

23 files changed

+1458
-10
lines changed

23 files changed

+1458
-10
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ add_sourcepp_library(steampp C PYTHON ) # sourcepp::steampp
209209
add_sourcepp_library(toolpp PYTHON ) # sourcepp::toolpp
210210
add_sourcepp_library(vcryptpp C CSHARP PYTHON ) # sourcepp::vcryptpp
211211
add_sourcepp_library(vpkpp C CSHARP NO_TEST ) # sourcepp::vpkpp
212-
add_sourcepp_library(vtfpp PYTHON BENCH) # sourcepp::vtfpp
212+
add_sourcepp_library(vtfpp C PYTHON BENCH) # sourcepp::vtfpp
213213

214214

215215
# Tests, part 2

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
250250
<td><a href="https://wiki.mozilla.org/APNG_Specification">APNG</a></td>
251251
<td align="center">✅</td>
252252
<td align="center">❌</td>
253-
<td rowspan="31" align="center">Python</td>
253+
<td rowspan="31" align="center">C<br>Python</td>
254254
</tr>
255255
<tr><!-- empty row to disable github striped bg color --></tr>
256256
<tr>

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
221221
<td><a href="https://wiki.mozilla.org/APNG_Specification">APNG</a></td>
222222
<td align="center">✅</td>
223223
<td align="center">❌</td>
224-
<td rowspan="16" align="center">Python</td>
224+
<td rowspan="16" align="center">C<br>Python</td>
225225
</tr>
226226
<tr>
227227
<td><a href="https://en.wikipedia.org/wiki/BMP_file_format">BMP</a></td>

include/vtfpp/VTF.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@ class VTF {
135135
FLAG_HINT_DXT5 = 1 << 5,
136136
FLAG_PWL_CORRECTED = 1 << 6,
137137
FLAG_NORMAL = 1 << 7,
138-
FLAG_NO_MIP = 1 << 8, // Applied at VTF bake time
139-
FLAG_NO_LOD = 1 << 9, // Applied at VTF bake time
138+
FLAG_NO_MIP = 1 << 8, // Controlled by mip count
139+
FLAG_NO_LOD = 1 << 9,
140140
FLAG_LOAD_ALL_MIPS = 1 << 10,
141141
FLAG_PROCEDURAL = 1 << 11,
142-
FLAG_ONE_BIT_ALPHA = 1 << 12, // Applied at VTF bake time
143-
FLAG_MULTI_BIT_ALPHA = 1 << 13, // Applied at VTF bake time
144-
FLAG_ENVMAP = 1 << 14, // Applied at VTF bake time
142+
FLAG_ONE_BIT_ALPHA = 1 << 12,
143+
FLAG_MULTI_BIT_ALPHA = 1 << 13,
144+
FLAG_ENVMAP = 1 << 14, // Controlled by face count
145145
FLAG_RENDERTARGET = 1 << 15,
146146
FLAG_DEPTH_RENDERTARGET = 1 << 16,
147147
FLAG_NO_DEBUG_OVERRIDE = 1 << 17,

lang/c/include/sourceppc/Buffer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ typedef struct {
1313

1414
#define SOURCEPP_BUFFER_INVALID (sourcepp_buffer_t{.size = -1, .data = NULL})
1515

16+
// Aliases
17+
typedef sourcepp_buffer_t sourcepp_buffer_uint32_t;
18+
typedef sourcepp_buffer_t sourcepp_buffer_uint64_t;
19+
1620
#ifdef __cplusplus
1721
} // extern "C"
1822
#endif

lang/c/include/vtfppc/Convert.hpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#pragma once
2+
3+
#include "PPL.h"
4+
#include "SHT.h"
5+
#include "TTX.h"
6+
#include "VTF.h"
7+
8+
/*
9+
* This is a header designed to be included in C++ source code.
10+
* It should not be included in applications using any C wrapper libraries!
11+
*/
12+
#ifndef __cplusplus
13+
#error "This header can only be used in C++!"
14+
#endif
15+
16+
namespace vtfpp {
17+
18+
class PPL;
19+
class SHT;
20+
class TTX;
21+
class VTF;
22+
23+
} // namespace vpkpp
24+
25+
namespace Convert {
26+
27+
vtfpp::PPL* ppl(vtfpp_ppl_handle_t handle);
28+
29+
vtfpp::SHT* sht(vtfpp_sht_handle_t handle);
30+
31+
vtfpp::TTX* ttx(vtfpp_ttx_handle_t handle);
32+
33+
vtfpp::VTF* vtf(vtfpp_vtf_handle_t handle);
34+
35+
} // namespace Convert
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#pragma once
2+
3+
#include <sourceppc/API.h>
4+
#include <sourceppc/Buffer.h>
5+
6+
#include "ImageFormats.h"
7+
8+
#ifdef __cplusplus
9+
extern "C" {
10+
#endif
11+
12+
// Skipping vtfpp::ImagePixel, not super useful
13+
14+
typedef enum {
15+
VTFPP_IMAGE_CONVERSION_FILE_FORMAT_DEFAULT,
16+
VTFPP_IMAGE_CONVERSION_FILE_FORMAT_PNG,
17+
VTFPP_IMAGE_CONVERSION_FILE_FORMAT_JPEG,
18+
VTFPP_IMAGE_CONVERSION_FILE_FORMAT_BMP,
19+
VTFPP_IMAGE_CONVERSION_FILE_FORMAT_TGA,
20+
VTFPP_IMAGE_CONVERSION_FILE_FORMAT_HDR,
21+
VTFPP_IMAGE_CONVERSION_FILE_FORMAT_EXR,
22+
} vtfpp_image_conversion_file_format_e;
23+
24+
typedef enum {
25+
VTFPP_IMAGE_CONVERSION_RESIZE_EDGE_CLAMP,
26+
VTFPP_IMAGE_CONVERSION_RESIZE_EDGE_REFLECT,
27+
VTFPP_IMAGE_CONVERSION_RESIZE_EDGE_WRAP,
28+
VTFPP_IMAGE_CONVERSION_RESIZE_EDGE_ZERO,
29+
} vtfpp_image_conversion_resize_edge_e;
30+
31+
typedef enum {
32+
VTFPP_IMAGE_CONVERSION_RESIZE_FILTER_DEFAULT,
33+
VTFPP_IMAGE_CONVERSION_RESIZE_FILTER_BOX,
34+
VTFPP_IMAGE_CONVERSION_RESIZE_FILTER_BILINEAR,
35+
VTFPP_IMAGE_CONVERSION_RESIZE_FILTER_CUBIC_BSPLINE,
36+
VTFPP_IMAGE_CONVERSION_RESIZE_FILTER_CATMULLROM,
37+
VTFPP_IMAGE_CONVERSION_RESIZE_FILTER_MITCHELL,
38+
//VTFPP_IMAGE_CONVERSION_RESIZE_FILTER_POINT_SAMPLE,
39+
} vtfpp_image_conversion_resize_filter_e;
40+
41+
typedef enum {
42+
VTFPP_IMAGE_CONVERSION_RESIZE_METHOD_NONE,
43+
VTFPP_IMAGE_CONVERSION_RESIZE_METHOD_POWER_OF_TWO_BIGGER,
44+
VTFPP_IMAGE_CONVERSION_RESIZE_METHOD_POWER_OF_TWO_SMALLER,
45+
VTFPP_IMAGE_CONVERSION_RESIZE_METHOD_POWER_OF_TWO_NEAREST,
46+
} vtfpp_image_conversion_resize_method_e;
47+
48+
#ifdef __cplusplus
49+
} // extern "C"
50+
#endif
51+
52+
// REQUIRES MANUAL FREE: sourcepp_buffer_free
53+
SOURCEPP_API sourcepp_buffer_t vtfpp_image_conversion_convert_image_data_to_format(const unsigned char* buffer, size_t bufferLen, vtfpp_image_format_e oldFormat, vtfpp_image_format_e newFormat, uint16_t width, uint16_t height);
54+
55+
// REQUIRES MANUAL FREE: sourcepp_buffer_free
56+
SOURCEPP_API sourcepp_buffer_t vtfpp_convert_several_image_data_to_format(const unsigned char* buffer, size_t bufferLen, vtfpp_image_format_e oldFormat, vtfpp_image_format_e newFormat, uint8_t mipCount, uint16_t frameCount, uint16_t faceCount, uint16_t width, uint16_t height, uint16_t sliceCount);
57+
58+
// REQUIRES MANUAL FREE: sourcepp_buffer_free
59+
SOURCEPP_API sourcepp_buffer_t vtfpp_image_conversion_convert_hdri_to_cubemap(const unsigned char* buffer, size_t bufferLen, vtfpp_image_format_e format, uint16_t width, uint16_t height);
60+
61+
// REQUIRES MANUAL FREE: sourcepp_buffer_free
62+
SOURCEPP_API sourcepp_buffer_t vtfpp_image_conversion_convert_hdri_to_cubemap_ex(const unsigned char* buffer, size_t bufferLen, vtfpp_image_format_e format, uint16_t width, uint16_t height, uint16_t resolution, int bilinear);
63+
64+
SOURCEPP_API vtfpp_image_conversion_file_format_e vtfpp_image_conversion_get_default_file_format_for_image_format(vtfpp_image_format_e format);
65+
66+
// REQUIRES MANUAL FREE: sourcepp_buffer_free
67+
SOURCEPP_API sourcepp_buffer_t vtfpp_image_conversion_convert_image_data_to_file(const unsigned char* buffer, size_t bufferLen, vtfpp_image_format_e format, uint16_t width, uint16_t height, vtfpp_image_conversion_file_format_e fileFormat);
68+
69+
// REQUIRES MANUAL FREE: sourcepp_buffer_free
70+
SOURCEPP_API sourcepp_buffer_t vtfpp_image_conversion_convert_file_to_image_data(const unsigned char* buffer, size_t bufferLen, vtfpp_image_format_e* format, int* width, int* height, int* frameCount);
71+
72+
SOURCEPP_API uint16_t vtfpp_image_conversion_get_resized_dim(uint16_t n, vtfpp_image_conversion_resize_method_e method);
73+
74+
SOURCEPP_API void vtfpp_image_conversion_set_resized_dims(uint16_t* width, vtfpp_image_conversion_resize_method_e widthResize, uint16_t* height, vtfpp_image_conversion_resize_method_e heightResize);
75+
76+
// REQUIRES MANUAL FREE: sourcepp_buffer_free
77+
SOURCEPP_API sourcepp_buffer_t vtfpp_image_conversion_resize_image_data(const unsigned char* buffer, size_t bufferLen, vtfpp_image_format_e format, uint16_t width, uint16_t newWidth, uint16_t height, uint16_t newHeight, int srgb, vtfpp_image_conversion_resize_filter_e filter, vtfpp_image_conversion_resize_edge_e edge);
78+
79+
// REQUIRES MANUAL FREE: sourcepp_buffer_free
80+
SOURCEPP_API sourcepp_buffer_t vtfpp_image_conversion_resize_image_data_strict(const unsigned char* buffer, size_t bufferLen, vtfpp_image_format_e format, uint16_t width, uint16_t newWidth, uint16_t* widthOut, vtfpp_image_conversion_resize_method_e widthResize, uint16_t height, uint16_t newHeight, uint16_t* heightOut, vtfpp_image_conversion_resize_method_e heightResize, bool srgb, vtfpp_image_conversion_resize_filter_e filter, vtfpp_image_conversion_resize_edge_e edge);
81+
82+
// REQUIRES MANUAL FREE: sourcepp_buffer_free
83+
SOURCEPP_API sourcepp_buffer_t vtfpp_image_conversion_crop_image_data(const unsigned char* buffer, size_t bufferLen, vtfpp_image_format_e format, uint16_t width, uint16_t newWidth, uint16_t xOffset, uint16_t height, uint16_t newHeight, uint16_t yOffset);
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
#pragma once
2+
3+
#include <sourceppc/API.h>
4+
#include <sourceppc/Buffer.h>
5+
6+
#ifdef __cplusplus
7+
extern "C" {
8+
#endif
9+
10+
typedef enum {
11+
VTFPP_IMAGE_FORMAT_RGBA8888 = 0,
12+
VTFPP_IMAGE_FORMAT_ABGR8888,
13+
VTFPP_IMAGE_FORMAT_RGB888,
14+
VTFPP_IMAGE_FORMAT_BGR888,
15+
VTFPP_IMAGE_FORMAT_RGB565,
16+
VTFPP_IMAGE_FORMAT_I8,
17+
VTFPP_IMAGE_FORMAT_IA88,
18+
VTFPP_IMAGE_FORMAT_P8,
19+
VTFPP_IMAGE_FORMAT_A8,
20+
VTFPP_IMAGE_FORMAT_RGB888_BLUESCREEN,
21+
VTFPP_IMAGE_FORMAT_BGR888_BLUESCREEN,
22+
VTFPP_IMAGE_FORMAT_ARGB8888,
23+
VTFPP_IMAGE_FORMAT_BGRA8888,
24+
VTFPP_IMAGE_FORMAT_DXT1,
25+
VTFPP_IMAGE_FORMAT_DXT3,
26+
VTFPP_IMAGE_FORMAT_DXT5,
27+
VTFPP_IMAGE_FORMAT_BGRX8888,
28+
VTFPP_IMAGE_FORMAT_BGR565,
29+
VTFPP_IMAGE_FORMAT_BGRX5551,
30+
VTFPP_IMAGE_FORMAT_BGRA4444,
31+
VTFPP_IMAGE_FORMAT_DXT1_ONE_BIT_ALPHA,
32+
VTFPP_IMAGE_FORMAT_BGRA5551,
33+
VTFPP_IMAGE_FORMAT_UV88,
34+
VTFPP_IMAGE_FORMAT_UVWQ8888,
35+
VTFPP_IMAGE_FORMAT_RGBA16161616F,
36+
VTFPP_IMAGE_FORMAT_RGBA16161616,
37+
VTFPP_IMAGE_FORMAT_UVLX8888,
38+
VTFPP_IMAGE_FORMAT_R32F,
39+
VTFPP_IMAGE_FORMAT_RGB323232F,
40+
VTFPP_IMAGE_FORMAT_RGBA32323232F,
41+
VTFPP_IMAGE_FORMAT_RG1616F,
42+
VTFPP_IMAGE_FORMAT_RG3232F,
43+
VTFPP_IMAGE_FORMAT_RGBX8888,
44+
VTFPP_IMAGE_FORMAT_EMPTY,
45+
VTFPP_IMAGE_FORMAT_ATI2N,
46+
VTFPP_IMAGE_FORMAT_ATI1N,
47+
VTFPP_IMAGE_FORMAT_RGBA1010102,
48+
VTFPP_IMAGE_FORMAT_BGRA1010102,
49+
VTFPP_IMAGE_FORMAT_R16F,
50+
51+
VTFPP_IMAGE_FORMAT_CONSOLE_BGRX8888_LINEAR = 42,
52+
VTFPP_IMAGE_FORMAT_CONSOLE_RGBA8888_LINEAR,
53+
VTFPP_IMAGE_FORMAT_CONSOLE_ABGR8888_LINEAR,
54+
VTFPP_IMAGE_FORMAT_CONSOLE_ARGB8888_LINEAR,
55+
VTFPP_IMAGE_FORMAT_CONSOLE_BGRA8888_LINEAR,
56+
VTFPP_IMAGE_FORMAT_CONSOLE_RGB888_LINEAR,
57+
VTFPP_IMAGE_FORMAT_CONSOLE_BGR888_LINEAR,
58+
VTFPP_IMAGE_FORMAT_CONSOLE_BGRX5551_LINEAR,
59+
VTFPP_IMAGE_FORMAT_CONSOLE_I8_LINEAR,
60+
VTFPP_IMAGE_FORMAT_CONSOLE_RGBA16161616_LINEAR,
61+
VTFPP_IMAGE_FORMAT_CONSOLE_BGRX8888_LE,
62+
VTFPP_IMAGE_FORMAT_CONSOLE_BGRA8888_LE,
63+
64+
VTFPP_IMAGE_FORMAT_R8 = 69,
65+
VTFPP_IMAGE_FORMAT_BC7,
66+
VTFPP_IMAGE_FORMAT_BC6H,
67+
} vtfpp_image_format_e;
68+
69+
#ifdef __cplusplus
70+
} // extern "C"
71+
#endif
72+
73+
SOURCEPP_API int8_t vtfpp_image_format_details_red(vtfpp_image_format_e format);
74+
75+
SOURCEPP_API int8_t vtfpp_image_format_details_decompressed_red(vtfpp_image_format_e format);
76+
77+
SOURCEPP_API int8_t vtfpp_image_format_details_green(vtfpp_image_format_e format);
78+
79+
SOURCEPP_API int8_t vtfpp_image_format_details_decompressed_green(vtfpp_image_format_e format);
80+
81+
SOURCEPP_API int8_t vtfpp_image_format_details_blue(vtfpp_image_format_e format);
82+
83+
SOURCEPP_API int8_t vtfpp_image_format_details_decompressed_blue(vtfpp_image_format_e format);
84+
85+
SOURCEPP_API int8_t vtfpp_image_format_details_alpha(vtfpp_image_format_e format);
86+
87+
SOURCEPP_API int8_t vtfpp_image_format_details_decompressed_alpha(vtfpp_image_format_e format);
88+
89+
SOURCEPP_API int8_t vtfpp_image_format_details_bpp(vtfpp_image_format_e format);
90+
91+
SOURCEPP_API vtfpp_image_format_e vtfpp_image_format_details_container_format(vtfpp_image_format_e format);
92+
93+
SOURCEPP_API int vtfpp_image_format_details_large(vtfpp_image_format_e format);
94+
95+
SOURCEPP_API int vtfpp_image_format_details_decimal(vtfpp_image_format_e format);
96+
97+
SOURCEPP_API int vtfpp_image_format_details_compressed(vtfpp_image_format_e format);
98+
99+
SOURCEPP_API int vtfpp_image_format_details_transparent(vtfpp_image_format_e format);
100+
101+
SOURCEPP_API int vtfpp_image_format_details_opaque(vtfpp_image_format_e format);
102+
103+
SOURCEPP_API uint32_t vtfpp_image_dimensions_get_mip_dim(uint8_t mip, uint16_t dim);
104+
105+
SOURCEPP_API uint8_t vtfpp_image_dimensions_get_recommended_mip_count_for_dim(vtfpp_image_format_e format, uint16_t width, uint16_t height);
106+
107+
SOURCEPP_API uint8_t vtfpp_image_dimensions_get_actual_mip_count_for_dims_on_console(uint16_t width, uint16_t height);
108+
109+
SOURCEPP_API uint32_t vtfpp_image_format_details_get_data_length(vtfpp_image_format_e format, uint16_t width, uint16_t height, uint16_t sliceCount);
110+
111+
SOURCEPP_API uint32_t vtfpp_image_format_details_get_data_length_ex(vtfpp_image_format_e format, uint8_t mipCount, uint16_t frameCount, uint8_t faceCount, uint16_t width, uint16_t height, uint16_t sliceCount);
112+
113+
SOURCEPP_API int vtfpp_image_format_details_get_data_position(uint32_t* offset, uint32_t* length, vtfpp_image_format_e format, uint8_t mip, uint8_t mipCount, uint16_t frame, uint16_t frameCount, uint8_t face, uint8_t faceCount, uint16_t width, uint16_t height, uint16_t slice, uint16_t sliceCount);

lang/c/include/vtfppc/PPL.h

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#pragma once
2+
3+
#include <sourceppc/API.h>
4+
#include <sourceppc/Buffer.h>
5+
6+
#include "ImageConversion.h"
7+
8+
#ifdef __cplusplus
9+
extern "C" {
10+
#endif
11+
12+
typedef void* vtfpp_ppl_handle_t;
13+
14+
#ifdef __cplusplus
15+
} // extern "C"
16+
#endif
17+
18+
// REQUIRES MANUAL FREE: vtfpp_ppl_close
19+
SOURCEPP_API vtfpp_ppl_handle_t vtfpp_ppl_create(uint32_t modelChecksum);
20+
21+
// REQUIRES MANUAL FREE: vtfpp_ppl_close
22+
SOURCEPP_API vtfpp_ppl_handle_t vtfpp_ppl_create_with_options(uint32_t modelChecksum, vtfpp_image_format_e format, uint32_t version);
23+
24+
// REQUIRES MANUAL FREE: vtfpp_ppl_close
25+
SOURCEPP_API vtfpp_ppl_handle_t vtfpp_ppl_open_from_mem(const unsigned char* buffer, size_t bufferLen);
26+
27+
// REQUIRES MANUAL FREE: vtfpp_ppl_close
28+
SOURCEPP_API vtfpp_ppl_handle_t vtfpp_ppl_open_from_file(const char* pplPath);
29+
30+
SOURCEPP_API int vtfpp_ppl_is_valid(vtfpp_ppl_handle_t handle);
31+
32+
SOURCEPP_API uint32_t vtfpp_ppl_get_version(vtfpp_ppl_handle_t handle);
33+
34+
SOURCEPP_API void vtfpp_ppl_set_version(vtfpp_ppl_handle_t handle, uint32_t version);
35+
36+
SOURCEPP_API uint32_t vtfpp_ppl_get_model_checksum(vtfpp_ppl_handle_t handle);
37+
38+
SOURCEPP_API void vtfpp_ppl_set_model_checksum(vtfpp_ppl_handle_t handle, uint32_t modelChecksum);
39+
40+
SOURCEPP_API vtfpp_image_format_e vtfpp_ppl_get_format(vtfpp_ppl_handle_t handle);
41+
42+
SOURCEPP_API void vtfpp_ppl_set_format(vtfpp_ppl_handle_t handle, vtfpp_image_format_e format);
43+
44+
SOURCEPP_API int vtfpp_ppl_has_image_for_lod(vtfpp_ppl_handle_t handle, uint32_t lod);
45+
46+
// REQUIRES MANUAL FREE: sourcepp_buffer_free
47+
SOURCEPP_API sourcepp_buffer_uint32_t vtfpp_ppl_get_image_lods(vtfpp_ppl_handle_t handle);
48+
49+
// REQUIRES MANUAL FREE: sourcepp_buffer_free
50+
SOURCEPP_API sourcepp_buffer_t vtfpp_ppl_get_image_raw(vtfpp_ppl_handle_t handle, uint32_t* width, uint32_t* height, uint32_t lod);
51+
52+
// REQUIRES MANUAL FREE: sourcepp_buffer_free
53+
SOURCEPP_API sourcepp_buffer_t vtfpp_ppl_get_image_as(vtfpp_ppl_handle_t handle, uint32_t* width, uint32_t* height, vtfpp_image_format_e format, uint32_t lod);
54+
55+
// REQUIRES MANUAL FREE: sourcepp_buffer_free
56+
SOURCEPP_API sourcepp_buffer_t vtfpp_ppl_get_image_as_rgb888(vtfpp_ppl_handle_t handle, uint32_t* width, uint32_t* height, uint32_t lod);
57+
58+
SOURCEPP_API int vtfpp_ppl_set_image_from_file(vtfpp_ppl_handle_t handle, const char* imagePath, uint32_t lod);
59+
60+
SOURCEPP_API int vtfpp_ppl_set_image_from_file_with_options(vtfpp_ppl_handle_t handle, const char* imagePath, uint32_t resizedWidth, uint32_t resizedHeight, uint32_t lod, vtfpp_image_conversion_resize_filter_e filter);
61+
62+
SOURCEPP_API int vtfpp_ppl_set_image_from_mem(vtfpp_ppl_handle_t handle, const unsigned char* buffer, size_t bufferLen, vtfpp_image_format_e format, uint32_t width, uint32_t height, uint32_t lod);
63+
64+
SOURCEPP_API int vtfpp_ppl_set_image_from_mem_with_options(vtfpp_ppl_handle_t handle, const unsigned char* buffer, size_t bufferLen, vtfpp_image_format_e format, uint32_t width, uint32_t height, uint32_t resizedWidth, uint32_t resizedHeight, uint32_t lod, vtfpp_image_conversion_resize_filter_e filter);
65+
66+
// REQUIRES MANUAL FREE: sourcepp_buffer_free
67+
SOURCEPP_API sourcepp_buffer_t vtfpp_ppl_save_image_to_file(vtfpp_ppl_handle_t handle, const char* imagePath, uint32_t lod, vtfpp_image_conversion_file_format_e fileFormat);
68+
69+
// REQUIRES MANUAL FREE: sourcepp_buffer_free
70+
SOURCEPP_API sourcepp_buffer_t vtfpp_ppl_bake(vtfpp_ppl_handle_t handle);
71+
72+
SOURCEPP_API int vtfpp_ppl_bake_to_file(vtfpp_ppl_handle_t handle, const char* pplPath);
73+
74+
SOURCEPP_API void vtfpp_ppl_close(vtfpp_ppl_handle_t* handle);

0 commit comments

Comments
 (0)