All images are given a pitch. The pitch is basically what can be described as "length of a line". What's funny is that the pitch does not have to be equal to the width of the image.
For instance, if you crop something off your image, the only thing that changes is the width of your image; the pitch and the actual byte-count of a line remains the same.
The image is then laid out like this:
rrrrrrrrrrrrrrrrpppp
rrrrrrrrrrrrrrrrpppp
rrrrrrrrrrrrrrrrpppp
Where 'r' are the pixels inside the image used, and 'p' is the padding inserted after each line.
Width = width in pixels.
Rowsize = number of bytes in one line.
Pitch = distance from start of one line to the next in bytes.
vi->BytesFromPixels(n) = size of n pixels in bytes - does NOT take pitch into consideration, so can only be used within a line.
For the PlanarImageFormat:
Aligned rowsize = width in bytes, always divisible with 8.
PVideoFrame contains information about a particular frame you requested. Height and Rowsize should not change (this can be considered a bug). Pitch can change, so you cannot rely on pitch being the same for all frames you recieve.
See more about DataStorageInAviSynth.
See more about ColorSpaces.
$Date: 2006/11/08 20:40:17 $
Original version of this document at http://www.avisynth.org/WorkingWithImages