ReactOS  0.4.14-dev-608-gd495a4f
dib.c File Reference
#include <win32k.h>
#include <debug.h>
Include dependency graph for dib.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

ULONG DIB_DoRop (ULONG Rop, ULONG Dest, ULONG Source, ULONG Pattern)
 
VOID Dummy_PutPixel (SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
 
ULONG Dummy_GetPixel (SURFOBJ *SurfObj, LONG x, LONG y)
 
VOID Dummy_HLine (SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
 
VOID Dummy_VLine (SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
 
BOOLEAN Dummy_BitBlt (PBLTINFO BltInfo)
 
BOOLEAN Dummy_StretchBlt (SURFOBJ *DestSurf, SURFOBJ *SourceSurf, SURFOBJ *PatternSurface, SURFOBJ *MaskSurf, RECTL *DestRect, RECTL *SourceRect, POINTL *MaskOrigin, BRUSHOBJ *Brush, POINTL *BrushOrign, XLATEOBJ *ColorTranslation, ROP4 Rop)
 
BOOLEAN Dummy_TransparentBlt (SURFOBJ *DestSurf, SURFOBJ *SourceSurf, RECTL *DestRect, RECTL *SourceRect, XLATEOBJ *ColorTranslation, ULONG iTransColor)
 
BOOLEAN Dummy_ColorFill (SURFOBJ *Dest, RECTL *DestRect, ULONG Color)
 
BOOLEAN Dummy_AlphaBlend (SURFOBJ *Dest, SURFOBJ *Source, RECTL *DestRect, RECTL *SourceRect, CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, BLENDOBJ *BlendObj)
 

Variables

unsigned char notmask [2] = { 0x0f, 0xf0 }
 
unsigned char altnotmask [2] = { 0xf0, 0x0f }
 
DIB_FUNCTIONS DibFunctionsForBitmapFormat []
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file dib.c.

Function Documentation

◆ DIB_DoRop()

ULONG DIB_DoRop ( ULONG  Rop,
ULONG  Dest,
ULONG  Source,
ULONG  Pattern 
)

Definition at line 92 of file dib.c.

93 {
94  ULONG ResultNibble;
95  ULONG Result = 0;
96  ULONG i;
97 static const ULONG ExpandDest[16] =
98  {
99  0x55555555 /* 0000 */,
100  0x555555AA /* 0001 */,
101  0x5555AA55 /* 0010 */,
102  0x5555AAAA /* 0011 */,
103  0x55AA5555 /* 0100 */,
104  0x55AA55AA /* 0101 */,
105  0x55AAAA55 /* 0110 */,
106  0x55AAAAAA /* 0111 */,
107  0xAA555555 /* 1000 */,
108  0xAA5555AA /* 1001 */,
109  0xAA55AA55 /* 1010 */,
110  0xAA55AAAA /* 1011 */,
111  0xAAAA5555 /* 1100 */,
112  0xAAAA55AA /* 1101 */,
113  0xAAAAAA55 /* 1110 */,
114  0xAAAAAAAA /* 1111 */,
115  };
116  static const ULONG ExpandSource[16] =
117  {
118  0x33333333 /* 0000 */,
119  0x333333CC /* 0001 */,
120  0x3333CC33 /* 0010 */,
121  0x3333CCCC /* 0011 */,
122  0x33CC3333 /* 0100 */,
123  0x33CC33CC /* 0101 */,
124  0x33CCCC33 /* 0110 */,
125  0x33CCCCCC /* 0111 */,
126  0xCC333333 /* 1000 */,
127  0xCC3333CC /* 1001 */,
128  0xCC33CC33 /* 1010 */,
129  0xCC33CCCC /* 1011 */,
130  0xCCCC3333 /* 1100 */,
131  0xCCCC33CC /* 1101 */,
132  0xCCCCCC33 /* 1110 */,
133  0xCCCCCCCC /* 1111 */,
134  };
135  static const ULONG ExpandPattern[16] =
136  {
137  0x0F0F0F0F /* 0000 */,
138  0x0F0F0FF0 /* 0001 */,
139  0x0F0FF00F /* 0010 */,
140  0x0F0FF0F0 /* 0011 */,
141  0x0FF00F0F /* 0100 */,
142  0x0FF00FF0 /* 0101 */,
143  0x0FF0F00F /* 0110 */,
144  0x0FF0F0F0 /* 0111 */,
145  0xF00F0F0F /* 1000 */,
146  0xF00F0FF0 /* 1001 */,
147  0xF00FF00F /* 1010 */,
148  0xF00FF0F0 /* 1011 */,
149  0xF0F00F0F /* 1100 */,
150  0xF0F00FF0 /* 1101 */,
151  0xF0F0F00F /* 1110 */,
152  0xF0F0F0F0 /* 1111 */,
153  };
154 
155  Rop &=0xFF;
156  switch(Rop)
157  {
158 
159  /* Optimized code for the various named rop codes. */
160  case R3_OPINDEX_NOOP: return(Dest);
161  case R3_OPINDEX_BLACKNESS: return(0);
162  case R3_OPINDEX_NOTSRCERASE: return(~(Dest | Source));
163  case R3_OPINDEX_NOTSRCCOPY: return(~Source);
164  case R3_OPINDEX_SRCERASE: return((~Dest) & Source);
165  case R3_OPINDEX_DSTINVERT: return(~Dest);
166  case R3_OPINDEX_PATINVERT: return(Dest ^ Pattern);
167  case R3_OPINDEX_SRCINVERT: return(Dest ^ Source);
168  case R3_OPINDEX_SRCAND: return(Dest & Source);
169  case R3_OPINDEX_MERGEPAINT: return(Dest | (~Source));
170  case R3_OPINDEX_SRCPAINT: return(Dest | Source);
171  case R3_OPINDEX_MERGECOPY: return(Source & Pattern);
172  case R3_OPINDEX_SRCCOPY: return(Source);
173  case R3_OPINDEX_PATCOPY: return(Pattern);
174  case R3_OPINDEX_PATPAINT: return(Dest | (~Source) | Pattern);
175  case R3_OPINDEX_WHITENESS: return(0xFFFFFFFF);
176  }
177 
178  /* Expand the ROP operation to all four bytes */
179  Rop |= (Rop << 24) | (Rop << 16) | (Rop << 8);
180  /* Do the operation on four bits simultaneously. */
181  Result = 0;
182  for (i = 0; i < 8; i++)
183  {
184  ResultNibble = Rop & ExpandDest[Dest & 0xF] & ExpandSource[Source & 0xF] & ExpandPattern[Pattern & 0xF];
185  Result |= (((ResultNibble & 0xFF000000) ? 0x8 : 0x0) | ((ResultNibble & 0x00FF0000) ? 0x4 : 0x0) |
186  ((ResultNibble & 0x0000FF00) ? 0x2 : 0x0) | ((ResultNibble & 0x000000FF) ? 0x1 : 0x0)) << (i * 4);
187  Dest >>= 4;
188  Source >>= 4;
189  Pattern >>= 4;
190  }
191  return(Result);
192 }
GLint x0
Definition: linetemp.h:95
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
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
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
unsigned int ULONG
Definition: retypes.h:1
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3167

Referenced by BltMask(), DIB_1BPP_BitBlt(), DIB_24BPP_BitBlt(), DIB_4BPP_BitBlt(), and DIB_XXBPP_StretchBlt().

◆ Dummy_AlphaBlend()

BOOLEAN Dummy_AlphaBlend ( SURFOBJ Dest,
SURFOBJ Source,
RECTL DestRect,
RECTL SourceRect,
CLIPOBJ ClipRegion,
XLATEOBJ ColorTranslation,
BLENDOBJ BlendObj 
)

Definition at line 244 of file dib.c.

247 {
248  return FALSE;
249 }

◆ Dummy_BitBlt()

BOOLEAN Dummy_BitBlt ( PBLTINFO  BltInfo)

Definition at line 214 of file dib.c.

215 {
216  return FALSE;
217 }

◆ Dummy_ColorFill()

BOOLEAN Dummy_ColorFill ( SURFOBJ Dest,
RECTL DestRect,
ULONG  Color 
)

Definition at line 237 of file dib.c.

238 {
239  return FALSE;
240 }

◆ Dummy_GetPixel()

ULONG Dummy_GetPixel ( SURFOBJ SurfObj,
LONG  x,
LONG  y 
)

Definition at line 199 of file dib.c.

200 {
201  return 0;
202 }

◆ Dummy_HLine()

VOID Dummy_HLine ( SURFOBJ SurfObj,
LONG  x1,
LONG  x2,
LONG  y,
ULONG  c 
)

Definition at line 204 of file dib.c.

205 {
206  return;
207 }

◆ Dummy_PutPixel()

VOID Dummy_PutPixel ( SURFOBJ SurfObj,
LONG  x,
LONG  y,
ULONG  c 
)

Definition at line 194 of file dib.c.

195 {
196  return;
197 }

◆ Dummy_StretchBlt()

BOOLEAN Dummy_StretchBlt ( SURFOBJ DestSurf,
SURFOBJ SourceSurf,
SURFOBJ PatternSurface,
SURFOBJ MaskSurf,
RECTL DestRect,
RECTL SourceRect,
POINTL MaskOrigin,
BRUSHOBJ Brush,
POINTL BrushOrign,
XLATEOBJ ColorTranslation,
ROP4  Rop 
)

Definition at line 219 of file dib.c.

226 {
227  return FALSE;
228 }

◆ Dummy_TransparentBlt()

BOOLEAN Dummy_TransparentBlt ( SURFOBJ DestSurf,
SURFOBJ SourceSurf,
RECTL DestRect,
RECTL SourceRect,
XLATEOBJ ColorTranslation,
ULONG  iTransColor 
)

Definition at line 230 of file dib.c.

233 {
234  return FALSE;
235 }

◆ Dummy_VLine()

VOID Dummy_VLine ( SURFOBJ SurfObj,
LONG  x,
LONG  y1,
LONG  y2,
ULONG  c 
)

Definition at line 209 of file dib.c.

210 {
211  return;
212 }

Variable Documentation

◆ altnotmask

unsigned char altnotmask[2] = { 0xf0, 0x0f }

◆ DibFunctionsForBitmapFormat

◆ notmask

unsigned char notmask[2] = { 0x0f, 0xf0 }

Definition at line 17 of file dib.c.

Referenced by DIB_4BPP_BitBltSrcCopy(), DIB_4BPP_HLine(), DIB_4BPP_PutPixel(), and DIB_4BPP_VLine().