webp-format
Installation
SKILL.md
WebP Format & libwebp Integration Skill (wlframe/C Style)
When to Apply
Use this skill when implementing, integrating, or reviewing WebP read/write C code in wlframe, especially in image/, buffer/, or related modules, or when using libwebp for WebP parsing/generation.
WebP Format Essentials
- WebP is a modern image format supporting lossy and lossless compression, alpha, animation.
- File is RIFF-based, starts with 'RIFF' and 'WEBP' signatures.
- Supports VP8 (lossy), VP8L (lossless), VP8X (extended), alpha, ICC profile, EXIF, XMP.
libwebp Integration & API Design
- Use official libwebp (https://github.com/webmproject/libwebp).
- Typical workflow:
- Use WebPDecode* or WebPEncode* APIs for decoding/encoding.
- Set up input/output (file or memory).
- Convert pixel data to/from wlframe's internal format as needed.
- Release all allocated resources.
- API prefix:
wlf_webp_. Useinit/createandfinish/destroypatterns. - Struct layout: hot fields first, group pointers/handles/flags, hide implementation details via
implpointer.