ReactOS  0.4.13-dev-99-g7e18b6d
dib4bpp.c File Reference
#include <win32k.h>
#include <debug.h>
Include dependency graph for dib4bpp.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID DIB_4BPP_PutPixel (SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
 
ULONG DIB_4BPP_GetPixel (SURFOBJ *SurfObj, LONG x, LONG y)
 
VOID DIB_4BPP_HLine (SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
 
VOID DIB_4BPP_VLine (SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
 
BOOLEAN DIB_4BPP_BitBltSrcCopy (PBLTINFO BltInfo)
 
BOOLEAN DIB_4BPP_BitBlt (PBLTINFO BltInfo)
 
BOOLEAN DIB_4BPP_ColorFill (SURFOBJ *DestSurface, RECTL *DestRect, ULONG color)
 
BOOLEAN DIB_4BPP_TransparentBlt (SURFOBJ *DestSurf, SURFOBJ *SourceSurf, RECTL *DestRect, RECTL *SourceRect, XLATEOBJ *ColorTranslation, ULONG iTransColor)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file dib4bpp.c.

Function Documentation

◆ DIB_4BPP_BitBlt()

BOOLEAN DIB_4BPP_BitBlt ( PBLTINFO  BltInfo)

Definition at line 222 of file dib4bpp.c.

223 {
224  LONG DestX, DestY;
225  LONG SourceX, SourceY;
226  LONG PatternY = 0;
227  ULONG Dest, Source = 0, Pattern = 0;
228  BOOLEAN UsesSource;
229  BOOLEAN UsesPattern;
230  PULONG DestBits;
231  LONG RoundedRight;
232  static const ULONG ExpandSolidColor[16] =
233  {
234  0x00000000 /* 0 */,
235  0x11111111 /* 1 */,
236  0x22222222 /* 2 */,
237  0x33333333 /* 3 */,
238  0x44444444 /* 4 */,
239  0x55555555 /* 5 */,
240  0x66666666 /* 6 */,
241  0x77777777 /* 7 */,
242  0x88888888 /* 8 */,
243  0x99999999 /* 9 */,
244  0xAAAAAAAA /* 10 */,
245  0xBBBBBBBB /* 11 */,
246  0xCCCCCCCC /* 12 */,
247  0xDDDDDDDD /* 13 */,
248  0xEEEEEEEE /* 14 */,
249  0xFFFFFFFF /* 15 */,
250  };
251 
252  UsesSource = ROP4_USES_SOURCE(BltInfo->Rop4);
253  UsesPattern = ROP4_USES_PATTERN(BltInfo->Rop4);
254 
255  SourceY = BltInfo->SourcePoint.y;
256  RoundedRight = BltInfo->DestRect.right -
257  ((BltInfo->DestRect.right - BltInfo->DestRect.left) & 0x7);
258 
259  if (UsesPattern)
260  {
261  if (BltInfo->PatternSurface)
262  {
263  PatternY = (BltInfo->DestRect.top + BltInfo->BrushOrigin.y) %
264  BltInfo->PatternSurface->sizlBitmap.cy;
265  }
266  else
267  {
268  if (BltInfo->Brush)
269  Pattern = ExpandSolidColor[BltInfo->Brush->iSolidColor];
270  }
271  }
272 
273  for (DestY = BltInfo->DestRect.top; DestY < BltInfo->DestRect.bottom; DestY++)
274  {
275  DestBits = (PULONG)(
276  (PBYTE)BltInfo->DestSurface->pvScan0 +
277  (BltInfo->DestRect.left >> 1) +
278  DestY * BltInfo->DestSurface->lDelta);
279  SourceX = BltInfo->SourcePoint.x;
280  DestX = BltInfo->DestRect.left;
281 
282  if (DestX & 0x1)
283  {
284  Dest = DIB_4BPP_GetPixel(BltInfo->DestSurface, DestX, DestY);
285 
286  if (UsesSource)
287  {
288  Source = DIB_GetSource(BltInfo->SourceSurface, SourceX, SourceY, BltInfo->XlateSourceToDest);
289  }
290 
291  if (BltInfo->PatternSurface)
292  {
293  Pattern = DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY);
294  }
295 
296  DIB_4BPP_PutPixel(BltInfo->DestSurface, DestX, DestY, DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern) & 0xF);
297 
298  DestX++;
299  SourceX++;
300  DestBits = (PULONG)((ULONG_PTR)DestBits + 1);
301  }
302 
303  for (; DestX < RoundedRight; DestX += 8, SourceX += 8, DestBits++)
304  {
305  Dest = *DestBits;
306  if (UsesSource)
307  {
308  Source =
309  (DIB_GetSource(BltInfo->SourceSurface, SourceX + 1, SourceY, BltInfo->XlateSourceToDest)) |
310  (DIB_GetSource(BltInfo->SourceSurface, SourceX + 0, SourceY, BltInfo->XlateSourceToDest) << 4) |
311  (DIB_GetSource(BltInfo->SourceSurface, SourceX + 3, SourceY, BltInfo->XlateSourceToDest) << 8) |
312  (DIB_GetSource(BltInfo->SourceSurface, SourceX + 2, SourceY, BltInfo->XlateSourceToDest) << 12) |
313  (DIB_GetSource(BltInfo->SourceSurface, SourceX + 5, SourceY, BltInfo->XlateSourceToDest) << 16) |
314  (DIB_GetSource(BltInfo->SourceSurface, SourceX + 4, SourceY, BltInfo->XlateSourceToDest) << 20) |
315  (DIB_GetSource(BltInfo->SourceSurface, SourceX + 7, SourceY, BltInfo->XlateSourceToDest) << 24) |
316  (DIB_GetSource(BltInfo->SourceSurface, SourceX + 6, SourceY, BltInfo->XlateSourceToDest) << 28);
317  }
318  if (BltInfo->PatternSurface)
319  {
320  Pattern = DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 1) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY);
321  Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 0) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << 4;
322  Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 3) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << 8;
323  Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 2) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << 12;
324  Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 5) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << 16;
325  Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 4) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << 20;
326  Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 7) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << 24;
327  Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 6) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY) << 28;
328  }
329  *DestBits = DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern);
330  }
331 
332  /* Process the rest of pixel on the line */
333  for (; DestX < BltInfo->DestRect.right; DestX++, SourceX++)
334  {
335  Dest = DIB_4BPP_GetPixel(BltInfo->DestSurface, DestX, DestY);
336  if (UsesSource)
337  {
338  Source = DIB_GetSource(BltInfo->SourceSurface, SourceX, SourceY, BltInfo->XlateSourceToDest);
339  }
340  if (BltInfo->PatternSurface)
341  {
342  Pattern = DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY);
343  }
344  DIB_4BPP_PutPixel(BltInfo->DestSurface, DestX, DestY, DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern) & 0xF);
345  }
346 
347  SourceY++;
348  if (BltInfo->PatternSurface)
349  {
350  PatternY++;
351  PatternY %= BltInfo->PatternSurface->sizlBitmap.cy;
352  }
353  }
354 
355  return TRUE;
356 }
POINTL BrushOrigin
Definition: dib.h:29
ROP4 Rop4
Definition: dib.h:30
#define TRUE
Definition: types.h:120
SIZEL sizlBitmap
Definition: winddi.h:1209
LONG lDelta
Definition: winddi.h:1213
XLATEOBJ * XlateSourceToDest
Definition: dib.h:25
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
SURFOBJ * PatternSurface
Definition: dib.h:24
LONG y
Definition: windef.h:315
uint32_t ULONG_PTR
Definition: typedefs.h:63
long right
Definition: polytest.cpp:53
#define DIB_GetSource(SourceSurf, sx, sy, ColorTranslation)
Definition: dib.h:136
long LONG
Definition: pedump.c:60
VOID DIB_4BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
Definition: dib4bpp.c:16
#define DIB_GetSourceIndex(SourceSurf, sx, sy)
Definition: dib.h:141
long top
Definition: polytest.cpp:53
unsigned char BOOLEAN
LONG cx
Definition: windef.h:319
#define ROP4_USES_SOURCE(Rop4)
Definition: inteng.h:45
ULONG DIB_DoRop(ULONG Rop, ULONG Dest, ULONG Source, ULONG Pattern)
Definition: dib.c:92
long left
Definition: polytest.cpp:53
SURFOBJ * SourceSurface
Definition: dib.h:23
RECTL DestRect
Definition: dib.h:26
SURFOBJ * DestSurface
Definition: dib.h:22
LONG x
Definition: windef.h:314
ULONG DIB_4BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
Definition: dib4bpp.c:23
ULONG iSolidColor
Definition: winddi.h:234
BRUSHOBJ * Brush
Definition: dib.h:28
#define ROP4_USES_PATTERN(Rop4)
Definition: inteng.h:46
unsigned int * PULONG
Definition: retypes.h:1
POINTL SourcePoint
Definition: dib.h:27
unsigned int ULONG
Definition: retypes.h:1
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3149
LONG cy
Definition: windef.h:320
BYTE * PBYTE
Definition: pedump.c:66
PVOID pvScan0
Definition: winddi.h:1212

