mirror of
https://github.com/reactos/reactos.git
synced 2025-02-20 15:35:04 +00:00
[GDIPLUS] Sync with Wine Staging 3.3. CORE-14434
This commit is contained in:
parent
235892b4a4
commit
5f279f2d12
19 changed files with 494 additions and 69 deletions
|
@ -21,7 +21,7 @@ list(APPEND SOURCE
|
|||
pen.c
|
||||
region.c
|
||||
stringformat.c
|
||||
gdiplus_private.h)
|
||||
precomp.h)
|
||||
|
||||
add_library(gdiplus SHARED
|
||||
${SOURCE}
|
||||
|
@ -34,7 +34,7 @@ set_module_type(gdiplus win32dll)
|
|||
target_link_libraries(gdiplus wine)
|
||||
add_delay_importlibs(gdiplus windowscodecs)
|
||||
add_importlibs(gdiplus msvcrt shlwapi oleaut32 ole32 user32 gdi32 kernel32 ntdll)
|
||||
add_pch(gdiplus gdiplus_private.h SOURCE)
|
||||
add_pch(gdiplus precomp.h SOURCE)
|
||||
add_cd_file(TARGET gdiplus DESTINATION reactos/system32 FOR all)
|
||||
add_cd_file(TARGET gdiplus DESTINATION reactos/winsxs/x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.23038_none_deadbeef FOR all)
|
||||
add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.23038_none_deadbeef.manifest DESTINATION reactos/winsxs/manifests FOR all)
|
||||
|
|
|
@ -17,7 +17,23 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "wingdi.h"
|
||||
|
||||
#define COBJMACROS
|
||||
#include "objbase.h"
|
||||
#include "olectl.h"
|
||||
#include "ole2.h"
|
||||
|
||||
#include "gdiplus.h"
|
||||
#include "gdiplus_private.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
|
||||
|
||||
#ifdef __REACTOS__
|
||||
/*
|
||||
|
|
|
@ -16,7 +16,19 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
|
||||
#include "objbase.h"
|
||||
|
||||
#include "gdiplus.h"
|
||||
#include "gdiplus_private.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
|
||||
|
||||
GpStatus WINGDIPAPI GdipCloneCustomLineCap(GpCustomLineCap* from,
|
||||
GpCustomLineCap** to)
|
||||
|
|
|
@ -17,10 +17,25 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winnls.h"
|
||||
#include "winreg.h"
|
||||
#include "wine/debug.h"
|
||||
#include "wine/unicode.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL (gdiplus);
|
||||
|
||||
#include "objbase.h"
|
||||
|
||||
#include "gdiplus.h"
|
||||
#include "gdiplus_private.h"
|
||||
|
||||
/* PANOSE is 10 bytes in size, need to pack the structure properly */
|
||||
#include <pshpack2.h>
|
||||
#include "pshpack2.h"
|
||||
typedef struct
|
||||
{
|
||||
USHORT version;
|
||||
|
@ -85,7 +100,7 @@ typedef struct
|
|||
SHORT metricDataFormat;
|
||||
USHORT numberOfHMetrics;
|
||||
} TT_HHEA;
|
||||
#include <poppack.h>
|
||||
#include "poppack.h"
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
#define GET_BE_WORD(x) (x)
|
||||
|
|
|
@ -16,8 +16,25 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winerror.h"
|
||||
#include "wine/debug.h"
|
||||
#include "wingdi.h"
|
||||
|
||||
#include "objbase.h"
|
||||
|
||||
#include "winreg.h"
|
||||
#include "shlwapi.h"
|
||||
|
||||
#include "gdiplus.h"
|
||||
#include "gdiplus_private.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
|
||||
|
||||
static const REAL mm_per_inch = 25.4;
|
||||
static const REAL point_per_inch = 72.0;
|
||||
|
||||
|
|
|
@ -615,7 +615,7 @@
|
|||
615 stub GdipGetEffectParameterSize
|
||||
616 stub GdipGetEffectParameters
|
||||
617 stdcall GdipSetEffectParameters(ptr ptr long)
|
||||
618 stdcall -stub GdipInitializePalette(ptr long long long ptr)
|
||||
618 stdcall GdipInitializePalette(ptr long long long ptr)
|
||||
619 stdcall GdipBitmapCreateApplyEffect(ptr long ptr ptr ptr ptr long ptr ptr)
|
||||
620 stdcall GdipBitmapApplyEffect(ptr ptr ptr long ptr ptr)
|
||||
621 stdcall GdipBitmapGetHistogram(ptr long long ptr ptr ptr ptr)
|
||||
|
|
|
@ -22,25 +22,18 @@
|
|||
#include <math.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#define WIN32_NO_STATUS
|
||||
#define _INC_WINDOWS
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include "windef.h"
|
||||
#include "wingdi.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
|
||||
#define NONAMELESSUNION
|
||||
#define COBJMACROS
|
||||
#include "objbase.h"
|
||||
#include "ocidl.h"
|
||||
#include "wincodecsdk.h"
|
||||
#include "wine/heap.h"
|
||||
#include "wine/list.h"
|
||||
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <wingdi.h>
|
||||
#include <objbase.h>
|
||||
#include <wincodecsdk.h>
|
||||
#include <gdiplus.h>
|
||||
|
||||
#include <wine/unicode.h>
|
||||
#include <wine/list.h>
|
||||
|
||||
#include <wine/debug.h>
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
|
||||
#include "gdiplus.h"
|
||||
|
||||
#define GP_DEFAULT_PENSTYLE (PS_GEOMETRIC | PS_SOLID | PS_ENDCAP_FLAT | PS_JOIN_MITER)
|
||||
#define MAX_ARC_PTS (13)
|
||||
|
@ -57,25 +50,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
|
|||
#define GIF_DISPOSE_RESTORE_TO_BKGND 2
|
||||
#define GIF_DISPOSE_RESTORE_TO_PREV 3
|
||||
|
||||
static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t size)
|
||||
{
|
||||
return HeapAlloc(GetProcessHeap(), 0, size);
|
||||
}
|
||||
|
||||
static inline void* __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t size)
|
||||
{
|
||||
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
|
||||
}
|
||||
|
||||
static inline void* __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, size_t size)
|
||||
{
|
||||
return HeapReAlloc(GetProcessHeap(), 0, mem, size);
|
||||
}
|
||||
|
||||
static inline BOOL heap_free(void *mem)
|
||||
{
|
||||
return HeapFree(GetProcessHeap(), 0, mem);
|
||||
}
|
||||
|
||||
COLORREF ARGB2COLORREF(ARGB color) DECLSPEC_HIDDEN;
|
||||
HBITMAP ARGB2BMP(ARGB color) DECLSPEC_HIDDEN;
|
||||
|
@ -627,4 +601,4 @@ static inline void image_unlock(GpImage *image, BOOL unlock)
|
|||
if (unlock) image->busy = 0;
|
||||
}
|
||||
|
||||
#endif /* __WINE_GP_PRIVATE_H_ */
|
||||
#endif
|
||||
|
|
|
@ -16,10 +16,31 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "gdiplus_private.h"
|
||||
#include <stdarg.h>
|
||||
#include <math.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include <winreg.h>
|
||||
#include <shlwapi.h>
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "wingdi.h"
|
||||
#include "wine/unicode.h"
|
||||
|
||||
#define COBJMACROS
|
||||
#include "objbase.h"
|
||||
#include "ocidl.h"
|
||||
#include "olectl.h"
|
||||
#include "ole2.h"
|
||||
|
||||
#include "winreg.h"
|
||||
#include "shlwapi.h"
|
||||
|
||||
#include "gdiplus.h"
|
||||
#include "gdiplus_private.h"
|
||||
#include "wine/debug.h"
|
||||
#include "wine/list.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
|
||||
|
||||
/* Mike "tamlin" Nordell 2012-09-14 for ReactOS:
|
||||
* NOTE: Wine uses per-GpGraphics id's ('contid' starting from zero in
|
||||
|
@ -531,12 +552,23 @@ static GpStatus alpha_blend_pixels(GpGraphics *graphics, INT dst_x, INT dst_y,
|
|||
return alpha_blend_pixels_hrgn(graphics, dst_x, dst_y, src, src_width, src_height, src_stride, NULL, fmt);
|
||||
}
|
||||
|
||||
/* NOTE: start and end pixels must be in pre-multiplied ARGB format */
|
||||
static inline ARGB blend_colors_premult(ARGB start, ARGB end, REAL position)
|
||||
{
|
||||
UINT pos = position * 255.0f + 0.5f;
|
||||
return
|
||||
(((((start >> 24) ) << 8) + (((end >> 24) ) - ((start >> 24) )) * pos) >> 8) << 24 |
|
||||
(((((start >> 16) & 0xff) << 8) + (((end >> 16) & 0xff) - ((start >> 16) & 0xff)) * pos) >> 8) << 16 |
|
||||
(((((start >> 8) & 0xff) << 8) + (((end >> 8) & 0xff) - ((start >> 8) & 0xff)) * pos) >> 8) << 8 |
|
||||
(((((start ) & 0xff) << 8) + (((end ) & 0xff) - ((start ) & 0xff)) * pos) >> 8);
|
||||
}
|
||||
|
||||
static ARGB blend_colors(ARGB start, ARGB end, REAL position)
|
||||
{
|
||||
INT start_a, end_a, final_a;
|
||||
INT pos;
|
||||
|
||||
pos = gdip_round(position * 0xff);
|
||||
pos = (INT)(position * 255.0f + 0.5f);
|
||||
|
||||
start_a = ((start >> 24) & 0xff) * (pos ^ 0xff);
|
||||
end_a = ((end >> 24) & 0xff) * pos;
|
||||
|
@ -942,6 +974,11 @@ static ARGB sample_bitmap_pixel(GDIPCONST GpRect *src_rect, LPBYTE bits, UINT wi
|
|||
return ((DWORD*)(bits))[(x - src_rect->X) + (y - src_rect->Y) * src_rect->Width];
|
||||
}
|
||||
|
||||
static inline int positive_ceilf(float f)
|
||||
{
|
||||
return f - (int)f > 0.0f ? f + 1.0f : f;
|
||||
}
|
||||
|
||||
static ARGB resample_bitmap_pixel(GDIPCONST GpRect *src_rect, LPBYTE bits, UINT width,
|
||||
UINT height, GpPointF *point, GDIPCONST GpImageAttributes *attributes,
|
||||
InterpolationMode interpolation, PixelOffsetMode offset_mode)
|
||||
|
@ -962,12 +999,12 @@ static ARGB resample_bitmap_pixel(GDIPCONST GpRect *src_rect, LPBYTE bits, UINT
|
|||
ARGB top, bottom;
|
||||
float x_offset;
|
||||
|
||||
leftxf = floorf(point->X);
|
||||
leftx = (INT)leftxf;
|
||||
rightx = (INT)ceilf(point->X);
|
||||
topyf = floorf(point->Y);
|
||||
topy = (INT)topyf;
|
||||
bottomy = (INT)ceilf(point->Y);
|
||||
leftx = (INT)point->X;
|
||||
leftxf = (REAL)leftx;
|
||||
rightx = positive_ceilf(point->X);
|
||||
topy = (INT)point->Y;
|
||||
topyf = (REAL)topy;
|
||||
bottomy = positive_ceilf(point->Y);
|
||||
|
||||
if (leftx == rightx && topy == bottomy)
|
||||
return sample_bitmap_pixel(src_rect, bits, width, height,
|
||||
|
@ -1011,6 +1048,75 @@ static ARGB resample_bitmap_pixel(GDIPCONST GpRect *src_rect, LPBYTE bits, UINT
|
|||
}
|
||||
}
|
||||
|
||||
static ARGB resample_bitmap_pixel_premult(GDIPCONST GpRect *src_rect, LPBYTE bits, UINT width,
|
||||
UINT height, GpPointF *point, GDIPCONST GpImageAttributes *attributes,
|
||||
InterpolationMode interpolation, PixelOffsetMode offset_mode)
|
||||
{
|
||||
static int fixme;
|
||||
|
||||
switch (interpolation)
|
||||
{
|
||||
default:
|
||||
if (!fixme++)
|
||||
FIXME("Unimplemented interpolation %i\n", interpolation);
|
||||
/* fall-through */
|
||||
case InterpolationModeBilinear:
|
||||
{
|
||||
REAL leftxf, topyf;
|
||||
INT leftx, rightx, topy, bottomy;
|
||||
ARGB topleft, topright, bottomleft, bottomright;
|
||||
ARGB top, bottom;
|
||||
float x_offset;
|
||||
|
||||
leftx = (INT)point->X;
|
||||
leftxf = (REAL)leftx;
|
||||
rightx = positive_ceilf(point->X);
|
||||
topy = (INT)point->Y;
|
||||
topyf = (REAL)topy;
|
||||
bottomy = positive_ceilf(point->Y);
|
||||
|
||||
if (leftx == rightx && topy == bottomy)
|
||||
return sample_bitmap_pixel(src_rect, bits, width, height,
|
||||
leftx, topy, attributes);
|
||||
|
||||
topleft = sample_bitmap_pixel(src_rect, bits, width, height,
|
||||
leftx, topy, attributes);
|
||||
topright = sample_bitmap_pixel(src_rect, bits, width, height,
|
||||
rightx, topy, attributes);
|
||||
bottomleft = sample_bitmap_pixel(src_rect, bits, width, height,
|
||||
leftx, bottomy, attributes);
|
||||
bottomright = sample_bitmap_pixel(src_rect, bits, width, height,
|
||||
rightx, bottomy, attributes);
|
||||
|
||||
x_offset = point->X - leftxf;
|
||||
top = blend_colors_premult(topleft, topright, x_offset);
|
||||
bottom = blend_colors_premult(bottomleft, bottomright, x_offset);
|
||||
|
||||
return blend_colors_premult(top, bottom, point->Y - topyf);
|
||||
}
|
||||
case InterpolationModeNearestNeighbor:
|
||||
{
|
||||
FLOAT pixel_offset;
|
||||
switch (offset_mode)
|
||||
{
|
||||
default:
|
||||
case PixelOffsetModeNone:
|
||||
case PixelOffsetModeHighSpeed:
|
||||
pixel_offset = 0.5;
|
||||
break;
|
||||
|
||||
case PixelOffsetModeHalf:
|
||||
case PixelOffsetModeHighQuality:
|
||||
pixel_offset = 0.0;
|
||||
break;
|
||||
}
|
||||
return sample_bitmap_pixel(src_rect, bits, width, height,
|
||||
floorf(point->X + pixel_offset), point->Y + pixel_offset, attributes);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static REAL intersect_line_scanline(const GpPointF *p1, const GpPointF *p2, REAL y)
|
||||
{
|
||||
return (p1->X - p2->X) * (p2->Y - y) / (p2->Y - p1->Y) + p2->X;
|
||||
|
@ -3106,8 +3212,10 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
|
|||
lockeddata.Scan0 = src_data;
|
||||
if (!do_resampling && bitmap->format == PixelFormat32bppPARGB)
|
||||
lockeddata.PixelFormat = apply_image_attributes(imageAttributes, NULL, 0, 0, 0, ColorAdjustTypeBitmap, bitmap->format);
|
||||
else
|
||||
else if (imageAttributes != &defaultImageAttributes)
|
||||
lockeddata.PixelFormat = PixelFormat32bppARGB;
|
||||
else
|
||||
lockeddata.PixelFormat = PixelFormat32bppPARGB;
|
||||
|
||||
stat = GdipBitmapLockBits(bitmap, &src_area, ImageLockModeRead|ImageLockModeUserInputBuf,
|
||||
lockeddata.PixelFormat, &lockeddata);
|
||||
|
@ -3127,6 +3235,8 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
|
|||
|
||||
if (do_resampling)
|
||||
{
|
||||
REAL delta_xx, delta_xy, delta_yx, delta_yy;
|
||||
|
||||
/* Transform the bits as needed to the destination. */
|
||||
dst_data = dst_dyn_data = heap_alloc_zero(sizeof(ARGB) * (dst_area.right - dst_area.left) * (dst_area.bottom - dst_area.top));
|
||||
if (!dst_data)
|
||||
|
@ -3144,24 +3254,42 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
|
|||
y_dx = dst_to_src_points[2].X - dst_to_src_points[0].X;
|
||||
y_dy = dst_to_src_points[2].Y - dst_to_src_points[0].Y;
|
||||
|
||||
for (x=dst_area.left; x<dst_area.right; x++)
|
||||
delta_yy = dst_area.top * y_dy;
|
||||
delta_yx = dst_area.top * y_dx;
|
||||
|
||||
for (y=dst_area.top; y<dst_area.bottom; y++)
|
||||
{
|
||||
for (y=dst_area.top; y<dst_area.bottom; y++)
|
||||
delta_xx = dst_area.left * x_dx;
|
||||
delta_xy = dst_area.left * x_dy;
|
||||
|
||||
for (x=dst_area.left; x<dst_area.right; x++)
|
||||
{
|
||||
GpPointF src_pointf;
|
||||
ARGB *dst_color;
|
||||
|
||||
src_pointf.X = dst_to_src_points[0].X + x * x_dx + y * y_dx;
|
||||
src_pointf.Y = dst_to_src_points[0].Y + x * x_dy + y * y_dy;
|
||||
src_pointf.X = dst_to_src_points[0].X + delta_xx + delta_yx;
|
||||
src_pointf.Y = dst_to_src_points[0].Y + delta_xy + delta_yy;
|
||||
|
||||
dst_color = (ARGB*)(dst_data + dst_stride * (y - dst_area.top) + sizeof(ARGB) * (x - dst_area.left));
|
||||
|
||||
if (src_pointf.X >= srcx && src_pointf.X < srcx + srcwidth && src_pointf.Y >= srcy && src_pointf.Y < srcy+srcheight)
|
||||
*dst_color = resample_bitmap_pixel(&src_area, src_data, bitmap->width, bitmap->height, &src_pointf,
|
||||
imageAttributes, interpolation, offset_mode);
|
||||
{
|
||||
if (lockeddata.PixelFormat != PixelFormat32bppPARGB)
|
||||
*dst_color = resample_bitmap_pixel(&src_area, src_data, bitmap->width, bitmap->height, &src_pointf,
|
||||
imageAttributes, interpolation, offset_mode);
|
||||
else
|
||||
*dst_color = resample_bitmap_pixel_premult(&src_area, src_data, bitmap->width, bitmap->height, &src_pointf,
|
||||
imageAttributes, interpolation, offset_mode);
|
||||
}
|
||||
else
|
||||
*dst_color = 0;
|
||||
|
||||
delta_xx += x_dx;
|
||||
delta_yx += y_dx;
|
||||
}
|
||||
|
||||
delta_xy += x_dy;
|
||||
delta_yy += y_dy;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -17,7 +17,21 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "wingdi.h"
|
||||
|
||||
#include "objbase.h"
|
||||
|
||||
#include "gdiplus.h"
|
||||
#include "gdiplus_private.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
|
||||
|
||||
typedef struct path_list_node_t path_list_node_t;
|
||||
struct path_list_node_t {
|
||||
|
@ -2292,6 +2306,9 @@ GpStatus WINGDIPAPI GdipAddPathRectangle(GpPath *path, REAL x, REAL y,
|
|||
if(!path)
|
||||
return InvalidParameter;
|
||||
|
||||
if (width <= 0.0 || height <= 0.0)
|
||||
return Ok;
|
||||
|
||||
/* make a backup copy of path data */
|
||||
if((retstat = GdipClonePath(path, &backup)) != Ok)
|
||||
return retstat;
|
||||
|
|
|
@ -17,11 +17,28 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "gdiplus_private.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
#include <ole2.h>
|
||||
#include <olectl.h>
|
||||
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "wingdi.h"
|
||||
|
||||
#define COBJMACROS
|
||||
#include "objbase.h"
|
||||
#include "olectl.h"
|
||||
#include "ole2.h"
|
||||
|
||||
#include "initguid.h"
|
||||
#include "wincodec.h"
|
||||
#include "gdiplus.h"
|
||||
#include "gdiplus_private.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
|
||||
|
||||
HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT, IWICImagingFactory**);
|
||||
|
||||
|
@ -38,13 +55,19 @@ static const struct
|
|||
{
|
||||
{ &GUID_WICPixelFormatBlackWhite, PixelFormat1bppIndexed, WICBitmapPaletteTypeFixedBW },
|
||||
{ &GUID_WICPixelFormat1bppIndexed, PixelFormat1bppIndexed, WICBitmapPaletteTypeFixedBW },
|
||||
{ &GUID_WICPixelFormat4bppIndexed, PixelFormat4bppIndexed, WICBitmapPaletteTypeFixedHalftone8 },
|
||||
{ &GUID_WICPixelFormat8bppGray, PixelFormat8bppIndexed, WICBitmapPaletteTypeFixedGray256 },
|
||||
{ &GUID_WICPixelFormat8bppIndexed, PixelFormat8bppIndexed, WICBitmapPaletteTypeFixedHalftone256 },
|
||||
{ &GUID_WICPixelFormat16bppBGR555, PixelFormat16bppRGB555, WICBitmapPaletteTypeFixedHalftone256 },
|
||||
{ &GUID_WICPixelFormat24bppBGR, PixelFormat24bppRGB, WICBitmapPaletteTypeFixedHalftone256 },
|
||||
{ &GUID_WICPixelFormat32bppBGR, PixelFormat32bppRGB, WICBitmapPaletteTypeFixedHalftone256 },
|
||||
{ &GUID_WICPixelFormat48bppRGB, PixelFormat48bppRGB, WICBitmapPaletteTypeFixedHalftone256 },
|
||||
{ &GUID_WICPixelFormat32bppBGRA, PixelFormat32bppARGB, WICBitmapPaletteTypeFixedHalftone256 },
|
||||
{ &GUID_WICPixelFormat32bppPBGRA, PixelFormat32bppPARGB, WICBitmapPaletteTypeFixedHalftone256 },
|
||||
{ &GUID_WICPixelFormat32bppCMYK, PixelFormat32bppCMYK, WICBitmapPaletteTypeFixedHalftone256 },
|
||||
{ &GUID_WICPixelFormat32bppGrayFloat, PixelFormat32bppARGB, WICBitmapPaletteTypeFixedGray256 },
|
||||
{ &GUID_WICPixelFormat64bppCMYK, PixelFormat48bppRGB, WICBitmapPaletteTypeFixedHalftone256 },
|
||||
{ &GUID_WICPixelFormat64bppRGBA, PixelFormat48bppRGB, WICBitmapPaletteTypeFixedHalftone256 },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
|
@ -4297,6 +4320,11 @@ GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream *stream, GpImage **image)
|
|||
HRESULT hr;
|
||||
const struct image_codec *codec=NULL;
|
||||
|
||||
TRACE("%p %p\n", stream, image);
|
||||
|
||||
if (!stream || !image)
|
||||
return InvalidParameter;
|
||||
|
||||
/* choose an appropriate image decoder */
|
||||
stat = get_decoder_info(stream, &codec);
|
||||
if (stat != Ok) return stat;
|
||||
|
@ -4545,7 +4573,7 @@ static GpStatus encode_image_jpeg(GpImage *image, IStream* stream,
|
|||
static GpStatus encode_image_gif(GpImage *image, IStream* stream,
|
||||
GDIPCONST EncoderParameters* params)
|
||||
{
|
||||
return encode_image_wic(image, stream, &CLSID_WICGifEncoder, params);
|
||||
return encode_image_wic(image, stream, &GUID_ContainerFormatGif, params);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -4558,7 +4586,7 @@ GpStatus WINGDIPAPI GdipSaveImageToStream(GpImage *image, IStream* stream,
|
|||
encode_image_func encode_image;
|
||||
int i;
|
||||
|
||||
TRACE("%p %p %p %p\n", image, stream, clsid, params);
|
||||
TRACE("%p %p %s %p\n", image, stream, wine_dbgstr_guid(clsid), params);
|
||||
|
||||
if(!image || !stream)
|
||||
return InvalidParameter;
|
||||
|
@ -5572,3 +5600,111 @@ GpStatus WINGDIPAPI GdipBitmapGetHistogramSize(HistogramFormat format, UINT *num
|
|||
*num_of_entries = 256;
|
||||
return Ok;
|
||||
}
|
||||
|
||||
static GpStatus create_optimal_palette(ColorPalette *palette, INT desired,
|
||||
BOOL transparent, GpBitmap *bitmap)
|
||||
{
|
||||
GpStatus status;
|
||||
BitmapData data;
|
||||
HRESULT hr;
|
||||
IWICImagingFactory *factory;
|
||||
IWICPalette *wic_palette;
|
||||
|
||||
if (!bitmap) return InvalidParameter;
|
||||
if (palette->Count < desired) return GenericError;
|
||||
|
||||
status = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead, PixelFormat24bppRGB, &data);
|
||||
if (status != Ok) return status;
|
||||
|
||||
hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory);
|
||||
if (hr != S_OK)
|
||||
{
|
||||
GdipBitmapUnlockBits(bitmap, &data);
|
||||
return hresult_to_status(hr);
|
||||
}
|
||||
|
||||
hr = IWICImagingFactory_CreatePalette(factory, &wic_palette);
|
||||
if (hr == S_OK)
|
||||
{
|
||||
IWICBitmap *bitmap;
|
||||
|
||||
/* PixelFormat24bppRGB actually stores the bitmap bits as BGR. */
|
||||
hr = IWICImagingFactory_CreateBitmapFromMemory(factory, data.Width, data.Height,
|
||||
&GUID_WICPixelFormat24bppBGR, data.Stride, data.Stride * data.Width, data.Scan0, &bitmap);
|
||||
if (hr == S_OK)
|
||||
{
|
||||
hr = IWICPalette_InitializeFromBitmap(wic_palette, (IWICBitmapSource *)bitmap, desired, transparent);
|
||||
if (hr == S_OK)
|
||||
{
|
||||
palette->Flags = 0;
|
||||
IWICPalette_GetColorCount(wic_palette, &palette->Count);
|
||||
IWICPalette_GetColors(wic_palette, palette->Count, palette->Entries, &palette->Count);
|
||||
}
|
||||
|
||||
IWICBitmap_Release(bitmap);
|
||||
}
|
||||
|
||||
IWICPalette_Release(wic_palette);
|
||||
}
|
||||
|
||||
IWICImagingFactory_Release(factory);
|
||||
GdipBitmapUnlockBits(bitmap, &data);
|
||||
|
||||
return hresult_to_status(hr);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* GdipInitializePalette [GDIPLUS.@]
|
||||
*/
|
||||
GpStatus WINGDIPAPI GdipInitializePalette(ColorPalette *palette,
|
||||
PaletteType type, INT desired, BOOL transparent, GpBitmap *bitmap)
|
||||
{
|
||||
TRACE("(%p,%d,%d,%d,%p)\n", palette, type, desired, transparent, bitmap);
|
||||
|
||||
if (!palette) return InvalidParameter;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case PaletteTypeCustom:
|
||||
return Ok;
|
||||
|
||||
case PaletteTypeOptimal:
|
||||
return create_optimal_palette(palette, desired, transparent, bitmap);
|
||||
|
||||
/* WIC palette type enumeration matches these gdiplus enums */
|
||||
case PaletteTypeFixedBW:
|
||||
case PaletteTypeFixedHalftone8:
|
||||
case PaletteTypeFixedHalftone27:
|
||||
case PaletteTypeFixedHalftone64:
|
||||
case PaletteTypeFixedHalftone125:
|
||||
case PaletteTypeFixedHalftone216:
|
||||
case PaletteTypeFixedHalftone252:
|
||||
case PaletteTypeFixedHalftone256:
|
||||
{
|
||||
ColorPalette *wic_palette;
|
||||
GpStatus status = Ok;
|
||||
|
||||
wic_palette = get_palette(NULL, type);
|
||||
if (!wic_palette) return OutOfMemory;
|
||||
|
||||
if (palette->Count >= wic_palette->Count)
|
||||
{
|
||||
palette->Flags = wic_palette->Flags;
|
||||
palette->Count = wic_palette->Count;
|
||||
memcpy(palette->Entries, wic_palette->Entries, wic_palette->Count * sizeof(wic_palette->Entries[0]));
|
||||
}
|
||||
else
|
||||
status = GenericError;
|
||||
|
||||
heap_free(wic_palette);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
default:
|
||||
FIXME("unknown palette type %d\n", type);
|
||||
break;
|
||||
}
|
||||
|
||||
return InvalidParameter;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,16 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "windef.h"
|
||||
#include "wingdi.h"
|
||||
|
||||
#include "objbase.h"
|
||||
|
||||
#include "gdiplus.h"
|
||||
#include "gdiplus_private.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
|
||||
|
||||
GpStatus WINGDIPAPI GdipCloneImageAttributes(GDIPCONST GpImageAttributes *imageattr,
|
||||
GpImageAttributes **cloneImageattr)
|
||||
|
|
|
@ -16,7 +16,20 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
|
||||
#include "objbase.h"
|
||||
|
||||
#include "gdiplus.h"
|
||||
#include "gdiplus_private.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
|
||||
|
||||
/* Multiplies two matrices of the form
|
||||
*
|
||||
|
|
|
@ -16,10 +16,32 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "gdiplus_private.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
#include <ole2.h>
|
||||
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "wine/unicode.h"
|
||||
|
||||
#define COBJMACROS
|
||||
#include "objbase.h"
|
||||
#include "ocidl.h"
|
||||
#include "olectl.h"
|
||||
#include "ole2.h"
|
||||
|
||||
#include "winreg.h"
|
||||
#include "shlwapi.h"
|
||||
|
||||
#include "gdiplus.h"
|
||||
#include "gdiplus_private.h"
|
||||
#include "wine/debug.h"
|
||||
#include "wine/list.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
|
||||
|
||||
HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT, IWICImagingFactory**);
|
||||
|
||||
|
|
|
@ -17,7 +17,19 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
|
||||
#include "objbase.h"
|
||||
|
||||
#include "gdiplus.h"
|
||||
#include "gdiplus_private.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
|
||||
|
||||
GpStatus WINGDIPAPI GdipCreatePathIter(GpPathIterator **iterator, GpPath* path)
|
||||
{
|
||||
|
|
|
@ -16,7 +16,19 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
|
||||
#include "objbase.h"
|
||||
|
||||
#include "gdiplus.h"
|
||||
#include "gdiplus_private.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
|
||||
|
||||
static DWORD gdip_to_gdi_dash(GpDashStyle dash)
|
||||
{
|
||||
|
|
17
dll/win32/gdiplus/precomp.h
Normal file
17
dll/win32/gdiplus/precomp.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
|
||||
#ifndef _WINE_GDIPLUS_PRECOMP_H_
|
||||
#define _WINE_GDIPLUS_PRECOMP_H_
|
||||
|
||||
#define WIN32_NO_STATUS
|
||||
#define _INC_WINDOWS
|
||||
#define COM_NO_WINDOWS_H
|
||||
|
||||
#define NONAMELESSUNION
|
||||
#define COBJMACROS
|
||||
|
||||
#include "gdiplus_private.h"
|
||||
|
||||
#include <wine/unicode.h>
|
||||
#include <wine/debug.h>
|
||||
|
||||
#endif /* !_WINE_GDIPLUS_PRECOMP_H_ */
|
|
@ -17,7 +17,19 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
|
||||
#include "objbase.h"
|
||||
|
||||
#include "gdiplus.h"
|
||||
#include "gdiplus_private.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
|
||||
|
||||
/**********************************************************
|
||||
*
|
||||
|
|
|
@ -17,7 +17,20 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winnls.h"
|
||||
|
||||
#include "objbase.h"
|
||||
|
||||
#include "gdiplus.h"
|
||||
#include "gdiplus_private.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
|
||||
|
||||
const GpStringFormat default_drawstring_format =
|
||||
{
|
||||
|
|
|
@ -68,7 +68,7 @@ reactos/dll/win32/dciman32 # Synced to WineStaging-3.3
|
|||
reactos/dll/win32/faultrep # Synced to WineStaging-2.9
|
||||
reactos/dll/win32/fontsub # Synced to WineStaging-2.9
|
||||
reactos/dll/win32/fusion # Synced to WineStaging-3.3
|
||||
reactos/dll/win32/gdiplus # Synced to Wine-3.0
|
||||
reactos/dll/win32/gdiplus # Synced to WineStaging-3.3
|
||||
reactos/dll/win32/hhctrl.ocx # Synced to Wine-3.0
|
||||
reactos/dll/win32/hlink # Synced to Wine-3.0
|
||||
reactos/dll/win32/hnetcfg # Synced to Wine-3.0
|
||||
|
|
Loading…
Reference in a new issue