ReactOS 0.4.16-dev-338-g34e76ad
colortransform.c File Reference
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "wincodecs_private.h"
#include "wine/debug.h"
Include dependency graph for colortransform.c:

Go to the source code of this file.

Classes

struct  ColorTransform
 

Macros

#define COBJMACROS
 

Typedefs

typedef struct ColorTransform ColorTransform
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wincodecs)
 
static ColorTransformimpl_from_IWICColorTransform (IWICColorTransform *iface)
 
static HRESULT WINAPI ColorTransform_QueryInterface (IWICColorTransform *iface, REFIID iid, void **ppv)
 
static ULONG WINAPI ColorTransform_AddRef (IWICColorTransform *iface)
 
static ULONG WINAPI ColorTransform_Release (IWICColorTransform *iface)
 
static HRESULT WINAPI ColorTransform_GetSize (IWICColorTransform *iface, UINT *puiWidth, UINT *puiHeight)
 
static HRESULT WINAPI ColorTransform_GetPixelFormat (IWICColorTransform *iface, WICPixelFormatGUID *pPixelFormat)
 
static HRESULT WINAPI ColorTransform_GetResolution (IWICColorTransform *iface, double *pDpiX, double *pDpiY)
 
static HRESULT WINAPI ColorTransform_CopyPalette (IWICColorTransform *iface, IWICPalette *pIPalette)
 
static HRESULT WINAPI ColorTransform_CopyPixels (IWICColorTransform *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer)
 
static HRESULT WINAPI ColorTransform_Initialize (IWICColorTransform *iface, IWICBitmapSource *pIBitmapSource, IWICColorContext *pIContextSource, IWICColorContext *pIContextDest, REFWICPixelFormatGUID pixelFmtDest)
 
HRESULT ColorTransform_Create (IWICColorTransform **colortransform)
 

Variables

static const IWICColorTransformVtbl ColorTransform_Vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file colortransform.c.

Typedef Documentation

◆ ColorTransform

Function Documentation

◆ ColorTransform_AddRef()

static ULONG WINAPI ColorTransform_AddRef ( IWICColorTransform iface)
static

Definition at line 70 of file colortransform.c.

71{
74
75 TRACE("(%p) refcount=%u\n", iface, ref);
76
77 return ref;
78}
#define InterlockedIncrement
Definition: armddk.h:53
static ColorTransform * impl_from_IWICColorTransform(IWICColorTransform *iface)
#define TRACE(s)
Definition: solgame.cpp:4
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ ColorTransform_CopyPalette()

static HRESULT WINAPI ColorTransform_CopyPalette ( IWICColorTransform iface,
IWICPalette pIPalette 
)
static

Definition at line 123 of file colortransform.c.

125{
127 TRACE("(%p,%p)\n", iface, pIPalette);
128
129 return IWICBitmapSource_CopyPalette(This->dst, pIPalette);
130}

◆ ColorTransform_CopyPixels()

static HRESULT WINAPI ColorTransform_CopyPixels ( IWICColorTransform iface,
const WICRect prc,
UINT  cbStride,
UINT  cbBufferSize,
BYTE pbBuffer 
)
static

Definition at line 132 of file colortransform.c.

134{
136 TRACE("(%p,%s,%u,%u,%p)\n", iface, debug_wic_rect(prc), cbStride, cbBufferSize, pbBuffer);
137
138 return IWICBitmapSource_CopyPixels(This->dst, prc, cbStride, cbBufferSize, pbBuffer);
139}
_Out_ LPRECT prc
Definition: ntgdi.h:1658
static const char * debug_wic_rect(const WICRect *rect)

◆ ColorTransform_Create()

HRESULT ColorTransform_Create ( IWICColorTransform **  colortransform)

Definition at line 174 of file colortransform.c.

175{
177
178 if (!colortransform) return E_INVALIDARG;
179
181 if (!This) return E_OUTOFMEMORY;
182
183 This->IWICColorTransform_iface.lpVtbl = &ColorTransform_Vtbl;
184 This->ref = 1;
185 This->dst = NULL;
186
187 *colortransform = &This->IWICColorTransform_iface;
188
189 return S_OK;
190}
static const IWICColorTransformVtbl ColorTransform_Vtbl
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define S_OK
Definition: intsafe.h:52

Referenced by ImagingFactory_CreateColorTransformer().

◆ ColorTransform_GetPixelFormat()

static HRESULT WINAPI ColorTransform_GetPixelFormat ( IWICColorTransform iface,
WICPixelFormatGUID pPixelFormat 
)
static

Definition at line 105 of file colortransform.c.

107{
109 TRACE("(%p,%p)\n", iface, pPixelFormat);
110
111 return IWICBitmapSource_GetPixelFormat(This->dst, pPixelFormat);
112}

◆ ColorTransform_GetResolution()

static HRESULT WINAPI ColorTransform_GetResolution ( IWICColorTransform iface,
double pDpiX,
double pDpiY 
)
static

