Release 8.16.
[wine.git] / dlls / gdiplus / gdiplus_private.h
blob1bc058b3413b27b39fad29de269e75960076cc69
1 /*
2 * Copyright (C) 2007 Google (Evan Stade)
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_GP_PRIVATE_H_
20 #define __WINE_GP_PRIVATE_H_
22 #include <math.h>
23 #include <stdarg.h>
25 #include "windef.h"
26 #include "wingdi.h"
27 #include "winbase.h"
28 #include "winuser.h"
30 #include "objbase.h"
31 #include "ocidl.h"
32 #include "wincodecsdk.h"
33 #include "wine/heap.h"
34 #include "wine/list.h"
36 #include "gdiplus.h"
38 #define GP_DEFAULT_PENSTYLE (PS_GEOMETRIC | PS_SOLID | PS_ENDCAP_FLAT | PS_JOIN_MITER)
39 #define MAX_ARC_PTS (13)
40 #define MAX_DASHLEN (16) /* this is a limitation of gdi */
41 #define INCH_HIMETRIC (2540)
43 #define VERSION_MAGIC 0xdbc01001
44 #define VERSION_MAGIC2 0xdbc01002
45 #define VALID_MAGIC(x) (((x) & 0xfffff000) == 0xdbc01000)
46 #define TENSION_CONST (0.3)
48 #define GIF_DISPOSE_UNSPECIFIED 0
49 #define GIF_DISPOSE_DO_NOT_DISPOSE 1
50 #define GIF_DISPOSE_RESTORE_TO_BKGND 2
51 #define GIF_DISPOSE_RESTORE_TO_PREV 3
54 COLORREF ARGB2COLORREF(ARGB color);
55 HBITMAP ARGB2BMP(ARGB color);
56 extern INT arc2polybezier(GpPointF * points, REAL x1, REAL y1, REAL x2, REAL y2,
57 REAL startAngle, REAL sweepAngle);
58 extern REAL gdiplus_atan2(REAL dy, REAL dx);
59 extern GpStatus hresult_to_status(HRESULT res);
60 extern REAL units_to_pixels(REAL units, GpUnit unit, REAL dpi, BOOL printer_display);
61 extern REAL pixels_to_units(REAL pixels, GpUnit unit, REAL dpi, BOOL printer_display);
62 extern REAL units_scale(GpUnit from, GpUnit to, REAL dpi, BOOL printer_display);
64 #define WineCoordinateSpaceGdiDevice ((GpCoordinateSpace)4)
66 extern GpStatus gdi_transform_acquire(GpGraphics *graphics);
67 extern GpStatus gdi_transform_release(GpGraphics *graphics);
68 extern GpStatus get_graphics_transform(GpGraphics *graphics, GpCoordinateSpace dst_space,
69 GpCoordinateSpace src_space, GpMatrix *matrix);
70 extern GpStatus gdip_transform_points(GpGraphics *graphics, GpCoordinateSpace dst_space,
71 GpCoordinateSpace src_space, GpPointF *points, INT count);
72 void transform_properties(GpGraphics *, GDIPCONST GpMatrix *, BOOL, REAL *, REAL *, REAL *);
74 extern GpStatus graphics_from_image(GpImage *image, GpGraphics **graphics);
75 extern GpStatus encode_image_png(GpImage *image, IStream* stream, GDIPCONST EncoderParameters* params);
76 extern GpStatus terminate_encoder_wic(GpImage *image);
78 extern GpStatus METAFILE_GetGraphicsContext(GpMetafile* metafile, GpGraphics **result);
79 extern GpStatus METAFILE_GetDC(GpMetafile* metafile, HDC *hdc);
80 extern GpStatus METAFILE_ReleaseDC(GpMetafile* metafile, HDC hdc);
81 extern GpStatus METAFILE_GraphicsClear(GpMetafile* metafile, ARGB color);
82 extern GpStatus METAFILE_FillRectangles(GpMetafile* metafile, GpBrush* brush,
83 GDIPCONST GpRectF* rects, INT count);
84 extern GpStatus METAFILE_SetClipRect(GpMetafile* metafile,
85 REAL x, REAL y, REAL width, REAL height, CombineMode mode);
86 extern GpStatus METAFILE_SetClipRegion(GpMetafile* metafile, GpRegion* region, CombineMode mode);
87 extern GpStatus METAFILE_SetPageTransform(GpMetafile* metafile, GpUnit unit, REAL scale);
88 extern GpStatus METAFILE_SetWorldTransform(GpMetafile* metafile, GDIPCONST GpMatrix* transform);
89 extern GpStatus METAFILE_ScaleWorldTransform(GpMetafile* metafile, REAL sx, REAL sy, MatrixOrder order);
90 extern GpStatus METAFILE_MultiplyWorldTransform(GpMetafile* metafile, GDIPCONST GpMatrix* matrix, MatrixOrder order);
91 extern GpStatus METAFILE_RotateWorldTransform(GpMetafile* metafile, REAL angle, MatrixOrder order);
92 extern GpStatus METAFILE_TranslateWorldTransform(GpMetafile* metafile, REAL dx, REAL dy, MatrixOrder order);
93 extern GpStatus METAFILE_ResetWorldTransform(GpMetafile* metafile);
94 extern GpStatus METAFILE_BeginContainer(GpMetafile* metafile, GDIPCONST GpRectF *dstrect,
95 GDIPCONST GpRectF *srcrect, GpUnit unit, DWORD StackIndex);
96 extern GpStatus METAFILE_BeginContainerNoParams(GpMetafile* metafile, DWORD StackIndex);
97 extern GpStatus METAFILE_EndContainer(GpMetafile* metafile, DWORD StackIndex);
98 extern GpStatus METAFILE_SaveGraphics(GpMetafile* metafile, DWORD StackIndex);
99 extern GpStatus METAFILE_RestoreGraphics(GpMetafile* metafile, DWORD StackIndex);
100 extern GpStatus METAFILE_GraphicsDeleted(GpMetafile* metafile);
101 extern GpStatus METAFILE_DrawImagePointsRect(GpMetafile* metafile, GpImage *image,
102 GDIPCONST GpPointF *points, INT count, REAL srcx, REAL srcy, REAL srcwidth,
103 REAL srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes* imageAttributes,
104 DrawImageAbort callback, VOID *callbackData);
105 extern GpStatus METAFILE_AddSimpleProperty(GpMetafile *metafile, SHORT prop, SHORT val);
106 extern GpStatus METAFILE_DrawPath(GpMetafile *metafile, GpPen *pen, GpPath *path);
107 extern GpStatus METAFILE_FillPath(GpMetafile *metafile, GpBrush *brush, GpPath *path);
108 extern GpStatus METAFILE_DrawDriverString(GpMetafile *metafile, GDIPCONST UINT16 *text, INT length,
109 GDIPCONST GpFont *font, GDIPCONST GpStringFormat *format, GDIPCONST GpBrush *brush,
110 GDIPCONST PointF *positions, INT flags, GDIPCONST GpMatrix *matrix);
111 extern GpStatus METAFILE_FillRegion(GpMetafile* metafile, GpBrush* brush,
112 GpRegion* region);
113 extern void METAFILE_Free(GpMetafile *metafile);
114 extern GpStatus METAFILE_DrawEllipse(GpMetafile *metafile, GpPen *pen, GpRectF *rect);
115 extern GpStatus METAFILE_FillEllipse(GpMetafile *metafile, GpBrush *brush, GpRectF *rect);
116 extern GpStatus METAFILE_DrawRectangles(GpMetafile *metafile, GpPen *pen, const GpRectF *rects, INT count);
117 extern GpStatus METAFILE_FillPie(GpMetafile *metafile, GpBrush *brush, const GpRectF *rect,
118 REAL startAngle, REAL sweepAngle);
119 extern GpStatus METAFILE_DrawArc(GpMetafile *metafile, GpPen *pen, const GpRectF *rect,
120 REAL startAngle, REAL sweepAngle);
121 extern GpStatus METAFILE_OffsetClip(GpMetafile *metafile, REAL dx, REAL dy);
122 extern GpStatus METAFILE_ResetClip(GpMetafile *metafile);
123 extern GpStatus METAFILE_SetClipPath(GpMetafile *metafile, GpPath *path, CombineMode mode);
124 extern GpStatus METAFILE_SetRenderingOrigin(GpMetafile *metafile, INT x, INT y);
126 extern void calc_curve_bezier(const GpPointF *pts, REAL tension, REAL *x1,
127 REAL *y1, REAL *x2, REAL *y2);
128 extern void calc_curve_bezier_endp(REAL xend, REAL yend, REAL xadj, REAL yadj,
129 REAL tension, REAL *x, REAL *y);
131 extern void free_installed_fonts(void);
133 extern BOOL lengthen_path(GpPath *path, INT len);
135 extern DWORD write_region_data(const GpRegion *region, void *data);
136 extern DWORD write_path_data(GpPath *path, void *data);
138 extern GpStatus trace_path(GpGraphics *graphics, GpPath *path);
140 typedef struct region_element region_element;
141 extern void delete_element(region_element *element);
143 extern GpStatus get_hatch_data(GpHatchStyle hatchstyle, const unsigned char **result);
145 static inline INT gdip_round(REAL x)
147 return (INT) floorf(x + 0.5);
150 static inline INT ceilr(REAL x)
152 return (INT) ceilf(x);
155 static inline REAL deg2rad(REAL degrees)
157 return M_PI * degrees / 180.0;
160 static inline ARGB color_over(ARGB bg, ARGB fg)
162 BYTE b, g, r, a;
163 BYTE bg_alpha, fg_alpha;
165 fg_alpha = (fg>>24)&0xff;
167 if (fg_alpha == 0xff) return fg;
169 if (fg_alpha == 0) return bg;
171 bg_alpha = (((bg>>24)&0xff) * (0xff-fg_alpha)) / 0xff;
173 if (bg_alpha == 0) return fg;
175 a = bg_alpha + fg_alpha;
176 b = ((bg&0xff)*bg_alpha + (fg&0xff)*fg_alpha)/a;
177 g = (((bg>>8)&0xff)*bg_alpha + ((fg>>8)&0xff)*fg_alpha)/a;
178 r = (((bg>>16)&0xff)*bg_alpha + ((fg>>16)&0xff)*fg_alpha)/a;
180 return (a<<24)|(r<<16)|(g<<8)|b;
183 /* fg is premult, bg and return value are not */
184 static inline ARGB color_over_fgpremult(ARGB bg, ARGB fg)
186 BYTE b, g, r, a;
187 BYTE bg_alpha, fg_alpha;
189 fg_alpha = (fg>>24)&0xff;
191 if (fg_alpha == 0) return bg;
193 bg_alpha = (((bg>>24)&0xff) * (0xff-fg_alpha)) / 0xff;
195 a = bg_alpha + fg_alpha;
196 b = ((bg&0xff)*bg_alpha + (fg&0xff)*0xff)/a;
197 g = (((bg>>8)&0xff)*bg_alpha + ((fg>>8)&0xff)*0xff)/a;
198 r = (((bg>>16)&0xff)*bg_alpha + ((fg>>16)&0xff)*0xff)/a;
200 return (a<<24)|(r<<16)|(g<<8)|b;
203 extern const char *debugstr_rectf(const RectF* rc);
205 extern const char *debugstr_pointf(const PointF* pt);
207 extern const char *debugstr_matrix(const GpMatrix* matrix);
209 extern void convert_32bppARGB_to_32bppPARGB(UINT width, UINT height,
210 BYTE *dst_bits, INT dst_stride, const BYTE *src_bits, INT src_stride);
212 extern GpStatus convert_pixels(INT width, INT height,
213 INT dst_stride, BYTE *dst_bits, PixelFormat dst_format, ColorPalette *dst_palette,
214 INT src_stride, const BYTE *src_bits, PixelFormat src_format, ColorPalette *src_palette);
216 extern PixelFormat apply_image_attributes(const GpImageAttributes *attributes, LPBYTE data,
217 UINT width, UINT height, INT stride, ColorAdjustType type, PixelFormat fmt);
219 struct GpMatrix{
220 REAL matrix[6];
223 struct GpPen{
224 UINT style;
225 GpUnit unit;
226 REAL width;
227 GpLineCap endcap;
228 GpLineCap startcap;
229 GpDashCap dashcap;
230 GpCustomLineCap *customstart;
231 GpCustomLineCap *customend;
232 GpLineJoin join;
233 REAL miterlimit;
234 GpDashStyle dash;
235 REAL *dashes;
236 INT numdashes;
237 REAL offset; /* dash offset */
238 GpBrush *brush;
239 GpPenAlignment align;
240 GpMatrix transform;
241 REAL *compound_array;
242 INT compound_array_size;
245 struct GpGraphics{
246 HDC hdc;
247 HWND hwnd;
248 BOOL owndc;
249 BOOL alpha_hdc;
250 BOOL printer_display;
251 GpImage *image;
252 ImageType image_type;
253 SmoothingMode smoothing;
254 CompositingQuality compqual;
255 InterpolationMode interpolation;
256 PixelOffsetMode pixeloffset;
257 CompositingMode compmode;
258 TextRenderingHint texthint;
259 GpUnit unit; /* page unit */
260 REAL scale; /* page scale */
261 REAL xres, yres;
262 GpMatrix worldtrans; /* world transform */
263 BOOL busy; /* hdc handle obtained by GdipGetDC */
264 GpRegion *clip; /* in device coords */
265 UINT textcontrast; /* not used yet. get/set only */
266 struct list containers;
267 GraphicsContainer contid; /* last-issued container ID */
268 INT origin_x, origin_y;
269 INT gdi_transform_acquire_count, gdi_transform_save;
270 GpMatrix gdi_transform;
271 HRGN gdi_clip;
272 /* For giving the caller an HDC when we technically can't: */
273 HBITMAP temp_hbitmap;
274 int temp_hbitmap_width;
275 int temp_hbitmap_height;
276 BYTE *temp_bits;
277 HDC temp_hdc;
280 struct GpBrush{
281 GpBrushType bt;
284 struct GpHatch{
285 GpBrush brush;
286 GpHatchStyle hatchstyle;
287 ARGB forecol;
288 ARGB backcol;
291 struct GpSolidFill{
292 GpBrush brush;
293 ARGB color;
296 struct GpPathGradient{
297 GpBrush brush;
298 GpPath* path;
299 ARGB centercolor;
300 GpWrapMode wrap;
301 BOOL gamma;
302 GpPointF center;
303 GpPointF focus;
304 REAL* blendfac; /* blend factors */
305 REAL* blendpos; /* blend positions */
306 INT blendcount;
307 ARGB *surroundcolors;
308 INT surroundcolorcount;
309 ARGB* pblendcolor; /* preset blend colors */
310 REAL* pblendpos; /* preset blend positions */
311 INT pblendcount;
312 GpMatrix transform;
315 struct GpLineGradient{
316 GpBrush brush;
317 ARGB startcolor;
318 ARGB endcolor;
319 RectF rect;
320 GpWrapMode wrap;
321 BOOL gamma;
322 REAL* blendfac; /* blend factors */
323 REAL* blendpos; /* blend positions */
324 INT blendcount;
325 ARGB* pblendcolor; /* preset blend colors */
326 REAL* pblendpos; /* preset blend positions */
327 INT pblendcount;
328 GpMatrix transform;
331 struct GpTexture{
332 GpBrush brush;
333 GpMatrix transform;
334 GpImage *image;
335 GpImageAttributes *imageattributes;
336 BYTE *bitmap_bits; /* image bits converted to ARGB and run through imageattributes */
339 struct GpPath{
340 GpFillMode fill;
341 GpPathData pathdata;
342 BOOL newfigure; /* whether the next drawing action starts a new figure */
343 INT datalen; /* size of the arrays in pathdata */
346 struct GpPathIterator{
347 GpPathData pathdata;
348 INT subpath_pos; /* for NextSubpath methods */
349 INT marker_pos; /* for NextMarker methods */
350 INT pathtype_pos; /* for NextPathType methods */
353 struct GpCustomLineCap{
354 CustomLineCapType type;
355 GpPathData pathdata;
356 BOOL fill; /* TRUE for fill, FALSE for stroke */
357 GpLineCap basecap; /* cap used together with customLineCap */
358 REAL inset; /* distance between line end and cap beginning */
359 GpLineCap strokeStartCap;
360 GpLineCap strokeEndCap;
361 GpLineJoin join; /* joins used for drawing custom cap*/
362 REAL scale;
365 struct GpAdjustableArrowCap{
366 GpCustomLineCap cap;
367 REAL middle_inset;
368 REAL height;
369 REAL width;
372 struct GpImage{
373 IWICBitmapDecoder *decoder;
374 IWICBitmapEncoder *encoder;
375 ImageType type;
376 GUID format;
377 UINT flags;
378 UINT frame_count, current_frame;
379 ColorPalette *palette;
380 REAL xres, yres;
381 SRWLOCK lock;
384 #define EmfPlusObjectTableSize 64
386 typedef enum EmfPlusObjectType
388 ObjectTypeInvalid,
389 ObjectTypeBrush,
390 ObjectTypePen,
391 ObjectTypePath,
392 ObjectTypeRegion,
393 ObjectTypeImage,
394 ObjectTypeFont,
395 ObjectTypeStringFormat,
396 ObjectTypeImageAttributes,
397 ObjectTypeCustomLineCap,
398 ObjectTypeMax = ObjectTypeCustomLineCap,
399 } EmfPlusObjectType;
401 /* Deserialized EmfPlusObject record. */
402 struct emfplus_object {
403 EmfPlusObjectType type;
404 union {
405 GpBrush *brush;
406 GpPen *pen;
407 GpPath *path;
408 GpRegion *region;
409 GpImage *image;
410 GpFont *font;
411 GpImageAttributes *image_attributes;
412 void *object;
413 } u;
416 struct GpMetafile{
417 GpImage image;
418 GpRectF bounds;
419 GpUnit unit;
420 MetafileType metafile_type;
421 HENHMETAFILE hemf;
422 int preserve_hemf; /* if true, hemf belongs to the app and should not be deleted */
424 /* recording */
425 HDC record_dc;
426 GpGraphics *record_graphics;
427 BYTE *comment_data;
428 DWORD comment_data_size;
429 DWORD comment_data_length;
430 IStream *record_stream;
431 BOOL auto_frame; /* If true, determine the frame automatically */
432 GpPointF auto_frame_min, auto_frame_max;
433 DWORD next_object_id;
434 UINT limit_dpi;
435 BOOL printer_display;
436 REAL logical_dpix;
437 REAL logical_dpiy;
439 /* playback */
440 GpGraphics *playback_graphics;
441 HDC playback_dc;
442 GpPointF playback_points[3];
443 GpRectF src_rect;
444 HANDLETABLE *handle_table;
445 int handle_count;
446 GpMatrix *world_transform;
447 GpUnit page_unit;
448 REAL page_scale;
449 GpRegion *base_clip; /* clip region in device space for all metafile output */
450 GpRegion *clip; /* clip region within the metafile */
451 struct list containers;
452 struct emfplus_object objtable[EmfPlusObjectTableSize];
455 struct GpBitmap{
456 GpImage image;
457 INT width;
458 INT height;
459 PixelFormat format;
460 ImageLockMode lockmode;
461 BYTE *bitmapbits; /* pointer to the buffer we passed in BitmapLockBits */
462 HBITMAP hbitmap;
463 HDC hdc;
464 BYTE *bits; /* actual image bits if this is a DIB */
465 INT stride; /* stride of bits if this is a DIB */
466 BYTE *own_bits; /* image bits that need to be freed with this object */
467 INT lockx, locky; /* X and Y coordinates of the rect when a bitmap is locked for writing. */
468 IWICMetadataReader *metadata_reader; /* NULL if there is no metadata */
469 UINT prop_count;
470 PropertyItem *prop_item; /* cached image properties */
473 struct GpCachedBitmap{
474 GpImage *image;
477 struct color_key{
478 BOOL enabled;
479 ARGB low;
480 ARGB high;
483 struct color_matrix{
484 BOOL enabled;
485 ColorMatrixFlags flags;
486 ColorMatrix colormatrix;
487 ColorMatrix graymatrix;
490 struct color_remap_table{
491 BOOL enabled;
492 INT mapsize;
493 ColorMap *colormap;
496 enum imageattr_noop{
497 IMAGEATTR_NOOP_UNDEFINED,
498 IMAGEATTR_NOOP_SET,
499 IMAGEATTR_NOOP_CLEAR,
502 struct GpImageAttributes{
503 WrapMode wrap;
504 ARGB outside_color;
505 BOOL clamp;
506 struct color_key colorkeys[ColorAdjustTypeCount];
507 struct color_matrix colormatrices[ColorAdjustTypeCount];
508 struct color_remap_table colorremaptables[ColorAdjustTypeCount];
509 BOOL gamma_enabled[ColorAdjustTypeCount];
510 REAL gamma[ColorAdjustTypeCount];
511 enum imageattr_noop noop[ColorAdjustTypeCount];
514 struct GpFont{
515 GpFontFamily *family;
516 OUTLINETEXTMETRICW otm;
517 REAL emSize; /* in font units */
518 Unit unit;
521 extern const struct GpStringFormat default_drawstring_format;
523 struct GpStringFormat{
524 INT attr;
525 LANGID lang;
526 LANGID digitlang;
527 StringAlignment align;
528 StringTrimming trimming;
529 HotkeyPrefix hkprefix;
530 StringAlignment line_align;
531 StringDigitSubstitute digitsub;
532 INT tabcount;
533 REAL firsttab;
534 REAL *tabs;
535 CharacterRange *character_ranges;
536 INT range_count;
537 BOOL generic_typographic;
540 extern void init_generic_string_formats(void);
541 extern void free_generic_string_formats(void);
543 struct GpFontCollection{
544 GpFontFamily **FontFamilies;
545 INT count;
546 INT allocated;
549 struct GpFontFamily{
550 WCHAR FamilyName[LF_FACESIZE];
551 UINT16 em_height, ascent, descent, line_spacing; /* in font units */
552 int dpi;
553 BOOL installed;
554 LONG ref;
557 /* internal use */
558 typedef enum RegionType
560 RegionDataRect = 0x10000000,
561 RegionDataPath = 0x10000001,
562 RegionDataEmptyRect = 0x10000002,
563 RegionDataInfiniteRect = 0x10000003,
564 } RegionType;
566 struct region_element
568 DWORD type; /* Rectangle, Path, SpecialRectangle, or CombineMode */
569 union
571 GpRectF rect;
572 GpPath *path;
573 struct
575 struct region_element *left; /* the original region */
576 struct region_element *right; /* what *left was combined with */
577 } combine;
578 } elementdata;
581 struct GpRegion{
582 DWORD num_children;
583 region_element node;
586 struct memory_buffer
588 const BYTE *buffer;
589 INT size, pos;
592 static inline void init_memory_buffer(struct memory_buffer *mbuf, const BYTE *buffer, INT size)
594 mbuf->buffer = buffer;
595 mbuf->size = size;
596 mbuf->pos = 0;
599 static inline const void *buffer_read(struct memory_buffer *mbuf, INT size)
601 if (mbuf->size - mbuf->pos >= size)
603 const void *data = mbuf->buffer + mbuf->pos;
604 mbuf->pos += size;
605 return data;
607 return NULL;
610 typedef GpStatus (*gdip_format_string_callback)(HDC hdc,
611 GDIPCONST WCHAR *string, INT index, INT length, GDIPCONST GpFont *font,
612 GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format,
613 INT lineno, const RectF *bounds, INT *underlined_indexes,
614 INT underlined_index_count, void *user_data);
616 GpStatus gdip_format_string(HDC hdc,
617 GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font,
618 GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, int ignore_empty_clip,
619 gdip_format_string_callback callback, void *user_data);
621 void get_log_fontW(const GpFont *, GpGraphics *, LOGFONTW *);
623 static inline BOOL image_lock(GpImage *image)
625 return TryAcquireSRWLockExclusive(&image->lock);
628 static inline void image_unlock(GpImage *image)
630 ReleaseSRWLockExclusive(&image->lock);
633 static inline void set_rect(GpRectF *rect, REAL x, REAL y, REAL width, REAL height)
635 rect->X = x;
636 rect->Y = y;
637 rect->Width = width;
638 rect->Height = height;
641 #endif