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

Research: Transparency & hatch form in arc ring #16

Open
LinqLover opened this issue Feb 23, 2021 · 1 comment
Open

Research: Transparency & hatch form in arc ring #16

LinqLover opened this issue Feb 23, 2021 · 1 comment

Comments

@LinqLover
Copy link
Owner

No description provided.

@LinqLover
Copy link
Owner Author

LinqLover commented Feb 23, 2021

Some findings:

  • We could cache the basic shape of each arc ring in a Form
  • When drawing it, we could render a rectangle first, reusing the usual Morph>>drawOn: implementation, and then use #image:at:sourceRect:rule:alpha: with rule Form and to limit the visible area (first and operand should be white for arc-ring pixels and transparent for all others). Don't know how many helper forms this requires.
  • With this approach, custom effects, including transparency, should be possible.
  • Furthermore, the cache might help us speed up the overall drawing.

Small example:

m := Morph new.
m extent: 256 @ 256.
m useGradientFill.
m fillStyle colorRamp at: 1 put: 0 -> (m fillStyle colorRamp first value  ccmWithAlpha: 0.5).

form1 := Form extent: m extent depth: 32.
form1 getCanvas fillOval: (0 @ 0 rect: form1 extent) color: Color white.
form1 getCanvas image: m imageForm at: 0 @ 0 sourceRect: (0 @ 0 rect: form1 extent) rule: Form and.
form1 openAsMorph.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant