ReactOS 0.4.16-dev-1093-g93e9710
colortransform.c File Reference
#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 21 of file colortransform.c.

Typedef Documentation

◆ ColorTransform

Function Documentation

◆ ColorTransform_AddRef()

static ULONG WINAPI ColorTransform_AddRef ( IWICColorTransform iface)
static

Definition at line 68 of file colortransform.c.

69{
72
73 TRACE("(%p) refcount=%lu\n", iface, ref);
74
75 return ref;
76}
#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 121 of file colortransform.c.

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

◆ ColorTransform_CopyPixels()

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

Definition at line 130 of file colortransform.c.

132{
134 TRACE("(%p,%s,%u,%u,%p)\n", iface, debug_wic_rect(prc), cbStride, cbBufferSize, pbBuffer);
135
136 return IWICBitmapSource_CopyPixels(This->dst, prc, cbStride, cbBufferSize, pbBuffer);
137}
_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 172 of file colortransform.c.

173{
175
176 if (!colortransform) return E_INVALIDARG;
177
178 This = malloc(sizeof(ColorTransform));
179 if (!This) return E_OUTOFMEMORY;
180
181 This->IWICColorTransform_iface.lpVtbl = &ColorTransform_Vtbl;
182 This->ref = 1;
183 This->dst = NULL;
184
185 *colortransform = &This->IWICColorTransform_iface;
186
187 return S_OK;
188}
static const IWICColorTransformVtbl ColorTransform_Vtbl
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#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 103 of file colortransform.c.

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

◆ ColorTransform_GetResolution()

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

Definition at line 112 of file colortransform.c.

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

◆ ColorTransform_GetSize()

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

Definition at line 94 of file colortransform.c.

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

◆ ColorTransform_Initialize()

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

Definition at line 139 of file colortransform.c.

142{
145 HRESULT hr;
146
147 TRACE("(%p,%p,%p,%p,%s)\n", iface, pIBitmapSource, pIContextSource,
148 pIContextDest, debugstr_guid(pixelFmtDest));
149
150 FIXME("ignoring color contexts\n");
151
152 hr = WICConvertBitmapSource(pixelFmtDest, pIBitmapSource, &dst);
153 if (FAILED(hr)) return hr;
154
155 if (This->dst) IWICBitmapSource_Release(This->dst);
156 This->dst = dst;
157 return S_OK;
158}
#define FIXME(fmt,...)
Definition: precomp.h:53
HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitmapSource *pISrc, IWICBitmapSource **ppIDst)
Definition: info.c:2437
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 44 of file colortransform.c.

46{
48 TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv);
49
50 if (!ppv) return E_INVALIDARG;
51
52 if (IsEqualIID(&IID_IUnknown, iid) ||
53 IsEqualIID(&IID_IWICBitmapSource, iid) ||
54 IsEqualIID(&IID_IWICColorTransform, iid))
55 {
56 *ppv = &This->IWICColorTransform_iface;
57 }
58 else
59 {
60 *ppv = NULL;
61 return E_NOINTERFACE;
62 }
63
64 IUnknown_AddRef((IUnknown*)*ppv);
65 return S_OK;
66}
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 78 of file colortransform.c.

79{
82
83 TRACE("(%p) refcount=%lu\n", iface, ref);
84
85 if (ref == 0)
86 {
87 if (This->dst) IWICBitmapSource_Release(This->dst);
88 free(This);
89 }
90
91 return ref;
92}
#define InterlockedDecrement
Definition: armddk.h:52
#define free
Definition: debug_ros.c:5

◆ 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 160 of file colortransform.c.

Referenced by ColorTransform_Create().