20 #ifndef FREERDP_LIB_GDI_CORE_H
21 #define FREERDP_LIB_GDI_CORE_H
26 #include <freerdp/api.h>
28 FREERDP_LOCAL BOOL gdi_bitmap_update(rdpContext* context,
const BITMAP_UPDATE* bitmapUpdate);
30 FREERDP_LOCAL gdiBitmap* gdi_bitmap_new_ex(rdpGdi* gdi,
int width,
int height,
int bpp, BYTE* data);
31 FREERDP_LOCAL
void gdi_bitmap_free_ex(gdiBitmap* gdi_bmp);
33 static INLINE BYTE* gdi_get_bitmap_pointer(
HGDI_DC hdcBmp, INT32 x, INT32 y)
38 if ((x >= 0) && (y >= 0) && (x < hBmp->width) && (y < hBmp->height))
40 p = hBmp->data + (y * hBmp->scanline) + (x * FreeRDPGetBytesPerPixel(hdcBmp->format));
45 WLog_ERR(FREERDP_TAG(
"gdi"),
46 "gdi_get_bitmap_pointer: requesting invalid pointer: (%" PRIu32
",%" PRIu32
47 ") in %" PRIu32
"x%" PRIu32
"",
48 x, y, hBmp->width, hBmp->height);
60 static INLINE BYTE* gdi_get_brush_pointer(
HGDI_DC hdcBrush, UINT32 x, UINT32 y)
63 UINT32 brushStyle = gdi_GetBrushStyle(hdcBrush);
75 x = (x + hBmpBrush->width - (hdcBrush->brush->nXOrg % hBmpBrush->width)) %
77 y = (y + hBmpBrush->height - (hdcBrush->brush->nYOrg % hBmpBrush->height)) %
79 p = hBmpBrush->data + (y * hBmpBrush->scanline) +
80 (x * FreeRDPGetBytesPerPixel(hBmpBrush->format));
89 p = (BYTE*)&(hdcBrush->textColor);