NvMedia Image Pitch-Linear

This example reads an image surface that represents a YUV 444 8-bit pitch-linear planar surface.

NvMediaImageSurfaceMap surfaceMap;
NvMediaStatus status;
NvMediaImageLock(image,
                    NVMEDIA_IMAGE_ACCESS_READ,
                    &surfaceMap);
for ( i = 0; i < surfaceMap.height; i++) {
    for ( j = 0; j < surfaceMap.width; j++) {
        /* Pitch-linear addressing */
        index = i*surfaceMap.surface[0].pitch + j;       
        ...
        Read surfaceMap.surface[0].mapping[index]   /* Y plane */
        Read surfaceMap.surface[1].mapping[index]   /* U plane */
        Read surfaceMap.surface[2].mapping[index]   /* V plane */
        ...
    }
}