2 * Copyright (C) 2007 Google (Evan Stade)
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #include "gdiplus_private.h"
26 #include "wine/debug.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(gdiplus
);
30 GpStatus WINGDIPAPI
GdipCloneImageAttributes(GDIPCONST GpImageAttributes
*imageattr
,
31 GpImageAttributes
**cloneImageattr
)
35 TRACE("(%p, %p)\n", imageattr
, cloneImageattr
);
37 if(!imageattr
|| !cloneImageattr
)
38 return InvalidParameter
;
40 stat
= GdipCreateImageAttributes(cloneImageattr
);
43 **cloneImageattr
= *imageattr
;
48 GpStatus WINGDIPAPI
GdipCreateImageAttributes(GpImageAttributes
**imageattr
)
51 return InvalidParameter
;
53 *imageattr
= GdipAlloc(sizeof(GpImageAttributes
));
54 if(!*imageattr
) return OutOfMemory
;
56 (*imageattr
)->wrap
= WrapModeClamp
;
58 TRACE("<-- %p\n", *imageattr
);
63 GpStatus WINGDIPAPI
GdipDisposeImageAttributes(GpImageAttributes
*imageattr
)
65 TRACE("(%p)\n", imageattr
);
68 return InvalidParameter
;
75 GpStatus WINGDIPAPI
GdipSetImageAttributesColorKeys(GpImageAttributes
*imageattr
,
76 ColorAdjustType type
, BOOL enableFlag
, ARGB colorLow
, ARGB colorHigh
)
78 TRACE("(%p,%u,%i,%08x,%08x)\n", imageattr
, type
, enableFlag
, colorLow
, colorHigh
);
80 if(!imageattr
|| type
>= ColorAdjustTypeCount
)
81 return InvalidParameter
;
83 imageattr
->colorkeys
[type
].enabled
= enableFlag
;
84 imageattr
->colorkeys
[type
].low
= colorLow
;
85 imageattr
->colorkeys
[type
].high
= colorHigh
;
90 GpStatus WINGDIPAPI
GdipSetImageAttributesColorMatrix(GpImageAttributes
*imageattr
,
91 ColorAdjustType type
, BOOL enableFlag
, GDIPCONST ColorMatrix
* colorMatrix
,
92 GDIPCONST ColorMatrix
* grayMatrix
, ColorMatrixFlags flags
)
94 TRACE("(%p,%u,%i,%p,%p,%u)\n", imageattr
, type
, enableFlag
, colorMatrix
,
97 if(!imageattr
|| type
>= ColorAdjustTypeCount
|| flags
> ColorMatrixFlagsAltGray
)
98 return InvalidParameter
;
103 return InvalidParameter
;
105 if (flags
== ColorMatrixFlagsAltGray
)
108 return InvalidParameter
;
110 imageattr
->colormatrices
[type
].graymatrix
= *grayMatrix
;
113 imageattr
->colormatrices
[type
].colormatrix
= *colorMatrix
;
114 imageattr
->colormatrices
[type
].flags
= flags
;
117 imageattr
->colormatrices
[type
].enabled
= enableFlag
;
122 GpStatus WINGDIPAPI
GdipSetImageAttributesWrapMode(GpImageAttributes
*imageAttr
,
123 WrapMode wrap
, ARGB argb
, BOOL clamp
)
125 TRACE("(%p,%u,%08x,%i)\n", imageAttr
, wrap
, argb
, clamp
);
127 if(!imageAttr
|| wrap
> WrapModeClamp
)
128 return InvalidParameter
;
130 imageAttr
->wrap
= wrap
;
131 imageAttr
->outside_color
= argb
;
132 imageAttr
->clamp
= clamp
;
137 GpStatus WINGDIPAPI
GdipSetImageAttributesCachedBackground(GpImageAttributes
*imageAttr
,
142 TRACE("(%p,%i)\n", imageAttr
, enableFlag
);
145 FIXME("not implemented\n");
147 return NotImplemented
;
150 GpStatus WINGDIPAPI
GdipSetImageAttributesGamma(GpImageAttributes
*imageAttr
,
151 ColorAdjustType type
, BOOL enableFlag
, REAL gamma
)
153 TRACE("(%p,%u,%i,%0.2f)\n", imageAttr
, type
, enableFlag
, gamma
);
155 if (!imageAttr
|| (enableFlag
&& gamma
<= 0.0) || type
>= ColorAdjustTypeCount
)
156 return InvalidParameter
;
158 imageAttr
->gamma_enabled
[type
] = enableFlag
;
159 imageAttr
->gamma
[type
] = gamma
;
164 GpStatus WINGDIPAPI
GdipSetImageAttributesNoOp(GpImageAttributes
*imageAttr
,
165 ColorAdjustType type
, BOOL enableFlag
)
169 TRACE("(%p,%u,%i)\n", imageAttr
, type
, enableFlag
);
172 FIXME("not implemented\n");
174 return NotImplemented
;
177 GpStatus WINGDIPAPI
GdipSetImageAttributesOutputChannel(GpImageAttributes
*imageAttr
,
178 ColorAdjustType type
, BOOL enableFlag
, ColorChannelFlags channelFlags
)
182 TRACE("(%p,%u,%i,%x)\n", imageAttr
, type
, enableFlag
, channelFlags
);
185 FIXME("not implemented\n");
187 return NotImplemented
;
190 GpStatus WINGDIPAPI
GdipSetImageAttributesOutputChannelColorProfile(GpImageAttributes
*imageAttr
,
191 ColorAdjustType type
, BOOL enableFlag
,
192 GDIPCONST WCHAR
*colorProfileFilename
)
196 TRACE("(%p,%u,%i,%s)\n", imageAttr
, type
, enableFlag
, debugstr_w(colorProfileFilename
));
199 FIXME("not implemented\n");
201 return NotImplemented
;
204 GpStatus WINGDIPAPI
GdipSetImageAttributesRemapTable(GpImageAttributes
*imageAttr
,
205 ColorAdjustType type
, BOOL enableFlag
, UINT mapSize
,
206 GDIPCONST ColorMap
*map
)
208 TRACE("(%p,%u,%i,%u,%p)\n", imageAttr
, type
, enableFlag
, mapSize
, map
);
210 if(!imageAttr
|| type
>= ColorAdjustTypeCount
)
211 return InvalidParameter
;
216 return InvalidParameter
;
218 imageAttr
->colorremaptables
[type
].mapsize
= mapSize
;
219 imageAttr
->colorremaptables
[type
].colormap
= map
;
222 imageAttr
->colorremaptables
[type
].enabled
= enableFlag
;
227 GpStatus WINGDIPAPI
GdipSetImageAttributesThreshold(GpImageAttributes
*imageAttr
,
228 ColorAdjustType type
, BOOL enableFlag
, REAL threshold
)
232 TRACE("(%p,%u,%i,%0.2f)\n", imageAttr
, type
, enableFlag
, threshold
);
235 FIXME("not implemented\n");
237 return NotImplemented
;
240 GpStatus WINGDIPAPI
GdipSetImageAttributesToIdentity(GpImageAttributes
*imageAttr
,
241 ColorAdjustType type
)
245 TRACE("(%p,%u)\n", imageAttr
, type
);
248 FIXME("not implemented\n");
250 return NotImplemented
;