Segfault > IT > Notes > Programming-Clutter

Links:


Remarks:

  • Stride/Rowstride
    • Buffers in video ram generally have a stride (also called pitch) associated with them. The stride is the width of the buffer in bytes. For example, if you have a 1024x768 pixel buffer at 16 bits/pixel (2 bytes/pixel), your stride would be: "1024 pixels * 2 bytes/pixel = 2048 bytes"
    • At 32 bits/pixel (4 bytes/pixel), your stride would be: "1024 pixels * 4 bytes/pixel = 4096 bytes"
    • Stride is important as it delineates where each line of the buffer starts and ends. With a linear buffer format, each line of the buffer follows the previous linearly in video ram.