• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Coordinates of Pixels
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coordinates of Pixels


  • Subject: Re: Coordinates of Pixels
  • From: Greg Titus <email@hidden>
  • Date: Wed, 18 Jul 2007 13:21:00 -0700


On Jul 18, 2007, at 1:06 PM, Richard Somers wrote:

This may be elementary computer graphics but I can't seem to find the answer.

Consider a rectangular matrix of pixels in device space with the origin at the lower left corner. Is the pixel at the lower left corner pixel 0, 0 or pixel 1, 1?

The pixel at the lower left corner is the rectangle with origin 0,0 and size 1,1.


When mapping from user space to device space (userSpaceScaleFactor = 1.0) are pixels considered located at even integer boundaries or half way in-between?

Half way in between. It helps me to think of the coordinates as a grid between the pixels, and the pixels as the little boxes made by the grid lines.


The Cocoa Drawing Guide example Listing 3-1 for pixel-exact drawing adjusts the origin of the drawn rectangle by 0.5 in x and y. This would lead you to the conclusion that the center of the pixels fall on 0.5 increment boundaries when overlaid with a floating point coordinate system from user space. Is this a correct conclusion?

Exactly.

Hope this helps,
	- Greg
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Coordinates of Pixels
      • From: Richard Somers <email@hidden>
    • Re: Coordinates of Pixels
      • From: Richard Somers <email@hidden>
References: 
 >Coordinates of Pixels (From: Richard Somers <email@hidden>)

  • Prev by Date: Coordinates of Pixels
  • Next by Date: Re: Coordinates of Pixels
  • Previous by thread: Coordinates of Pixels
  • Next by thread: Re: Coordinates of Pixels
  • Index(es):
    • Date
    • Thread