ReverseBox 0.35.7__tar.gz → 0.36.0__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.
- {reversebox-0.35.7 → reversebox-0.36.0}/PKG-INFO +8 -8
- {reversebox-0.35.7 → reversebox-0.36.0}/README.md +7 -7
- {reversebox-0.35.7 → reversebox-0.36.0}/ReverseBox.egg-info/PKG-INFO +8 -8
- {reversebox-0.35.7 → reversebox-0.36.0}/ReverseBox.egg-info/SOURCES.txt +1 -1
- reversebox-0.35.7/reversebox/image/decoders/compressed_decoder.py → reversebox-0.36.0/reversebox/image/decoders/compressed_decoder_encoder.py +27 -12
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/image_decoder.py +4 -3
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/image_encoder.py +6 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/libs/DirectXTex.dll +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/setup.py +1 -1
- {reversebox-0.35.7 → reversebox-0.36.0}/LICENSE +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/ReverseBox.egg-info/dependency_links.txt +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/ReverseBox.egg-info/requires.txt +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/ReverseBox.egg-info/top_level.txt +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/__init__.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/checksum/__init__.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/checksum/checksum_adler32.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/checksum/checksum_cocos2d_pvr.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/checksum/checksum_fletcher16.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/checksum/checksum_fletcher32.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/checksum/checksum_internet_ipv4_header.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/checksum/checksum_sum8.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/checksum/checksum_sum8_2s_complement.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/checksum/checksum_unix_sum_bsd16.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/checksum/checksum_unix_sum_sysv.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/checksum/checksum_xor8.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/common/__init__.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/common/common.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/common/logger.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/common/numpy_helper_functions.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/compression/__init__.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/compression/compression_jcalg1.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/compression/compression_lzo.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/compression/compression_mio0.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/compression/compression_re_tiyoruga_dat.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/compression/compression_refpack.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/compression/compression_zlib.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/crc/__init__.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/crc/crc16_arc.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/crc/crc16_ccitt.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/crc/crc16_dnp.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/crc/crc16_ea_crcf.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/crc/crc16_kermit.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/crc/crc16_modbus.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/crc/crc16_sick.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/crc/crc32_asobo.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/crc/crc32_iso_hdlc.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/crc/crc64_asobo.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/crc/crc64_go_iso.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/crc/crc8.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/crc/crc_unix_cksum.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/encryption/__init__.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/encryption/encryption_hatch_engine.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/encryption/encryption_rot13.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/encryption/encryption_xor_basic.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/encryption/encryption_xor_basic_key_guesser.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/encryption/encryption_xor_gianas_return_zda.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/encryption/encryption_xor_retro64_eco.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/hash/__init__.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/hash/hash_additive.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/hash/hash_ap.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/hash/hash_djb2.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/hash/hash_fnv.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/hash/hash_jenkins_one_at_a_time.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/hash/hash_md2.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/hash/hash_md5.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/hash/hash_murmur3.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/hash/hash_pivotal_games_dat.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/hash/hash_sdbm.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/hash/hash_sha1.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/hash/hash_sha2.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/__init__.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/byte_swap.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/common.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/compression/__init__.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/compression/compression_gst.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/compression/compression_lzw.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/compression/compression_packbits.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/compression/compression_rle_executioners.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/compression/compression_rle_tga.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/compression/compression_zlib.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/decoders/__init__.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/decoders/bumpmap_decoder.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/decoders/gst_decoder.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/decoders/n64_decoder.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/decoders/yuv_decoder.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/encoders/__init__.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/encoders/gst_encoder.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/file_formats/__init__.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/file_formats/image_dds.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/image_formats.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/palettes/__init__.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/palettes/palette_random.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/palettes/palette_vga.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/pillow_wrapper.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/swizzling/__init__.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/swizzling/swizzle_3ds.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/swizzling/swizzle_bc.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/swizzling/swizzle_cmpr.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/swizzling/swizzle_gamecube.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/swizzling/swizzle_gst.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/swizzling/swizzle_morton.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/swizzling/swizzle_morton_ps4.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/swizzling/swizzle_ps2.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/swizzling/swizzle_ps2_4bit.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/swizzling/swizzle_ps2_suba.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/swizzling/swizzle_psp.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/swizzling/swizzle_psvita_dreamcast.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/swizzling/swizzle_switch.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/swizzling/swizzle_wii_u.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/swizzling/swizzle_x360.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/io_files/__init__.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/io_files/bytes_handler.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/io_files/bytes_helper_functions.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/io_files/check_file.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/io_files/file_handler.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/io_files/mod_handler.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/io_files/translation_text_handler.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/libs/__init__.py +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/reversebox/libs/refpack.dll +0 -0
- {reversebox-0.35.7 → reversebox-0.36.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ReverseBox
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.36.0
|
4
4
|
Summary: A set of functions useful in reverse engineering.
|
5
5
|
Home-page: https://github.com/bartlomiejduda/ReverseBox
|
6
6
|
Author: Bartlomiej Duda
|
@@ -186,13 +186,13 @@ or software researchers).
|
|
186
186
|
- Decode N64_IA8 ✔️
|
187
187
|
- Decode N64_RGBA32 ✔️
|
188
188
|
- Decode N64_CMPR ✔️
|
189
|
-
- Decode BC1/DXT1 ✔️
|
190
|
-
- Decode BC2/DXT3 ✔️
|
191
|
-
- Decode BC3/DXT5 ✔️
|
192
|
-
- Decode BC4 ✔️
|
193
|
-
- Decode BC5 ✔️
|
194
|
-
- Decode BC6 ✔️
|
195
|
-
- Decode BC7 ✔️
|
189
|
+
- Decode/Encode BC1/DXT1 ✔️
|
190
|
+
- Decode/Encode BC2/DXT3 ✔️
|
191
|
+
- Decode/Encode BC3/DXT5 ✔️
|
192
|
+
- Decode/Encode BC4 ✔️
|
193
|
+
- Decode/Encode BC5 ✔️
|
194
|
+
- Decode/Encode BC6 ✔️
|
195
|
+
- Decode/Encode BC7 ✔️
|
196
196
|
- Decode GST121 ✔️
|
197
197
|
- Decode GST221 ✔️
|
198
198
|
- Decode GST421 ✔️
|
@@ -149,13 +149,13 @@ or software researchers).
|
|
149
149
|
- Decode N64_IA8 ✔️
|
150
150
|
- Decode N64_RGBA32 ✔️
|
151
151
|
- Decode N64_CMPR ✔️
|
152
|
-
- Decode BC1/DXT1 ✔️
|
153
|
-
- Decode BC2/DXT3 ✔️
|
154
|
-
- Decode BC3/DXT5 ✔️
|
155
|
-
- Decode BC4 ✔️
|
156
|
-
- Decode BC5 ✔️
|
157
|
-
- Decode BC6 ✔️
|
158
|
-
- Decode BC7 ✔️
|
152
|
+
- Decode/Encode BC1/DXT1 ✔️
|
153
|
+
- Decode/Encode BC2/DXT3 ✔️
|
154
|
+
- Decode/Encode BC3/DXT5 ✔️
|
155
|
+
- Decode/Encode BC4 ✔️
|
156
|
+
- Decode/Encode BC5 ✔️
|
157
|
+
- Decode/Encode BC6 ✔️
|
158
|
+
- Decode/Encode BC7 ✔️
|
159
159
|
- Decode GST121 ✔️
|
160
160
|
- Decode GST221 ✔️
|
161
161
|
- Decode GST421 ✔️
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ReverseBox
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.36.0
|
4
4
|
Summary: A set of functions useful in reverse engineering.
|
5
5
|
Home-page: https://github.com/bartlomiejduda/ReverseBox
|
6
6
|
Author: Bartlomiej Duda
|
@@ -186,13 +186,13 @@ or software researchers).
|
|
186
186
|
- Decode N64_IA8 ✔️
|
187
187
|
- Decode N64_RGBA32 ✔️
|
188
188
|
- Decode N64_CMPR ✔️
|
189
|
-
- Decode BC1/DXT1 ✔️
|
190
|
-
- Decode BC2/DXT3 ✔️
|
191
|
-
- Decode BC3/DXT5 ✔️
|
192
|
-
- Decode BC4 ✔️
|
193
|
-
- Decode BC5 ✔️
|
194
|
-
- Decode BC6 ✔️
|
195
|
-
- Decode BC7 ✔️
|
189
|
+
- Decode/Encode BC1/DXT1 ✔️
|
190
|
+
- Decode/Encode BC2/DXT3 ✔️
|
191
|
+
- Decode/Encode BC3/DXT5 ✔️
|
192
|
+
- Decode/Encode BC4 ✔️
|
193
|
+
- Decode/Encode BC5 ✔️
|
194
|
+
- Decode/Encode BC6 ✔️
|
195
|
+
- Decode/Encode BC7 ✔️
|
196
196
|
- Decode GST121 ✔️
|
197
197
|
- Decode GST221 ✔️
|
198
198
|
- Decode GST421 ✔️
|
@@ -79,7 +79,7 @@ reversebox/image/compression/compression_rle_tga.py
|
|
79
79
|
reversebox/image/compression/compression_zlib.py
|
80
80
|
reversebox/image/decoders/__init__.py
|
81
81
|
reversebox/image/decoders/bumpmap_decoder.py
|
82
|
-
reversebox/image/decoders/
|
82
|
+
reversebox/image/decoders/compressed_decoder_encoder.py
|
83
83
|
reversebox/image/decoders/gst_decoder.py
|
84
84
|
reversebox/image/decoders/n64_decoder.py
|
85
85
|
reversebox/image/decoders/yuv_decoder.py
|
@@ -1,5 +1,5 @@
|
|
1
1
|
"""
|
2
|
-
Copyright © 2024 Bartłomiej Duda
|
2
|
+
Copyright © 2024-2025 Bartłomiej Duda
|
3
3
|
License: GPL-3.0 License
|
4
4
|
"""
|
5
5
|
|
@@ -22,6 +22,7 @@ from reversebox.image.image_formats import ImageFormats
|
|
22
22
|
logger = get_logger(__name__)
|
23
23
|
|
24
24
|
# fmt: off
|
25
|
+
# mypy: ignore-errors
|
25
26
|
|
26
27
|
|
27
28
|
class DXGIImage(Structure):
|
@@ -38,7 +39,7 @@ class DXGIImage(Structure):
|
|
38
39
|
]
|
39
40
|
|
40
41
|
|
41
|
-
class
|
42
|
+
class CompressedImageDecoderEncoder:
|
42
43
|
"""
|
43
44
|
Decoder for any compressed images like BC1/DXT1, BC2/DXT2 etc.
|
44
45
|
"""
|
@@ -91,15 +92,19 @@ class CompressedImageDecoder:
|
|
91
92
|
else:
|
92
93
|
raise Exception(f"Not supported image format! Image_format: {image_format}")
|
93
94
|
|
94
|
-
def
|
95
|
+
def _convert_directxtex_image(self, image_data: bytes, img_width: int, img_height: int, image_format: ImageFormats, encode_flag: bool) -> bytes:
|
95
96
|
"""
|
96
97
|
Function used for decoding compressed BC formats
|
97
98
|
"""
|
98
99
|
dll_path: str = get_dll_path("DirectXTex.dll")
|
99
|
-
|
100
|
-
|
100
|
+
if encode_flag:
|
101
|
+
input_format_number: int = self._get_dxgi_format_number(ImageFormats.RGBA8888)
|
102
|
+
output_format_number: int = self._get_dxgi_format_number(image_format)
|
103
|
+
else:
|
104
|
+
input_format_number: int = self._get_dxgi_format_number(image_format)
|
105
|
+
output_format_number: int = self._get_dxgi_format_number(ImageFormats.RGBA8888)
|
101
106
|
|
102
|
-
# calculating pitch
|
107
|
+
# calculating pitch params
|
103
108
|
c_input_format_number = c_int(input_format_number)
|
104
109
|
c_output_format_number = c_int(output_format_number)
|
105
110
|
c_image_width = c_int(img_width)
|
@@ -110,6 +115,10 @@ class CompressedImageDecoder:
|
|
110
115
|
c_output_slice_pitch = c_long(0)
|
111
116
|
c_flags = c_int(0)
|
112
117
|
|
118
|
+
# encode params
|
119
|
+
c_threshold = ctypes.c_float(0.5)
|
120
|
+
c_nullptr = (c_uint8 * 100)()
|
121
|
+
|
113
122
|
try:
|
114
123
|
dll_file = ctypes.CDLL(dll_path)
|
115
124
|
dll_file.ComputePitch(c_input_format_number, c_image_width, c_image_height, ctypes.byref(c_input_row_pitch), ctypes.byref(c_input_slice_pitch), c_flags)
|
@@ -122,10 +131,16 @@ class CompressedImageDecoder:
|
|
122
131
|
input_dxgi_image: DXGIImage = self._init_dxgi_image(img_width, img_height, input_format_number, c_input_row_pitch.value, c_input_slice_pitch.value, image_data)
|
123
132
|
output_dxgi_image: DXGIImage = self._init_dxgi_image(img_width, img_height, output_format_number, c_output_row_pitch.value, c_output_slice_pitch.value, b'')
|
124
133
|
|
125
|
-
# decompressing image logic
|
134
|
+
# decompressing/compressing image logic
|
126
135
|
try:
|
127
136
|
dll_file = ctypes.CDLL(dll_path)
|
128
|
-
|
137
|
+
|
138
|
+
if encode_flag:
|
139
|
+
h_result = dll_file.CompressBC(ctypes.byref(input_dxgi_image), ctypes.byref(output_dxgi_image),
|
140
|
+
c_flags, c_flags,
|
141
|
+
c_threshold, c_nullptr)
|
142
|
+
else:
|
143
|
+
h_result = dll_file.DecompressBC(ctypes.byref(input_dxgi_image), ctypes.byref(output_dxgi_image))
|
129
144
|
except Exception as error:
|
130
145
|
raise Exception(f"Error while decoding compressed data! Error: {error}")
|
131
146
|
|
@@ -137,7 +152,7 @@ class CompressedImageDecoder:
|
|
137
152
|
return decoded_data
|
138
153
|
|
139
154
|
def decode_compressed_image_main(self, image_data: bytes, img_width: int, img_height: int, image_format: ImageFormats) -> bytes:
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
return self.
|
155
|
+
return self._convert_directxtex_image(image_data, img_width, img_height, image_format, False)
|
156
|
+
|
157
|
+
def encode_compressed_image_main(self, image_data: bytes, img_width: int, img_height: int, image_format: ImageFormats) -> bytes:
|
158
|
+
return self._convert_directxtex_image(image_data, img_width, img_height, image_format, True)
|
@@ -8,7 +8,9 @@ import struct
|
|
8
8
|
from reversebox.common.logger import get_logger
|
9
9
|
from reversebox.image.common import convert_bpp_to_bytes_per_pixel
|
10
10
|
from reversebox.image.decoders.bumpmap_decoder import BumpmapDecoder
|
11
|
-
from reversebox.image.decoders.
|
11
|
+
from reversebox.image.decoders.compressed_decoder_encoder import (
|
12
|
+
CompressedImageDecoderEncoder,
|
13
|
+
)
|
12
14
|
from reversebox.image.decoders.gst_decoder import GSTImageDecoder
|
13
15
|
from reversebox.image.decoders.n64_decoder import N64Decoder
|
14
16
|
from reversebox.image.decoders.yuv_decoder import YUVDecoder
|
@@ -792,8 +794,7 @@ class ImageDecoder:
|
|
792
794
|
return self._decode_indexed(image_data, palette_data, img_width, img_height, image_format, palette_format, image_endianess, palette_endianess)
|
793
795
|
|
794
796
|
def decode_compressed_image(self, image_data: bytes, img_width: int, img_height: int, image_format: ImageFormats) -> bytes:
|
795
|
-
|
796
|
-
return compressed_decoder.decode_compressed_image_main(image_data, img_width, img_height, image_format)
|
797
|
+
return CompressedImageDecoderEncoder().decode_compressed_image_main(image_data, img_width, img_height, image_format)
|
797
798
|
|
798
799
|
def decode_gst_image(self, image_data: bytes, palette_data: bytes, img_width: int, img_height: int, image_format: ImageFormats, convert_format: ImageFormats, convert_pal_format: ImageFormats, is_swizzled: bool = True) -> bytes:
|
799
800
|
gst_decoder = GSTImageDecoder()
|
@@ -12,6 +12,9 @@ from reversebox.image.common import (
|
|
12
12
|
convert_bpp_to_bytes_per_pixel,
|
13
13
|
get_bpp_for_image_format,
|
14
14
|
)
|
15
|
+
from reversebox.image.decoders.compressed_decoder_encoder import (
|
16
|
+
CompressedImageDecoderEncoder,
|
17
|
+
)
|
15
18
|
from reversebox.image.image_formats import ImageFormats
|
16
19
|
from reversebox.image.pillow_wrapper import PillowWrapper
|
17
20
|
from reversebox.io_files.bytes_handler import BytesHandler
|
@@ -431,3 +434,6 @@ class ImageEncoder:
|
|
431
434
|
|
432
435
|
def encode_indexed_image(self, image_data: bytes, img_width: int, img_height: int, image_format: ImageFormats, palette_format: ImageFormats, max_color_count: int, image_endianess: str = "little", palette_endianess: str = "little") -> Tuple[bytes, bytes]:
|
433
436
|
return self._encode_indexed(image_data, img_width, img_height, image_format, palette_format, image_endianess, palette_endianess, max_color_count)
|
437
|
+
|
438
|
+
def encode_compressed_image(self, image_data: bytes, img_width: int, img_height: int, image_format: ImageFormats) -> bytes:
|
439
|
+
return CompressedImageDecoderEncoder().encode_compressed_image_main(image_data, img_width, img_height, image_format)
|
Binary file
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{reversebox-0.35.7 → reversebox-0.36.0}/reversebox/checksum/checksum_internet_ipv4_header.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{reversebox-0.35.7 → reversebox-0.36.0}/reversebox/compression/compression_re_tiyoruga_dat.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{reversebox-0.35.7 → reversebox-0.36.0}/reversebox/encryption/encryption_xor_basic_key_guesser.py
RENAMED
File without changes
|
{reversebox-0.35.7 → reversebox-0.36.0}/reversebox/encryption/encryption_xor_gianas_return_zda.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/compression/compression_packbits.py
RENAMED
File without changes
|
{reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/compression/compression_rle_executioners.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{reversebox-0.35.7 → reversebox-0.36.0}/reversebox/image/swizzling/swizzle_psvita_dreamcast.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|