SE_rastileinfo_get_pixel_data

Retrieves the pixel tile’s data into a pixel buffer

Usage syntax

LONG SE_rastileinfo_get_pixel_data (SE_RASTILEINFO tile, void *pixel_buffer, LONG *length);

Parameters
tile The rastertileinfo handle
pixel_buffer A pointer to a pixel_buffer
length The number of bytes in the pixel buffer
Description

SE_rastileinfo_get_pixel_data retrieves the pixel data of a raster tile into a pixel buffer. You may allocate memory to the pixel buffer prior to calling the SE_rastileinfo_get_pixel_data or allow the function to allocate it for you. For pixel buffers managed by SE_rastileinfo_get_pixel_data, you must treat the memory as read-only and be aware that the pixel buffers contents are only valid until the next SE_rastileinfo_get_pixel_data function call.

The length returned may have one of three possible values:

     1) The number of bytes in a tile of pixels

     2) The number of bytes in a tile of pixels and the number of bytes in the bitmap

     3) Zero, which would indicate that the tile is empty

The length of the pixel buffer can be computed as follows, assuming that it is not 0:

1) If a bitmap is not present, the length of the pixel buffer must equal the product of the tile width rounded up to the byte and tile height and the pixel depth factor. The tile width and tile height are a property of rasterband and are obtained with the SE_rasterband_get_tile_size. The pixel depth factor is obtained from the pixel depth factor table listed below. The tile width must be rounded to the byte for 1-bit and 4-bit data. For example, if the pixel depth is 1-bit and the tile width is 43, you must round it up to 48, as ArcSDE will pad the last 5 bits.

    pixel length without bitmap = tile height * tile width rounded up to the byte* pixel depth factor

2) If a bitmap is present, the length of the pixel buffer must equal the sum of the length of the pixels computed in 1 and the bitmap. Since the bitmap sets a bit for each pixel in the pixel buffer it is computed as the product of the tile height and tile width divided by eight (since there are 8 bits to each byte of the bitmap). Note: you do not round the tile width up to the nearest byte to compute the bitmap. The bitmap is a packed stream of continuous bits and is not segmented according to the width of the tile.

    pixel length with bitmap = (tile height * tile width rounded up to the byte* pixel depth factor) + (tile height * tile width / 8)

Pixel Depth Factor Table: Listed below are the factors for each pixel depth supported by ArcSDE. The pixel depth is a property of the raster band and can be obtained with the SE_rasbandinfo_get_pixel_type function.

Pixel Depth

 Pixel Depth Factor

1-bit

 0.125

4-bit

0.5

8-bit

1

16-bit

2

32-bit

4

64-bit

8

Returns

SE_SUCCESS
SE_INVALID_POINTER

SE_INVALID_RASTILEINFO_OBJECT

SE_NET_FAILURE

SE_SDE_NOT_STARTED