Merge aicom-network-branch (without NDIS changes for now)
[reactos.git] / reactos / dll / win32 / 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 TRACE("(%p, %p)\n", imageattr, cloneImageattr);
34
35 if(!imageattr || !cloneImageattr)
36 return InvalidParameter;
37
38 **cloneImageattr = *imageattr;
39
40 return Ok;
41 }
42
43 GpStatus WINGDIPAPI GdipCreateImageAttributes(GpImageAttributes **imageattr)
44 {
45 TRACE("(%p)\n", imageattr);
46
47 if(!imageattr)
48 return InvalidParameter;
49
50 *imageattr = GdipAlloc(sizeof(GpImageAttributes));
51 if(!*imageattr) return OutOfMemory;
52
53 return Ok;
54 }
55
56 GpStatus WINGDIPAPI GdipDisposeImageAttributes(GpImageAttributes *imageattr)
57 {
58 TRACE("(%p)\n", imageattr);
59
60 if(!imageattr)
61 return InvalidParameter;
62
63 GdipFree(imageattr);
64
65 return Ok;
66 }
67
68 GpStatus WINGDIPAPI GdipSetImageAttributesColorKeys(GpImageAttributes *imageattr,
69 ColorAdjustType type, BOOL enableFlag, ARGB colorLow, ARGB colorHigh)
70 {
71 TRACE("(%p,%u,%i,%08x,%08x)\n", imageattr, type, enableFlag, colorLow, colorHigh);
72
73 if(!imageattr || type >= ColorAdjustTypeCount)
74 return InvalidParameter;
75
76 imageattr->colorkeys[type].enabled = enableFlag;
77 imageattr->colorkeys[type].low = colorLow;
78 imageattr->colorkeys[type].high = colorHigh;
79
80 return Ok;
81 }
82
83 GpStatus WINGDIPAPI GdipSetImageAttributesColorMatrix(GpImageAttributes *imageattr,
84 ColorAdjustType type, BOOL enableFlag, GDIPCONST ColorMatrix* colorMatrix,
85 GDIPCONST ColorMatrix* grayMatrix, ColorMatrixFlags flags)
86 {
87 static int calls;
88
89 if(!imageattr || !colorMatrix || !grayMatrix)
90 return InvalidParameter;
91
92 if(!(calls++))
93 FIXME("not implemented\n");
94
95 return NotImplemented;
96 }
97
98 GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode(GpImageAttributes *imageAttr,
99 WrapMode wrap, ARGB argb, BOOL clamp)
100 {
101 static int calls;
102
103 if(!imageAttr)
104 return InvalidParameter;
105
106 if(!(calls++))
107 FIXME("not implemented\n");
108
109 return NotImplemented;
110 }
111
112 GpStatus WINGDIPAPI GdipSetImageAttributesCachedBackground(GpImageAttributes *imageAttr,
113 BOOL enableFlag)
114 {
115 static int calls;
116
117 if(!(calls++))
118 FIXME("not implemented\n");
119
120 return NotImplemented;
121 }
122
123 GpStatus WINGDIPAPI GdipSetImageAttributesGamma(GpImageAttributes *imageAttr,
124 ColorAdjustType type, BOOL enableFlag, REAL gamma)
125 {
126 static int calls;
127
128 if(!(calls++))
129 FIXME("not implemented\n");
130
131 return NotImplemented;
132 }
133
134 GpStatus WINGDIPAPI GdipSetImageAttributesNoOp(GpImageAttributes *imageAttr,
135 ColorAdjustType type, BOOL enableFlag)
136 {
137 static int calls;
138
139 if(!(calls++))
140 FIXME("not implemented\n");
141
142 return NotImplemented;
143 }
144
145 GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannel(GpImageAttributes *imageAttr,
146 ColorAdjustType type, BOOL enableFlag, ColorChannelFlags channelFlags)
147 {
148 static int calls;
149
150 if(!(calls++))
151 FIXME("not implemented\n");
152
153 return NotImplemented;
154 }
155
156 GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannelColorProfile(GpImageAttributes *imageAttr,
157 ColorAdjustType type, BOOL enableFlag,
158 GDIPCONST WCHAR *colorProfileFilename)
159 {
160 static int calls;
161
162 if(!(calls++))
163 FIXME("not implemented\n");
164
165 return NotImplemented;
166 }
167
168 GpStatus WINGDIPAPI GdipSetImageAttributesRemapTable(GpImageAttributes *imageAttr,
169 ColorAdjustType type, BOOL enableFlag, UINT mapSize,
170 GDIPCONST ColorMap *map)
171 {
172 static int calls;
173
174 if(!(calls++))
175 FIXME("not implemented\n");
176
177 return NotImplemented;
178 }
179
180 GpStatus WINGDIPAPI GdipSetImageAttributesThreshold(GpImageAttributes *imageAttr,
181 ColorAdjustType type, BOOL enableFlag, REAL threshold)
182 {
183 static int calls;
184
185 if(!(calls++))
186 FIXME("not implemented\n");
187
188 return NotImplemented;
189 }
190
191 GpStatus WINGDIPAPI GdipSetImageAttributesToIdentity(GpImageAttributes *imageAttr,
192 ColorAdjustType type)
193 {
194 static int calls;
195
196 if(!(calls++))
197 FIXME("not implemented\n");
198
199 return NotImplemented;
200 }