ReactOS  0.4.15-dev-448-gd6c4411
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 }
static ColorTransform * impl_from_IWICColorTransform(IWICColorTransform *iface)
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

◆ 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 }
static ColorTransform * impl_from_IWICColorTransform(IWICColorTransform *iface)
#define TRACE(s)
Definition: solgame.cpp:4

◆ 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 }
static ColorTransform * impl_from_IWICColorTransform(IWICColorTransform *iface)
#define TRACE(s)
Definition: solgame.cpp:4
static const char * debug_wic_rect(const WICRect *rect)
_Out_ LPRECT prc
Definition: ntgdi.h:1658

◆ ColorTransform_Create()

HRESULT ColorTransform_Create ( IWICColorTransform **  colortransform)

Definition at line 174 of file colortransform.c.

175 {
177 
178  if (!colortransform) return E_INVALIDARG;
179 
180  This = HeapAlloc(GetProcessHeap(), 0, sizeof(ColorTransform));
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 }
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static const IWICColorTransformVtbl ColorTransform_Vtbl
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define S_OK
Definition: intsafe.h:59

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 }
static ColorTransform * impl_from_IWICColorTransform(IWICColorTransform *iface)
#define TRACE(s)
Definition: solgame.cpp:4

◆ 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 }
static ColorTransform * impl_from_IWICColorTransform(IWICColorTransform *iface)
#define TRACE(s)
Definition: solgame.cpp:4

◆ 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 }
static ColorTransform * impl_from_IWICColorTransform(IWICColorTransform *iface)
#define TRACE(s)
Definition: solgame.cpp:4

◆ 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 }
HRESULT hr
Definition: shlfolder.c:183
static ColorTransform * impl_from_IWICColorTransform(IWICColorTransform *iface)
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
#define S_OK
Definition: intsafe.h:59
GLenum GLenum dst
Definition: glext.h:6340
HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitmapSource *pISrc, IWICBitmapSource **ppIDst)
Definition: info.c:2474

◆ 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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
static ColorTransform * impl_from_IWICColorTransform(IWICColorTransform *iface)
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ 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 }
static ColorTransform * impl_from_IWICColorTransform(IWICColorTransform *iface)
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:404
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:403

◆ impl_from_IWICColorTransform()

static ColorTransform* impl_from_IWICColorTransform ( IWICColorTransform iface)
inlinestatic

Definition at line 41 of file colortransform.c.

42 {
43  return CONTAINING_RECORD(iface, ColorTransform, IWICColorTransform_iface);
44 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by ColorTransform_AddRef(), ColorTransform_CopyPalette(), ColorTransform_CopyPixels(), ColorTransform_GetPixelFormat(), ColorTransform_GetResolution(), ColorTransform_GetSize(), ColorTransform_Initialize(), ColorTransform_QueryInterface(), and ColorTransform_Release().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wincodecs  )

Variable Documentation

◆ ColorTransform_Vtbl

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

Definition at line 162 of file colortransform.c.

Referenced by ColorTransform_Create().