◆ DIB_4BPP_BitBltSrcCopy()

BOOLEAN DIB_4BPP_BitBltSrcCopy ( PBLTINFO  BltInfo)

Definition at line 60 of file dib4bpp.c.

61 {
62  LONG i, j, sx, sy, f2, xColor;
63  PBYTE SourceBits_24BPP, SourceLine_24BPP;
64  PBYTE DestBits, DestLine, SourceBits_8BPP, SourceLine_8BPP;
65  PBYTE SourceBits, SourceLine;
66 
67  DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 +
68  (BltInfo->DestRect.left >> 1) +
69  BltInfo->DestRect.top * BltInfo->DestSurface->lDelta;
70 
71  switch (BltInfo->SourceSurface->iBitmapFormat)
72  {
73  case BMF_1BPP:
74  sx = BltInfo->SourcePoint.x;
75  sy = BltInfo->SourcePoint.y;
76 
77  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
78  {
79  sx = BltInfo->SourcePoint.x;
80  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
81  {
82  if(DIB_1BPP_GetPixel(BltInfo->SourceSurface, sx, sy) == 0)
83  {
85  }
86  else
87  {
89  }
90  sx++;
91  }
92  sy++;
93  }
94  break;
95 
96  case BMF_4BPP:
97  sy = BltInfo->SourcePoint.y;
98 
99  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
100  {
101  sx = BltInfo->SourcePoint.x;
102 
103  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
104  {
105  if (NULL != BltInfo->XlateSourceToDest)
106  {
108  }
109  else
110  {
111  DIB_4BPP_PutPixel(BltInfo->DestSurface, i, j, DIB_4BPP_GetPixel(BltInfo->SourceSurface, sx, sy));
112  }
113  sx++;
114  }
115  sy++;
116  }
117  break;
118 
119  case BMF_8BPP:
120  SourceBits_8BPP = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
121 
122  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
123  {
124  SourceLine_8BPP = SourceBits_8BPP;
125  DestLine = DestBits;
126  f2 = BltInfo->DestRect.left & 1;
127 
128  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
129  {
130  *DestLine = (*DestLine & notmask[f2]) |
131  (BYTE)((XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *SourceLine_8BPP)) << ((4 * (1 - f2))));
132  if(f2 == 1) { DestLine++; f2 = 0; } else { f2 = 1; }
133  SourceLine_8BPP++;
134  }
135 
136  SourceBits_8BPP += BltInfo->SourceSurface->lDelta;
137  DestBits += BltInfo->DestSurface->lDelta;
138  }
139  break;
140 
141  case BMF_16BPP:
142  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 * BltInfo->SourcePoint.x;
143  DestLine = DestBits;
144 
145  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
146  {
147  SourceBits = SourceLine;
148  DestBits = DestLine;
149  f2 = BltInfo->DestRect.left & 1;
150 
151  for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
152  {
153  xColor = *((PWORD) SourceBits);
154  *DestBits = (*DestBits & notmask[f2]) |
155  (BYTE)((XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor)) << ((4 * (1 - f2))));
156  if(f2 == 1) { DestBits++; f2 = 0; } else { f2 = 1; }
157  SourceBits += 2;
158  }
159 
160  SourceLine += BltInfo->SourceSurface->lDelta;
161  DestLine += BltInfo->DestSurface->lDelta;
162  }
163  break;
164 
165  case BMF_24BPP:
166  SourceBits_24BPP = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x * 3;
167 
168  for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
169  {
170  SourceLine_24BPP = SourceBits_24BPP;
171  DestLine = DestBits;
172  f2 = BltInfo->DestRect.left & 1;
173 
174  for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
175  {
176  xColor = (*(SourceLine_24BPP + 2) << 0x10) +
177  (*(SourceLine_24BPP + 1) << 0x08) +
178  (*(SourceLine_24BPP));
179  *DestLine = (*DestLine & notmask[f2]) |
180  (BYTE)((XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor)) << ((4 * (1 - f2))));
181  if(f2 == 1) { DestLine++; f2 = 0; } else { f2 = 1; }
182  SourceLine_24BPP+=3;
183  }
184 
185  SourceBits_24BPP += BltInfo->SourceSurface->lDelta;
186  DestBits += BltInfo->DestSurface->lDelta;
187  }
188  break;
189 
190  case BMF_32BPP:
191  SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x;
192  DestLine = DestBits;
193 
194  for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
195  {
196  SourceBits = SourceLine;
197  DestBits = DestLine;
198  f2 = BltInfo->DestRect.left & 1;
199 
200  for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
201  {
202  xColor = *((PDWORD) SourceBits);
203  *DestBits = (*DestBits & notmask[f2]) |
204  (BYTE)((XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor)) << ((4 * (1 - f2))));
205  if(f2 == 1) { DestBits++; f2 = 0; } else { f2 = 1; }
206  SourceBits += 4;
207  }
208 
209  SourceLine += BltInfo->SourceSurface->lDelta;
210  DestLine += BltInfo->DestSurface->lDelta;
211  }
212  break;
213 
214  default:
215  DbgPrint("DIB_4BPP_Bitblt: Unhandled Source BPP: %u\n", BitsPerFormat(BltInfo->SourceSurface->iBitmapFormat));
216  return FALSE;
217  }
218  return(TRUE);
219 }
#define BMF_24BPP
Definition: winddi.h:359
#define TRUE
Definition: types.h:120
LONG lDelta
Definition: winddi.h:1213
#define BMF_32BPP
Definition: winddi.h:360
#define DbgPrint
Definition: loader.c:25
XLATEOBJ * XlateSourceToDest
Definition: dib.h:25
#define BitsPerFormat(Format)
Definition: surface.h:109
Definition: xlate.c:10
ULONG iBitmapFormat
Definition: winddi.h:1215
LONG y
Definition: windef.h:315
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
long LONG
Definition: pedump.c:60
VOID DIB_4BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
Definition: dib4bpp.c:16
long top
Definition: polytest.cpp:53
smooth NULL
Definition: ftsmooth.c:416
unsigned char notmask[2]
Definition: dib.c:17
long left
Definition: polytest.cpp:53
#define BMF_16BPP
Definition: winddi.h:358
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 GLint GLint j
Definition: glfuncs.h:250
SURFOBJ * SourceSurface
Definition: dib.h:23
WORD * PWORD
Definition: pedump.c:67
RECTL DestRect
Definition: dib.h:26
SURFOBJ * DestSurface
Definition: dib.h:22
LONG x
Definition: windef.h:314
ULONG DIB_4BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
Definition: dib4bpp.c:23
ULONG DIB_1BPP_GetPixel(SURFOBJ *, LONG, LONG)
Definition: dib1bpp.c:26
unsigned char BYTE
Definition: mem.h:68
Definition: xlate.c:8
DWORD * PDWORD
Definition: pedump.c:68
POINTL SourcePoint
Definition: dib.h:27
Definition: xlate.c:9
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:664
int f2(S1 &, S2 &)
BYTE * PBYTE
Definition: pedump.c:66
PVOID pvScan0
Definition: winddi.h:1212

