-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ready to release. Unsymboled useless parts of the code.
Optimized few things. Reviewed-by: V E L Δ <36549174+veld-dev@users.noreply.github.com>
- Loading branch information
Showing
12 changed files
with
85 additions
and
110 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,25 @@ | ||
from . import types | ||
from . import rat_types | ||
from .stream_helper import (StreamHelper) | ||
from . import utils | ||
import io | ||
from .libs.imageio import v2 as imageio | ||
|
||
def convert_dxt_to_png(dxt_buffer): | ||
# Charge l'image DXT à partir du buffer | ||
img = imageio.imread(dxt_buffer, 'dds') | ||
|
||
# Convertit l'image en PNG | ||
png_buffer = io.BytesIO() | ||
imageio.imwrite(png_buffer, img, format='png') | ||
png_buffer.seek(0) | ||
|
||
# Retourne le buffer de l'image PNG | ||
return png_buffer.getvalue() | ||
class TextureReader: | ||
def __init__(self, stream: StreamHelper, texture_ref: types.IGAssetRef): | ||
def __init__(self, stream: StreamHelper, texture_ref: rat_types.IGAssetRef): | ||
stream.seek(texture_ref.offset) | ||
self.ighw_header: types.IGHeader = utils.read_ighw_header(stream) | ||
self.ighw_header: rat_types.IGHeader = utils.read_ighw_header(stream) | ||
stream.jump(0x20) | ||
self.ighw_chunks: list[types.IGSectionChunk] = list(utils.read_sections_chunks(self.ighw_header, stream)) | ||
self.ighw_chunks: list[rat_types.IGSectionChunk] = list(utils.read_sections_chunks(self.ighw_header, stream)) | ||
|
||
### READ TEXTURE METADATAS ### |
Oops, something went wrong.