sourcepp 2025.2.20.dev1__tar.gz → 2025.5.25.dev1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,7 +30,7 @@ endif()
30
30
  set(CMAKE_POSITION_INDEPENDENT_CODE ON)
31
31
 
32
32
  set(SOURCEPP_BUILD_PYTHON_WRAPPERS ON CACHE INTERNAL "" FORCE)
33
- set(SOURCEPP_VERSION "2025.2.20dev1")
33
+ set(SOURCEPP_VERSION "2025.05.25dev1")
34
34
 
35
35
  # As weird as this looks, this is necessary for sdist wheel
36
36
  set(SOURCEPP_PYTHON_IS_SUBDIR OFF)
@@ -41,6 +41,6 @@ else()
41
41
  FetchContent_Declare(
42
42
  sourcepp
43
43
  GIT_REPOSITORY "https://github.com/craftablescience/sourcepp.git"
44
- GIT_TAG "f8771653daee393500d1f9735fb2054d577bcfee")
44
+ GIT_TAG "bc129fb8450454092a64dac0e78fe824ea91c332")
45
45
  FetchContent_MakeAvailable(sourcepp)
46
46
  endif()
@@ -1,12 +1,36 @@
1
+ Metadata-Version: 2.1
2
+ Name: sourcepp
3
+ Version: 2025.5.25.dev1
4
+ Summary: Several modern C++20 libraries for sanely parsing Valve formats.
5
+ Author-Email: craftablescience <lauralewisdev@gmail.com>
6
+ Maintainer-Email: craftablescience <lauralewisdev@gmail.com>
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: Programming Language :: Python :: 3 :: Only
10
+ Classifier: Programming Language :: Python :: 3.8
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Project-URL: homepage, https://github.com/craftablescience/sourcepp
17
+ Project-URL: repository, https://github.com/craftablescience/sourcepp
18
+ Project-URL: issue tracker, https://github.com/craftablescience/sourcepp/issues
19
+ Project-URL: funding, https://ko-fi.com/craftablescience
20
+ Requires-Python: >=3.8
21
+ Description-Content-Type: text/markdown
22
+
1
23
  <div>
2
24
  <img align="left" width="101px" src="https://github.com/craftablescience/sourcepp/blob/main/branding/logo.png?raw=true" alt="The Source Pretty Parsers logo. A printer-esque device is scanning a page with hex codes and printing a picture of Cordon Freeman." />
3
25
  <h1>Source Pretty Parsers</h1>
4
26
  </div>
5
27
 
