ShiftData method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

 

Syntax

short ShiftData (ILEADRaster *pRasterDst, LPDISPATCH pRasterSrc, long lSrcLowBit, long lSrcHighBit, long lDstLowBit, long lDstBitsPerPixel);

Overview

Refer to Grayscale Images

Remarks

(Medical only) Selects a specified number of bits from an 8, 12 or 16-bit grayscale bitmap into a mask and places the mask in a new 8, 12 or 16-bit grayscale bitmap.

This method is used mainly as a visualization aid. You can select certain bits of the bitmap and display them in another bitmap.

You can use this method for other purposes than visualization. For example, let’s say you loaded a 16-bit file that has the pixels in Motorola format (where the high and low bytes are swapped). You can swap the high and low 8 bits for each pixel by calling this method twice and OR-ing the results.

When the function returns successfully the pRasterDst will be an 8, 12 or 16-bit grayscale.

For 8, 12 and 16-bit grayscale bitmaps, the lSrcLowBit can range from 0 to 7, 0 to 11, and 0 to 15 respectively. However if this value exceeds the range, then the method will not return an error, and the pRasterDst will be a pure black bitmap.

The lSrcHighBit must be greater than or equal to lSrcLowBit. The method will return an invalid parameter error if lSrcHighBit < lSrcLowBit.

The lDstLowBit can range from 0 to lDstBitsPerPixel – 1. If you pass greater values for lDstLowBit, the method will not return an error, but pRasterDst will become a pure black bitmap.

This method supports 8, 12 and 16-bit grayscale bitmaps only. Support for 12 and 16-bit grayscale images are available only in the Document/Medical toolkits. It also can process the whole image or a region. If a bitmap has a region, the effect is applied only to the region.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements:

SelectData method, ColorizeGray method

Topics:

Raster Image Functions: Doing Color Expansion or Reduction