◆ DIB_4BPP_ColorFill()

BOOLEAN DIB_4BPP_ColorFill ( SURFOBJ DestSurface,
RECTL DestRect,
ULONG  color 
)

Definition at line 360 of file dib4bpp.c.

361 {
362  LONG DestY;
363 
364  for (DestY = DestRect->top; DestY < DestRect->bottom; DestY++)
365  {
366  DIB_4BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color);
367  }
368  return TRUE;
369 }
#define TRUE
Definition: types.h:120
VOID DIB_4BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
Definition: dib4bpp.c:30
long right
Definition: polytest.cpp:53
long LONG
Definition: pedump.c:60
GLuint color
Definition: glext.h:6243
long top
Definition: polytest.cpp:53
GLint GLint bottom
Definition: glext.h:7726
long left
Definition: polytest.cpp:53

◆ DIB_4BPP_GetPixel()

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

Definition at line 23 of file dib4bpp.c.

24 {
25  PBYTE addr = (PBYTE)SurfObj->pvScan0 + (x>>1) + y * SurfObj->lDelta;
26  return (*addr >> ((1-(x&1))<<2)) & 0x0f;
27 }
LONG lDelta
Definition: winddi.h:1213
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLenum const GLvoid * addr
Definition: glext.h:9621
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
BYTE * PBYTE
Definition: pedump.c:66
PVOID pvScan0
Definition: winddi.h:1212

