27#include "wine/unicode.h"
57#define GDIP_CONTID_STEP 64
59#define GDIP_GET_NEW_CONTID_FOR(pGpGraphics) \
60 (UINT)(InterlockedExchangeAdd(&g_priv_contid,GDIP_CONTID_STEP))
67#define ANCHOR_WIDTH (2.0)
91 ERR(
"Bad point type\n");
122 argb =
line->startcolor;
132 FIXME(
"unhandled brush type %d\n", brush->
bt);
146 bmih.
biSize =
sizeof(bmih);
157 const char *hatch_data;
161 for (
y = 0;
y < 8;
y++)
163 for (
x = 0;
x < 8;
x++)
165 if (hatch_data[
y] & (0x80 >>
x))
176 for (
y = 0;
y < 64;
y++)
212 FIXME(
"unhandled brush type %d\n", brush->
bt);
249 INT save_state,
i, numdashes;
286 TRACE(
"dashes are: ");
287 for(
i = 0;
i < numdashes;
i++){
289 TRACE(
"%d, ", dash_array[
i]);
291 TRACE(
"\n and the pen style is %x\n", pen->
style);
295 numdashes, dash_array);
332 TRACE(
"alpha blending not supported by device, fallback to StretchBlt\n");
334 StretchBlt(graphics->
hdc, dst_x, dst_y, dst_width, dst_height,
335 hdc, src_x, src_y, src_width, src_height,
SRCCOPY);
347 hdc, src_x, src_y, src_width, src_height, bf);
398 for (
y=0;
y<src_height;
y++)
400 for (
x=0;
x<src_width;
x++)
402 ARGB dst_color, src_color;
403 src_color = ((
ARGB*)(
src + src_stride *
y))[
x];
405 if (!(src_color & 0xff000000))
442 (
void**)&temp_bits,
NULL, 0);
447 memcpy(temp_bits,
src, src_width * src_height * 4);
450 4 * src_width,
src, src_stride);
454 hdc, 0, 0, src_width, src_height);
472 HRGN
hrgn, visible_rgn;
496 rgndata = heap_alloc_zero(
size);
510 &
src[(rects[
i].
left - dst_x) * 4 + (rects[
i].
top - dst_y) * src_stride],
523 ERR(
"This should not be used for metafiles; fix caller\n");
544 src_height, src_stride,
fmt);
563 UINT pos = position * 255.0f + 0.5f;
565 (((((
start >> 24) ) << 8) + (((
end >> 24) ) - ((
start >> 24) )) *
pos) >> 8) << 24 |
566 (((((
start >> 16) & 0xff) << 8) + (((
end >> 16) & 0xff) - ((
start >> 16) & 0xff)) *
pos) >> 8) << 16 |
567 (((((
start >> 8) & 0xff) << 8) + (((
end >> 8) & 0xff) - ((
start >> 8) & 0xff)) *
pos) >> 8) << 8 |
568 (((((
start ) & 0xff) << 8) + (((
end ) & 0xff) - ((
start ) & 0xff)) *
pos) >> 8);
573 INT start_a, end_a, final_a;
576 pos = (
INT)(position * 255.0f + 0.5f);
578 start_a = ((
start >> 24) & 0xff) * (
pos ^ 0xff);
579 end_a = ((
end >> 24) & 0xff) *
pos;
581 final_a = start_a + end_a;
583 if (final_a < 0xff)
return 0;
585 return (final_a / 0xff) << 24 |
586 ((((
start >> 16) & 0xff) * start_a + (((
end >> 16) & 0xff) * end_a)) / final_a) << 16 |
587 ((((
start >> 8) & 0xff) * start_a + (((
end >> 8) & 0xff) * end_a)) / final_a) << 8 |
588 (((
start & 0xff) * start_a + ((
end & 0xff) * end_a)) / final_a);
599 position =
fmodf(position, 1.0f);
600 if (position < 0.0f) position += 1.0f;
604 position =
fmodf(position, 2.0f);
605 if (position < 0.0f) position += 2.0f;
606 if (position > 1.0f) position = 2.0f - position;
614 REAL left_blendpos, left_blendfac, right_blendpos, right_blendfac;
626 range = right_blendpos - left_blendpos;
627 blendfac = (left_blendfac * (right_blendpos - position) +
628 right_blendfac * (position - left_blendpos)) /
range;
636 ARGB left_blendcolor, right_blendcolor;
637 REAL left_blendpos, right_blendpos;
648 blendfac = (blendfac - left_blendpos) / (right_blendpos - left_blendpos);
649 return blend_colors(left_blendcolor, right_blendcolor, blendfac);
674 unsigned char a,
r,
g,
b;
695 return (
a << 24) | (
r << 16) | (
g << 8) |
b;
700 unsigned char r,
g,
b;
706 return (
r ==
g) && (
g ==
b);
725 BYTE min_blue, min_green, min_red;
726 BYTE max_blue, max_green, max_red;
736 min_blue =
key->low&0xff;
737 min_green = (
key->low>>8)&0xff;
738 min_red = (
key->low>>16)&0xff;
740 max_blue =
key->high&0xff;
741 max_green = (
key->high>>8)&0xff;
742 max_red = (
key->high>>16)&0xff;
750 blue = *src_color&0xff;
751 green = (*src_color>>8)&0xff;
752 red = (*src_color>>16)&0xff;
753 if (
blue >= min_blue &&
green >= min_green &&
red >= min_red &&
754 blue <= max_blue &&
green <= max_green &&
red <= max_red)
755 *src_color = 0x00000000;
779 if (*src_color ==
table->colormap[
i].oldColor.Argb)
781 *src_color =
table->colormap[
i].newColor.Argb;
793 int gray_matrix[5][5];
852 blue = *src_color&0xff;
853 green = (*src_color>>8)&0xff;
854 red = (*src_color>>16)&0xff;
861 *src_color = (*src_color & 0xff000000) | (
red << 16) | (
green << 8) |
blue;
876 switch (interpolation)
942 return attributes->outside_color;
973 if (x < src_rect->
X || y < src_rect->
Y ||
x >= src_rect->X + src_rect->Width ||
y >= src_rect->Y + src_rect->Height)
975 ERR(
"out of range pixel requested\n");
979 return ((
DWORD*)(
bits))[(
x - src_rect->X) + (
y - src_rect->Y) * src_rect->Width];
984 return f - (
int)
f > 0.0f ?
f + 1.0f :
f;
993 switch (interpolation)
997 FIXME(
"Unimplemented interpolation %i\n", interpolation);
1002 INT leftx, rightx, topy, bottomy;
1003 ARGB topleft, topright, bottomleft, bottomright;
1008 leftxf = (
REAL)leftx;
1014 if (leftx == rightx && topy == bottomy)
1016 leftx, topy, attributes);
1019 leftx, topy, attributes);
1021 rightx, topy, attributes);
1023 leftx, bottomy, attributes);
1025 rightx, bottomy, attributes);
1027 x_offset =
point->X - leftxf;
1036 switch (offset_mode)
1062 switch (interpolation)
1066 FIXME(
"Unimplemented interpolation %i\n", interpolation);
1071 INT leftx, rightx, topy, bottomy;
1072 ARGB topleft, topright, bottomleft, bottomright;
1077 leftxf = (
REAL)leftx;
1083 if (leftx == rightx && topy == bottomy)
1085 leftx, topy, attributes);
1088 leftx, topy, attributes);
1090 rightx, topy, attributes);
1092 leftx, bottomy, attributes);
1094 rightx, bottomy, attributes);
1096 x_offset =
point->X - leftxf;
1105 switch (offset_mode)
1127 return (p1->
X - p2->
X) * (p2->
Y -
y) / (p2->
Y - p1->
Y) + p2->
X;
1148 return ((hatch->
forecol & 0xff000000) == 0xff000000) &&
1149 ((hatch->
backcol & 0xff000000) == 0xff000000);
1204 HBRUSH gdibrush, old_brush;
1250 argb_pixels[
x +
y*cdwStride] =
fill->color;
1257 const char *hatch_data;
1268 hx = (
x + fill_area->
X) % 8;
1269 hy = (
y + fill_area->
Y) % 8;
1271 if ((hatch_data[7-hy] & (0x80 >> hx)) != 0)
1272 argb_pixels[
x +
y*cdwStride] =
fill->forecol;
1274 argb_pixels[
x +
y*cdwStride] =
fill->backcol;
1286 draw_points[0].
X = fill_area->
X;
1287 draw_points[0].
Y = fill_area->
Y;
1288 draw_points[1].
X = fill_area->
X+1;
1289 draw_points[1].
Y = fill_area->
Y;
1290 draw_points[2].
X = fill_area->
X;
1291 draw_points[2].
Y = fill_area->
Y+1;
1310 REAL x_delta = draw_points[1].
X - draw_points[0].
X;
1311 REAL y_delta = draw_points[2].
X - draw_points[0].
X;
1317 REAL pos = draw_points[0].
X +
x * x_delta +
y * y_delta;
1338 FIXME(
"metafile texture brushes not implemented\n");
1345 src_area.
X = src_area.
Y = 0;
1349 draw_points[0].
X = fill_area->
X;
1350 draw_points[0].
Y = fill_area->
Y;
1351 draw_points[1].
X = fill_area->
X+1;
1352 draw_points[1].
Y = fill_area->
Y;
1353 draw_points[2].
X = fill_area->
X;
1354 draw_points[2].
Y = fill_area->
Y+1;
1374 if (!
fill->bitmap_bits)
1381 lockeddata.
Stride = src_stride;
1406 REAL x_dx = draw_points[1].
X - draw_points[0].
X;
1407 REAL x_dy = draw_points[1].
Y - draw_points[0].
Y;
1408 REAL y_dx = draw_points[2].
X - draw_points[0].
X;
1409 REAL y_dy = draw_points[2].
Y - draw_points[0].
Y;
1416 point.X = draw_points[0].
X +
x * x_dx +
y * y_dx;
1417 point.Y = draw_points[0].
Y +
y * x_dy +
y * y_dy;
1435 int i, figure_start=0;
1436 GpPointF start_point, end_point, center_point;
1438 REAL min_yf, max_yf, line1_xf, line2_xf;
1439 INT min_y, max_y, min_x, max_x;
1442 static BOOL transform_fixme_once;
1444 if (
fill->focus.X != 0.0 ||
fill->focus.Y != 0.0)
1448 FIXME(
"path gradient focus not implemented\n");
1455 FIXME(
"path gradient gamma correction not implemented\n");
1458 if (
fill->blendcount)
1462 FIXME(
"path gradient blend not implemented\n");
1465 if (
fill->pblendcount)
1469 FIXME(
"path gradient preset blend not implemented\n");
1472 if (!transform_fixme_once)
1478 FIXME(
"path gradient transform not implemented\n");
1479 transform_fixme_once =
TRUE;
1496 center_point =
fill->center;
1512 int start_center_line=0, end_center_line=0;
1514 REAL center_distance;
1515 ARGB start_color, end_color;
1525 start_color =
fill->surroundcolors[
min(
i,
fill->surroundcolorcount-1)];
1530 end_color =
fill->surroundcolors[
min(figure_start,
fill->surroundcolorcount-1)];
1535 end_color =
fill->surroundcolors[
min(
i+1,
fill->surroundcolorcount-1)];
1540 outer_color = start_color;
1542 min_yf = center_point.
Y;
1543 if (min_yf > start_point.
Y) min_yf = start_point.
Y;
1544 if (min_yf > end_point.
Y) min_yf = end_point.
Y;
1546 if (min_yf < fill_area->
Y)
1547 min_y = fill_area->
Y;
1551 max_yf = center_point.
Y;
1552 if (max_yf < start_point.
Y) max_yf = start_point.
Y;
1553 if (max_yf < end_point.
Y) max_yf = end_point.
Y;
1555 if (max_yf > fill_area->
Y + fill_area->
Height)
1556 max_y = fill_area->
Y + fill_area->
Height;
1560 dy = end_point.
Y - start_point.
Y;
1561 dx = end_point.
X - start_point.
X;
1564 center_distance =
dy * (start_point.
X - center_point.
X) +
1565 dx * (center_point.
Y - start_point.
Y);
1567 for (
y=min_y;
y<max_y;
y++)
1571 if (!seen_start && yf >= start_point.
Y)
1574 start_center_line ^= 1;
1576 if (!seen_end && yf >= end_point.
Y)
1579 end_center_line ^= 1;
1581 if (!seen_center && yf >= center_point.
Y)
1584 start_center_line ^= 1;
1585 end_center_line ^= 1;
1588 if (start_center_line)
1593 if (end_center_line)
1598 if (line1_xf < line2_xf)
1609 if (min_x < fill_area->
X)
1610 min_x = fill_area->
X;
1611 if (max_x > fill_area->
X + fill_area->
Width)
1612 max_x = fill_area->
X + fill_area->
Width;
1614 for (
x=min_x;
x<max_x;
x++)
1619 if (start_color != end_color)
1621 REAL blend_amount, pdy, pdx;
1622 pdy = yf - center_point.
Y;
1623 pdx = xf - center_point.
X;
1625 if (
fabs(pdx) <= 0.001 &&
fabs(pdy) <= 0.001)
1628 outer_color = start_color;
1632 blend_amount = ( (center_point.
Y - start_point.
Y) * pdx + (start_point.
X - center_point.
X) * pdy ) / (
dy * pdx -
dx * pdy );
1633 outer_color =
blend_colors(start_color, end_color, blend_amount);
1637 distance = (end_point.
Y - start_point.
Y) * (start_point.
X - xf) +
1638 (end_point.
X - start_point.
X) * (yf - start_point.
Y);
1642 argb_pixels[(
x-fill_area->
X) + (
y-fill_area->
Y)*cdwStride] =
1664 HBRUSH brush =
NULL;
1669 REAL theta, dsmall, dbig,
dx,
dy = 0.0;
1708 ptf[0].
X =
x2 - dsmall;
1709 ptf[1].
X =
x2 + dbig;
1711 ptf[0].
Y =
y2 - dbig;
1712 ptf[3].
Y =
y2 + dsmall;
1714 ptf[1].
Y =
y2 - dsmall;
1715 ptf[2].
Y =
y2 + dbig;
1717 ptf[3].
X =
x2 - dbig;
1718 ptf[2].
X =
x2 + dsmall;
1811 pt[2].y,
pt[3].x,
pt[3].y);
1826 custptf = heap_alloc_zero(
count *
sizeof(
PointF));
1827 custpt = heap_alloc_zero(
count *
sizeof(
POINT));
1830 if(!custptf || !custpt || !
tp)
1887 dx =
cos(theta) * dist;
1888 dy =
sin(theta) * dist;
1903 if(
dx == 0 &&
dy == 0)
1926 REAL percent = 0.00,
dx,
dy, origx, origy, diff = -1.0;
1927 INT i,
first = 0, second = 1, third = 2, fourth = 3;
1936 origx =
pt[fourth].X;
1937 origy =
pt[fourth].Y;
1951 dx =
pt[fourth].X - origx;
1952 dy =
pt[fourth].Y - origy;
1955 percent += 0.0005 * amt;
1973 if(!pti || !
tp || !ptcopy){
1982 ERR(
"Bad bezier points\n");
2024 ERR(
"Bad path last point\n");
2041 pt[
j - 1].X - (ptcopy[
j - 1].
X - ptcopy[
j].
X),
2042 pt[
j - 1].Y - (ptcopy[
j - 1].
Y - ptcopy[
j].
Y),
2043 pt[
j - 1].X,
pt[
j - 1].Y);
2049 &ptcopy[
j - 1].
X, &ptcopy[
j - 1].
Y,
2053 &ptcopy[
j - 1].
X, &ptcopy[
j - 1].
Y,
2062 ERR(
"Bad path points\n");
2130 (*container)->contid = graphics->contid + 1;
2131 (*container)->type =
type;
2133 (*container)->smoothing = graphics->smoothing;
2134 (*container)->compqual = graphics->compqual;
2135 (*container)->interpolation = graphics->interpolation;
2136 (*container)->compmode = graphics->compmode;
2137 (*container)->texthint = graphics->texthint;
2138 (*container)->scale = graphics->scale;
2139 (*container)->unit = graphics->unit;
2140 (*container)->textcontrast = graphics->textcontrast;
2141 (*container)->pixeloffset = graphics->pixeloffset;
2142 (*container)->origin_x = graphics->origin_x;
2143 (*container)->origin_y = graphics->origin_y;
2144 (*container)->worldtrans = graphics->worldtrans;
2168 if(sts !=
Ok)
return sts;
2173 graphics->
clip = newClip;
2198 if(graphics->
hwnd) {
2206 }
else if (graphics->
image){
2209 FIXME(
"need to convert from unit %i\n",
unit);
2255 min_point = max_point =
points[0];
2265 rect->X = min_point.
X;
2266 rect->Y = min_point.
Y;
2267 rect->Width = max_point.
X - min_point.
X;
2268 rect->Height = max_point.
Y - min_point.
Y;
2326 lf->
lfItalic =
font->otm.otmTextMetrics.tmItalic ? 1 : 0;
2345 HFONT unscaled_font;
2397 TRACE(
"(%p, %p)\n",
hdc, graphics);
2422 TRACE(
"(%p, %p, %p)\n",
hdc, hDevice, graphics);
2425 FIXME(
"Don't know how to handle parameter hDevice\n");
2430 if(graphics ==
NULL)
2433 *graphics = heap_alloc_zero(
sizeof(
GpGraphics));
2445 dib.dsBmih.biBitCount == 32 &&
dib.dsBmih.biCompression ==
BI_RGB)
2447 (*graphics)->alpha_hdc = 1;
2450 (*graphics)->hdc =
hdc;
2452 (*graphics)->owndc =
FALSE;
2459 (*graphics)->scale = 1.0;
2462 (*graphics)->busy =
FALSE;
2463 (*graphics)->textcontrast = 4;
2468 (*graphics)->contid = 0;
2476 (*graphics)->gdi_clip =
NULL;
2479 TRACE(
"<-- %p\n", *graphics);
2488 *graphics = heap_alloc_zero(
sizeof(
GpGraphics));
2499 (*graphics)->hdc =
NULL;
2500 (*graphics)->hwnd =
NULL;
2501 (*graphics)->owndc =
FALSE;
2502 (*graphics)->image =
image;
2505 (*graphics)->image_type =
image->type;
2512 (*graphics)->scale = 1.0;
2513 (*graphics)->xres =
image->xres;
2514 (*graphics)->yres =
image->yres;
2515 (*graphics)->busy =
FALSE;
2516 (*graphics)->textcontrast = 4;
2521 (*graphics)->contid = 0;
2524 TRACE(
"<-- %p\n", *graphics);
2544 (*graphics)->hwnd =
hwnd;
2545 (*graphics)->owndc =
TRUE;
2585 TRACE(
"(%p)\n", graphics);
2625 TRACE(
"(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen,
x,
y,
2628 if(!graphics || !pen ||
width <= 0 ||
height <= 0)
2648 TRACE(
"(%p, %p, %d, %d, %d, %d, %.2f, %.2f)\n", graphics, pen,
x,
y,
2659 TRACE(
"(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen,
x1,
y1,
2660 x2,
y2, x3, y3, x4, y4);
2662 if(!graphics || !pen)
2682 TRACE(
"(%p, %p, %d, %d, %d, %d, %d, %d, %d, %d)\n", graphics, pen,
x1,
y1,
2683 x2,
y2, x3, y3, x4, y4);
2858 if(!graphics || !pen)
2909 TRACE(
"(%p, %p, %p, %d, %d, %d, %.2f)\n", graphics, pen,
points,
count,
offset, numberOfSegments, tension);
2922 TRACE(
"(%p, %p, %p, %d, %d, %d, %.2f)\n", graphics, pen,
points,
count,
offset, numberOfSegments, tension);
2941 TRACE(
"(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen,
x,
y,
width,
height);
2943 if(!graphics || !pen)
2963 TRACE(
"(%p, %p, %d, %d, %d, %d)\n", graphics, pen,
x,
y,
width,
height);
2973 TRACE(
"(%p, %p, %.2f, %.2f)\n", graphics,
image,
x,
y);
2975 if(!graphics || !
image)
3000 TRACE(
"(%p, %p, %f, %f, %f, %f, %f, %f, %d)\n", graphics,
image,
x,
y, srcx, srcy, srcwidth, srcheight, srcUnit);
3005 scale_x *= graphics->
xres /
image->xres;
3007 scale_y *= graphics->
yres /
image->yres;
3008 width = srcwidth * scale_x;
3009 height = srcheight * scale_y;
3051 if (
count != 3 || !dstpoints)
3054 ptf[0].
X = (
REAL)dstpoints[0].
X;
3055 ptf[0].
Y = (
REAL)dstpoints[0].
Y;
3056 ptf[1].
X = (
REAL)dstpoints[1].
X;
3057 ptf[1].
Y = (
REAL)dstpoints[1].
Y;
3058 ptf[2].
X = (
REAL)dstpoints[2].
X;
3059 ptf[2].
Y = (
REAL)dstpoints[2].
Y;
3065 unsigned int dataSize,
const unsigned char *pStr,
void *userdata)
3080 TRACE(
"(%p, %p, %p, %d, %f, %f, %f, %f, %d, %p, %p, %p)\n", graphics,
image,
points,
3081 count, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes,
callback,
3097 srcUnit, imageAttributes,
callback, callbackData);
3106 srcx = srcx + srcwidth;
3107 srcwidth = -srcwidth;
3108 ptf[2].
X = ptf[2].
X + ptf[1].
X - ptf[0].
X;
3109 ptf[2].
Y = ptf[2].
Y + ptf[1].
Y - ptf[0].
Y;
3117 srcy = srcy + srcheight;
3118 srcheight = -srcheight;
3119 ptf[1].
X = ptf[1].
X + ptf[2].
X - ptf[0].
X;
3120 ptf[1].
Y = ptf[1].
Y + ptf[2].
Y - ptf[0].
Y;
3125 ptf[3].
X = ptf[2].
X + ptf[1].
X - ptf[0].
X;
3126 ptf[3].
Y = ptf[2].
Y + ptf[1].
Y - ptf[0].
Y;
3127 if (!srcwidth || !srcheight || (ptf[3].
X == ptf[0].
X && ptf[3].
Y == ptf[0].
Y))
3139 TRACE(
"src pixels: %f,%f %fx%f\n", srcx, srcy, srcwidth, srcheight);
3147 TRACE(
"graphics: %.2fx%.2f dpi, fmt %#x, scale %f, image: %.2fx%.2f dpi, fmt %#x, color %08x\n",
3151 imageAttributes ? imageAttributes->outside_color : 0);
3153 if (ptf[1].
Y != ptf[0].
Y || ptf[2].
X != ptf[0].
X ||
3154 ptf[1].
X - ptf[0].
X != srcwidth || ptf[2].
Y - ptf[0].
Y != srcheight ||
3155 srcx < 0 || srcy < 0 ||
3157 do_resampling =
TRUE;
3159 if (imageAttributes || graphics->
alpha_hdc || do_resampling ||
3161 use_software =
TRUE;
3168 int i,
x,
y, src_stride, dst_stride;
3171 LPBYTE src_data, dst_data, dst_dyn_data=
NULL;
3175 GpPointF dst_to_src_points[3] = {{0.0, 0.0}, {1.0, 0.0}, {0.0, 1.0}};
3176 REAL x_dx, x_dy, y_dx, y_dy;
3179 if (!imageAttributes)
3180 imageAttributes = &defaultImageAttributes;
3186 if (dst_area.
left > pti[
i].
x) dst_area.
left = pti[
i].
x;
3188 if (dst_area.
top > pti[
i].
y) dst_area.
top = pti[
i].
y;
3204 m11 = (ptf[1].
X - ptf[0].
X) / srcwidth;
3205 m21 = (ptf[2].
X - ptf[0].
X) / srcheight;
3206 mdx = ptf[0].
X -
m11 * srcx -
m21 * srcy;
3207 m12 = (ptf[1].
Y - ptf[0].
Y) / srcwidth;
3208 m22 = (ptf[2].
Y - ptf[0].
Y) / srcheight;
3209 mdy = ptf[0].
Y -
m12 * srcx -
m22 * srcy;
3219 bitmap, srcx, srcy, srcwidth, srcheight, &src_area);
3224 src_area.
X = srcx + dst_area.
left - pti[0].
x;
3225 src_area.
Y = srcy + dst_area.
top - pti[0].
y;
3232 src_data = heap_alloc_zero(
sizeof(
ARGB) * src_area.
Width * src_area.
Height);
3235 src_stride =
sizeof(
ARGB) * src_area.
Width;
3240 lockeddata.
Stride = src_stride;
3241 lockeddata.
Scan0 = src_data;
3244 else if (imageAttributes != &defaultImageAttributes)
3268 DOUBLE delta_xx, delta_xy, delta_yx, delta_yy;
3270 REAL delta_xx, delta_xy, delta_yx, delta_yy;
3274 dst_data = dst_dyn_data = heap_alloc_zero(
sizeof(
ARGB) * (dst_area.
right - dst_area.
left) * (dst_area.
bottom - dst_area.
top));
3281 dst_stride =
sizeof(
ARGB) * (dst_area.
right - dst_area.
left);
3285 x_dx = dst_to_src_points[1].
X - dst_to_src_points[0].
X;
3286 x_dy = dst_to_src_points[1].
Y - dst_to_src_points[0].
Y;
3287 y_dx = dst_to_src_points[2].
X - dst_to_src_points[0].
X;
3288 y_dy = dst_to_src_points[2].
Y - dst_to_src_points[0].
Y;
3290 delta_yy = dst_area.
top * y_dy;
3291 delta_yx = dst_area.
top * y_dx;
3295 delta_xx = dst_area.
left * x_dx;
3296 delta_xy = dst_area.
left * x_dy;
3303 src_pointf.
X = dst_to_src_points[0].
X + delta_xx + delta_yx;
3304 src_pointf.
Y = dst_to_src_points[0].
Y + delta_xy + delta_yy;
3306 dst_color = (
ARGB*)(dst_data + dst_stride * (
y - dst_area.
top) +
sizeof(
ARGB) * (
x - dst_area.
left));
3308 if (src_pointf.
X >= srcx && src_pointf.
X < srcx + srcwidth && src_pointf.
Y >= srcy && src_pointf.
Y < srcy+srcheight)
3312 imageAttributes, interpolation, offset_mode);
3315 imageAttributes, interpolation, offset_mode);
3330 dst_data = src_data;
3331 dst_stride = src_stride;
3337 dst_data, dst_area.
right - dst_area.
left, dst_area.
bottom - dst_area.
top, dst_stride,
3383 (
void**)&temp_bits,
NULL, 0);
3406 temp_hdc = (
hdc == 0);
3430 hdc, srcx, srcy, srcwidth, srcheight);
3435 hdc, srcx, srcy, srcwidth, srcheight,
SRCCOPY);
3458 rc.
Width = srcwidth;
3466 WARN(
"GpImage with nothing we can draw (metafile in wrong state?)\n");
3481 TRACE(
"(%p, %p, %p, %d, %d, %d, %d, %d, %d, %p, %p, %p)\n", graphics,
image,
points,
count,
3482 srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes,
callback,
3494 (
REAL)srcwidth, (
REAL)srcheight, srcUnit, imageAttributes,
3502 VOID * callbackData)
3506 TRACE(
"(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %d, %p, %p, %p)\n",
3507 graphics,
image, dstx, dsty, dstwidth, dstheight, srcx, srcy,
3508 srcwidth, srcheight, srcUnit, imageattr,
callback, callbackData);
3512 points[1].X = dstx + dstwidth;
3515 points[2].Y = dsty + dstheight;
3518 srcwidth, srcheight, srcUnit, imageattr,
callback, callbackData);
3525 VOID * callbackData)
3529 TRACE(
"(%p, %p, %d, %d, %d, %d, %d, %d, %d, %d, %d, %p, %p, %p)\n",
3530 graphics,
image, dstx, dsty, dstwidth, dstheight, srcx, srcy,
3531 srcwidth, srcheight, srcUnit, imageAttributes,
callback, callbackData);
3535 points[1].X = dstx + dstwidth;
3538 points[2].Y = dsty + dstheight;
3541 srcwidth, srcheight, srcUnit, imageAttributes,
callback, callbackData);
3551 TRACE(
"(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics,
image,
x,
y,
width,
height);
3553 if(!graphics || !
image)
3568 TRACE(
"(%p, %p, %d, %d, %d, %d)\n", graphics,
image,
x,
y,
width,
height);
3578 TRACE(
"(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen,
x1,
y1,
x2,
y2);
3596 TRACE(
"(%p, %p, %d, %d, %d, %d)\n", graphics, pen,
x1,
y1,
x2,
y2);
3609 if(!pen || !graphics || (
count < 2))