Skip to content

[Good First Issue] Implement Image component (PNG/JPEG) #2

@wangnaihe

Description

@wangnaihe

Module

w3cos-std + w3cos-runtime/src/render.rs

Description

Add an Image { src } component kind. Decode PNG/JPEG images and render them using tiny-skia.

Acceptance Criteria

  • New Component::image(src, style) constructor
  • Support PNG and JPEG formats
  • Render the image within the layout bounds respecting width/height styles
  • Add an example app that displays an image

Difficulty

Low-Medium

Relevant Files

  • crates/w3cos-std/src/component.rs — Add Image variant
  • crates/w3cos-runtime/src/render.rs — Render the image pixels
  • crates/w3cos-runtime/src/layout.rs — Layout for image nodes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions