@ 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)
@ 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)
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];
};
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;
if(graphics->busy)
return ObjectBusy;
- return NotImplemented;
+ return Ok;
}
GpStatus WINGDIPAPI GdipGetPageScale(GpGraphics *graphics, REAL *scale)
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;
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;
{
GdipFree(((GpBitmap*)image)->bitmapbits);
DeleteDC(((GpBitmap*)image)->hdc);
+ DeleteObject(((GpBitmap*)image)->hbitmap);
}
GdipFree(image->palette_entries);
GdipFree(image);
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)
{
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,
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;
+}
struct ColorMap
{
Color oldColor;
- Color newCOlor;
+ Color newColor;
};
#ifndef __cplusplus