[GDIPLUS]

sync gdiplus to wine 1.1.40

svn path=/trunk/; revision=45924
This commit is contained in:
Christoph von Wittich 2010-03-06 12:15:38 +00:00
parent e162d33ac4
commit 640aaf3a2e
7 changed files with 74 additions and 25 deletions

View file

@ -290,7 +290,7 @@
@ stdcall GdipGetImageGraphicsContext(ptr ptr)
@ stdcall GdipGetImageHeight(ptr ptr)
@ stdcall GdipGetImageHorizontalResolution(ptr ptr)
@ stub GdipGetImageItemData
@ stdcall GdipGetImageItemData(ptr ptr)
@ stdcall GdipGetImagePalette(ptr ptr long)
@ stdcall GdipGetImagePaletteSize(ptr ptr)
@ stdcall GdipGetImagePixelFormat(ptr ptr)
@ -381,7 +381,7 @@
@ stdcall GdipGetRegionDataSize(ptr ptr)
@ stdcall GdipGetRegionHRgn(ptr ptr ptr)
@ stub GdipGetRegionScans
@ stub GdipGetRegionScansCount
@ stdcall GdipGetRegionScansCount(ptr ptr ptr)
@ stub GdipGetRegionScansI
@ stub GdipGetRenderingOrigin
@ stdcall GdipGetSmoothingMode(ptr ptr)

View file

@ -264,10 +264,17 @@ struct color_matrix{
ColorMatrix graymatrix;
};
struct color_remap_table{
BOOL enabled;
INT mapsize;
GDIPCONST ColorMap *colormap;
};
struct GpImageAttributes{
WrapMode wrap;
struct color_key colorkeys[ColorAdjustTypeCount];
struct color_matrix colormatrices[ColorAdjustTypeCount];
struct color_remap_table colorremaptables[ColorAdjustTypeCount];
BOOL gamma_enabled[ColorAdjustTypeCount];
REAL gamma[ColorAdjustTypeCount];
};

View file

@ -3173,9 +3173,10 @@ GpStatus WINGDIPAPI GdipGetInterpolationMode(GpGraphics *graphics,
return Ok;
}
/* FIXME: Need to handle color depths less than 24bpp */
GpStatus WINGDIPAPI GdipGetNearestColor(GpGraphics *graphics, ARGB* argb)
{
FIXME("(%p, %p): stub\n", graphics, argb);
FIXME("(%p, %p): Passing color unmodified\n", graphics, argb);
if(!graphics || !argb)
return InvalidParameter;
@ -3183,7 +3184,7 @@ GpStatus WINGDIPAPI GdipGetNearestColor(GpGraphics *graphics, ARGB* argb)
if(graphics->busy)
return ObjectBusy;
return NotImplemented;
return Ok;
}
GpStatus WINGDIPAPI GdipGetPageScale(GpGraphics *graphics, REAL *scale)

View file

@ -1614,7 +1614,7 @@ static GpStatus get_screen_resolution(REAL *xres, REAL *yres)
GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
PixelFormat format, BYTE* scan0, GpBitmap** bitmap)
{
BITMAPINFOHEADER bmih;
BITMAPINFO* pbmi;
HBITMAP hbitmap;
INT row_size, dib_stride;
HDC hdc;
@ -1644,26 +1644,33 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
if(stride == 0)
stride = dib_stride;
bmih.biSize = sizeof(BITMAPINFOHEADER);
bmih.biWidth = width;
bmih.biHeight = -height;
bmih.biPlanes = 1;
pbmi = GdipAlloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
if (!pbmi)
return OutOfMemory;
pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
pbmi->bmiHeader.biWidth = width;
pbmi->bmiHeader.biHeight = -height;
pbmi->bmiHeader.biPlanes = 1;
/* FIXME: use the rest of the data from format */
bmih.biBitCount = PIXELFORMATBPP(format);
bmih.biCompression = BI_RGB;
bmih.biSizeImage = 0;
bmih.biXPelsPerMeter = 0;
bmih.biYPelsPerMeter = 0;
bmih.biClrUsed = 0;
bmih.biClrImportant = 0;
pbmi->bmiHeader.biBitCount = PIXELFORMATBPP(format);
pbmi->bmiHeader.biCompression = BI_RGB;
pbmi->bmiHeader.biSizeImage = 0;
pbmi->bmiHeader.biXPelsPerMeter = 0;
pbmi->bmiHeader.biYPelsPerMeter = 0;
pbmi->bmiHeader.biClrUsed = 0;
pbmi->bmiHeader.biClrImportant = 0;
hdc = CreateCompatibleDC(NULL);
if (!hdc) return GenericError;
if (!hdc) {
GdipFree(pbmi);
return GenericError;
}
hbitmap = CreateDIBSection(hdc, (BITMAPINFO*)&bmih, DIB_RGB_COLORS, (void**)&bits,
NULL, 0);
hbitmap = CreateDIBSection(hdc, pbmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
DeleteDC(hdc);
GdipFree(pbmi);
if (!hbitmap) return GenericError;
@ -1837,6 +1844,7 @@ GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
{
GdipFree(((GpBitmap*)image)->bitmapbits);
DeleteDC(((GpBitmap*)image)->hdc);
DeleteObject(((GpBitmap*)image)->hbitmap);
}
GdipFree(image->palette_entries);
GdipFree(image);
@ -1859,6 +1867,18 @@ GpStatus WINGDIPAPI GdipFindFirstImageItem(GpImage *image, ImageItemData* item)
return NotImplemented;
}
GpStatus WINGDIPAPI GdipGetImageItemData(GpImage *image, ImageItemData *item)
{
static int calls;
TRACE("(%p,%p)\n", image, item);
if (!(calls++))
FIXME("not implemented\n");
return NotImplemented;
}
GpStatus WINGDIPAPI GdipGetImageBounds(GpImage *image, GpRectF *srcRect,
GpUnit *srcUnit)
{

View file

@ -204,14 +204,23 @@ GpStatus WINGDIPAPI GdipSetImageAttributesRemapTable(GpImageAttributes *imageAtt
ColorAdjustType type, BOOL enableFlag, UINT mapSize,
GDIPCONST ColorMap *map)
{
static int calls;
TRACE("(%p,%u,%i,%u,%p)\n", imageAttr, type, enableFlag, mapSize, map);
if(!(calls++))
FIXME("not implemented\n");
if(!imageAttr || type >= ColorAdjustTypeCount)
return InvalidParameter;
return NotImplemented;
if (enableFlag)
{
if(!map || !mapSize)
return InvalidParameter;
imageAttr->colorremaptables[type].mapsize = mapSize;
imageAttr->colorremaptables[type].colormap = map;
}
imageAttr->colorremaptables[type].enabled = enableFlag;
return Ok;
}
GpStatus WINGDIPAPI GdipSetImageAttributesThreshold(GpImageAttributes *imageAttr,

View file

@ -1306,3 +1306,15 @@ GpStatus WINGDIPAPI GdipTranslateRegionI(GpRegion *region, INT dx, INT dy)
return GdipTranslateRegion(region, (REAL)dx, (REAL)dy);
}
GpStatus WINGDIPAPI GdipGetRegionScansCount(GpRegion *region, UINT *count, GpMatrix *matrix)
{
static int calls;
TRACE("(%p, %p, %p)\n", region, count, matrix);
if (!(calls++))
FIXME("not implemented\n");
return NotImplemented;
}

View file

@ -45,7 +45,7 @@ enum ColorAdjustType
struct ColorMap
{
Color oldColor;
Color newCOlor;
Color newColor;
};
#ifndef __cplusplus