ReactOS  0.4.15-dev-1201-gb2cf5a4
color.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _COLORSPACE
 
struct  _COLORTRANSFORMOBJ
 

Macros

#define PC_SYS_USED   0x80 /* Palentry is used (both system and logical) */
 
#define PC_SYS_RESERVED   0x40 /* System palentry is not to be mapped to */
 
#define PC_SYS_MAPPED   0x10 /* Logical palentry is a direct alias for system palentry */
 
#define NB_RESERVED_COLORS   20 /* Number of fixed colors in system palette */
 
#define COLORSPACEOBJ_AllocCS()   ((PCOLORSPACE) GDIOBJ_AllocObj(GDIObjType_ICMLCS_TYPE))
 
#define COLORSPACEOBJ_AllocCSWithHandle()   ((PCOLORSPACE) GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_COLORSPACE, sizeof(COLORSPACE)))
 
#define COLORSPACEOBJ_LockCS(hCS)   ((PCOLORSPACE)GDIOBJ_LockObject((HGDIOBJ)hCS, GDIObjType_ICMLCS_TYPE))
 
#define COLORSPACEOBJ_UnlockCS(pCS)   GDIOBJ_vUnlockObject((POBJ)pCS)
 

Typedefs

typedef struct _COLORSPACE COLORSPACE
 
typedef struct _COLORSPACEPCOLORSPACE
 
typedef struct _COLORTRANSFORMOBJ GDICLRXFORM
 
typedef struct _COLORTRANSFORMOBJ COLORTRANSFORMOBJ
 
typedef struct _COLORTRANSFORMOBJPCOLORTRANSFORMOBJ
 

Functions

UINT FASTCALL IntGdiRealizePalette (HDC)
 

Variables

HCOLORSPACE hStockColorSpace
 

Macro Definition Documentation

◆ COLORSPACEOBJ_AllocCS

#define COLORSPACEOBJ_AllocCS ( )    ((PCOLORSPACE) GDIOBJ_AllocObj(GDIObjType_ICMLCS_TYPE))

Definition at line 17 of file color.h.

◆ COLORSPACEOBJ_AllocCSWithHandle

#define COLORSPACEOBJ_AllocCSWithHandle ( )    ((PCOLORSPACE) GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_COLORSPACE, sizeof(COLORSPACE)))

Definition at line 18 of file color.h.

◆ COLORSPACEOBJ_LockCS

#define COLORSPACEOBJ_LockCS (   hCS)    ((PCOLORSPACE)GDIOBJ_LockObject((HGDIOBJ)hCS, GDIObjType_ICMLCS_TYPE))

Definition at line 19 of file color.h.

◆ COLORSPACEOBJ_UnlockCS

#define COLORSPACEOBJ_UnlockCS (   pCS)    GDIOBJ_vUnlockObject((POBJ)pCS)

Definition at line 20 of file color.h.

◆ NB_RESERVED_COLORS

#define NB_RESERVED_COLORS   20 /* Number of fixed colors in system palette */

Definition at line 7 of file color.h.

◆ PC_SYS_MAPPED

#define PC_SYS_MAPPED   0x10 /* Logical palentry is a direct alias for system palentry */

Definition at line 5 of file color.h.

◆ PC_SYS_RESERVED

#define PC_SYS_RESERVED   0x40 /* System palentry is not to be mapped to */

Definition at line 4 of file color.h.

◆ PC_SYS_USED

#define PC_SYS_USED   0x80 /* Palentry is used (both system and logical) */

Definition at line 3 of file color.h.

Typedef Documentation

◆ COLORSPACE

◆ COLORTRANSFORMOBJ

◆ GDICLRXFORM

◆ PCOLORSPACE

◆ PCOLORTRANSFORMOBJ

Function Documentation

◆ IntGdiRealizePalette()

UINT FASTCALL IntGdiRealizePalette ( HDC  )

FIXME: shouldn't dereference pSurface while the PDEV is not locked

Definition at line 731 of file palette.c.

732 {
733  UINT i, realize = 0;
734  PDC pdc;
735  PALETTE *ppalSurf, *ppalDC;
736 
737  pdc = DC_LockDc(hDC);
738  if (!pdc)
739  {
741  return 0;
742  }
743 
744  if (!pdc->dclevel.pSurface)
745  {
746  goto cleanup;
747  }
748 
749  if (pdc->dctype == DCTYPE_DIRECT)
750  {
751  static BOOL g_WarnedOnce = FALSE;
752  if (!g_WarnedOnce)
753  {
754  g_WarnedOnce = TRUE;
756  }
757  goto cleanup;
758  }
759 
761  ppalSurf = pdc->dclevel.pSurface->ppal;
762  ppalDC = pdc->dclevel.ppal;
763 
764  if (!(ppalSurf->flFlags & PAL_INDEXED))
765  {
766  // FIXME: Set error?
767  goto cleanup;
768  }
769 
770  ASSERT(ppalDC->flFlags & PAL_INDEXED);
771 
772  // FIXME: Should we resize ppalSurf if it's too small?
773  realize = (ppalDC->NumColors < ppalSurf->NumColors) ? ppalDC->NumColors : ppalSurf->NumColors;
774 
775  for (i=0; i<realize; i++)
776  {
777  InterlockedExchange((LONG*)&ppalSurf->IndexedColors[i], *(LONG*)&ppalDC->IndexedColors[i]);
778  }
779 
780 cleanup:
781  DC_UnlockDc(pdc);
782  return realize;
783 }
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define TRUE
Definition: types.h:120
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
PALETTEENTRY * IndexedColors
Definition: palette.h:42
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
Definition: polytest.cpp:40
#define for
Definition: utility.h:88
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
ULONG NumColors
Definition: palette.h:41
FLONG flFlags
Definition: palette.h:40
#define InterlockedExchange
Definition: armddk.h:54
static HDC hDC
Definition: 3dtext.c:33
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
unsigned int UINT
Definition: ndis.h:50
#define UNIMPLEMENTED
Definition: debug.h:115
char * cleanup(char *str)
Definition: wpickclick.c:99
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by IntAnimatePalette(), and UserRealizePalette().

Variable Documentation

◆ hStockColorSpace

HCOLORSPACE hStockColorSpace

Definition at line 14 of file icm.c.

Referenced by IntGdiDeleteColorSpace().