Crate pmd_wan

Source

Re-exports§

pub use wan_image::WanImage;

Modules§

image_tool
wan_image

Structs§

Animation
An Animation is a set of AnimationFrame, that will be played one after the other, and that would loop most of the time. The duration between an AnimationFrame and the next one is contained in the AnimationFrame
AnimationFrame
A single frame of an crate::Animation
AnimationStore
Contain all the Animation, as well as all the animation group (a.k.a animation table in ppmdu sprite editor). Animation group are a list of Animation. An animation group usually have 8 entry, one per rotation of the monster.
Fragment
A Fragment may reference an crate::FragmentBytes, that will form a single (or all if small enought) part of an crate::Frame
FragmentBytes
FragmentBytesStore
FragmentFinderData
The output of find_fragments_in_images. The fragment (here) are 8×8 pixel of size. A tile may be Flip on either or both axis (or not at all). Only the smallest of the 4 possible flip is added in this collection (based on the comparaison of the resulting pixels, as Rust compare u8 arrays). The key is the pixels of the fragment (image are stored line by line, from top-left to bottom-right) The key is where they are used. The x or y may be negative.
FragmentFlip
Frame
A single frame of animation
FrameOffset
The coordinate of some point in the Pokémon, in the form of X then Y
FrameStore
GeneralResolution
ImageBuffer
Represents an paletted image, with each pixel being an 8bits number.
NormalizedBytes
Represent a 8×8 bytes that is been normalized, as such that all four FragmentFlip will result in the same NormalizedBytes
OamShape
One of the possible shape usable by the DS’s OAM See LCD OBJ - OAM Attributes of GBATEK.
Palette
A palette, composed of group of 16 color when the first is transparent. Colors are RGBA.
VariableNormalizedBytes

Enums§

CompressionMethod
DecodeFragmentBytesError
FragmentBytesToImageError
FragmentFinderError
FragmentFlipError
SpriteType
WanError

Constants§

FLIP_BOTH
FLIP_HORIZONTAL
FLIP_STANDARD
FLIP_VERTICAL

Functions§

create_wan_from_multiple_images
decode_fragment_pixels
Take the raw encoded fragment (from an [ImageBytes]), and decode them into a list of pixels
encode_fragment_pixels
find_fragments_in_images
Find all 8×8 fragment all input images contain. See FragmentFinderData for more information on the output The image is filled on all sides (7 pixels) by 0s. Fragments consisting of only zeroes are discared. 0×0 images are skipped.
get_bit_u16
A utility function that get the byte at the position “id” from “bytes”. From the left. If the id is >= 16, then it return None, otherwise return Some.
get_opt_le
insert_frame_in_wanimage
pad_seven_pixel