6
- ![Build Status](https://img.shields.io/github/actions/workflow/status/craftablescience/sourcepp/build.yml?label=Build&logo=github&logoColor=%23FFFFFF)
7
- ![License](https://img.shields.io/github/license/craftablescience/sourcepp?label=License&logo=libreofficewriter&logoColor=%23FFFFFF)
8
- ![Discord](https://img.shields.io/discord/678074864346857482?label=Discord&logo=Discord&logoColor=%23FFFFFF)
9
- ![Ko-fi](https://img.shields.io/badge/donate-006dae?label=Ko-fi&logo=ko-fi)
28
+ <div>
29
+ <a href="https://github.com/craftablescience/sourcepp/actions" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/github/actions/workflow/status/craftablescience/sourcepp/build.yml?label=Build&logo=github&logoColor=%23FFFFFF" alt="Build Status" /></a>
30
+ <a href="https://github.com/craftablescience/sourcepp/blob/main/LICENSE" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/github/license/craftablescience/sourcepp?label=License&logo=libreofficewriter&logoColor=%23FFFFFF" alt="License" /></a>
31
+ <a href="https://discord.gg/ASgHFkX" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/discord/678074864346857482?label=Discord&logo=Discord&logoColor=%23FFFFFF" alt="Discord" /></a>
32
+ <a href="https://ko-fi.com/craftablescience" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/donate-006dae?label=Ko-fi&logo=ko-fi" alt="Ko-Fi" /></a>
33
+ </div>
10
34
 
11
35
  Several modern C++20 libraries for sanely parsing Valve formats, rolled into one big repository.
12
36
 
@@ -157,11 +181,11 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
157
181
  </tr>
158
182
  <tr><!-- empty row to disable github striped bg color --></tr>
159
183
  <tr>
160
- <td rowspan="23"><code>vpkpp</code></td>
184
+ <td rowspan="29"><code>vpkpp</code></td>
161
185
  <td>007 v1.1, v1.3 (007 - Nightfire)</td>
162
186
  <td align="center">✅</td>
163
187
  <td align="center">❌</td>
164
- <td rowspan="23" align="center">C<br>C#</td>
188
+ <td rowspan="29" align="center">C<br>C#</td>
165
189
  </tr>
166
190
  <tr><!-- empty row to disable github striped bg color --></tr>
167
191
  <tr>
@@ -182,6 +206,12 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
182
206
  <td align="center">✅</td>
183
207
  </tr>
184
208
  <tr><!-- empty row to disable github striped bg color --></tr>
209
+ <tr>
210
+ <td>HOG (Descent)</td>
211
+ <td align="center">✅</td>
212
+ <td align="center">❌</td>
213
+ </tr>
214
+ <tr><!-- empty row to disable github striped bg color --></tr>
185
215
  <tr>
186
216
  <td>OL (Worldcraft Object Library)</td>
187
217
  <td align="center">✅</td>
@@ -225,12 +255,24 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
225
255
  <td align="center">✅</td>
226
256
  </tr>
227
257
  <tr><!-- empty row to disable github striped bg color --></tr>
258
+ <tr>
259
+ <td>VPP v1-3 (Red Faction)</td>
260
+ <td align="center">✅</td>
261
+ <td align="center">❌</td>
262
+ </tr>
263
+ <tr><!-- empty row to disable github striped bg color --></tr>
228
264
  <tr>
229
265
  <td>WAD v3</td>
230
266
  <td align="center">✅</td>
231
267
  <td align="center">✅</td>
232
268
  </tr>
233
269
  <tr><!-- empty row to disable github striped bg color --></tr>
270
+ <tr>
271
+ <td>XZP v6 (Half-Life 2 for XBOX)</td>
272
+ <td align="center">✅</td>
273
+ <td align="center">❌</td>
274
+ </tr>
275
+ <tr><!-- empty row to disable github striped bg color --></tr>
234
276
  <tr>
235
277
  <td>
236
278
  ZIP, and some of its aliases:
@@ -246,11 +288,11 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
246
288
  </tr>
247
289
  <tr><!-- empty row to disable github striped bg color --></tr>
248
290
  <tr>
249
- <td rowspan="31"><code>vtfpp</code></td>
291
+ <td rowspan="33"><code>vtfpp</code></td>
250
292
  <td><a href="https://wiki.mozilla.org/APNG_Specification">APNG</a></td>
251
293
  <td align="center">✅</td>
252
294
  <td align="center">❌</td>
253
- <td rowspan="31" align="center">Python</td>
295
+ <td rowspan="33" align="center">C<br>Python</td>
254
296
  </tr>
255
297
  <tr><!-- empty row to disable github striped bg color --></tr>
256
298
  <tr>
@@ -313,6 +355,12 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
313
355
  <td align="center">❌</td>
314
356
  </tr>
315
357
  <tr><!-- empty row to disable github striped bg color --></tr>
358
+ <tr>
359
+ <td><a href="https://qoiformat.org">QOI</a></td>
360
+ <td align="center">✅</td>
361
+ <td align="center">✅</td>
362
+ </tr>
363
+ <tr><!-- empty row to disable github striped bg color --></tr>
316
364
  <tr>
317
365
  <td><a href="https://developer.valvesoftware.com/wiki/Animated_Particles">SHT</a> v0-1</td>
318
366
  <td align="center">✅</td>
@@ -366,9 +414,11 @@ found on PyPI in the [sourcepp](https://pypi.org/project/sourcepp) package.
366
414
  - `bsppp` partial library redesign, lump compression and game lump parsing/writing support contributed by [@Tholp](https://github.com/Tholp1).
367
415
  - `steampp` is based on the [SteamAppPathProvider](https://github.com/Trico-Everfire/SteamAppPathProvider) library by [@Trico Everfire](https://github.com/Trico-Everfire) and [Momentum Mod](https://momentum-mod.org) contributors.
368
416
  - `vpkpp`'s 007 parser is based on [reverse-engineering work](https://raw.githubusercontent.com/SmileyAG/dumpster/refs/heads/src_jb007nightfirepc_alurazoe/file_format_analysis.txt) by Alhexx.
369
- - `vpkpp`'s GCF parser was contributed by [@bt](https://github.com/caatge) and [@ymgve](https://github.com/ymgve).
417
+ - `vpkpp`'s GCF parser was contributed by [@bt](https://github.com/eepycats) and [@ymgve](https://github.com/ymgve).
418
+ - `vpkpp`'s HOG parser was contributed by [@erysdren](https://github.com/erysdren).
370
419
  - `vpkpp`'s OL parser is based on [reverse-engineering work](https://github.com/erysdren/scratch/blob/main/kaitai/worldcraft_ol.ksy) by [@erysdren](https://github.com/erysdren).
371
420
  - `vpkpp`'s ORE parser is based on [reverse-engineering work](https://github.com/erysdren/narbacular-drop-tools) by [@erysdren](https://github.com/erysdren).
421
+ - `vpkpp`'s VPP parser was contributed by [@erysdren](https://github.com/erysdren).
372
422
  - `vpkpp`'s WAD3 parser/writer was contributed by [@ozxybox](https://github.com/ozxybox).
373
423
  - `vtfpp`'s SHT parser/writer was contributed by [@Trico Everfire](https://github.com/Trico-Everfire).
374
424
  - `vtfpp`'s VTF write support is loosely based on work by [@Trico Everfire](https://github.com/Trico-Everfire).
@@ -1,35 +1,14 @@
1
- Metadata-Version: 2.1
2
- Name: sourcepp
3
- Version: 2025.2.20.dev1
4
- Summary: Several modern C++20 libraries for sanely parsing Valve formats.
5
- Home-page: https://github.com/craftablescience/sourcepp
6
- Author-Email: craftablescience <lauralewisdev@gmail.com>
7
- Maintainer-Email: craftablescience <lauralewisdev@gmail.com>
8
- Classifier: License :: OSI Approved :: MIT License
9
- Classifier: Intended Audience :: Developers
10
- Classifier: Programming Language :: Python :: 3 :: Only
11
- Classifier: Programming Language :: Python :: 3.8
12
- Classifier: Programming Language :: Python :: 3.9
13
- Classifier: Programming Language :: Python :: 3.10
14
- Classifier: Programming Language :: Python :: 3.11
15
- Classifier: Programming Language :: Python :: 3.12
16
- Classifier: Programming Language :: Python :: 3.13
17
- Project-URL: Homepage, https://github.com/craftablescience/sourcepp
18
- Project-URL: Repository, https://github.com/craftablescience/sourcepp
19
- Project-URL: Issue tracker, https://github.com/craftablescience/sourcepp/issues
20
- Project-URL: Funding, https://ko-fi.com/craftablescience
21
- Requires-Python: >=3.8
22
- Description-Content-Type: text/markdown
23
-
24
1
  <div>
25
2
  <img align="left" width="101px" src="https://github.com/craftablescience/sourcepp/blob/main/branding/logo.png?raw=true" alt="The Source Pretty Parsers logo. A printer-esque device is scanning a page with hex codes and printing a picture of Cordon Freeman." />
26
3
  <h1>Source Pretty Parsers</h1>
27
4
  </div>
28
5
 
29
- ![Build Status](https://img.shields.io/github/actions/workflow/status/craftablescience/sourcepp/build.yml?label=Build&logo=github&logoColor=%23FFFFFF)
30
- ![License](https://img.shields.io/github/license/craftablescience/sourcepp?label=License&logo=libreofficewriter&logoColor=%23FFFFFF)
31
- ![Discord](https://img.shields.io/discord/678074864346857482?label=Discord&logo=Discord&logoColor=%23FFFFFF)
32
- ![Ko-fi](https://img.shields.io/badge/donate-006dae?label=Ko-fi&logo=ko-fi)
6
+ <div>
7
+ <a href="https://github.com/craftablescience/sourcepp/actions" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/github/actions/workflow/status/craftablescience/sourcepp/build.yml?label=Build&logo=github&logoColor=%23FFFFFF" alt="Build Status" /></a>
8
+ <a href="https://github.com/craftablescience/sourcepp/blob/main/LICENSE" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/github/license/craftablescience/sourcepp?label=License&logo=libreofficewriter&logoColor=%23FFFFFF" alt="License" /></a>
9
+ <a href="https://discord.gg/ASgHFkX" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/discord/678074864346857482?label=Discord&logo=Discord&logoColor=%23FFFFFF" alt="Discord" /></a>
10
+ <a href="https://ko-fi.com/craftablescience" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/donate-006dae?label=Ko-fi&logo=ko-fi" alt="Ko-Fi" /></a>
11
+ </div>
33
12
 
34
13
  Several modern C++20 libraries for sanely parsing Valve formats, rolled into one big repository.
35
14
 
@@ -180,11 +159,11 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
180
159
  </tr>
181
160
  <tr><!-- empty row to disable github striped bg color --></tr>
182
161
  <tr>
183
- <td rowspan="23"><code>vpkpp</code></td>
162
+ <td rowspan="29"><code>vpkpp</code></td>
184
163
  <td>007 v1.1, v1.3 (007 - Nightfire)</td>
185
164
  <td align="center">✅</td>
186
165
  <td align="center">❌</td>
187
- <td rowspan="23" align="center">C<br>C#</td>
166
+ <td rowspan="29" align="center">C<br>C#</td>
188
167
  </tr>
189
168
  <tr><!-- empty row to disable github striped bg color --></tr>
190
169
  <tr>
@@ -205,6 +184,12 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
205
184
  <td align="center">✅</td>
206
185
  </tr>
207
186
  <tr><!-- empty row to disable github striped bg color --></tr>
187
+ <tr>
188
+ <td>HOG (Descent)</td>
189
+ <td align="center">✅</td>
190
+ <td align="center">❌</td>
191
+ </tr>
192
+ <tr><!-- empty row to disable github striped bg color --></tr>
208
193
  <tr>
209
194
  <td>OL (Worldcraft Object Library)</td>
210
195
  <td align="center">✅</td>
@@ -248,12 +233,24 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
248
233
  <td align="center">✅</td>
249
234
  </tr>
250
235
  <tr><!-- empty row to disable github striped bg color --></tr>
236
+ <tr>
237
+ <td>VPP v1-3 (Red Faction)</td>
238
+ <td align="center">✅</td>
239
+ <td align="center">❌</td>
240
+ </tr>
241
+ <tr><!-- empty row to disable github striped bg color --></tr>
251
242
  <tr>
252
243
  <td>WAD v3</td>
253
244
  <td align="center">✅</td>
254
245
  <td align="center">✅</td>
255
246
  </tr>
256
247
  <tr><!-- empty row to disable github striped bg color --></tr>
248
+ <tr>
249
+ <td>XZP v6 (Half-Life 2 for XBOX)</td>
250
+ <td align="center">✅</td>
251
+ <td align="center">❌</td>
252
+ </tr>
253
+ <tr><!-- empty row to disable github striped bg color --></tr>
257
254
  <tr>
258
255
  <td>
259
256
  ZIP, and some of its aliases:
@@ -269,11 +266,11 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
269
266
  </tr>
270
267
  <tr><!-- empty row to disable github striped bg color --></tr>
271
268
  <tr>
272
- <td rowspan="31"><code>vtfpp</code></td>
269
+ <td rowspan="33"><code>vtfpp</code></td>
273
270
  <td><a href="https://wiki.mozilla.org/APNG_Specification">APNG</a></td>
274
271
  <td align="center">✅</td>
275
272
  <td align="center">❌</td>
276
- <td rowspan="31" align="center">Python</td>
273
+ <td rowspan="33" align="center">C<br>Python</td>
277
274
  </tr>
278
275
  <tr><!-- empty row to disable github striped bg color --></tr>
279
276
  <tr>
@@ -336,6 +333,12 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
336
333
  <td align="center">❌</td>
337
334
  </tr>
338
335
  <tr><!-- empty row to disable github striped bg color --></tr>
336
+ <tr>
337
+ <td><a href="https://qoiformat.org">QOI</a></td>
338
+ <td align="center">✅</td>
339
+ <td align="center">✅</td>
340
+ </tr>
341
+ <tr><!-- empty row to disable github striped bg color --></tr>
339
342
  <tr>
340
343
  <td><a href="https://developer.valvesoftware.com/wiki/Animated_Particles">SHT</a> v0-1</td>
341
344
  <td align="center">✅</td>
@@ -389,9 +392,11 @@ found on PyPI in the [sourcepp](https://pypi.org/project/sourcepp) package.
389
392
  - `bsppp` partial library redesign, lump compression and game lump parsing/writing support contributed by [@Tholp](https://github.com/Tholp1).
390
393
  - `steampp` is based on the [SteamAppPathProvider](https://github.com/Trico-Everfire/SteamAppPathProvider) library by [@Trico Everfire](https://github.com/Trico-Everfire) and [Momentum Mod](https://momentum-mod.org) contributors.
391
394
  - `vpkpp`'s 007 parser is based on [reverse-engineering work](https://raw.githubusercontent.com/SmileyAG/dumpster/refs/heads/src_jb007nightfirepc_alurazoe/file_format_analysis.txt) by Alhexx.
392
- - `vpkpp`'s GCF parser was contributed by [@bt](https://github.com/caatge) and [@ymgve](https://github.com/ymgve).
395
+ - `vpkpp`'s GCF parser was contributed by [@bt](https://github.com/eepycats) and [@ymgve](https://github.com/ymgve).
396
+ - `vpkpp`'s HOG parser was contributed by [@erysdren](https://github.com/erysdren).
393
397
  - `vpkpp`'s OL parser is based on [reverse-engineering work](https://github.com/erysdren/scratch/blob/main/kaitai/worldcraft_ol.ksy) by [@erysdren](https://github.com/erysdren).
394
398
  - `vpkpp`'s ORE parser is based on [reverse-engineering work](https://github.com/erysdren/narbacular-drop-tools) by [@erysdren](https://github.com/erysdren).
399
+ - `vpkpp`'s VPP parser was contributed by [@erysdren](https://github.com/erysdren).
395
400
  - `vpkpp`'s WAD3 parser/writer was contributed by [@ozxybox](https://github.com/ozxybox).
396
401
  - `vtfpp`'s SHT parser/writer was contributed by [@Trico Everfire](https://github.com/Trico-Everfire).
397
402
  - `vtfpp`'s VTF write support is loosely based on work by [@Trico Everfire](https://github.com/Trico-Everfire).
@@ -278,6 +278,31 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
278
278
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
279
279
 
280
280
 
281
+ --------------- qoi ---------------
282
+
283
+ MIT License
284
+
285
+ Copyright (c) 2022 Dominic Szablewski
286
+
287
+ Permission is hereby granted, free of charge, to any person obtaining a copy
288
+ of this software and associated documentation files (the "Software"), to deal
289
+ in the Software without restriction, including without limitation the rights
290
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
291
+ copies of the Software, and to permit persons to whom the Software is
292
+ furnished to do so, subject to the following conditions:
293
+
294
+ The above copyright notice and this permission notice shall be included in all
295
+ copies or substantial portions of the Software.
296
+
297
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
298
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
299
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
300
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
301
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
302
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
303
+ SOFTWARE.
304
+
305
+
281
306
  --------------- SciPy ---------------
282
307
 
283
308
  Copyright (c) 2001-2002 Enthought, Inc. 2003, SciPy Developers.
@@ -5,7 +5,7 @@ build-backend = "scikit_build_core.build"
5
5
 
6
6
  [project]
7
7
  name = "sourcepp"
8
- version = "2025.2.20dev1"
8
+ version = "2025.05.25dev1"
9
9
  authors = [{ name = "craftablescience", email = "lauralewisdev@gmail.com" }]
10
10
  maintainers = [{ name = "craftablescience", email = "lauralewisdev@gmail.com" }]
11
11
  description = "Several modern C++20 libraries for sanely parsing Valve formats."
@@ -1,5 +1,5 @@
1
1
  from ._sourcepp_impl import __doc__, bsppp, gamepp, sourcepp, steampp, toolpp, vcryptpp, vtfpp
2
2
 
3
3
  __author__ = "craftablescience"
4
- __version__ = "2025.2.20dev1"
4
+ __version__ = "2025.05.25dev1"
5
5
  __all__ = ['__author__', '__doc__', '__version__', 'bsppp', 'gamepp', 'sourcepp', 'steampp', 'toolpp', 'vcryptpp', 'vtfpp']
@@ -8,6 +8,8 @@
8
8
  #include <nanobind/stl/tuple.h>
9
9
  #include <nanobind/stl/vector.h>
10
10
 
11
+ #include "../../../include/vtfpp/ImageConversion.h"
12
+
11
13
  namespace py = nanobind;
12
14
 
13
15
  #include <vtfpp/vtfpp.h>
@@ -82,7 +84,8 @@ void register_python(py::module_& m) {
82
84
  .def("decimal", &decimal, py::arg("format"))
83
85
  .def("compressed", &compressed, py::arg("format"))
84
86
  .def("transparent", &transparent, py::arg("format"))
85
- .def("opaque", &opaque, py::arg("format"));
87
+ .def("opaque", &opaque, py::arg("format"))
88
+ .def("console", &console, py::arg("format"));
86
89
 
87
90
  ImageFormatDetails
88
91
  .def("get_data_length", py::overload_cast<ImageFormat, uint16_t, uint16_t, uint16_t>(&getDataLength), py::arg("format"), py::arg("width"), py::arg("height"), py::arg("slice_count") = 1)
@@ -130,9 +133,10 @@ void register_python(py::module_& m) {
130
133
  py::enum_<FileFormat>(ImageConversion, "FileFormat")
131
134
  .value("DEFAULT", FileFormat::DEFAULT)
132
135
  .value("PNG", FileFormat::PNG)
133
- .value("JPEG", FileFormat::JPEG)
136
+ .value("JPG", FileFormat::JPG)
134
137
  .value("BMP", FileFormat::BMP)
135
138
  .value("TGA", FileFormat::TGA)
139
+ .value("QOI", FileFormat::QOI)
136
140
  .value("HDR", FileFormat::HDR)
137
141
  .value("EXR", FileFormat::EXR)
138
142
  .export_values();
@@ -198,8 +202,17 @@ void register_python(py::module_& m) {
198
202
  return py::bytes{d.data(), d.size()};
199
203
  }, py::arg("image_data"), py::arg("format"), py::arg("width"), py::arg("new_width"), py::arg("x_offset"), py::arg("height"), py::arg("new_height"), py::arg("y_offset"));
200
204
 
205
+ ImageConversion.def("gamma_correct_image_data", [](const py::bytes& imageData, ImageFormat format, uint16_t width, uint16_t height, float gamma) {
206
+ const auto d = gammaCorrectImageData({reinterpret_cast<const std::byte*>(imageData.data()), imageData.size()}, format, width, height, gamma);
207
+ return py::bytes{d.data(), d.size()};
208
+ }, py::arg("image_data"), py::arg("format"), py::arg("width"), py::arg("height"), py::arg("gamma"));
209
+
210
+ ImageConversion.def("invert_green_channel_for_image_data", [](const py::bytes& imageData, ImageFormat format, uint16_t width, uint16_t height) {
211
+ const auto d = invertGreenChannelForImageData({reinterpret_cast<const std::byte*>(imageData.data()), imageData.size()}, format, width, height);
212
+ return py::bytes{d.data(), d.size()};
213
+ }, py::arg("image_data"), py::arg("format"), py::arg("width"), py::arg("height"));
214
+
201
215
  // Skip extractChannelFromImageData, difficult to bind
202
- // Skip applyChannelToImageData, difficult to bind
203
216
  }
204
217
 
205
218
  auto cPPL = py::class_<PPL>(vtfpp, "PPL");
@@ -212,14 +225,14 @@ void register_python(py::module_& m) {
212
225
  });
213
226
 
214
227
  cPPL
215
- .def(py::init<uint32_t, ImageFormat, uint32_t>(), py::arg("checksum"), py::arg("format") = ImageFormat::RGB888, py::arg("version") = 0)
228
+ .def(py::init<uint32_t, ImageFormat, uint32_t>(), py::arg("model_checksum"), py::arg("format") = ImageFormat::RGB888, py::arg("version") = 0)
216
229
  .def("__init__", [](PPL* self, const py::bytes& pplData) {
217
230
  return new(self) PPL{{reinterpret_cast<const std::byte*>(pplData.data()), pplData.size()}};
218
231
  }, py::arg("ppl_data"))
219
232
  .def(py::init<const std::string&>(), py::arg("path"))
220
233
  .def("__bool__", &PPL::operator bool, py::is_operator())
221
234
  .def_prop_rw("version", &PPL::getVersion, &PPL::setVersion)
222
- .def_prop_rw("checksum", &PPL::getChecksum, &PPL::setChecksum)
235
+ .def_prop_rw("model_checksum", &PPL::getModelChecksum, &PPL::setModelChecksum)
223
236
  .def_prop_rw("format", &PPL::getFormat, &PPL::setFormat)
224
237
  .def("has_image_for_lod", &PPL::hasImageForLOD, py::arg("lod"))
225
238
  .def_prop_ro("image_lods", &PPL::getImageLODs)
@@ -421,7 +434,9 @@ void register_python(py::module_& m) {
421
434
  .def_rw("compute_reflectivity", &VTF::CreationOptions::computeReflectivity)
422
435
  .def_rw("compression_level", &VTF::CreationOptions::compressionLevel)
423
436
  .def_rw("compression_method", &VTF::CreationOptions::compressionMethod)
424
- .def_rw("bumpmap_scale", &VTF::CreationOptions::bumpMapScale);
437
+ .def_rw("bumpmap_scale", &VTF::CreationOptions::bumpMapScale)
438
+ .def_rw("gamma_correction", &VTF::CreationOptions::gammaCorrection)
439
+ .def_rw("invert_green_channel", &VTF::CreationOptions::invertGreenChannel);
425
440
 
426
441
  cVTF
427
442
  .def_ro_static("FLAG_MASK_AFTER_V7_3", &VTF::FLAG_MASK_AFTER_V7_3)