Hardware Dev Center

DrvIcmSetDeviceGammaRamp function

The DrvIcmSetDeviceGammaRamp function sets the hardware gamma ramp of the specified display device.

Syntax


BOOL DrvIcmSetDeviceGammaRamp(
   DHPDEV dhpdev,
   ULONG  iFormat,
   LPVOID lpRamp
);

Parameters

dhpdev

Handle to the physical device's PDEV. This identifies the physical device whose gamma ramp is to be set.

iFormat

Specifies the data format of the buffer to which lpRamp points. This parameter is always IGRF_RGB_256WORDS.

lpRamp

Pointer to the buffer containing the gamma ramp to be set on the device. The format of the data in this buffer is determined by iFormat.

When iFormat is IGRF_RGB_256WORDS, lpRamp points to a GAMMARAMP structure that defines the 256-entry ramps to be set for each of the red, blue, and green color channels. Each value is described using 16-bit precision. If the hardware has fewer bits of precision, it should downshift and use the most significant bits, without rounding.

Return value

DrvIcmSetDeviceGammaRamp returns TRUE upon success. Otherwise, it returns FALSE.

Remarks

Drivers for display devices with loadable hardware gamma ramps should implement this function.

DrvIcmSetDeviceGammaRamp should fail if it is called with any other value besides IGRF_RGB_256WORDS in iFormat.

The driver hooks this function by setting the GCAPS2_CHANGEGAMMARAMP flag in the flGraphicsCaps2 field of the DEVINFO structure passed to DrvEnablePDEV. If the driver is running in a palettized 8bpp mode, this capability is optional.

Requirements

Target platform

Desktop

Header

Winddi.h (include Winddi.h)

See also

DrvEnablePDEV

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft