Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

canvas_ity port #860

Closed
15 tasks done
p0nce opened this issue Oct 3, 2024 · 6 comments
Closed
15 tasks done

canvas_ity port #860

p0nce opened this issue Oct 3, 2024 · 6 comments
Labels
Documentation This issue is about documentation. Enhancement This issue is about a new feature rather than a bug.

Comments

@p0nce
Copy link
Collaborator

p0nce commented Oct 3, 2024

The goal is to have before 1.0.0

  • Use colors library instead of passing 4 floats, deprecate old method
  • gamma-space yes or no? => assuming gamma 2.0 is almost the same but much faster than sRGB conversions
  • premultiplied yes or no? => yes always
  • Integrate into dplug:canvas, allows to use HTML colors, ImageRef!RGBA, ImageRef!L16 => no, separate library
  • a slower but more featureful Canvas, named Canvasity (ISC licence) which borrow from canvas_ity.h
  • make it work, no gradients
  • without allocations
  • resembling HTML5 Canvas even more
  • remove fonts... for now, since the API not good
  • remove gradients... for now, since the API not good
  • getImageData must work => no, removed, dithering removed
  • putImageData must work => no, removed
  • backing buffer can be any PixelType

Decisions:

  • should the canvas backing store be owned by the canvas, or external like in dplug:canvas? The latter uses less memory, but also it's lesser quality. => external
  • Perhaps more something that could be integrated in Gamut? => no, and doesn't need a dep on that either
@p0nce p0nce added Enhancement This issue is about a new feature rather than a bug. Documentation This issue is about documentation. labels Oct 3, 2024
@p0nce
Copy link
Collaborator Author

p0nce commented Oct 3, 2024

Current port can already do that
output

@p0nce
Copy link
Collaborator Author

p0nce commented Oct 11, 2024

  • colors package define a single, monomorphic, Color type (no dependencies apart libc), based upon CSS Color recommendation
  • gamut package define a single, monomorphic, Image type (depend on intel-intrinsics and soon colors), loosely based upon FreeImage design
  • canvasity package define a single, monomorphic, Canvasity type (depend on gamut and colors and intel-intrinsics and dplug:core for Vec and sorting), based upon Canvasity and made faster. This canvas can have any image type as underlying buffer!

@p0nce
Copy link
Collaborator Author

p0nce commented Oct 15, 2024

kinda functional, but need Dplug integration

  • Take vec2f and vec2i
  • Take box2f and box2i => no, later
  • take RGBA is possible => OK
  • take ImageRef!RGBA is possible => no, quite hard. Example in distort/levelmeter.d for how to use in Dplug

@p0nce
Copy link
Collaborator Author

p0nce commented Oct 15, 2024

  • v1.0.0 for canvasity => Leaks canvasity#1
  • Udpate distort example to use it.
  • turtle should have both canvas ready to use by user
  • trying on more important widget with curves, make visual comparisons
  • dplug:canvas should depends on colors and take a Color where possible.
  • More Wiki documentation, especially a case for when to use one or the other
  • pretty sure there are bugs when save/restore and matrices are involved => LATER
  • Minor tag and release
  • Update turtle to use colors for color parsing

@p0nce
Copy link
Collaborator Author

p0nce commented Oct 16, 2024

Comparison that highlight difference in integration.
image
Left is dplug:canvas, right is canvasity
alpha values needs to be boosted in canvasity to match, because of the gamma-aware blending.

@p0nce
Copy link
Collaborator Author

p0nce commented Oct 17, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation This issue is about documentation. Enhancement This issue is about a new feature rather than a bug.
Projects
None yet
Development

No branches or pull requests

1 participant