Referenced by DIB_1BPP_BitBltSrcCopy(), DIB_4BPP_BitBlt(), and DIB_4BPP_BitBltSrcCopy().

◆ DIB_4BPP_HLine()

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

Definition at line 30 of file dib4bpp.c.

31 {
32  PBYTE addr = (PBYTE)SurfObj->pvScan0 + (x1>>1) + y * SurfObj->lDelta;
33  LONG cx = x1;
34 
35  while(cx < x2)
36  {
37  *addr = (*addr & notmask[x1&1]) | (BYTE)(c << ((1-(x1&1))<<2));
38  if((++x1 & 1) == 0)
39  ++addr;
40  ++cx;
41  }
42 }
LONG lDelta
Definition: winddi.h:1213
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
long LONG
Definition: pedump.c:60
unsigned char notmask[2]
Definition: dib.c:17
const GLubyte * c
Definition: glext.h:8905
GLenum const GLvoid * addr
Definition: glext.h:9621
unsigned char BYTE
Definition: mem.h:68
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
_Out_opt_ int * cx
Definition: commctrl.h:570
BYTE * PBYTE
Definition: pedump.c:66
PVOID pvScan0
Definition: winddi.h:1212

Referenced by DIB_4BPP_ColorFill().

◆ DIB_4BPP_PutPixel()

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

