Console-Swizzler
C library to swizzle DDS textures for console games
|
Class for context of swizzling. More...
#include <console-swizzler.h>
Public Member Functions | |
_SWIZ_EXTERN SwizContext * | swizNewContext () |
Creates a new context. | |
_SWIZ_EXTERN void | swizFreeContext (SwizContext *context) |
Frees the memory of a context. | |
_SWIZ_EXTERN void | swizContextInit (SwizContext *context) |
Initialize attributes of a context. | |
_SWIZ_EXTERN SwizError | swizContextSetPlatform (SwizContext *context, SwizPlatform platform) |
Sets platform information to context. | |
_SWIZ_EXTERN SwizError | swizContextSetTextureSize (SwizContext *context, int width, int height) |
Sets width and height to context. | |
_SWIZ_EXTERN void | swizContextSetHasMips (SwizContext *context, int has_mips) |
Sets if textures have mipmaps or not. | |
_SWIZ_EXTERN SwizError | swizContextSetArraySize (SwizContext *context, int array_size) |
Sets the number of textures in a buffer. | |
_SWIZ_EXTERN SwizError | swizContextSetGobsHeight (SwizContext *context, int gobs_height) |
Sets the max height of GOBs blocks for switch. | |
_SWIZ_EXTERN SwizError | swizContextSetBlockInfo (SwizContext *context, int block_width, int block_height, int block_data_size) |
Sets block size to context. | |
_SWIZ_EXTERN SwizError | swizContextGetLastError (SwizContext *context) |
Gets error status of context. | |
_SWIZ_EXTERN uint32_t | swizGetSwizzledSize (SwizContext *context) |
Gets binary size of swizzled data. | |
_SWIZ_EXTERN uint32_t | swizGetUnswizzledSize (SwizContext *context) |
Gets binary size of unswizzled data. | |
_SWIZ_EXTERN uint8_t * | swizAllocSwizzledData (SwizContext *context) |
Allocates a buffer for swizzled data. | |
_SWIZ_EXTERN uint8_t * | swizAllocUnswizzledData (SwizContext *context) |
Allocates a buffer for unswizzled data. | |
_SWIZ_EXTERN SwizError | swizDoSwizzle (const uint8_t *data, uint8_t *swizzled, SwizContext *context) |
Swizzles a texture. | |
_SWIZ_EXTERN SwizError | swizDoUnswizzle (const uint8_t *data, uint8_t *unswizzled, SwizContext *context) |
Unswizzles a texture. | |
Class for context of swizzling.
_SWIZ_EXTERN uint8_t * swizAllocSwizzledData | ( | SwizContext * | context | ) |
Allocates a buffer for swizzled data.
context | SwizContext instance |
_SWIZ_EXTERN uint8_t * swizAllocUnswizzledData | ( | SwizContext * | context | ) |
Allocates a buffer for unswizzled data.
context | SwizContext instance |
_SWIZ_EXTERN SwizError swizContextGetLastError | ( | SwizContext * | context | ) |
Gets error status of context.
context | SwizContext instance |
_SWIZ_EXTERN void swizContextInit | ( | SwizContext * | context | ) |
Initialize attributes of a context.
context | The context to initialize |
_SWIZ_EXTERN SwizError swizContextSetArraySize | ( | SwizContext * | context, |
int | array_size | ||
) |
Sets the number of textures in a buffer.
context | SwizContext instance |
array_size | The number of textures in a buffer |
_SWIZ_EXTERN SwizError swizContextSetBlockInfo | ( | SwizContext * | context, |
int | block_width, | ||
int | block_height, | ||
int | block_data_size | ||
) |
Sets block size to context.
context | SwizContext instance |
block_width | Width of a block |
block_height | Height of a block |
block_data_size | Data size of a block |
_SWIZ_EXTERN SwizError swizContextSetGobsHeight | ( | SwizContext * | context, |
int | gobs_height | ||
) |
Sets the max height of GOBs blocks for switch.
context | SwizContext instance |
gobs_height | The max height for blocks of GOBs |
_SWIZ_EXTERN void swizContextSetHasMips | ( | SwizContext * | context, |
int | has_mips | ||
) |
Sets if textures have mipmaps or not.
context | SwizContext instance |
has_mips | Whether if texutures have mipmaps or not |
_SWIZ_EXTERN SwizError swizContextSetPlatform | ( | SwizContext * | context, |
SwizPlatform | platform | ||
) |
Sets platform information to context.
context | SwizContext instance |
platform | This should be #SWIZ_PLATFORM_PS4 |
_SWIZ_EXTERN SwizError swizContextSetTextureSize | ( | SwizContext * | context, |
int | width, | ||
int | height | ||
) |
Sets width and height to context.
context | SwizContext instance |
width | Width of images |
height | Height of images |
_SWIZ_EXTERN SwizError swizDoSwizzle | ( | const uint8_t * | data, |
uint8_t * | swizzled, | ||
SwizContext * | context | ||
) |
Swizzles a texture.
data | Unswizzled data. Data size should be equal to swizGetUnswizzledSize(). |
swizzled | Swizzled data. Data size should be equal to swizGetSwizzledSize(). |
context | SwizContext instance |
_SWIZ_EXTERN SwizError swizDoUnswizzle | ( | const uint8_t * | data, |
uint8_t * | unswizzled, | ||
SwizContext * | context | ||
) |
Unswizzles a texture.
data | Swizzled data. Data size should be equal to swizGetSwizzledSize(). |
unswizzled | Unswizzled data. Data size should be equal to swizGetUnswizzledSize(). |
context | SwizContext instance |
_SWIZ_EXTERN void swizFreeContext | ( | SwizContext * | context | ) |
Frees the memory of a context.
context | The context to free memory |
_SWIZ_EXTERN uint32_t swizGetSwizzledSize | ( | SwizContext * | context | ) |
Gets binary size of swizzled data.
context | SwizContext instance |
_SWIZ_EXTERN uint32_t swizGetUnswizzledSize | ( | SwizContext * | context | ) |
Gets binary size of unswizzled data.
context | SwizContext instance |
_SWIZ_EXTERN SwizContext * swizNewContext | ( | ) |
Creates a new context.