2008-03-25 17:34:57 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2007 Google (Evan Stade)
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* 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);
|
|
|
|
|
2008-07-02 08:19:00 +00:00
|
|
|
GpStatus WINGDIPAPI GdipCloneImageAttributes(GDIPCONST GpImageAttributes *imageattr,
|
|
|
|
GpImageAttributes **cloneImageattr)
|
|
|
|
{
|
2010-03-04 13:34:05 +00:00
|
|
|
GpStatus stat;
|
|
|
|
|
2008-09-07 10:32:49 +00:00
|
|
|
TRACE("(%p, %p)\n", imageattr, cloneImageattr);
|
|
|
|
|
2008-07-02 08:19:00 +00:00
|
|
|
if(!imageattr || !cloneImageattr)
|
|
|
|
return InvalidParameter;
|
|
|
|
|
2010-03-04 13:34:05 +00:00
|
|
|
stat = GdipCreateImageAttributes(cloneImageattr);
|
2008-07-02 08:19:00 +00:00
|
|
|
|
2010-03-04 13:34:05 +00:00
|
|
|
if (stat == Ok)
|
|
|
|
**cloneImageattr = *imageattr;
|
|
|
|
|
|
|
|
return stat;
|
2008-07-02 08:19:00 +00:00
|
|
|
}
|
|
|
|
|
2008-03-25 17:34:57 +00:00
|
|
|
GpStatus WINGDIPAPI GdipCreateImageAttributes(GpImageAttributes **imageattr)
|
|
|
|
{
|
|
|
|
if(!imageattr)
|
|
|
|
return InvalidParameter;
|
|
|
|
|
|
|
|
*imageattr = GdipAlloc(sizeof(GpImageAttributes));
|
|
|
|
if(!*imageattr) return OutOfMemory;
|
|
|
|
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
(*imageattr)->wrap = WrapModeClamp;
|
|
|
|
|
2010-03-04 13:34:05 +00:00
|
|
|
TRACE("<-- %p\n", *imageattr);
|
|
|
|
|
2008-03-25 17:34:57 +00:00
|
|
|
return Ok;
|
|
|
|
}
|
|
|
|
|
|
|
|
GpStatus WINGDIPAPI GdipDisposeImageAttributes(GpImageAttributes *imageattr)
|
|
|
|
{
|
2008-09-07 10:32:49 +00:00
|
|
|
TRACE("(%p)\n", imageattr);
|
|
|
|
|
2008-03-25 17:34:57 +00:00
|
|
|
if(!imageattr)
|
|
|
|
return InvalidParameter;
|
|
|
|
|
|
|
|
GdipFree(imageattr);
|
|
|
|
|
|
|
|
return Ok;
|
|
|
|
}
|
|
|
|
|
|
|
|
GpStatus WINGDIPAPI GdipSetImageAttributesColorKeys(GpImageAttributes *imageattr,
|
|
|
|
ColorAdjustType type, BOOL enableFlag, ARGB colorLow, ARGB colorHigh)
|
|
|
|
{
|
2009-09-03 15:07:25 +00:00
|
|
|
TRACE("(%p,%u,%i,%08x,%08x)\n", imageattr, type, enableFlag, colorLow, colorHigh);
|
2008-03-25 17:34:57 +00:00
|
|
|
|
2009-09-03 15:07:25 +00:00
|
|
|
if(!imageattr || type >= ColorAdjustTypeCount)
|
2008-03-25 17:34:57 +00:00
|
|
|
return InvalidParameter;
|
|
|
|
|
2009-09-03 15:07:25 +00:00
|
|
|
imageattr->colorkeys[type].enabled = enableFlag;
|
|
|
|
imageattr->colorkeys[type].low = colorLow;
|
|
|
|
imageattr->colorkeys[type].high = colorHigh;
|
2008-03-25 17:34:57 +00:00
|
|
|
|
2009-09-03 15:07:25 +00:00
|
|
|
return Ok;
|
2008-03-25 17:34:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GpStatus WINGDIPAPI GdipSetImageAttributesColorMatrix(GpImageAttributes *imageattr,
|
|
|
|
ColorAdjustType type, BOOL enableFlag, GDIPCONST ColorMatrix* colorMatrix,
|
|
|
|
GDIPCONST ColorMatrix* grayMatrix, ColorMatrixFlags flags)
|
|
|
|
{
|
2010-03-04 13:34:05 +00:00
|
|
|
TRACE("(%p,%u,%i,%p,%p,%u)\n", imageattr, type, enableFlag, colorMatrix,
|
|
|
|
grayMatrix, flags);
|
2008-03-25 17:34:57 +00:00
|
|
|
|
2010-03-04 13:34:05 +00:00
|
|
|
if(!imageattr || type >= ColorAdjustTypeCount || flags > ColorMatrixFlagsAltGray)
|
2008-03-25 17:34:57 +00:00
|
|
|
return InvalidParameter;
|
|
|
|
|
2010-03-04 13:34:05 +00:00
|
|
|
if (enableFlag)
|
|
|
|
{
|
|
|
|
if (!colorMatrix)
|
|
|
|
return InvalidParameter;
|
2008-03-25 17:34:57 +00:00
|
|
|
|
2010-03-04 13:34:05 +00:00
|
|
|
if (flags == ColorMatrixFlagsAltGray)
|
|
|
|
{
|
|
|
|
if (!grayMatrix)
|
|
|
|
return InvalidParameter;
|
|
|
|
|
|
|
|
imageattr->colormatrices[type].graymatrix = *grayMatrix;
|
|
|
|
}
|
|
|
|
|
|
|
|
imageattr->colormatrices[type].colormatrix = *colorMatrix;
|
|
|
|
imageattr->colormatrices[type].flags = flags;
|
|
|
|
}
|
|
|
|
|
|
|
|
imageattr->colormatrices[type].enabled = enableFlag;
|
|
|
|
|
|
|
|
return Ok;
|
2008-03-25 17:34:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode(GpImageAttributes *imageAttr,
|
|
|
|
WrapMode wrap, ARGB argb, BOOL clamp)
|
|
|
|
{
|
2010-03-04 13:34:05 +00:00
|
|
|
TRACE("(%p,%u,%08x,%i)\n", imageAttr, wrap, argb, clamp);
|
|
|
|
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
if(!imageAttr || wrap > WrapModeClamp)
|
2008-03-25 17:34:57 +00:00
|
|
|
return InvalidParameter;
|
|
|
|
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
imageAttr->wrap = wrap;
|
|
|
|
imageAttr->outside_color = argb;
|
|
|
|
imageAttr->clamp = clamp;
|
2008-03-25 17:34:57 +00:00
|
|
|
|
Sync avifil, credui, crypt32, cryptdlg, cryptui, dnsapi, gdiplus, hhctrl, hnetcfg, iccvid, imaadp32, imm32, jscript, localspl, localui, mapi32, mciavi32, mcicda, mciqtz32, mciseq, mciwave, mshtml, msrle32, msvfw32, msvidc32, msxml3, oleacc, oleaut32 to Wine 1.2rc5 (Samuel Serapion, small changes by me)
Remove Esperanto and Walon languages from comctl32, comdlg32, mpr, msi, shlwapi, wininet
svn path=/trunk/; revision=47920
2010-07-01 11:09:47 +00:00
|
|
|
return Ok;
|
2008-03-25 17:34:57 +00:00
|
|
|
}
|
2008-04-14 12:53:30 +00:00
|
|
|
|
|
|
|
GpStatus WINGDIPAPI GdipSetImageAttributesCachedBackground(GpImageAttributes *imageAttr,
|
|
|
|
BOOL enableFlag)
|
|
|
|
{
|
|
|
|
static int calls;
|
|
|
|
|
2010-03-04 13:34:05 +00:00
|
|
|
TRACE("(%p,%i)\n", imageAttr, enableFlag);
|
|
|
|
|
2008-04-14 12:53:30 +00:00
|
|
|
if(!(calls++))
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
|
|
|
|
return NotImplemented;
|
|
|
|
}
|
|
|
|
|
|
|
|
GpStatus WINGDIPAPI GdipSetImageAttributesGamma(GpImageAttributes *imageAttr,
|
|
|
|
ColorAdjustType type, BOOL enableFlag, REAL gamma)
|
|
|
|
{
|
2010-03-04 13:34:05 +00:00
|
|
|
TRACE("(%p,%u,%i,%0.2f)\n", imageAttr, type, enableFlag, gamma);
|
2008-04-14 12:53:30 +00:00
|
|
|
|
2010-03-04 13:34:05 +00:00
|
|
|
if (!imageAttr || (enableFlag && gamma <= 0.0) || type >= ColorAdjustTypeCount)
|
|
|
|
return InvalidParameter;
|
2008-04-14 12:53:30 +00:00
|
|
|
|
2010-03-04 13:34:05 +00:00
|
|
|
imageAttr->gamma_enabled[type] = enableFlag;
|
|
|
|
imageAttr->gamma[type] = gamma;
|
|
|
|
|
|
|
|
return Ok;
|
2008-04-14 12:53:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GpStatus WINGDIPAPI GdipSetImageAttributesNoOp(GpImageAttributes *imageAttr,
|
|
|
|
ColorAdjustType type, BOOL enableFlag)
|
|
|
|
{
|
|
|
|
static int calls;
|
|
|
|
|
2010-03-04 13:34:05 +00:00
|
|
|
TRACE("(%p,%u,%i)\n", imageAttr, type, enableFlag);
|
|
|
|
|
2008-04-14 12:53:30 +00:00
|
|
|
if(!(calls++))
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
|
|
|
|
return NotImplemented;
|
|
|
|
}
|
|
|
|
|
|
|
|
GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannel(GpImageAttributes *imageAttr,
|
|
|
|
ColorAdjustType type, BOOL enableFlag, ColorChannelFlags channelFlags)
|
|
|
|
{
|
|
|
|
static int calls;
|
|
|
|
|
2010-03-04 13:34:05 +00:00
|
|
|
TRACE("(%p,%u,%i,%x)\n", imageAttr, type, enableFlag, channelFlags);
|
|
|
|
|
2008-04-14 12:53:30 +00:00
|
|
|
if(!(calls++))
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
|
|
|
|
return NotImplemented;
|
|
|
|
}
|
|
|
|
|
|
|
|
GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannelColorProfile(GpImageAttributes *imageAttr,
|
|
|
|
ColorAdjustType type, BOOL enableFlag,
|
|
|
|
GDIPCONST WCHAR *colorProfileFilename)
|
|
|
|
{
|
|
|
|
static int calls;
|
|
|
|
|
2010-03-04 13:34:05 +00:00
|
|
|
TRACE("(%p,%u,%i,%s)\n", imageAttr, type, enableFlag, debugstr_w(colorProfileFilename));
|
|
|
|
|
2008-04-14 12:53:30 +00:00
|
|
|
if(!(calls++))
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
|
|
|
|
return NotImplemented;
|
|
|
|
}
|
|
|
|
|
|
|
|
GpStatus WINGDIPAPI GdipSetImageAttributesRemapTable(GpImageAttributes *imageAttr,
|
|
|
|
ColorAdjustType type, BOOL enableFlag, UINT mapSize,
|
|
|
|
GDIPCONST ColorMap *map)
|
|
|
|
{
|
2010-03-04 13:34:05 +00:00
|
|
|
TRACE("(%p,%u,%i,%u,%p)\n", imageAttr, type, enableFlag, mapSize, map);
|
|
|
|
|
2010-03-06 12:15:38 +00:00
|
|
|
if(!imageAttr || type >= ColorAdjustTypeCount)
|
|
|
|
return InvalidParameter;
|
2008-04-14 12:53:30 +00:00
|
|
|
|
2010-03-06 12:15:38 +00:00
|
|
|
if (enableFlag)
|
|
|
|
{
|
|
|
|
if(!map || !mapSize)
|
|
|
|
return InvalidParameter;
|
|
|
|
|
|
|
|
imageAttr->colorremaptables[type].mapsize = mapSize;
|
|
|
|
imageAttr->colorremaptables[type].colormap = map;
|
|
|
|
}
|
|
|
|
|
|
|
|
imageAttr->colorremaptables[type].enabled = enableFlag;
|
|
|
|
|
|
|
|
return Ok;
|
2008-04-14 12:53:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GpStatus WINGDIPAPI GdipSetImageAttributesThreshold(GpImageAttributes *imageAttr,
|
|
|
|
ColorAdjustType type, BOOL enableFlag, REAL threshold)
|
|
|
|
{
|
|
|
|
static int calls;
|
|
|
|
|
2010-03-04 13:34:05 +00:00
|
|
|
TRACE("(%p,%u,%i,%0.2f)\n", imageAttr, type, enableFlag, threshold);
|
|
|
|
|
2008-04-14 12:53:30 +00:00
|
|
|
if(!(calls++))
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
|
|
|
|
return NotImplemented;
|
|
|
|
}
|
|
|
|
|
|
|
|
GpStatus WINGDIPAPI GdipSetImageAttributesToIdentity(GpImageAttributes *imageAttr,
|
|
|
|
ColorAdjustType type)
|
|
|
|
{
|
|
|
|
static int calls;
|
|
|
|
|
2010-03-04 13:34:05 +00:00
|
|
|
TRACE("(%p,%u)\n", imageAttr, type);
|
|
|
|
|
2008-04-14 12:53:30 +00:00
|
|
|
if(!(calls++))
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
|
|
|
|
return NotImplemented;
|
|
|
|
}
|