In CVB .NET, there are two ways to access pixel data:
If the memory layout is linear, the most efficient way to access pixel data is through linear access:
(1) A monochrome 8-bit unsigned image is created. For monochrome images, the Create
function generates an image with a contiguous linear layout.
(2) Linear access is obtained for the first image plane.
(3) The base pointer to the image is obtained as well as the x and y increments.
(4) The pointer to the current line is computed.
(5) The pointer to the current pixel is computed.
(5) Pixel value is read.
(6) Pixel value is modified.
(7) Alternatively, you can access pixel values more conveniently using linearAccess[x, y]
, though at the cost of performance.
If linear access is not possible, the last resort is to use the slowest method: accessing the image via VPAT.
When linear access is not available, the next option is to access the image through the slower method: VPAT-based access, as described in VPAT Memory Layout.
(1) Obtain VPA table with the appropriate type.
(2) Access the pixel value.