Skip to content

Comments

Canvas::get_pixel: Use a virtual colorspace#2931

Draft
provigz wants to merge 6 commits intomasterfrom
get-pixel-colorspaces
Draft

Canvas::get_pixel: Use a virtual colorspace#2931
provigz wants to merge 6 commits intomasterfrom
get-pixel-colorspaces

Conversation

@provigz
Copy link
Member

@provigz provigz commented Apr 29, 2024

Virtual colorspaces, consisting of colored shapes, can now be used for the get_pixel API, instead of relying on the GPU.

TODO:

  • Detect, or allow to specify lightsprites as circles with a radius and border radius, making the light check more visually correct.
  • Divide Spotlight light sprite into two and draw them separately, to achieve a more exact light check by specifying a circle radius for each.
  • Make sure the shape of every lightsprite, needed to be detected by the get_pixel API, is being added into the LIGHTSPRITES colorspace.
  • More extensive testing.

Fixes #2661. Fixes #1939 (theoretically, should also be tested).

Virtual colorspaces, consisting of colored shapes, can now be used for the `get_pixel` API, instead of relying on the GPU.

**TODO:**

[ ] Detect, or allow to specify lightsprites as circles with a radius and border radius, making the light check more visually correct.
[ ] Make sure the shape of every lightsprite, needed to be detected by the `get_pixel` API, is being added into the `LIGHTSPRITES` colorspace.
[ ] More extensive testing.

Fixes #2661. Fixes #1939 (theoretically, should also be tested).
@provigz provigz added status:in-progress Progress has been done, but more is intended be done category:code type:bugfix Pull Requests that fix bugs. labels Apr 29, 2024
@provigz provigz added this to the 0.7.0 milestone Jan 25, 2025
@v1993
Copy link

v1993 commented Jul 9, 2025

Perhaps call it something other than a color space, given that the term already has a well-established definition? Something like a virtual canvas layer, maybe, since it's basically an additional simple CPU-side render target.

@provigz provigz modified the milestones: 0.7.0, 0.7.1 Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:code involves:performance status:in-progress Progress has been done, but more is intended be done type:bugfix Pull Requests that fix bugs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Magic Tiles affected by light intensity Magic Blocks Rublight/Ambient light inconsistency

3 participants