gdiplus: Add traces to unimplemented functions in imageattributes.c.
[wine] / dlls / gdiplus / imageattributes.c
1 /*
2  * Copyright (C) 2007 Google (Evan Stade)
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #include "windef.h"
20 #include "wingdi.h"
21
22 #include "objbase.h"
23
24 #include "gdiplus.h"
25 #include "gdiplus_private.h"
26 #include "wine/debug.h"
27
28 WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
29
30 GpStatus WINGDIPAPI GdipCloneImageAttributes(GDIPCONST GpImageAttributes *imageattr,
31     GpImageAttributes **cloneImageattr)
32 {
33     GpStatus stat;
34
35     TRACE("(%p, %p)\n", imageattr, cloneImageattr);
36
37     if(!imageattr || !cloneImageattr)
38         return InvalidParameter;
39
40     stat = GdipCreateImageAttributes(cloneImageattr);
41
42     if (stat == Ok)
43         **cloneImageattr = *imageattr;
44
45     return stat;
46 }
47
48 GpStatus WINGDIPAPI GdipCreateImageAttributes(GpImageAttributes **imageattr)
49 {
50     if(!imageattr)
51         return InvalidParameter;
52
53     *imageattr = GdipAlloc(sizeof(GpImageAttributes));
54     if(!*imageattr)    return OutOfMemory;
55
56     TRACE("<-- %p\n", *imageattr);
57
58     return Ok;
59 }
60
61 GpStatus WINGDIPAPI GdipDisposeImageAttributes(GpImageAttributes *imageattr)
62 {
63     TRACE("(%p)\n", imageattr);
64
65     if(!imageattr)
66         return InvalidParameter;
67
68     GdipFree(imageattr);
69
70     return Ok;
71 }
72
73 GpStatus WINGDIPAPI GdipSetImageAttributesColorKeys(GpImageAttributes *imageattr,
74     ColorAdjustType type, BOOL enableFlag, ARGB colorLow, ARGB colorHigh)
75 {
76     TRACE("(%p,%u,%i,%08x,%08x)\n", imageattr, type, enableFlag, colorLow, colorHigh);
77
78     if(!imageattr || type >= ColorAdjustTypeCount)
79         return InvalidParameter;
80
81     imageattr->colorkeys[type].enabled = enableFlag;
82     imageattr->colorkeys[type].low = colorLow;
83     imageattr->colorkeys[type].high = colorHigh;
84
85     return Ok;
86 }
87
88 GpStatus WINGDIPAPI GdipSetImageAttributesColorMatrix(GpImageAttributes *imageattr,
89     ColorAdjustType type, BOOL enableFlag, GDIPCONST ColorMatrix* colorMatrix,
90     GDIPCONST ColorMatrix* grayMatrix, ColorMatrixFlags flags)
91 {
92     TRACE("(%p,%u,%i,%p,%p,%u)\n", imageattr, type, enableFlag, colorMatrix,
93         grayMatrix, flags);
94
95     if(!imageattr || type >= ColorAdjustTypeCount || flags > ColorMatrixFlagsAltGray)
96         return InvalidParameter;
97
98     if (enableFlag)
99     {
100         if (!colorMatrix)
101             return InvalidParameter;
102
103         if (flags == ColorMatrixFlagsAltGray)
104         {
105             if (!grayMatrix)
106                 return InvalidParameter;
107
108             imageattr->colormatrices[type].graymatrix = *grayMatrix;
109         }
110
111         imageattr->colormatrices[type].colormatrix = *colorMatrix;
112         imageattr->colormatrices[type].flags = flags;
113     }
114
115     imageattr->colormatrices[type].enabled = enableFlag;
116
117     return Ok;
118 }
119
120 GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode(GpImageAttributes *imageAttr,
121     WrapMode wrap, ARGB argb, BOOL clamp)
122 {
123     static int calls;
124
125     TRACE("(%p,%u,%08x,%i)\n", imageAttr, wrap, argb, clamp);
126
127     if(!imageAttr)
128         return InvalidParameter;
129
130     if(!(calls++))
131         FIXME("not implemented\n");
132
133     return NotImplemented;
134 }
135
136 GpStatus WINGDIPAPI GdipSetImageAttributesCachedBackground(GpImageAttributes *imageAttr,
137     BOOL enableFlag)
138 {
139     static int calls;
140
141     TRACE("(%p,%i)\n", imageAttr, enableFlag);
142
143     if(!(calls++))
144         FIXME("not implemented\n");
145
146     return NotImplemented;
147 }
148
149 GpStatus WINGDIPAPI GdipSetImageAttributesGamma(GpImageAttributes *imageAttr,
150     ColorAdjustType type, BOOL enableFlag, REAL gamma)
151 {
152     static int calls;
153
154     TRACE("(%p,%u,%i,%0.2f)\n", imageAttr, type, enableFlag, gamma);
155
156     if(!(calls++))
157         FIXME("not implemented\n");
158
159     return NotImplemented;
160 }
161
162 GpStatus WINGDIPAPI GdipSetImageAttributesNoOp(GpImageAttributes *imageAttr,
163     ColorAdjustType type, BOOL enableFlag)
164 {
165     static int calls;
166
167     TRACE("(%p,%u,%i)\n", imageAttr, type, enableFlag);
168
169     if(!(calls++))
170         FIXME("not implemented\n");
171
172     return NotImplemented;
173 }
174
175 GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannel(GpImageAttributes *imageAttr,
176     ColorAdjustType type, BOOL enableFlag, ColorChannelFlags channelFlags)
177 {
178     static int calls;
179
180     TRACE("(%p,%u,%i,%x)\n", imageAttr, type, enableFlag, channelFlags);
181
182     if(!(calls++))
183         FIXME("not implemented\n");
184
185     return NotImplemented;
186 }
187
188 GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannelColorProfile(GpImageAttributes *imageAttr,
189     ColorAdjustType type, BOOL enableFlag,
190     GDIPCONST WCHAR *colorProfileFilename)
191 {
192     static int calls;
193
194     TRACE("(%p,%u,%i,%s)\n", imageAttr, type, enableFlag, debugstr_w(colorProfileFilename));
195
196     if(!(calls++))
197         FIXME("not implemented\n");
198
199     return NotImplemented;
200 }
201
202 GpStatus WINGDIPAPI GdipSetImageAttributesRemapTable(GpImageAttributes *imageAttr,
203     ColorAdjustType type, BOOL enableFlag, UINT mapSize,
204     GDIPCONST ColorMap *map)
205 {
206     static int calls;
207
208     TRACE("(%p,%u,%i,%u,%p)\n", imageAttr, type, enableFlag, mapSize, map);
209
210     if(!(calls++))
211         FIXME("not implemented\n");
212
213     return NotImplemented;
214 }
215
216 GpStatus WINGDIPAPI GdipSetImageAttributesThreshold(GpImageAttributes *imageAttr,
217     ColorAdjustType type, BOOL enableFlag, REAL threshold)
218 {
219     static int calls;
220
221     TRACE("(%p,%u,%i,%0.2f)\n", imageAttr, type, enableFlag, threshold);
222
223     if(!(calls++))
224         FIXME("not implemented\n");
225
226     return NotImplemented;
227 }
228
229 GpStatus WINGDIPAPI GdipSetImageAttributesToIdentity(GpImageAttributes *imageAttr,
230     ColorAdjustType type)
231 {
232     static int calls;
233
234     TRACE("(%p,%u)\n", imageAttr, type);
235
236     if(!(calls++))
237         FIXME("not implemented\n");
238
239     return NotImplemented;
240 }