~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/gdiplus/imageattributes.c

Version: ~ [ wine-1.5.31 ] ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  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     (*imageattr)->wrap = WrapModeClamp;
 57 
 58     TRACE("<-- %p\n", *imageattr);
 59 
 60     return Ok;
 61 }
 62 
 63 GpStatus WINGDIPAPI GdipDisposeImageAttributes(GpImageAttributes *imageattr)
 64 {
 65     TRACE("(%p)\n", imageattr);
 66 
 67     if(!imageattr)
 68         return InvalidParameter;
 69 
 70     GdipFree(imageattr);
 71 
 72     return Ok;
 73 }
 74 
 75 GpStatus WINGDIPAPI GdipSetImageAttributesColorKeys(GpImageAttributes *imageattr,
 76     ColorAdjustType type, BOOL enableFlag, ARGB colorLow, ARGB colorHigh)
 77 {
 78     TRACE("(%p,%u,%i,%08x,%08x)\n", imageattr, type, enableFlag, colorLow, colorHigh);
 79 
 80     if(!imageattr || type >= ColorAdjustTypeCount)
 81         return InvalidParameter;
 82 
 83     imageattr->colorkeys[type].enabled = enableFlag;
 84     imageattr->colorkeys[type].low = colorLow;
 85     imageattr->colorkeys[type].high = colorHigh;
 86 
 87     return Ok;
 88 }
 89 
 90 GpStatus WINGDIPAPI GdipSetImageAttributesColorMatrix(GpImageAttributes *imageattr,
 91     ColorAdjustType type, BOOL enableFlag, GDIPCONST ColorMatrix* colorMatrix,
 92     GDIPCONST ColorMatrix* grayMatrix, ColorMatrixFlags flags)
 93 {
 94     TRACE("(%p,%u,%i,%p,%p,%u)\n", imageattr, type, enableFlag, colorMatrix,
 95         grayMatrix, flags);
 96 
 97     if(!imageattr || type >= ColorAdjustTypeCount || flags > ColorMatrixFlagsAltGray)
 98         return InvalidParameter;
 99 
100     if (enableFlag)
101     {
102         if (!colorMatrix)
103             return InvalidParameter;
104 
105         if (flags == ColorMatrixFlagsAltGray)
106         {
107             if (!grayMatrix)
108                 return InvalidParameter;
109 
110             imageattr->colormatrices[type].graymatrix = *grayMatrix;
111         }
112 
113         imageattr->colormatrices[type].colormatrix = *colorMatrix;
114         imageattr->colormatrices[type].flags = flags;
115     }
116 
117     imageattr->colormatrices[type].enabled = enableFlag;
118 
119     return Ok;
120 }
121 
122 GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode(GpImageAttributes *imageAttr,
123     WrapMode wrap, ARGB argb, BOOL clamp)
124 {
125     TRACE("(%p,%u,%08x,%i)\n", imageAttr, wrap, argb, clamp);
126 
127     if(!imageAttr || wrap > WrapModeClamp)
128         return InvalidParameter;
129 
130     imageAttr->wrap = wrap;
131     imageAttr->outside_color = argb;
132     imageAttr->clamp = clamp;
133 
134     return Ok;
135 }
136 
137 GpStatus WINGDIPAPI GdipSetImageAttributesCachedBackground(GpImageAttributes *imageAttr,
138     BOOL enableFlag)
139 {
140     static int calls;
141 
142     TRACE("(%p,%i)\n", imageAttr, enableFlag);
143 
144     if(!(calls++))
145         FIXME("not implemented\n");
146 
147     return NotImplemented;
148 }
149 
150 GpStatus WINGDIPAPI GdipSetImageAttributesGamma(GpImageAttributes *imageAttr,
151     ColorAdjustType type, BOOL enableFlag, REAL gamma)
152 {
153     TRACE("(%p,%u,%i,%0.2f)\n", imageAttr, type, enableFlag, gamma);
154 
155     if (!imageAttr || (enableFlag && gamma <= 0.0) || type >= ColorAdjustTypeCount)
156         return InvalidParameter;
157 
158     imageAttr->gamma_enabled[type] = enableFlag;
159     imageAttr->gamma[type] = gamma;
160 
161     return Ok;
162 }
163 
164 GpStatus WINGDIPAPI GdipSetImageAttributesNoOp(GpImageAttributes *imageAttr,
165     ColorAdjustType type, BOOL enableFlag)
166 {
167     static int calls;
168 
169     TRACE("(%p,%u,%i)\n", imageAttr, type, enableFlag);
170 
171     if(!(calls++))
172         FIXME("not implemented\n");
173 
174     return NotImplemented;
175 }
176 
177 GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannel(GpImageAttributes *imageAttr,
178     ColorAdjustType type, BOOL enableFlag, ColorChannelFlags channelFlags)
179 {
180     static int calls;
181 
182     TRACE("(%p,%u,%i,%x)\n", imageAttr, type, enableFlag, channelFlags);
183 
184     if(!(calls++))
185         FIXME("not implemented\n");
186 
187     return NotImplemented;
188 }
189 
190 GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannelColorProfile(GpImageAttributes *imageAttr,
191     ColorAdjustType type, BOOL enableFlag,
192     GDIPCONST WCHAR *colorProfileFilename)
193 {
194     static int calls;
195 
196     TRACE("(%p,%u,%i,%s)\n", imageAttr, type, enableFlag, debugstr_w(colorProfileFilename));
197 
198     if(!(calls++))
199         FIXME("not implemented\n");
200 
201     return NotImplemented;
202 }
203 
204 GpStatus WINGDIPAPI GdipSetImageAttributesRemapTable(GpImageAttributes *imageAttr,
205     ColorAdjustType type, BOOL enableFlag, UINT mapSize,
206     GDIPCONST ColorMap *map)
207 {
208     TRACE("(%p,%u,%i,%u,%p)\n", imageAttr, type, enableFlag, mapSize, map);
209 
210     if(!imageAttr || type >= ColorAdjustTypeCount)
211         return InvalidParameter;
212 
213     if (enableFlag)
214     {
215         if(!map || !mapSize)
216             return InvalidParameter;
217 
218         imageAttr->colorremaptables[type].mapsize = mapSize;
219         imageAttr->colorremaptables[type].colormap = map;
220     }
221 
222     imageAttr->colorremaptables[type].enabled = enableFlag;
223 
224     return Ok;
225 }
226 
227 GpStatus WINGDIPAPI GdipSetImageAttributesThreshold(GpImageAttributes *imageAttr,
228     ColorAdjustType type, BOOL enableFlag, REAL threshold)
229 {
230     static int calls;
231 
232     TRACE("(%p,%u,%i,%0.2f)\n", imageAttr, type, enableFlag, threshold);
233 
234     if(!(calls++))
235         FIXME("not implemented\n");
236 
237     return NotImplemented;
238 }
239 
240 GpStatus WINGDIPAPI GdipSetImageAttributesToIdentity(GpImageAttributes *imageAttr,
241     ColorAdjustType type)
242 {
243     static int calls;
244 
245     TRACE("(%p,%u)\n", imageAttr, type);
246 
247     if(!(calls++))
248         FIXME("not implemented\n");
249 
250     return NotImplemented;
251 }
252 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.