_gfx_read_2d / _gfx_write_2d

Reads a rectangular area from or writes one to a 2D image. This topic only applies to Intel® 64 and IA-32 architectures targeting Intel® Graphics Technology.

Syntax

void _gfx_read_2d(__gfx_surface_index img, int col, int row, void* dst, int dst_width, int dst_height);

void _gfx_write_2d(__gfx_surface_index img, int col, int row, void* src, int src_width, int src_height);

Parameters

img

The identifier of the 2D image to read from or write to. The 2D image is represented in the target code by variables of type __gfx_surface_index. For different representations of 2D images and the API to create them on the host side, see Asynchronous Offloading.

col, row

Coordinates of the upper left corner of the area to read within the image, col in image elements, row in rows.

The size of the element depends on the image format and the way it is created on the host side.

dst

A pointer to the target area in memory in which to store the result. The area is laid out linearly, row by row.

dst_width, dst_height

The width, in bytes, and height, in rows, of the area in the image to read. The actual parameters must be compile-time constants.

dst_width must be <=32. dst_width*dst_height must be <=256.

src

A pointer to the source area in memory. The area is laid out linearly, row by row.

src_width, src_height

The width, in bytes, and height, in rows, of the area in the image to write. The actual parameters must be compile-time constants.

src_width must be <=32. src_width*src_height must be <=256.

Description

_gfx_read_2d reads a rectangular area from a 2D image, identified by img, into memory that is pointed to by dst. The resulting area is laid out in that memory linearly, row by row.

_gfx_write_2d writes a rectangular area to a 2D image identified by img from memory that is pointed to by src.

Return Values

None

For more complete information about compiler optimizations, see our Optimization Notice.