[Cuis-dev] QuickDraw Regions and Morphic 3.

Juan Vuletich juan at jvuletich.org
Thu Jul 30 08:18:16 PDT 2020


Hi Lawson,

Welcome to the Cuis community!

(below)
On 7/30/2020 10:21 AM, LawsonEnglish via Cuis-dev wrote:
> Hi all.
>
> Being bored and strange, I decided to look into adding the ability to handle an implementation of QUickDraw regions within some variation of Bitmaps on Squeak.
>
> Seing how Morphic 3 is meant to use vector graphics, I was unsure if it would be of value in that context or not.
>
> One thing I realized as I analyzed the main strategyused in QD  is that QD regions are limited because of a need for speed.
>
> Scanlines were originally terminated with 0x7fff and the entire region was terminated with 0x7fff7fff, but that was so it could fit into a 32-bit register.
>
> With 1,000x faster processors and 64-bit and VeryLargeIntegers available, there’s no practical limit (other than speed) to the theoretical size of the region. Any unique number maximum number could be used as the flag:
>
> 0x7fff for optimization on 32-bit machines via slang, or 0x7fffffff for 64-bit machines, or any old randomly chosen max width&  height if speed isn’t that big an issue.
>
> The question, of course, is: are pixel-based regions still useful in a vector graphics based system?
>
> Keep in mind that all regions define is when to pick up or put down the pen (or pattern/color/algorithmic equivalent). That regions were originally defined for 1 bit per pixel screens says nothing about the number of colors supported in the drawing system.
>
> There are other uses for pixel-based regions besides graphics (to describe accurately the non-zero elements of a sparse matrix for example), but graphics was the original usecase for them, so I was wondering if it would be of use in Cuis for Mophic 3 vector graphics or not?
>
> You can define a region’s  size in terms of any number of pixels and scale up or down from there, so in theory, at least, you could have pixel precise regions defined for the entire vector graphics space of a 32-bit or 64-bit vector graphics system. It might be a tad unwieldy to use in the naive implementation of course.
>
>
> L

I think Lisa Regions are a great idea. I'm sure they would have been 
extremely useful in a 1bpp system like the original Smalltalk-80. They 
are also useful for specifying areas to repair, or to react to events. 
If a single color is used for paint, they can fully specify a shape to 
be drawn, even if full color systems.

In Cuis, with anti aliased Vector Graphics, their application is more 
restricted, as in the pixels that lie in the anti aliased boundary 
between shapes, we use alpha blending between background and foreground. 
That means that those pixels actually belong to both of them.

But I'm sure we'll find good use for them.

Thanks!

-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich



More information about the Cuis-dev mailing list