Definition at line 16 of file dib4bpp.c.

17 {
18  PBYTE addr = (PBYTE)SurfObj->pvScan0 + (x>>1) + y * SurfObj->lDelta;
19  *addr = (*addr & notmask[x&1]) | (BYTE)(c << ((1-(x&1))<<2));
20 }
LONG lDelta
Definition: winddi.h:1213
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
unsigned char notmask[2]
Definition: dib.c:17
const GLubyte * c
Definition: glext.h:8905
GLenum const GLvoid * addr
Definition: glext.h:9621
unsigned char BYTE
Definition: mem.h:68
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
BYTE * PBYTE
Definition: pedump.c:66
PVOID pvScan0
Definition: winddi.h:1212

Referenced by DIB_4BPP_BitBlt(), and DIB_4BPP_BitBltSrcCopy().

◆ DIB_4BPP_TransparentBlt()

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

Definition at line 373 of file dib4bpp.c.

376 {
377  return FALSE;
378 }

◆ DIB_4BPP_VLine()

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

Definition at line 45 of file dib4bpp.c.

46 {
47  PBYTE addr = SurfObj->pvScan0;
48  int lDelta = SurfObj->lDelta;
49 
50  addr += (x>>1) + y1 * lDelta;
51  while(y1++ < y2)
52  {
53  *addr = (*addr & notmask[x&1]) | (BYTE)(c << ((1-(x&1))<<2));
54  addr += lDelta;
55  }
56 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3706
LONG lDelta
Definition: winddi.h:1213
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
unsigned char notmask[2]
Definition: dib.c:17
const GLubyte * c
Definition: glext.h:8905
GLenum const GLvoid * addr
Definition: glext.h:9621
unsigned char BYTE
Definition: mem.h:68
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3706
BYTE * PBYTE
Definition: pedump.c:66
PVOID pvScan0
Definition: winddi.h:1212