GreDeviceAnimatePalette

From EDM2
Revision as of 04:00, 16 January 2020 by Martini (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

GreDeviceAnimatePalette is the presentation driver version of GreAnimatePalette. It is called to process an application's GreAnimatePalette request. The purpose of this function is to modify the RGB values in the hardware palette rapidly and make the changes apparent immediately. Changes are reflected immediately for each logical palette entry that is marked as PC-RESERVED and is associated with a hardware slot. The RGB value on the logical application's palette, as well as the hardware palette itself, are updated.

This function can be hooked by the presentation driver.

Simulation support
This function is simulated by a handling routine in Revision 2.0 (or higher) of the graphics engine.

Syntax

GreDeviceAnimatePalette(hdc, hdevpal, ulFormat, ulStart, cclr, pclr, pInstance, lFunction);

Parameters

hdc (HDC) - input
Device context handle.
hdevpal (ULONG) - input
Device palette handle.
ulFormat (ULONG) - input
Specifies the entry format. Must be LCOLF_CONSECRGB.
ulStart (ULONG) - input
Starting index, that is, the first palette entry to change.
cclr (ULONG) - input
Count of the palette entries to change.
pclr (PULONG) - input
Pointer to table of new RGB2 palette entries.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreDeviceAnimatePalette.

Returns

rc (ULONG) - returns
Return codes.
PAL-ERROR Error Count of the hardware palette slots changed.
Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:
  • PMERR_PALETTE_BUSY
  • PMERR_INV_IN_AREA
  • PMERR_INV_IN_PATH.


Sample

#define INCL_GRE_PALETTE
#include <os2.h>

HDC       hdc;        /*  Device context handle. */
ULONG     hdevpal;    /*  Device palette handle. */
ULONG     ulFormat;   /*  Specifies the entry format. Must be LCOLF_CONSECRGB. */
ULONG     ulStart;    /*  Starting index, that is, the first palette entry to change. */
ULONG     cclr;       /*  Count of the palette entries to change. */
PULONG    pclr;       /*  Pointer to table of new RGB2 palette entries. */
PVOID     pInstance;  /*  Pointer to instance data. */
ULONG     lFunction;  /*  High-order WORD=flags; low-order WORD=NGreDeviceAnimatePalette. */
ULONG     rc;         /*  Return codes. */

rc = GreDeviceAnimatePalette(hdc, hdevpal,
       ulFormat, ulStart, cclr, pclr, pInstance,
       lFunction);


Remarks

This function modifies the colors in a palette. Changes are reflected immediately for each animated index that has a hardware slot.