Re: Drawing Pixels with NSBezierPath
Re: Drawing Pixels with NSBezierPath
- Subject: Re: Drawing Pixels with NSBezierPath
- From: Scott Thompson <email@hidden>
- Date: Tue, 6 Jul 2004 22:34:38 -0500
On Jul 6, 2004, at 5:20 PM, Steve Sims wrote:
On 6 Jul 2004, at 16:52, Shawn Erickson wrote:
Only fall back on doing this if needed because of performance and
consider any need to print out or otherwise export the images
generated. Finally consider the assumption of 1 pixel per point in
the 72 DPI world because that assumption may change in the future.
I second the call to not assume 1 pixel per point and 72DPI. After
all, what would happen if you're presented with display with much
greater pixel density? Drawing individual pixels then can result in
tiny images.
Check out this monitor, for instance:
http://www.viewsonic.com/products/desktopdisplays/lcddisplays/
proseries/vp2290b/
A 22.2 inch display with an astounding 9.2 megapixels - that's
3840x2400, or roughly 5x the pixel density of most LCDs - over 200DPI.
The reports I've heard is that this is a great monitor, but the
common complaint is that desktop displays are tiny - text and window
furniture is drawn so small it's difficult to see. It would make a
great deal of sense for a desktop to be rendered at a higher DPI level
on screens like this. I would not be surprised if Quartz was capable
of drawing at a higher resolution already.
In the interest of picking nits and providing interesting, albeit
pedantic, information to the discussion... Quartz doesn't have to
change in order to support drawing at (just about) any resolution.
Quartz is based on the same imaging model as PostScript in which
drawings always occur in "User Space". The basic unit of user space is
the "point". The idea of "points" comes from the world of typography.
For a painfully exhaustive discussion of the topic see
<
http://home.att.net/~tom.brodhead/points.htm>. The point is that in
the world of typography, depending on whose values you use, a "point"
will be some value close to 1/72 of an inch. In PostScript, however, a
point is defined to be exactly 1/72 of an inch.
Before the "user space" can be realized on any given device (be it the
screen, or a printer, or your neighbor's pet poodle), the drawing
commands go through a transformation matrix that map from user space to
device space. The upshot of this is that the resolution of the device
space is completely independent of the definitions of User Space. This
means that Quartz can already draw at almost any arbitrary resolution
simply by using the appropriate transformation to take the drawing
commands from user space to device space.
What's missing is the mechanism in the operating system to tell you
what transformation matrix you need to take your drawing from user
space to the correct device space of the monitor that would cause a 72
point line to take up 1 inch of space if you held a ruler to your
monitor.
Right now the operating system makes the simplifying assumption that
the transformation matrix you want is one that maps one point in user
space to one pixel in device space (so one point becomes one pixel on
the screen) but that mapping is already inaccurate on many of the
monitors I use (which range from 90 pixels/inch to 120 pixels/inch). I
would not be surprised to see that change in the near future as
higher-density monitors and devices become more widely available.
The point, however, is that the ability to draw at higher resolutions
is not a limitation of the Quartz drawing model, rather it is a
limitation of other parts of the operating system and the applications
that run on it.
Scott
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.