Architecture
This page provides an overview of the TotemLib architecture and how the different components work together.
Component Overview
TotemLib consists of several key components that work together to generate totem textures:
- Skin: Loads and processes Minecraft skin files
- TotemBuilder: Configures and orchestrates the totem generation process
- Styles: Define how the skin is transformed into a totem
- Totem: Represents the final generated totem texture
Component Relationships
Here's how these components interact:
- The Skin class loads a Minecraft skin file and provides methods to access its different parts.
- The TotemBuilder takes a Skin object and configuration options.
- When
build()
is called, the TotemBuilder creates a Style instance (WavyStyle, STTStyle, or a custom style). - The Style uses the Skin to generate a totem image.
- The TotemBuilder creates a Totem object with the generated image and configuration.
- The Totem can be scaled and saved as needed.
Data Flow
The data flow in TotemLib follows this pattern:
Minecraft Skin File → Skin → TotemBuilder → Style → Totem → Final Image
Extensibility
TotemLib is designed to be extensible:
- You can create custom styles by inheriting from AbstractStyle
- The TotemBuilder accepts additional keyword arguments that are passed to the style
- The Totem class provides methods for further processing the generated image
This architecture allows for a high degree of customization while maintaining a simple API for basic use cases.