summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-18 04:29:12 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-18 04:29:12 +0000
commit0e2c4e72cdda4301e6c8886108e6ac0940d9ac76 (patch)
tree1ff44681099a614a6c8fe52ad3dd98eec231db1c
parenta1ed6df88da07d10aace5105ad0a35ae074b6204 (diff)
automatic import of python-texture2ddecoder
-rw-r--r--.gitignore1
-rw-r--r--python-texture2ddecoder.spec653
-rw-r--r--sources1
3 files changed, 655 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..00820eb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/texture2ddecoder-1.0.4.tar.gz
diff --git a/python-texture2ddecoder.spec b/python-texture2ddecoder.spec
new file mode 100644
index 0000000..f376c1e
--- /dev/null
+++ b/python-texture2ddecoder.spec
@@ -0,0 +1,653 @@
+%global _empty_manifest_terminate_build 0
+Name: python-texture2ddecoder
+Version: 1.0.4
+Release: 1
+Summary: a python wrapper for Perfare's Texture2DDecoder
+License: MIT License
+URL: https://github.com/K0lb3/texture2ddecoder
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/e2/dc/0ea3c5f8555677d69dd7c5aacfa119ff36506f05dc2af385a8556af5539d/texture2ddecoder-1.0.4.tar.gz
+
+
+%description
+# texture2ddecoder
+
+[![PyPI supported Python versions](https://img.shields.io/pypi/pyversions/UnityPy.svg)](https://pypi.python.org/pypi/texture2ddecoder)
+[![Win/Mac/Linux](https://img.shields.io/badge/platform-windows%20%7C%20macos%20%7C%20linux-informational)]()
+[![MIT](https://img.shields.io/pypi/l/UnityPy.svg)](https://github.com/K0lb3/texture2ddecoder/blob/master/LICENSE)
+[![Build Status](https://travis-ci.com/K0lb3/texture2ddecoder.svg?branch=master)](https://travis-ci.com/K0lb3/texture2ddecoder)
+[![Build Status (Github)](https://github.com/K0lb3/texture2ddecoder/workflows/Test%20and%20Publish/badge.svg?branch=master)](https://github.com/K0lb3/texture2ddecoder/actions?query=workflow%3A%22Test+and+Publish%22)
+
+A python wrapper for [Perfare](https://github.com/Perfare)'s [Texture2DDecoder](https://github.com/Perfare/AssetStudio/tree/master/Texture2DDecoder)
+
+Some changes were made to the original code to make it cross-platform compatible.
+
+1. [Installation](https://github.com/K0lb3/texture2ddecoder#installation)
+2. [Example](https://github.com/K0lb3/texture2ddecoder#example)
+3. [Functions](https://github.com/K0lb3/texture2ddecoder#functions)
+
+## Installation
+
+```cmd
+pip install texture2ddecoder
+```
+
+or download/clone the git and use
+
+```cmd
+python setup.py install
+```
+
+## Example
+
+```python
+import texture2ddecoder
+
+# load sample data
+data = open("astc_sample", "rb").read()
+
+# decode data
+width = 512
+height = 512
+block_width = block_height = 4
+
+decoded_data= texture2ddecoder.decode_astc(data, width, height, block_width, block_height)
+
+# load raw image data
+dec_img = Image.frombytes("RGBA", (width, height), decoded_data, 'raw', ("BGRA"))
+```
+
+## Functions
+
+* All functions accept only arguments, no keywords.
+* decode_pvrtc can cause segfaults on Mac OS
+
+#### decode_bc1
+
+*decompresses bc1 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_bc3
+
+*decompresses bc3 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_pvrtc
+
+*decompresses pvrtc textures to BGRA*
+
+Params: bytes data, long width, long height, bool is2bpp
+Return: bytes
+
+#### decode_etc1
+
+*decompresses etc1 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_etc2
+
+*decompresses etc2 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_etc2a1
+
+*decompresses etc2a1 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_etc2a8
+
+*decompresses etc2a8 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_eacr
+
+*decompresses eacr textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_eacr_signed
+
+*decompresses eacr_signed textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_eacrg
+
+*decompresses eacrg textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_eacrg_signed
+
+*decompresses eacrg_signed textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_bc4
+
+*decompresses bc4 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_bc5
+
+*decompresses bc5 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_bc6
+
+*decompresses bc6 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_bc7
+
+*decompresses bc7 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_atc_rgb4
+
+*decompresses atc_rgb4 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_atc_rgba8
+
+*decompresses atc_rgba8 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_astc
+
+*decompresses astc textures to BGRA*
+
+Params: bytes data, long width, long height, int block_width, int block_height
+Return: bytes
+
+#### unpack_crunch
+
+*decompresses crunch textures to BGRA*
+
+Params: bytes data
+Return: bytes
+
+#### unpack_unity_crunch
+
+*decompresses unity_crunch textures to BGRA*
+
+Params: bytes data
+Return: bytes
+
+
+
+
+%package -n python3-texture2ddecoder
+Summary: a python wrapper for Perfare's Texture2DDecoder
+Provides: python-texture2ddecoder
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+BuildRequires: python3-cffi
+BuildRequires: gcc
+BuildRequires: gdb
+%description -n python3-texture2ddecoder
+# texture2ddecoder
+
+[![PyPI supported Python versions](https://img.shields.io/pypi/pyversions/UnityPy.svg)](https://pypi.python.org/pypi/texture2ddecoder)
+[![Win/Mac/Linux](https://img.shields.io/badge/platform-windows%20%7C%20macos%20%7C%20linux-informational)]()
+[![MIT](https://img.shields.io/pypi/l/UnityPy.svg)](https://github.com/K0lb3/texture2ddecoder/blob/master/LICENSE)
+[![Build Status](https://travis-ci.com/K0lb3/texture2ddecoder.svg?branch=master)](https://travis-ci.com/K0lb3/texture2ddecoder)
+[![Build Status (Github)](https://github.com/K0lb3/texture2ddecoder/workflows/Test%20and%20Publish/badge.svg?branch=master)](https://github.com/K0lb3/texture2ddecoder/actions?query=workflow%3A%22Test+and+Publish%22)
+
+A python wrapper for [Perfare](https://github.com/Perfare)'s [Texture2DDecoder](https://github.com/Perfare/AssetStudio/tree/master/Texture2DDecoder)
+
+Some changes were made to the original code to make it cross-platform compatible.
+
+1. [Installation](https://github.com/K0lb3/texture2ddecoder#installation)
+2. [Example](https://github.com/K0lb3/texture2ddecoder#example)
+3. [Functions](https://github.com/K0lb3/texture2ddecoder#functions)
+
+## Installation
+
+```cmd
+pip install texture2ddecoder
+```
+
+or download/clone the git and use
+
+```cmd
+python setup.py install
+```
+
+## Example
+
+```python
+import texture2ddecoder
+
+# load sample data
+data = open("astc_sample", "rb").read()
+
+# decode data
+width = 512
+height = 512
+block_width = block_height = 4
+
+decoded_data= texture2ddecoder.decode_astc(data, width, height, block_width, block_height)
+
+# load raw image data
+dec_img = Image.frombytes("RGBA", (width, height), decoded_data, 'raw', ("BGRA"))
+```
+
+## Functions
+
+* All functions accept only arguments, no keywords.
+* decode_pvrtc can cause segfaults on Mac OS
+
+#### decode_bc1
+
+*decompresses bc1 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_bc3
+
+*decompresses bc3 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_pvrtc
+
+*decompresses pvrtc textures to BGRA*
+
+Params: bytes data, long width, long height, bool is2bpp
+Return: bytes
+
+#### decode_etc1
+
+*decompresses etc1 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_etc2
+
+*decompresses etc2 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_etc2a1
+
+*decompresses etc2a1 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_etc2a8
+
+*decompresses etc2a8 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_eacr
+
+*decompresses eacr textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_eacr_signed
+
+*decompresses eacr_signed textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_eacrg
+
+*decompresses eacrg textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_eacrg_signed
+
+*decompresses eacrg_signed textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_bc4
+
+*decompresses bc4 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_bc5
+
+*decompresses bc5 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_bc6
+
+*decompresses bc6 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_bc7
+
+*decompresses bc7 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_atc_rgb4
+
+*decompresses atc_rgb4 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_atc_rgba8
+
+*decompresses atc_rgba8 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_astc
+
+*decompresses astc textures to BGRA*
+
+Params: bytes data, long width, long height, int block_width, int block_height
+Return: bytes
+
+#### unpack_crunch
+
+*decompresses crunch textures to BGRA*
+
+Params: bytes data
+Return: bytes
+
+#### unpack_unity_crunch
+
+*decompresses unity_crunch textures to BGRA*
+
+Params: bytes data
+Return: bytes
+
+
+
+
+%package help
+Summary: Development documents and examples for texture2ddecoder
+Provides: python3-texture2ddecoder-doc
+%description help
+# texture2ddecoder
+
+[![PyPI supported Python versions](https://img.shields.io/pypi/pyversions/UnityPy.svg)](https://pypi.python.org/pypi/texture2ddecoder)
+[![Win/Mac/Linux](https://img.shields.io/badge/platform-windows%20%7C%20macos%20%7C%20linux-informational)]()
+[![MIT](https://img.shields.io/pypi/l/UnityPy.svg)](https://github.com/K0lb3/texture2ddecoder/blob/master/LICENSE)
+[![Build Status](https://travis-ci.com/K0lb3/texture2ddecoder.svg?branch=master)](https://travis-ci.com/K0lb3/texture2ddecoder)
+[![Build Status (Github)](https://github.com/K0lb3/texture2ddecoder/workflows/Test%20and%20Publish/badge.svg?branch=master)](https://github.com/K0lb3/texture2ddecoder/actions?query=workflow%3A%22Test+and+Publish%22)
+
+A python wrapper for [Perfare](https://github.com/Perfare)'s [Texture2DDecoder](https://github.com/Perfare/AssetStudio/tree/master/Texture2DDecoder)
+
+Some changes were made to the original code to make it cross-platform compatible.
+
+1. [Installation](https://github.com/K0lb3/texture2ddecoder#installation)
+2. [Example](https://github.com/K0lb3/texture2ddecoder#example)
+3. [Functions](https://github.com/K0lb3/texture2ddecoder#functions)
+
+## Installation
+
+```cmd
+pip install texture2ddecoder
+```
+
+or download/clone the git and use
+
+```cmd
+python setup.py install
+```
+
+## Example
+
+```python
+import texture2ddecoder
+
+# load sample data
+data = open("astc_sample", "rb").read()
+
+# decode data
+width = 512
+height = 512
+block_width = block_height = 4
+
+decoded_data= texture2ddecoder.decode_astc(data, width, height, block_width, block_height)
+
+# load raw image data
+dec_img = Image.frombytes("RGBA", (width, height), decoded_data, 'raw', ("BGRA"))
+```
+
+## Functions
+
+* All functions accept only arguments, no keywords.
+* decode_pvrtc can cause segfaults on Mac OS
+
+#### decode_bc1
+
+*decompresses bc1 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_bc3
+
+*decompresses bc3 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_pvrtc
+
+*decompresses pvrtc textures to BGRA*
+
+Params: bytes data, long width, long height, bool is2bpp
+Return: bytes
+
+#### decode_etc1
+
+*decompresses etc1 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_etc2
+
+*decompresses etc2 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_etc2a1
+
+*decompresses etc2a1 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_etc2a8
+
+*decompresses etc2a8 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_eacr
+
+*decompresses eacr textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_eacr_signed
+
+*decompresses eacr_signed textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_eacrg
+
+*decompresses eacrg textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_eacrg_signed
+
+*decompresses eacrg_signed textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_bc4
+
+*decompresses bc4 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_bc5
+
+*decompresses bc5 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_bc6
+
+*decompresses bc6 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_bc7
+
+*decompresses bc7 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_atc_rgb4
+
+*decompresses atc_rgb4 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_atc_rgba8
+
+*decompresses atc_rgba8 textures to BGRA*
+
+Params: bytes data, long width, long height
+Return: bytes
+
+#### decode_astc
+
+*decompresses astc textures to BGRA*
+
+Params: bytes data, long width, long height, int block_width, int block_height
+Return: bytes
+
+#### unpack_crunch
+
+*decompresses crunch textures to BGRA*
+
+Params: bytes data
+Return: bytes
+
+#### unpack_unity_crunch
+
+*decompresses unity_crunch textures to BGRA*
+
+Params: bytes data
+Return: bytes
+
+
+
+
+%prep
+%autosetup -n texture2ddecoder-1.0.4
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-texture2ddecoder -f filelist.lst
+%dir %{python3_sitearch}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Thu May 18 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0.4-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..a096d5a
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+70c8a5b83856cd770f143b44241696cf texture2ddecoder-1.0.4.tar.gz