[Cuis-dev] QuickDraw Regions and Morphic 3.

LawsonEnglish LEnglish5 at cox.net
Thu Jul 30 06:21:58 PDT 2020


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


More information about the Cuis-dev mailing list