Repository navigation
image: add Go-inspired core image module - #27647
Conversation
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: abe0db278e
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return false | ||
| } | ||
| } | ||
| return true |
There was a problem hiding this comment.
Return false for empty palettes in opaque
When a non-empty Paletted image has an empty palette, at() reports every in-bounds pixel as color.transparent, but opaque() skips the palette loop and reaches this true, so callers can treat a fully transparent image as fully opaque. Add an empty-palette check (or otherwise align opaque() with at()'s empty-palette behavior) before this return.
Useful? React with πΒ / π.
Summary
imagevlib module with Go-stylePoint,Rectangle, uniform images, packed pixel buffers, paletted images, and Y'CbCr buffersimage.colorwith standard color structs, model conversion, palette lookup, Y'CbCr conversion, and CMYK conversionimageformat registration/sniff/decode hooks to Vio.Readerviaregister_format,decode, anddecode_configScope
This ports the core Go
image/image.colorbehavior into V-style APIs. Format-specific codec packages such as PNG, JPEG, and GIF are intentionally left out for follow-up PRs, but the registration hooks needed by such packages are included.Tests
./vnew -silent test vlib/image/./vnew check-md vlib/image/README.md