70 rect.Width = srcwidth;
71 rect.Height = srcheight;
76 if (rc->
X < 0 || rc->
Y < 0 || rc->
X+rc->
Width > srcwidth || rc->
Y+rc->
Height > srcheight)
80 bytesperrow = ((
bpp * rc->
Width)+7)/8;
82 if (dststride < bytesperrow)
85 if ((dststride * (rc->
Height-1)) + bytesperrow > dstbuffersize)
89 if (rc->
X == 0 && rc->
Y == 0 && rc->
Width == srcwidth && rc->
Height == srcheight &&
90 srcstride == dststride && srcstride == bytesperrow)
92 memcpy(dstbuffer, srcbuffer, srcstride * srcheight);
96 row_offset = rc->
X *
bpp;
98 if (row_offset % 8 == 0)
105 src = srcbuffer + (row_offset / 8) + srcstride * rc->
Y;
118 FIXME(
"cannot reliably copy bitmap data if bpp < 8\n");
137 hr = IWICBitmapSource_GetPixelFormat(
source, &src_format);
140 hr = IWICBitmapFrameEncode_SetPixelFormat(iface, &src_format);
144 if (xres == 0.0 || yres == 0.0)
146 hr = IWICBitmapSource_GetResolution(
source, &xres, &yres);
148 hr = IWICBitmapFrameEncode_SetResolution(iface, xres, yres);
168 UINT src_width, src_height;
169 hr = IWICBitmapSource_GetSize(
source, &src_width, &src_height);
173 rc.
Width = src_width;
193 IWICBitmapSource_Release(converted_source);
197 hr = IWICBitmapSource_CopyPixels(converted_source,
prc,
stride,
202 hr = IWICBitmapFrameEncode_WritePixels(iface,
prc->Height,
stride,
207 IWICBitmapSource_Release(converted_source);
226 pixel += bytesperpixel;
247 pixel += bytesperpixel;
261 hr = IWICComponentInfo_QueryInterface(
info, &IID_IWICPixelFormatInfo, (
void**)&formatinfo);
265 hr = IWICPixelFormatInfo_GetBitsPerPixel(formatinfo,
bpp);
267 IWICPixelFormatInfo_Release(formatinfo);
270 IWICComponentInfo_Release(
info);
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
HRESULT WINAPI DllCanUnloadNow(void)
#define DLL_PROCESS_ATTACH
#define DLL_PROCESS_DETACH
#define HeapFree(x, y, z)
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
HRESULT CreateComponentInfo(REFCLSID clsid, IWICComponentInfo **ppIInfo)
HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitmapSource *pISrc, IWICBitmapSource **ppIDst)
void ReleaseComponentInfos(void)
HRESULT write_source(IWICBitmapFrameEncode *iface, IWICBitmapSource *source, const WICRect *prc, const WICPixelFormatGUID *format, UINT bpp, INT width, INT height)
void reverse_bgr8(UINT bytesperpixel, LPBYTE bits, UINT width, UINT height, INT stride)
HRESULT get_pixelformat_bpp(const GUID *pixelformat, UINT *bpp)
HRESULT configure_write_source(IWICBitmapFrameEncode *iface, IWICBitmapSource *source, const WICRect *prc, const WICPixelFormatGUID *format, INT width, INT height, double xres, double yres)
void convert_rgba_to_bgra(UINT bytesperpixel, LPBYTE bits, UINT width, UINT height, INT stride)
HRESULT copy_pixels(UINT bpp, const BYTE *srcbuffer, UINT srcwidth, UINT srcheight, INT srcstride, const WICRect *rc, UINT dststride, UINT dstbuffersize, BYTE *dstbuffer)
BOOL WINAPI WIC_DllMain(HINSTANCE, DWORD, LPVOID)
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
static IN DWORD IN LPVOID lpvReserved
#define memcpy(s1, s2, n)
#define WINCODEC_ERR_WRONGSTATE