ReverseBox 0.35.0__tar.gz → 0.35.1__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.0 → reversebox-0.35.1}/PKG-INFO +1 -1
- {reversebox-0.35.0 → reversebox-0.35.1}/ReverseBox.egg-info/PKG-INFO +1 -1
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/image_encoder.py +16 -7
- {reversebox-0.35.0 → reversebox-0.35.1}/setup.py +1 -1
- {reversebox-0.35.0 → reversebox-0.35.1}/LICENSE +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/README.md +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/ReverseBox.egg-info/SOURCES.txt +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/ReverseBox.egg-info/dependency_links.txt +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/ReverseBox.egg-info/requires.txt +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/ReverseBox.egg-info/top_level.txt +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/__init__.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/checksum/__init__.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/checksum/checksum_adler32.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/checksum/checksum_cocos2d_pvr.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/checksum/checksum_fletcher16.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/checksum/checksum_fletcher32.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/checksum/checksum_internet_ipv4_header.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/checksum/checksum_sum8.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/checksum/checksum_sum8_2s_complement.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/checksum/checksum_unix_sum_bsd16.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/checksum/checksum_unix_sum_sysv.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/checksum/checksum_xor8.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/common/__init__.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/common/common.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/common/logger.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/common/numpy_helper_functions.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/compression/__init__.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/compression/compression_jcalg1.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/compression/compression_lzo.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/compression/compression_mio0.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/compression/compression_re_tiyoruga_dat.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/compression/compression_refpack.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/compression/compression_zlib.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/crc/__init__.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/crc/crc16_arc.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/crc/crc16_ccitt.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/crc/crc16_dnp.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/crc/crc16_ea_crcf.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/crc/crc16_kermit.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/crc/crc16_modbus.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/crc/crc16_sick.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/crc/crc32_asobo.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/crc/crc32_iso_hdlc.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/crc/crc64_asobo.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/crc/crc64_go_iso.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/crc/crc8.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/crc/crc_unix_cksum.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/encryption/__init__.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/encryption/encryption_hatch_engine.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/encryption/encryption_rot13.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/encryption/encryption_xor_basic.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/encryption/encryption_xor_basic_key_guesser.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/encryption/encryption_xor_gianas_return_zda.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/encryption/encryption_xor_retro64_eco.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/hash/__init__.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/hash/hash_additive.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/hash/hash_ap.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/hash/hash_djb2.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/hash/hash_fnv.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/hash/hash_jenkins_one_at_a_time.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/hash/hash_md2.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/hash/hash_md5.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/hash/hash_murmur3.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/hash/hash_pivotal_games_dat.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/hash/hash_sdbm.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/hash/hash_sha1.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/hash/hash_sha2.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/__init__.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/common.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/compression/__init__.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/compression/compression_gst.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/compression/compression_lzw.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/compression/compression_packbits.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/compression/compression_rle_executioners.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/compression/compression_rle_tga.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/compression/compression_zlib.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/decoders/__init__.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/decoders/bumpmap_decoder.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/decoders/compressed_decoder.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/decoders/gst_decoder.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/decoders/n64_decoder.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/decoders/yuv_decoder.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/encoders/__init__.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/encoders/gst_encoder.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/file_formats/__init__.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/file_formats/image_dds.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/image_decoder.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/image_formats.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/palettes/__init__.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/palettes/palette_random.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/palettes/palette_vga.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/pillow_wrapper.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/swizzling/__init__.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/swizzling/swizzle_3ds.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/swizzling/swizzle_bc.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/swizzling/swizzle_cmpr.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/swizzling/swizzle_gamecube.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/swizzling/swizzle_gst.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/swizzling/swizzle_morton.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/swizzling/swizzle_morton_ps4.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/swizzling/swizzle_ps2.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/swizzling/swizzle_ps2_4bit.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/swizzling/swizzle_ps2_suba.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/swizzling/swizzle_psp.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/swizzling/swizzle_psvita_dreamcast.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/swizzling/swizzle_switch.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/swizzling/swizzle_wii_u.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/swizzling/swizzle_x360.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/io_files/__init__.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/io_files/bytes_handler.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/io_files/bytes_helper_functions.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/io_files/check_file.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/io_files/file_handler.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/io_files/mod_handler.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/io_files/translation_text_handler.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/libs/DirectXTex.dll +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/libs/__init__.py +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/reversebox/libs/refpack.dll +0 -0
- {reversebox-0.35.0 → reversebox-0.35.1}/setup.cfg +0 -0
@@ -320,13 +320,15 @@ class ImageEncoder:
|
|
320
320
|
else:
|
321
321
|
raise Exception(f"[1] Image_bits_per_pixel={image_bpp} not supported!")
|
322
322
|
|
323
|
-
|
324
|
-
encoded_intermediate_image: bytes = self._encode_generic(image_data, img_width, img_height, palette_format, image_endianess) # RGBA8888
|
323
|
+
texture_data_expected_size: int = len(texture_data)
|
325
324
|
|
326
|
-
# colour quantization
|
327
|
-
pillow_img: Image = PillowWrapper().get_pillow_image_from_rgba8888_data(
|
328
|
-
pillow_img = pillow_img.quantize(colors=max_colors_count, method=2).convert("RGBA")
|
329
|
-
|
325
|
+
# colour quantization and dithering
|
326
|
+
pillow_img: Image = PillowWrapper().get_pillow_image_from_rgba8888_data(image_data, img_width, img_height)
|
327
|
+
pillow_img = pillow_img.quantize(colors=max_colors_count, method=2).convert("RGBA", dither=Image.Dither.FLOYDSTEINBERG)
|
328
|
+
image_data = pillow_img.tobytes()
|
329
|
+
|
330
|
+
# encode to intermediate image (e.g. RGBA8888 -> RGB565)
|
331
|
+
encoded_intermediate_image: bytes = self._encode_generic(image_data, img_width, img_height, palette_format, image_endianess)
|
330
332
|
|
331
333
|
# get pixels from intermediate image
|
332
334
|
pixel_int_values: list[int] = []
|
@@ -350,6 +352,7 @@ class ImageEncoder:
|
|
350
352
|
raise Exception(f"Not supported aligned colors count for max_colors_count={max_colors_count}") # TODO - support other formats like PAL16
|
351
353
|
|
352
354
|
palette_data: bytearray = bytearray(aligned_colors_count * palette_bytes_per_pixel)
|
355
|
+
palette_data_expected_size: int = len(palette_data)
|
353
356
|
|
354
357
|
# palette preparation (get unique values for palette)
|
355
358
|
pixel_check_list: List[int] = []
|
@@ -370,7 +373,6 @@ class ImageEncoder:
|
|
370
373
|
|
371
374
|
# encode indices
|
372
375
|
img_entry_number: int = 0
|
373
|
-
|
374
376
|
if image_bpp == 4: # PAL4
|
375
377
|
for i in range(0, len(pixel_int_values), 2):
|
376
378
|
pal_entry_number_1: int = pixel_map[pixel_int_values[i]]
|
@@ -390,6 +392,13 @@ class ImageEncoder:
|
|
390
392
|
else:
|
391
393
|
raise Exception(f"Not supported img_bpp={image_bpp}!") # TODO - support other formats like PAL16
|
392
394
|
|
395
|
+
# final checks
|
396
|
+
if len(palette_data) > palette_data_expected_size or len(palette_data) > 1024:
|
397
|
+
raise Exception("Error! Palette data too big!")
|
398
|
+
|
399
|
+
if len(texture_data) > texture_data_expected_size:
|
400
|
+
raise Exception("Error! Texture data too big!")
|
401
|
+
|
393
402
|
return texture_data, palette_data
|
394
403
|
|
395
404
|
def encode_image(self, image_data: bytes, img_width: int, img_height: int, image_format: ImageFormats, image_endianess: str = "little") -> bytes:
|
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.0 → reversebox-0.35.1}/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.0 → reversebox-0.35.1}/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.0 → reversebox-0.35.1}/reversebox/encryption/encryption_xor_basic_key_guesser.py
RENAMED
File without changes
|
{reversebox-0.35.0 → reversebox-0.35.1}/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
|
{reversebox-0.35.0 → reversebox-0.35.1}/reversebox/image/compression/compression_packbits.py
RENAMED
File without changes
|
{reversebox-0.35.0 → reversebox-0.35.1}/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
|
File without changes
|
File without changes
|
{reversebox-0.35.0 → reversebox-0.35.1}/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
|
File without changes
|