39DEFINE_GUID(GUID_WineContainerFormatTga, 0x0c44fda1,0xa5c5,0x4298,0x96,0x85,0x47,0x3f,0xc1,0x7c,0xd3,0x22);
46 { &GUID_WICPixelFormat8bppIndexed,
D3DFMT_P8 },
47 { &GUID_WICPixelFormat1bppIndexed,
D3DFMT_P8 },
48 { &GUID_WICPixelFormat4bppIndexed,
D3DFMT_P8 },
49 { &GUID_WICPixelFormat8bppGray,
D3DFMT_L8 },
88#define DDS_PIXELFORMAT 0x1000
89#define DDS_MIPMAPCOUNT 0x20000
90#define DDS_LINEARSIZE 0x80000
91#define DDS_DEPTH 0x800000
94#define DDS_CAPS_COMPLEX 0x8
95#define DDS_CAPS_TEXTURE 0x1000
96#define DDS_CAPS_MIPMAP 0x400000
99#define DDS_CAPS2_CUBEMAP 0x200
100#define DDS_CAPS2_CUBEMAP_POSITIVEX 0x400
101#define DDS_CAPS2_CUBEMAP_NEGATIVEX 0x800
102#define DDS_CAPS2_CUBEMAP_POSITIVEY 0x1000
103#define DDS_CAPS2_CUBEMAP_NEGATIVEY 0x2000
104#define DDS_CAPS2_CUBEMAP_POSITIVEZ 0x4000
105#define DDS_CAPS2_CUBEMAP_NEGATIVEZ 0x8000
106#define DDS_CAPS2_CUBEMAP_ALL_FACES ( DDS_CAPS2_CUBEMAP_POSITIVEX | DDS_CAPS2_CUBEMAP_NEGATIVEX \
107 | DDS_CAPS2_CUBEMAP_POSITIVEY | DDS_CAPS2_CUBEMAP_NEGATIVEY \
108 | DDS_CAPS2_CUBEMAP_POSITIVEZ | DDS_CAPS2_CUBEMAP_NEGATIVEZ )
109#define DDS_CAPS2_VOLUME 0x200000
112#define DDS_PF_ALPHA 0x1
113#define DDS_PF_ALPHA_ONLY 0x2
114#define DDS_PF_FOURCC 0x4
115#define DDS_PF_INDEXED 0x20
116#define DDS_PF_RGB 0x40
117#define DDS_PF_YUV 0x200
118#define DDS_PF_LUMINANCE 0x20000
119#define DDS_PF_BUMPLUMINANCE 0x40000
120#define DDS_PF_BUMPDUDV 0x80000
156 static const DWORD known_fourcc[] = {
199 { 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000,
D3DFMT_R8G8B8 },
200 { 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000,
D3DFMT_A8R8G8B8 },
201 { 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000,
D3DFMT_X8R8G8B8 },
204 { 32, 0x0000ffff, 0xffff0000, 0x00000000, 0x00000000,
D3DFMT_G16R16 },
205 { 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000,
D3DFMT_A8B8G8R8 },
206 { 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000,
D3DFMT_X8B8G8R8 },
210 IDirect3DSurface9 **temp_surface,
BOOL write)
219 *temp_surface =
NULL;
242 WARN(
"Failed to create temporary surface, surface %p, format %#x,"
243 " usage %#x, pool %#x, write %#x, width %u, height %u.\n",
256 WARN(
"Failed to lock surface %p, write %#x, usage %#x, pool %#x.\n",
259 *temp_surface =
NULL;
262 TRACE(
"Created temporary surface %p.\n", surface);
268 IDirect3DSurface9 *temp_surface,
BOOL update)
285 surface_point.
x = surface_rect->
left;
286 surface_point.
y = surface_rect->
top;
295 WARN(
"Updating surface failed, hr %#x, surface %p, temp_surface %p.\n",
296 hr, surface, temp_surface);
321 WARN(
"Unknown RGB pixel format (%#x, %#x, %#x, %#x)\n",
343 WARN(
"Unknown luminance pixel format (bpp %u, l %#x, a %#x)\n",
373 WARN(
"Unknown bump pixel format (%u, %#x, %#x, %#x, %#x)\n",
pixel_format->bpp,
384 WARN(
"Unknown bump pixel format (%u, %#x, %#x, %#x, %#x).\n",
pixel_format->bpp,
391 TRACE(
"pixel_format: size %u, flags %#x, fourcc %#x, bpp %u.\n",
pixel_format->size,
411 WARN(
"Unknown pixel format (flags %#x, fourcc %#x, bpp %u, r %#x, g %#x, b %#x, a %#x)\n",
480 for (
i = 0;
i < miplevels;
i++)
515 UINT expected_length;
521 if (
header->pixel_format.size !=
sizeof(
header->pixel_format))
533 TRACE(
"Pixel format is %#x\n",
info->Format);
557 info->MipLevels, faces);
558 if (
length < expected_length)
560 WARN(
"File is too short %u, expected at least %u bytes\n",
length, expected_length);
598 IDirect3DSurface9 *temp_surface;
602 FIXME(
"Saving a part of a surface to a DDS file is not implemented yet\n");
667 ERR(
"Unexpected texture type\n");
677 IDirect3DSurface9 *surface;
686 FIXME(
"Cube texture not supported yet\n");
691 FIXME(
"Volume texture not supported yet\n");
699 FIXME(
"Mipmap not supported yet\n");
705 FIXME(
"Saving surfaces with palettized pixel formats not implemented yet\n");
723 UINT row_pitch, slice_pitch;
739 unsigned int *loaded_miplevels)
748 IDirect3DSurface9 *surface;
758 WARN(
"Trying to load a %u resource as a 2D texture, returning failure.\n", src_info->
ResourceType);
767 for (mip_level = 0; mip_level < mip_levels + skip_levels; ++mip_level)
772 if (mip_level >= skip_levels)
789 *loaded_miplevels = mip_levels - skip_levels;
805 IDirect3DSurface9 *surface;
814 WARN(
"Only full cubemaps are supported\n");
822 for (mip_level = 0; mip_level < src_info->
MipLevels; mip_level++)
828 if (mip_level < mip_levels)
853 UINT src_slice_pitch;
869 for (mip_level = 0; mip_level < mip_levels; mip_level++)
913 (header_size ==
sizeof(BITMAPV5HEADER)) ||
914 (header_size == 64 ))
943 TRACE(
"Converting DIB file to BMP\n");
952 header->bfSize = new_size;
1002 TRACE(
"File type is DDS\n");
1015 IWICStream_Release(
stream);
1016 IWICImagingFactory_Release(
factory);
1021 FIXME(
"File type PPM is not supported yet\n");
1023 FIXME(
"File type HDR is not supported yet\n");
1025 FIXME(
"File type PFM is not supported yet\n");
1029 GUID container_format;
1032 hr = IWICBitmapDecoder_GetContainerFormat(decoder, &container_format);
1034 if (
IsEqualGUID(&container_format, &GUID_ContainerFormatBmp)) {
1036 TRACE(
"File type is DIB\n");
1039 TRACE(
"File type is BMP\n");
1042 }
else if (
IsEqualGUID(&container_format, &GUID_ContainerFormatPng)) {
1043 TRACE(
"File type is PNG\n");
1045 }
else if(
IsEqualGUID(&container_format, &GUID_ContainerFormatJpeg)) {
1046 TRACE(
"File type is JPG\n");
1048 }
else if(
IsEqualGUID(&container_format, &GUID_WineContainerFormatTga)) {
1049 TRACE(
"File type is TGA\n");
1058 hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
1065 hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
1068 hr = IWICBitmapFrameDecode_GetSize(frame, &
info->Width, &
info->Height);
1091 for (
i = 0;
i <
info->Width *
info->Height;
i++) {
1102 IWICBitmapFrameDecode_Release(frame);
1105 info->MipLevels = 1;
1111 IWICBitmapDecoder_Release(decoder);
1117 TRACE(
"Invalid or unsupported image file\n");
1246 const PALETTEENTRY *pDestPalette,
const RECT *pDestRect,
const void *pSrcData,
UINT SrcDataSize,
1261 TRACE(
"dst_surface %p, dst_palette %p, dst_rect %s, src_data %p, src_data_size %u, "
1262 "src_rect %s, filter %#x, color_key 0x%08x, src_info %p.\n",
1263 pDestSurface, pDestPalette,
wine_dbgstr_rect(pDestRect), pSrcData, SrcDataSize,
1266 if (!pDestSurface || !pSrcData || !SrcDataSize)
1276 wicrect.
X = pSrcRect->
left;
1277 wicrect.
Y = pSrcRect->
top;
1294 dwFilter, Colorkey, &imginfo);
1296 *pSrcInfo = imginfo;
1308 IWICImagingFactory_Release(
factory);
1313 IWICStream_InitializeFromMemory(
stream, (
BYTE*)pSrcData, SrcDataSize);
1317 IWICStream_Release(
stream);
1322 hr = IWICBitmapDecoder_GetFrame(decoder, 0, &bitmapframe);
1331 FIXME(
"Unsupported pixel format\n");
1344 hr = IWICBitmapFrameDecode_CopyPixels(bitmapframe, &wicrect, pitch,
1352 hr = IWICImagingFactory_CreatePalette(
factory, &wic_palette);
1354 hr = IWICBitmapFrameDecode_CopyPalette(bitmapframe, wic_palette);
1356 hr = IWICPalette_GetColorCount(wic_palette, &nb_colors);
1365 hr = IWICPalette_GetColors(wic_palette, nb_colors, colors, &nb_colors);
1371 for (
i = 0;
i < nb_colors;
i++)
1373 palette[
i].peRed = (colors[
i] >> 16) & 0xff;
1374 palette[
i].peGreen = (colors[
i] >> 8) & 0xff;
1376 palette[
i].peFlags = (colors[
i] >> 24) & 0xff;
1380 IWICPalette_Release(wic_palette);
1395 IWICBitmapFrameDecode_Release(bitmapframe);
1398 IWICBitmapDecoder_Release(decoder);
1402 IWICImagingFactory_Release(
factory);
1411 *pSrcInfo = imginfo;
1417 const PALETTEENTRY *dst_palette,
const RECT *dst_rect,
const char *src_file,
1424 TRACE(
"dst_surface %p, dst_palette %p, dst_rect %s, src_file %s, "
1425 "src_rect %s, filter %#x, color_key 0x%08x, src_info %p.\n",
1429 if (!src_file || !dst_surface)
1451 TRACE(
"dst_surface %p, dst_palette %p, dst_rect %s, src_file %s, "
1452 "src_rect %s, filter %#x, color_key 0x%08x, src_info %p.\n",
1456 if (!src_file || !dst_surface)
1477 TRACE(
"dst_surface %p, dst_palette %p, dst_rect %s, src_module %p, resource %s, "
1478 "src_rect %s, filter %#x, color_key 0x%08x, src_info %p.\n",
1505 TRACE(
"dst_surface %p, dst_palette %p, dst_rect %s, src_module %p, resource %s, "
1506 "src_rect %s, filter %#x, color_key 0x%08x, src_info %p.\n",
1543 info->channelmask = 0;
1545 info->srcformat = srcformat;
1546 info->destformat = destformat;
1548 for(
i = 0;
i < 4;
i++) {
1556 info->destmask[
i] = ((1 << destformat->
bits[
i]) - 1) << destformat->
shift[
i];
1559 if(destformat->
bits[
i]) {
1561 else info->channelmask |=
info->destmask[
i];
1575 unsigned int component,
mask;
1577 for (
i = 0;
i < 4; ++
i)
1579 if (!
info->process_channel[
i])
1584 for (
j = 0;
j < 4 &&
mask; ++
j)
1586 if (
info->srcshift[
i] <
j * 8)
1587 component |= (col[
j] &
mask) << (
j * 8 -
info->srcshift[
i]);
1589 component |= (col[
j] &
mask) >> (
info->srcshift[
i] -
j * 8);
1607 for(
i = 0;
i < 4;
i++) {
1608 if(
info->process_channel[
i]) {
1625 for (
c = 0;
c < 4; ++
c)
1627 static const unsigned int component_offsets[4] = {3, 0, 1, 2};
1628 float *dst_component = (
float *)
dst + component_offsets[
c];
1640 *dst_component = *(
float *)&tmp;
1645 *dst_component = 1.0f;
1657 for (
c = 0;
c < 4; ++
c)
1659 static const unsigned int component_offsets[4] = {3, 0, 1, 2};
1660 const float src_component = *((
const float *)
src + component_offsets[
c]);
1665 mask32 = ~0
u >> (32 -
format->bits[
c]);
1670 v = *(
DWORD *)&src_component;
1672 v = (
DWORD)(src_component * ((1 <<
format->bits[
c]) - 1) + 0.5f);
1706 const BYTE *src_addr;
1712 src_addr =
src +
slice * src_slice_pitch;
1713 dst_addr =
dst +
slice * dst_slice_pitch;
1717 memcpy(dst_addr, src_addr, row_block_count *
format->block_byte_count);
1718 src_addr += src_row_pitch;
1719 dst_addr += dst_row_pitch;
1739 UINT min_width, min_height, min_depth;
1742 TRACE(
"src %p, src_row_pitch %u, src_slice_pitch %u, src_size %p, src_format %p, dst %p, "
1743 "dst_row_pitch %u, dst_slice_pitch %u, dst_size %p, dst_format %p, color_key 0x%08x, palette %p.\n",
1744 src, src_row_pitch, src_slice_pitch, src_size, src_format,
dst, dst_row_pitch, dst_slice_pitch, dst_size,
1761 for (
z = 0;
z < min_depth;
z++) {
1762 const BYTE *src_slice_ptr =
src +
z * src_slice_pitch;
1763 BYTE *dst_slice_ptr =
dst +
z * dst_slice_pitch;
1765 for (
y = 0;
y < min_height;
y++) {
1766 const BYTE *src_ptr = src_slice_ptr +
y * src_row_pitch;
1767 BYTE *dst_ptr = dst_slice_ptr +
y * dst_row_pitch;
1769 for (
x = 0;
x < min_width;
x++) {
1786 val &= ~conv_info.destmask[0];
1849 TRACE(
"src %p, src_row_pitch %u, src_slice_pitch %u, src_size %p, src_format %p, dst %p, "
1850 "dst_row_pitch %u, dst_slice_pitch %u, dst_size %p, dst_format %p, color_key 0x%08x, palette %p.\n",
1851 src, src_row_pitch, src_slice_pitch, src_size, src_format,
dst, dst_row_pitch, dst_slice_pitch, dst_size,
1864 for (
z = 0;
z < dst_size->
depth;
z++)
1866 BYTE *dst_slice_ptr =
dst +
z * dst_slice_pitch;
1867 const BYTE *src_slice_ptr =
src + src_slice_pitch * (
z * src_size->
depth / dst_size->
depth);
1871 BYTE *dst_ptr = dst_slice_ptr +
y * dst_row_pitch;
1872 const BYTE *src_row_ptr = src_slice_ptr + src_row_pitch * (
y * src_size->
height / dst_size->
height);
1874 for (
x = 0;
x < dst_size->
width;
x++)
1894 val &= ~conv_info.destmask[0];
1964 const PALETTEENTRY *dst_palette,
const RECT *dst_rect,
const void *src_memory,
1969 struct volume src_size, dst_size, dst_size_aligned;
1970 RECT dst_rect_temp, dst_rect_aligned;
1971 IDirect3DSurface9 *surface;
1976 TRACE(
"(%p, %p, %s, %p, %#x, %u, %p, %s, %#x, 0x%08x)\n",
1977 dst_surface, dst_palette,
wine_dbgstr_rect(dst_rect), src_memory, src_format,
1980 if (!dst_surface || !src_memory || !src_rect)
1982 WARN(
"Invalid argument specified.\n");
1989 WARN(
"Invalid src_format or src_rect.\n");
1996 FIXME(
"Unsupported format %#x.\n", src_format);
2008 dst_rect = &dst_rect_temp;
2009 dst_rect_temp.
left = 0;
2010 dst_rect_temp.top = 0;
2011 dst_rect_temp.right = surfdesc.
Width;
2012 dst_rect_temp.bottom = surfdesc.
Height;
2018 || dst_rect->
left < 0 || dst_rect->
top < 0)
2020 WARN(
"Invalid dst_rect specified.\n");
2025 WARN(
"Empty dst_rect specified.\n");
2030 dst_rect_aligned = *dst_rect;
2031 if (dst_rect_aligned.left & (destformatdesc->
block_width - 1))
2032 dst_rect_aligned.
left = dst_rect_aligned.left & ~(destformatdesc->
block_width - 1);
2033 if (dst_rect_aligned.top & (destformatdesc->
block_height - 1))
2034 dst_rect_aligned.top = dst_rect_aligned.top & ~(destformatdesc->
block_height - 1);
2035 if (dst_rect_aligned.right & (destformatdesc->
block_width - 1) && dst_rect_aligned.right != surfdesc.
Width)
2036 dst_rect_aligned.right =
min((dst_rect_aligned.right + destformatdesc->
block_width - 1)
2038 if (dst_rect_aligned.bottom & (destformatdesc->
block_height - 1) && dst_rect_aligned.bottom != surfdesc.
Height)
2039 dst_rect_aligned.bottom =
min((dst_rect_aligned.bottom + destformatdesc->
block_height - 1)
2045 dst_size_aligned.
width = dst_rect_aligned.right - dst_rect_aligned.left;
2046 dst_size_aligned.
height = dst_rect_aligned.bottom - dst_rect_aligned.top;
2047 dst_size_aligned.
depth = 1;
2067 TRACE(
"Simple copy.\n");
2069 &src_size, srcformatdesc);
2076 unsigned int dst_pitch;
2082 FIXME(
"Unsupported format conversion %#x -> %#x.\n", src_format, surfdesc.
Format);
2090 int i,
int j,
void *texel);
2096 if (!src_uncompressed)
2116 FIXME(
"Unexpected compressed texture format %u.\n", src_format);
2117 fetch_dxt_texel =
NULL;
2120 TRACE(
"Uncompressing DXTn surface.\n");
2124 for (
x = 0;
x < src_size.
width; ++
x)
2126 fetch_dxt_texel(src_pitch, src_memory,
x + src_rect->
left,
y + src_rect->
top,
ptr);
2130 src_memory = src_uncompressed;
2137 BOOL dst_misaligned = dst_rect->
left != dst_rect_aligned.left
2138 || dst_rect->
top != dst_rect_aligned.top
2139 || dst_rect->
right != dst_rect_aligned.right
2140 || dst_rect->
bottom != dst_rect_aligned.bottom;
2144 if (!dst_uncompressed)
2150 dst_pitch = dst_size_aligned.
width *
sizeof(
DWORD);
2152 dst_mem = dst_uncompressed + (dst_rect->
top - dst_rect_aligned.top) * dst_pitch
2153 + (dst_rect->
left - dst_rect_aligned.left) *
sizeof(
DWORD);
2157 dst_mem = lockrect.
pBits;
2158 dst_pitch = lockrect.
Pitch;
2180 if (dst_uncompressed)
2184 TRACE(
"Compressing DXTn surface.\n");
2199 ERR(
"Unexpected destination compressed format %u.\n", surfdesc.
Format);
2202 dst_uncompressed, gl_format, lockrect.
pBits,
2234 const PALETTEENTRY *dst_palette,
const RECT *dst_rect, IDirect3DSurface9 *src_surface,
2239 struct volume src_size, dst_size;
2240 IDirect3DSurface9 *temp_surface;
2242 IDirect3DDevice9 *
device;
2248 TRACE(
"dst_surface %p, dst_palette %p, dst_rect %s, src_surface %p, "
2249 "src_palette %p, src_rect %s, filter %#x, color_key 0x%08x.\n",
2253 if (!dst_surface || !src_surface)
2265 WARN(
"Empty src_rect specified.\n");
2271 || src_rect->
top < 0 || src_rect->
top > src_desc.
Height)
2273 WARN(
"Invalid src_rect specified.\n");
2286 dst_rect = &dst_rect_temp;
2290 WARN(
"Empty dst_rect specified.\n");
2296 || dst_rect->
top < 0 || dst_rect->
top > dst_desc.
Height)
2298 WARN(
"Invalid dst_rect specified.\n");
2306 if (!dst_palette && !src_palette && !
color_key)
2365 IDirect3DSurface9 *src_surface,
const PALETTEENTRY *src_palette,
const RECT *src_rect)
2372 TRACE(
"(%s, %#x, %p, %p, %s): relay\n",
2394 IDirect3DSurface9 *src_surface,
const PALETTEENTRY *src_palette,
const RECT *src_rect)
2399 TRACE(
"(%s, %#x, %p, %p, %s): relay\n",
2415 IDirect3DSurface9 *src_surface,
const PALETTEENTRY *src_palette,
const RECT *src_rect)
2422 const GUID *container_format;
2423 const GUID *pixel_format_guid;
2428 IDirect3DSurface9 *temp_surface;
2431 STATSTG stream_stats;
2436 TRACE(
"dst_buffer %p, file_format %#x, src_surface %p, src_palette %p, src_rect %s.\n",
2437 dst_buffer, file_format, src_surface, src_palette,
wine_dbgstr_rect(src_rect));
2443 FIXME(
"Saving surfaces with palettized pixel formats is not implemented yet\n");
2447 switch (file_format)
2451 container_format = &GUID_ContainerFormatBmp;
2454 container_format = &GUID_ContainerFormatPng;
2457 container_format = &GUID_ContainerFormatJpeg;
2465 FIXME(
"File format %#x is not supported yet\n", file_format);
2476 WARN(
"Invalid rectangle with 0 area\n");
2479 if (src_rect->
left < 0 || src_rect->
top < 0)
2498 hr = IWICImagingFactory_CreateEncoder(
factory, container_format,
NULL, &encoder);
2499 IWICImagingFactory_Release(
factory);
2508 hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frame, &encoder_options);
2511 hr = IWICBitmapFrameEncode_Initialize(frame, encoder_options);
2518 if (!pixel_format_guid)
2520 FIXME(
"Pixel format %#x is not supported yet\n", src_surface_desc.
Format);
2525 memcpy(&wic_pixel_format, pixel_format_guid,
sizeof(
GUID));
2526 hr = IWICBitmapFrameEncode_SetPixelFormat(frame, &wic_pixel_format);
2530 TRACE(
"Using pixel format %s %#x\n",
debugstr_guid(&wic_pixel_format), d3d_pixel_format);
2531 if (src_surface_desc.
Format == d3d_pixel_format)
2536 IWICBitmapFrameEncode_WritePixels(frame,
height,
2552 FIXME(
"Unsupported format conversion %#x -> %#x.\n",
2553 src_surface_desc.
Format, d3d_pixel_format);
2574 dst_data, dst_pitch, 0, &
size, dst_format_desc, 0,
NULL);
2577 IWICBitmapFrameEncode_WritePixels(frame,
height, dst_pitch, dst_pitch *
height, dst_data);
2581 hr = IWICBitmapFrameEncode_Commit(frame);
2584 else WARN(
"Unsupported pixel format %#x\n", src_surface_desc.
Format);
2587 hr = IStream_Stat(
stream, &stream_stats, STATFLAG_NONAME);
2590 if (stream_stats.cbSize.u.HighPart != 0)
2595 size = stream_stats.cbSize.u.LowPart;
2625 if (frame) IWICBitmapFrameEncode_Release(frame);
2626 if (encoder_options) IPropertyBag2_Release(encoder_options);
2628 if (encoder) IWICBitmapEncoder_Release(encoder);
void tx_compress_dxtn(GLint srccomps, GLint width, GLint height, const GLubyte *srcPixData, GLenum destFormat, GLubyte *dest, GLint dstRowStride)
void fetch_2d_texel_rgba_dxt3(GLint srcRowStride, const GLubyte *pixdata, GLint i, GLint j, GLvoid *texel)
void fetch_2d_texel_rgba_dxt1(GLint srcRowStride, const GLubyte *pixdata, GLint i, GLint j, GLvoid *texel)
void fetch_2d_texel_rgba_dxt5(GLint srcRowStride, const GLubyte *pixdata, GLint i, GLint j, GLvoid *texel)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
static const char * wine_dbgstr_rect(const RECT *prc)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define D3DXERR_INVALIDDATA
enum _D3DRESOURCETYPE D3DRESOURCETYPE
@ D3DCUBEMAP_FACE_POSITIVE_X
@ D3DCUBEMAP_FACE_NEGATIVE_Z
enum _D3DFORMAT D3DFORMAT
enum _D3DTEXTUREFILTERTYPE D3DTEXTUREFILTERTYPE
#define IDirect3DSurface9_GetDevice(p, a)
#define IDirect3DTexture9_GetSurfaceLevel(p, a, b)
#define IDirect3DSurface9_LockRect(p, a, b, c)
#define IDirect3DDevice9_StretchRect(p, a, b, c, d, e)
#define IDirect3DTexture9_GetLevelCount(p)
#define IDirect3DVolumeTexture9_GetLevelCount(p)
#define IDirect3DCubeTexture9_GetLevelCount(p)
#define IDirect3DVolume9_Release(p)
#define IDirect3DVolumeTexture9_GetVolumeLevel(p, a, b)
#define IDirect3DSurface9_GetDesc(p, a)
#define IDirect3DDevice9_Release(p)
#define IDirect3DSurface9_UnlockRect(p)
#define IDirect3DDevice9_UpdateSurface(p, a, b, c, d)
#define IDirect3DSurface9_Release(p)
#define IDirect3DCubeTexture9_GetCubeMapSurface(p, a, b, c)
#define IDirect3DDevice9_CreateRenderTarget(p, a, b, c, d, e, f, g, h)
#define IDirect3DBaseTexture9_GetType(p)
#define IDirect3DDevice9_CreateOffscreenPlainSurface(p, a, b, c, d, e, f)
#define D3DERR_INVALIDCALL
struct ID3DXBuffer ID3DXBuffer
static BOOL is_conversion_to_supported(const struct pixel_format_desc *format)
HRESULT map_view_of_file(const WCHAR *filename, void **buffer, DWORD *length) DECLSPEC_HIDDEN
unsigned short float_32_to_16(const float in) DECLSPEC_HIDDEN
const struct pixel_format_desc * get_format_info(D3DFORMAT format) DECLSPEC_HIDDEN
HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, void **buffer, DWORD *length) DECLSPEC_HIDDEN
float float_16_to_32(const unsigned short in) DECLSPEC_HIDDEN
HRESULT write_buffer_to_file(const WCHAR *filename, ID3DXBuffer *buffer) DECLSPEC_HIDDEN
static BOOL is_conversion_from_supported(const struct pixel_format_desc *format)
#define ID3DXBuffer_GetBufferPointer(p)
#define ID3DXBuffer_Release(p)
#define D3DX_FILTER_LINEAR
#define D3DX_FILTER_TRIANGLE
#define D3DX_FILTER_DITHER
#define D3DX_FILTER_POINT
enum _D3DXIMAGE_FILEFORMAT D3DXIMAGE_FILEFORMAT
HRESULT WINAPI D3DXCreateBuffer(DWORD size, ID3DXBuffer **buffer)
HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, const void *src_memory, D3DFORMAT src_format, UINT src_pitch, const PALETTEENTRY *src_palette, const RECT *src_rect, DWORD filter, D3DCOLOR color_key)
static UINT calculate_dds_file_size(D3DFORMAT format, UINT width, UINT height, UINT depth, UINT miplevels, UINT faces)
HRESULT WINAPI D3DXLoadSurfaceFromFileA(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, const char *src_file, const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info)
HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(const void *data, UINT datasize, D3DXIMAGE_INFO *info)
HRESULT unlock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, IDirect3DSurface9 *temp_surface, BOOL update)
static D3DFORMAT dds_bump_to_d3dformat(const struct dds_pixel_format *pixel_format)
static D3DFORMAT dds_fourcc_to_d3dformat(DWORD fourcc)
#define DDS_CAPS2_CUBEMAP_ALL_FACES
static D3DFORMAT dds_indexed_to_d3dformat(const struct dds_pixel_format *pixel_format)
HRESULT WINAPI D3DXGetImageInfoFromResourceA(HMODULE module, const char *resource, D3DXIMAGE_INFO *info)
static BOOL convert_dib_to_bmp(const void **data, unsigned int *size)
HRESULT lock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, D3DLOCKED_RECT *lock, IDirect3DSurface9 **temp_surface, BOOL write)
static D3DFORMAT dds_bump_luminance_to_d3dformat(const struct dds_pixel_format *pixel_format)
HRESULT WINAPI D3DXGetImageInfoFromFileW(const WCHAR *file, D3DXIMAGE_INFO *info)
static void format_to_vec4(const struct pixel_format_desc *format, const BYTE *src, struct vec4 *dst)
HRESULT WINAPI D3DXSaveSurfaceToFileA(const char *dst_filename, D3DXIMAGE_FILEFORMAT file_format, IDirect3DSurface9 *src_surface, const PALETTEENTRY *src_palette, const RECT *src_rect)
#define DDS_CAPS2_CUBEMAP_NEGATIVEZ
HRESULT WINAPI D3DXLoadSurfaceFromFileW(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, const WCHAR *src_file, const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info)
#define DDS_CAPS2_CUBEMAP_POSITIVEX
void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, const struct volume *src_size, const struct pixel_format_desc *src_format, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, const struct volume *dst_size, const struct pixel_format_desc *dst_format, D3DCOLOR color_key, const PALETTEENTRY *palette)
static void init_argb_conversion_info(const struct pixel_format_desc *srcformat, const struct pixel_format_desc *destformat, struct argb_conversion_info *info)
static HRESULT save_dds_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSurface9 *src_surface, const RECT *src_rect)
HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE_FILEFORMAT file_format, IDirect3DSurface9 *src_surface, const PALETTEENTRY *src_palette, const RECT *src_rect)
HRESULT WINAPI D3DXGetImageInfoFromFileA(const char *file, D3DXIMAGE_INFO *info)
static const GUID * d3dformat_to_wic_guid(D3DFORMAT format)
#define DDS_PF_BUMPLUMINANCE
HRESULT WINAPI D3DXGetImageInfoFromResourceW(HMODULE module, const WCHAR *resource, D3DXIMAGE_INFO *info)
static const struct @245 wic_pixel_formats[]
HRESULT WINAPI D3DXLoadSurfaceFromResourceA(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, HMODULE src_module, const char *resource, const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info)
static HRESULT load_surface_from_dds(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, const void *src_data, const RECT *src_rect, DWORD filter, D3DCOLOR color_key, const D3DXIMAGE_INFO *src_info)
static D3DFORMAT dds_alpha_to_d3dformat(const struct dds_pixel_format *pixel_format)
HRESULT WINAPI D3DXLoadSurfaceFromResourceW(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, HMODULE src_module, const WCHAR *resource, const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info)
void copy_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, const struct volume *size, const struct pixel_format_desc *format)
HRESULT WINAPI D3DXLoadSurfaceFromSurface(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, IDirect3DSurface9 *src_surface, const PALETTEENTRY *src_palette, const RECT *src_rect, DWORD filter, D3DCOLOR color_key)
static HRESULT get_surface(D3DRESOURCETYPE type, struct IDirect3DBaseTexture9 *tex, int face, UINT level, struct IDirect3DSurface9 **surf)
#define DDS_PF_ALPHA_ONLY
static HRESULT get_image_info_from_dds(const void *buffer, UINT length, D3DXIMAGE_INFO *info)
HRESULT load_volume_from_dds(IDirect3DVolume9 *dst_volume, const PALETTEENTRY *dst_palette, const D3DBOX *dst_box, const void *src_data, const D3DBOX *src_box, DWORD filter, D3DCOLOR color_key, const D3DXIMAGE_INFO *src_info)
static void get_relevant_argb_components(const struct argb_conversion_info *info, const BYTE *col, DWORD *out)
HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface, const PALETTEENTRY *pDestPalette, const RECT *pDestRect, const void *pSrcData, UINT SrcDataSize, const RECT *pSrcRect, DWORD dwFilter, D3DCOLOR Colorkey, D3DXIMAGE_INFO *pSrcInfo)
HRESULT load_volume_texture_from_dds(IDirect3DVolumeTexture9 *volume_texture, const void *src_data, const PALETTEENTRY *palette, DWORD filter, DWORD color_key, const D3DXIMAGE_INFO *src_info)
HRESULT load_texture_from_dds(IDirect3DTexture9 *texture, const void *src_data, const PALETTEENTRY *palette, DWORD filter, D3DCOLOR color_key, const D3DXIMAGE_INFO *src_info, unsigned int skip_levels, unsigned int *loaded_miplevels)
static void format_from_vec4(const struct pixel_format_desc *format, const struct vec4 *src, BYTE *dst)
HRESULT save_dds_texture_to_memory(ID3DXBuffer **dst_buffer, IDirect3DBaseTexture9 *src_texture, const PALETTEENTRY *src_palette)
HRESULT WINAPI D3DXSaveSurfaceToFileW(const WCHAR *dst_filename, D3DXIMAGE_FILEFORMAT file_format, IDirect3DSurface9 *src_surface, const PALETTEENTRY *src_palette, const RECT *src_rect)
static D3DFORMAT dds_rgb_to_d3dformat(const struct dds_pixel_format *pixel_format)
#define DDS_CAPS2_CUBEMAP
HRESULT load_cube_texture_from_dds(IDirect3DCubeTexture9 *cube_texture, const void *src_data, const PALETTEENTRY *palette, DWORD filter, DWORD color_key, const D3DXIMAGE_INFO *src_info)
HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT, IWICImagingFactory **)
static D3DFORMAT wic_guid_to_d3dformat(const GUID *guid)
void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, const struct volume *src_size, const struct pixel_format_desc *src_format, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, const struct volume *dst_size, const struct pixel_format_desc *dst_format, D3DCOLOR color_key, const PALETTEENTRY *palette)
static const struct @246 rgb_pixel_formats[]
static D3DFORMAT dds_luminance_to_d3dformat(const struct dds_pixel_format *pixel_format)
static HRESULT d3dformat_to_dds_pixel_format(struct dds_pixel_format *pixel_format, D3DFORMAT d3dformat)
static HRESULT calculate_dds_surface_size(D3DFORMAT format, UINT width, UINT height, UINT *pitch, UINT *size)
static D3DFORMAT dds_pixel_format_to_d3dformat(const struct dds_pixel_format *pixel_format)
static DWORD make_argb_color(const struct argb_conversion_info *info, const DWORD *in)
HRESULT WINAPI D3DXLoadVolumeFromMemory(IDirect3DVolume9 *dst_volume, const PALETTEENTRY *dst_palette, const D3DBOX *dst_box, const void *src_memory, D3DFORMAT src_format, UINT src_row_pitch, UINT src_slice_pitch, const PALETTEENTRY *src_palette, const D3DBOX *src_box, DWORD filter, D3DCOLOR color_key)
#define HeapFree(x, y, z)
#define MultiByteToWideChar
static void cleanup(void)
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
HRESULT WINAPI GetHGlobalFromStream(IStream *pstm, HGLOBAL *phglobal)
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
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
#define MAKEFOURCC(ch0, ch1, ch2, ch3)
GLint GLint GLsizei GLsizei GLsizei depth
GLint GLint GLint GLint GLint x
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
GLenum GLuint GLint GLenum face
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLuint GLsizei GLsizei * length
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
#define memcpy(s1, s2, n)
static const WCHAR desc[]
static const unsigned char pixdata[]
static const char * dst_format
static const char stream_data[]
static float(__cdecl *square_half_float)(float x
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
#define IsEqualGUID(rguid1, rguid2)
static unsigned int file_size
const char int int int static __inline const char * wine_dbgstr_a(const char *s)
D3DRESOURCETYPE ResourceType
D3DXIMAGE_FILEFORMAT ImageFileFormat
const struct pixel_format_desc * destformat
const struct pixel_format_desc * srcformat
#define FIELD_OFFSET(t, f)
@ WICBitmapEncoderNoCache
struct tagBITMAPFILEHEADER BITMAPFILEHEADER
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)