logoalt Hacker News

jimbob45today at 1:48 AM2 repliesview on HN

What is pitch in regard to a rectangle in question two?


Replies

hcstoday at 5:38 AM

Pitch is the offset between the start of consecutive rows of pixels in the image, used to convert y coordinates into the start of any given row, so you access a pixel as buffer[y*pitch+x]. Often this is the image width, but can be greater depending on required alignment.

show 1 reply