Definition at line 114 of file colortransform.c.

116{
118 TRACE("(%p,%p,%p)\n", iface, pDpiX, pDpiY);
119
120 return IWICBitmapSource_GetResolution(This->dst, pDpiX, pDpiY);
121}

◆ ColorTransform_GetSize()

static HRESULT WINAPI ColorTransform_GetSize ( IWICColorTransform iface,
UINT puiWidth,
UINT puiHeight 
)
static

Definition at line 96 of file colortransform.c.

98{
100 TRACE("(%p,%p,%p)\n", iface, puiWidth, puiHeight);
101
102 return IWICBitmapSource_GetSize(This->dst, puiWidth, puiHeight);
103}

◆ ColorTransform_Initialize()

static HRESULT WINAPI ColorTransform_Initialize ( IWICColorTransform iface,
IWICBitmapSource pIBitmapSource,
IWICColorContext pIContextSource,
IWICColorContext pIContextDest,
REFWICPixelFormatGUID  pixelFmtDest 
)
static

Definition at line 141 of file colortransform.c.

144{
147 HRESULT hr;
148
149 TRACE("(%p,%p,%p,%p,%s)\n", iface, pIBitmapSource, pIContextSource,
150 pIContextDest, debugstr_guid(pixelFmtDest));
151
152 FIXME("ignoring color contexts\n");
153
154 hr = WICConvertBitmapSource(pixelFmtDest, pIBitmapSource, &dst);
155 if (FAILED(hr)) return hr;
156
157 if (This->dst) IWICBitmapSource_Release(This->dst);
158 This->dst = dst;
159 return S_OK;
160}
#define FIXME(fmt,...)
Definition: precomp.h:53
HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitmapSource *pISrc, IWICBitmapSource **ppIDst)
Definition: info.c:2474
GLenum GLenum dst
Definition: glext.h:6340
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
HRESULT hr
Definition: shlfolder.c:183

◆ ColorTransform_QueryInterface()

static HRESULT WINAPI ColorTransform_QueryInterface ( IWICColorTransform iface,
REFIID  iid,
void **  ppv 
)
static

Definition at line 46 of file colortransform.c.

48{
50 TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv);
51
52 if (!ppv) return E_INVALIDARG;
53
54 if (IsEqualIID(&IID_IUnknown, iid) ||
55 IsEqualIID(&IID_IWICBitmapSource, iid) ||
56 IsEqualIID(&IID_IWICColorTransform, iid))
57 {
58 *ppv = &This->IWICColorTransform_iface;
59 }
60 else
61 {
62 *ppv = NULL;
63 return E_NOINTERFACE;
64 }
65
66 IUnknown_AddRef((IUnknown*)*ppv);
67 return S_OK;
68}
const GUID IID_IUnknown
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ ColorTransform_Release()

static ULONG WINAPI ColorTransform_Release ( IWICColorTransform iface)
static

Definition at line 80 of file colortransform.c.

81{
84
85 TRACE("(%p) refcount=%u\n", iface, ref);
86
87 if (ref == 0)
88 {
89 if (This->dst) IWICBitmapSource_Release(This->dst);
91 }
92
93 return ref;
94}
#define InterlockedDecrement
Definition: armddk.h:52
#define HeapFree(x, y, z)
Definition: compat.h:735

◆ impl_from_IWICColorTransform()

static ColorTransform * impl_from_IWICColorTransform ( IWICColorTransform iface)
inlinestatic

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wincodecs  )

Variable Documentation

◆ ColorTransform_Vtbl

const IWICColorTransformVtbl ColorTransform_Vtbl
static
Initial value:
= {
}
static HRESULT WINAPI ColorTransform_GetResolution(IWICColorTransform *iface, double *pDpiX, double *pDpiY)
static HRESULT WINAPI ColorTransform_Initialize(IWICColorTransform *iface, IWICBitmapSource *pIBitmapSource, IWICColorContext *pIContextSource, IWICColorContext *pIContextDest, REFWICPixelFormatGUID pixelFmtDest)
static HRESULT WINAPI ColorTransform_CopyPalette(IWICColorTransform *iface, IWICPalette *pIPalette)
static HRESULT WINAPI ColorTransform_QueryInterface(IWICColorTransform *iface, REFIID iid, void **ppv)
static ULONG WINAPI ColorTransform_Release(IWICColorTransform *iface)
static ULONG WINAPI ColorTransform_AddRef(IWICColorTransform *iface)
static HRESULT WINAPI ColorTransform_GetPixelFormat(IWICColorTransform *iface, WICPixelFormatGUID *pPixelFormat)
static HRESULT WINAPI ColorTransform_GetSize(IWICColorTransform *iface, UINT *puiWidth, UINT *puiHeight)
static HRESULT WINAPI ColorTransform_CopyPixels(IWICColorTransform *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer)

Definition at line 162 of file colortransform.c.

Referenced by ColorTransform_Create().