29#define NONAMELESSUNION
72 hr = IStream_Read(
stream, *
data, *data_size, &bytesread);
74 if (
FAILED(
hr) || bytesread < *data_size)
96 ULONG name_len, value_len;
106 name_len = name_end_ptr -
data;
108 if (!name_end_ptr || name_len > 79)
114 value_len = data_size - name_len - 1;
129 PropVariantInit(&
result[0].
id);
134 value[value_len] = 0;
151 &CLSID_WICPngTextMetadataReader,
168 static const WCHAR ImageGamma[] = {
'I',
'm',
'a',
'g',
'e',
'G',
'a',
'm',
'm',
'a',0};
195 PropVariantInit(&
result[0].
id);
203 result[0].value.u.ulVal = gamma;
213 &CLSID_WICPngGamaMetadataReader,
230 {
'W',
'h',
'i',
't',
'e',
'P',
'o',
'i',
'n',
't',
'X',0},
231 {
'W',
'h',
'i',
't',
'e',
'P',
'o',
'i',
'n',
't',
'Y',0},
234 {
'G',
'r',
'e',
'e',
'n',
'X',0},
235 {
'G',
'r',
'e',
'e',
'n',
'Y',0},
236 {
'B',
'l',
'u',
'e',
'X',0},
237 {
'B',
'l',
'u',
'e',
'Y',0},
239 LPWSTR dyn_names[8] = {0};
256 if (!dyn_names[
i])
break;
271 PropVariantInit(&
result[
i].
id);
273 result[
i].id.u.pwszVal = dyn_names[
i];
291 &CLSID_WICPngChrmMetadataReader,
302static void *libpng_handle;
303#define MAKE_FUNCPTR(f) static typeof(f) * p##f
350 0, 0, { (
DWORD_PTR)(__FILE__
": init_png_cs") }
352static CRITICAL_SECTION init_png_cs = { &init_png_cs_debug, -1, 0, 0, 0, 0 };
354static const WCHAR wszPngInterlaceOption[] = {
'I',
'n',
't',
'e',
'r',
'l',
'a',
'c',
'e',
'O',
'p',
't',
'i',
'o',
'n',0};
355static const WCHAR wszPngFilterOption[] = {
'F',
'i',
'l',
't',
'e',
'r',
'O',
'p',
't',
'i',
'o',
'n',0};
357static void *load_libpng(
void)
365#define LOAD_FUNCPTR(f) \
366 if((p##f = wine_dlsym(libpng_handle, #f, NULL, 0)) == NULL) { \
367 libpng_handle = NULL; \
368 LeaveCriticalSection(&init_png_cs); \
428 pjmpbuf = ppng_get_error_ptr(
png_ptr);
429 longjmp(*pjmpbuf, 1);
440} metadata_block_info;
458 ULONG metadata_count;
459 metadata_block_info* metadata_blocks;
477static const IWICBitmapFrameDecodeVtbl PngDecoder_FrameVtbl;
489 *
ppv = &
This->IWICBitmapDecoder_iface;
506 TRACE(
"(%p) refcount=%u\n", iface,
ref);
517 TRACE(
"(%p) refcount=%u\n", iface,
ref);
522 IStream_Release(
This->stream);
524 ppng_destroy_read_struct(&
This->png_ptr, &
This->info_ptr, &
This->end_info);
525 This->lock.DebugInfo->Spare[0] = 0;
528 for (
i=0;
i<
This->metadata_count;
i++)
530 if (
This->metadata_blocks[
i].reader)
531 IWICMetadataReader_Release(
This->metadata_blocks[
i].reader);
567 ppng_error(
png_ptr,
"failed reading data");
580 int color_type, bit_depth;
589 ULONG metadata_blocks_size = 0;
591 TRACE(
"(%p,%p,%x)\n", iface, pIStream, cacheOptions);
603 This->info_ptr = ppng_create_info_struct(
This->png_ptr);
612 This->end_info = ppng_create_info_struct(
This->png_ptr);
615 ppng_destroy_read_struct(&
This->png_ptr, &
This->info_ptr,
NULL);
624 ppng_destroy_read_struct(&
This->png_ptr, &
This->info_ptr, &
This->end_info);
629 ppng_set_error_fn(
This->png_ptr,
jmpbuf, user_error_fn, user_warning_fn);
634 hr = IStream_Seek(pIStream,
seek, STREAM_SEEK_SET,
NULL);
638 ppng_set_read_fn(
This->png_ptr, pIStream, user_read_data);
641 ppng_read_info(
This->png_ptr,
This->info_ptr);
644 color_type = ppng_get_color_type(
This->png_ptr,
This->info_ptr);
645 bit_depth = ppng_get_bit_depth(
This->png_ptr,
This->info_ptr);
649 ppng_set_swap(
This->png_ptr);
652 transparency = ppng_get_tRNS(
This->png_ptr,
This->info_ptr, &trans, &num_trans, &trans_values);
659 ppng_set_gray_to_rgb(
This->png_ptr);
660 ppng_set_tRNS_to_alpha(
This->png_ptr);
668 ppng_set_gray_to_rgb(
This->png_ptr);
671 This->bpp = bit_depth * 4;
675 ppng_set_bgr(
This->png_ptr);
676 This->format = &GUID_WICPixelFormat32bppBGRA;
678 case 16:
This->format = &GUID_WICPixelFormat64bppRGBA;
break;
680 ERR(
"invalid RGBA bit depth: %i\n", bit_depth);
686 This->bpp = bit_depth;
691 case 1:
This->format = &GUID_WICPixelFormatBlackWhite;
break;
692 case 2:
This->format = &GUID_WICPixelFormat2bppGray;
break;
693 case 4:
This->format = &GUID_WICPixelFormat4bppGray;
break;
694 case 8:
This->format = &GUID_WICPixelFormat8bppGray;
break;
695 case 16:
This->format = &GUID_WICPixelFormat16bppGray;
break;
697 ERR(
"invalid grayscale bit depth: %i\n", bit_depth);
705 This->bpp = bit_depth;
708 case 1:
This->format = &GUID_WICPixelFormat1bppIndexed;
break;
709 case 2:
This->format = &GUID_WICPixelFormat2bppIndexed;
break;
710 case 4:
This->format = &GUID_WICPixelFormat4bppIndexed;
break;
711 case 8:
This->format = &GUID_WICPixelFormat8bppIndexed;
break;
713 ERR(
"invalid indexed color bit depth: %i\n", bit_depth);
719 This->bpp = bit_depth * 3;
723 ppng_set_bgr(
This->png_ptr);
724 This->format = &GUID_WICPixelFormat24bppBGR;
726 case 16:
This->format = &GUID_WICPixelFormat48bppRGB;
break;
728 ERR(
"invalid RGB color bit depth: %i\n", bit_depth);
734 ERR(
"invalid color type %i\n", color_type);
740 This->width = ppng_get_image_width(
This->png_ptr,
This->info_ptr);
741 This->height = ppng_get_image_height(
This->png_ptr,
This->info_ptr);
746 if (!
This->image_bits)
760 row_pointers[
i] =
This->image_bits +
i *
This->stride;
762 ppng_read_image(
This->png_ptr, row_pointers);
767 ppng_read_end(
This->png_ptr,
This->end_info);
774 hr = IStream_Seek(pIStream,
seek, STREAM_SEEK_SET, &chunk_start);
780 if (chunk_type[0] >=
'a' && chunk_type[0] <=
'z' &&
781 memcmp(chunk_type,
"tRNS", 4) &&
memcmp(chunk_type,
"pHYs", 4))
784 if (
This->metadata_count == metadata_blocks_size)
786 metadata_block_info* new_metadata_blocks;
787 ULONG new_metadata_blocks_size;
789 new_metadata_blocks_size = 4 + metadata_blocks_size * 2;
791 new_metadata_blocks_size *
sizeof(*new_metadata_blocks));
793 if (!new_metadata_blocks)
799 memcpy(new_metadata_blocks,
This->metadata_blocks,
800 This->metadata_count *
sizeof(*new_metadata_blocks));
803 This->metadata_blocks = new_metadata_blocks;
804 metadata_blocks_size = new_metadata_blocks_size;
807 This->metadata_blocks[
This->metadata_count].ofs = chunk_start;
808 This->metadata_blocks[
This->metadata_count].len.QuadPart = chunk_size + 12;
809 This->metadata_blocks[
This->metadata_count].reader =
NULL;
810 This->metadata_count++;
814 }
while (
memcmp(chunk_type,
"IEND", 4));
816 This->stream = pIStream;
817 IStream_AddRef(
This->stream);
830 GUID *pguidContainerFormat)
832 memcpy(pguidContainerFormat, &GUID_ContainerFormatPng,
sizeof(
GUID));
839 TRACE(
"(%p,%p)\n", iface, ppIDecoderInfo);
865 TRACE(
"(%p,%p)\n", iface, ppIBitmapSource);
869 *ppIBitmapSource =
NULL;
876 TRACE(
"(%p,%u,%p,%p)\n", iface, cCount, ppIColorContexts, pcActualCount);
883 TRACE(
"(%p,%p)\n", iface, ppIThumbnail);
887 *ppIThumbnail =
NULL;
904 TRACE(
"(%p,%u,%p)\n", iface,
index, ppIBitmapFrame);
910 IWICBitmapDecoder_AddRef(iface);
912 *ppIBitmapFrame = &
This->IWICBitmapFrameDecode_iface;
917static const IWICBitmapDecoderVtbl PngDecoder_Vtbl = {
918 PngDecoder_QueryInterface,
921 PngDecoder_QueryCapability,
922 PngDecoder_Initialize,
923 PngDecoder_GetContainerFormat,
924 PngDecoder_GetDecoderInfo,
925 PngDecoder_CopyPalette,
926 PngDecoder_GetMetadataQueryReader,
927 PngDecoder_GetPreview,
928 PngDecoder_GetColorContexts,
929 PngDecoder_GetThumbnail,
930 PngDecoder_GetFrameCount,
944 *
ppv = &
This->IWICBitmapFrameDecode_iface;
946 else if (
IsEqualIID(&IID_IWICMetadataBlockReader, iid))
948 *
ppv = &
This->IWICMetadataBlockReader_iface;
963 return IWICBitmapDecoder_AddRef(&
This->IWICBitmapDecoder_iface);
969 return IWICBitmapDecoder_Release(&
This->IWICBitmapDecoder_iface);
976 *puiWidth =
This->width;
977 *puiHeight =
This->height;
978 TRACE(
"(%p)->(%u,%u)\n", iface, *puiWidth, *puiHeight);
986 TRACE(
"(%p,%p)\n", iface, pPixelFormat);
994 double *pDpiX,
double *pDpiY)
1002 ret = ppng_get_pHYs(
This->png_ptr,
This->info_ptr, &xres, &yres, &unit_type);
1006 *pDpiX = xres * 0.0254;
1007 *pDpiY = yres * 0.0254;
1011 WARN(
"no pHYs block present\n");
1012 *pDpiX = *pDpiY = 96.0;
1017 TRACE(
"(%p)->(%0.2f,%0.2f)\n", iface, *pDpiX, *pDpiY);
1036 TRACE(
"(%p,%p)\n", iface, pIPalette);
1040 color_type = ppng_get_color_type(
This->png_ptr,
This->info_ptr);
1041 bit_depth = ppng_get_bit_depth(
This->png_ptr,
This->info_ptr);
1045 ret = ppng_get_PLTE(
This->png_ptr,
This->info_ptr, &png_palette, &num_palette);
1052 if (num_palette > 256)
1054 ERR(
"palette has %i colors?!\n", num_palette);
1059 ret = ppng_get_tRNS(
This->png_ptr,
This->info_ptr, &trans_alpha, &num_trans, &trans_values);
1060 if (!
ret) num_trans = 0;
1062 for (
i=0;
i<num_palette;
i++)
1064 BYTE alpha = (
i < num_trans) ? trans_alpha[
i] : 0xff;
1066 png_palette[
i].
red << 16|
1067 png_palette[
i].
green << 8|
1068 png_palette[
i].
blue);
1072 ret = ppng_get_tRNS(
This->png_ptr,
This->info_ptr, &trans_alpha, &num_trans, &trans_values);
1080 num_palette = 1 << bit_depth;
1082 for (
i=0;
i<num_palette;
i++)
1085 BYTE val =
i * 255 / (num_palette - 1);
1099 hr = IWICPalette_InitializeCustom(pIPalette,
palette, num_palette);
1112 prc, cbStride, cbBufferSize, pbBuffer);
1120 TRACE(
"(%p,%p)\n", iface, ppIMetadataQueryReader);
1122 if (!ppIMetadataQueryReader)
1135 int compression_type;
1138 TRACE(
"(%p,%u,%p,%p)\n", iface, cCount, ppIColorContexts, pcActualCount);
1146 if (cCount && ppIColorContexts)
1148 hr = IWICColorContext_InitializeFromMemory(*ppIColorContexts,
profile,
len);
1168 TRACE(
"(%p,%p)\n", iface, ppIThumbnail);
1172 *ppIThumbnail =
NULL;
1176static const IWICBitmapFrameDecodeVtbl PngDecoder_FrameVtbl = {
1177 PngDecoder_Frame_QueryInterface,
1178 PngDecoder_Frame_AddRef,
1179 PngDecoder_Frame_Release,
1180 PngDecoder_Frame_GetSize,
1181 PngDecoder_Frame_GetPixelFormat,
1182 PngDecoder_Frame_GetResolution,
1183 PngDecoder_Frame_CopyPalette,
1184 PngDecoder_Frame_CopyPixels,
1185 PngDecoder_Frame_GetMetadataQueryReader,
1186 PngDecoder_Frame_GetColorContexts,
1187 PngDecoder_Frame_GetThumbnail
1194 return IWICBitmapFrameDecode_QueryInterface(&
This->IWICBitmapFrameDecode_iface, iid,
ppv);
1200 return IWICBitmapDecoder_AddRef(&
This->IWICBitmapDecoder_iface);
1206 return IWICBitmapDecoder_Release(&
This->IWICBitmapDecoder_iface);
1210 GUID *pguidContainerFormat)
1213 memcpy(pguidContainerFormat, &GUID_ContainerFormatPng,
sizeof(
GUID));
1222 TRACE(
"%p,%p\n", iface, pcCount);
1226 *pcCount =
This->metadata_count;
1239 TRACE(
"%p,%d,%p\n", iface, nIndex, ppIMetadataReader);
1241 if (nIndex >=
This->metadata_count || !ppIMetadataReader)
1244 if (!
This->metadata_blocks[nIndex].reader)
1250 hr = IWICStream_InitializeFromIStreamRegion(
stream,
This->stream,
1251 This->metadata_blocks[nIndex].ofs,
This->metadata_blocks[nIndex].len);
1258 hr = IWICComponentFactory_CreateMetadataReaderFromContainer(
factory,
1262 IWICComponentFactory_Release(
factory);
1265 IWICStream_Release(
stream);
1270 *ppIMetadataReader =
NULL;
1275 *ppIMetadataReader =
This->metadata_blocks[nIndex].reader;
1276 IWICMetadataReader_AddRef(*ppIMetadataReader);
1284 FIXME(
"%p,%p\n", iface, ppIEnumMetadata);
1288static const IWICMetadataBlockReaderVtbl PngDecoder_BlockVtbl = {
1289 PngDecoder_Block_QueryInterface,
1290 PngDecoder_Block_AddRef,
1291 PngDecoder_Block_Release,
1292 PngDecoder_Block_GetContainerFormat,
1293 PngDecoder_Block_GetCount,
1294 PngDecoder_Block_GetReaderByIndex,
1295 PngDecoder_Block_GetEnumerator,
1316 This->IWICBitmapDecoder_iface.lpVtbl = &PngDecoder_Vtbl;
1317 This->IWICBitmapFrameDecode_iface.lpVtbl = &PngDecoder_FrameVtbl;
1318 This->IWICMetadataBlockReader_iface.lpVtbl = &PngDecoder_BlockVtbl;
1327 This->lock.DebugInfo->Spare[0] = (
DWORD_PTR)(__FILE__
": PngDecoder.lock");
1328 This->metadata_count = 0;
1331 ret = IWICBitmapDecoder_QueryInterface(&
This->IWICBitmapDecoder_iface, iid,
ppv);
1332 IWICBitmapDecoder_Release(&
This->IWICBitmapDecoder_iface);
1337struct png_pixelformat {
1346static const struct png_pixelformat
formats[] = {
1364typedef struct PngEncoder {
1372 BOOL frame_initialized;
1373 const struct png_pixelformat *
format;
1378 BOOL frame_committed;
1411 *
ppv = &
This->IWICBitmapFrameEncode_iface;
1426 return IWICBitmapEncoder_AddRef(&
This->IWICBitmapEncoder_iface);
1432 return IWICBitmapEncoder_Release(&
This->IWICBitmapEncoder_iface);
1441 PROPBAG2 opts[2]= {{0}};
1446 TRACE(
"(%p,%p)\n", iface, pIEncoderOptions);
1448 opts[0].pstrName = (
LPOLESTR)wszPngInterlaceOption;
1450 opts[1].pstrName = (
LPOLESTR)wszPngFilterOption;
1453 if (pIEncoderOptions)
1455 hr = IPropertyBag2_Read(pIEncoderOptions,
ARRAY_SIZE(opts), opts,
NULL, opt_values, opt_hres);
1463 interlace = (
V_BOOL(&opt_values[0]) != 0);
1468 WARN(
"Unrecognized filter option value %u.\n",
filter);
1480 if (
This->frame_initialized)
1486 This->interlace = interlace;
1500 TRACE(
"(%p,%u,%u)\n", iface, uiWidth, uiHeight);
1504 if (!
This->frame_initialized ||
This->info_written)
1510 This->width = uiWidth;
1511 This->height = uiHeight;
1519 double dpiX,
double dpiY)
1522 TRACE(
"(%p,%0.2f,%0.2f)\n", iface, dpiX, dpiY);
1526 if (!
This->frame_initialized ||
This->info_written)
1549 if (!
This->frame_initialized ||
This->info_written)
1574 FIXME(
"(%p,%u,%p): stub\n", iface, cCount, ppIColorContext);
1590 if (
This->frame_initialized)
1602 FIXME(
"(%p,%p): stub\n", iface, pIThumbnail);
1610 png_byte **row_pointers=
NULL;
1613 TRACE(
"(%p,%u,%u,%u,%p)\n", iface, lineCount, cbStride, cbBufferSize, pbPixels);
1617 if (!
This->frame_initialized || !
This->width || !
This->height || !
This->format)
1623 if (lineCount == 0 || lineCount +
This->lines_written >
This->height)
1636 ppng_set_error_fn(
This->png_ptr,
jmpbuf, user_error_fn, user_warning_fn);
1638 if (!
This->info_written)
1640 if (
This->interlace)
1643 This->stride = (
This->format->bpp *
This->width + 7)/8;
1653 if (
This->format->bit_depth > 8)
1654 ppng_set_swap(
This->png_ptr);
1657 This->format->bit_depth,
This->format->color_type,
1661 if (
This->xres != 0.0 &&
This->yres != 0.0)
1663 ppng_set_pHYs(
This->png_ptr,
This->info_ptr, (
This->xres+0.0127) / 0.0254,
1670 png_byte trans[256];
1671 UINT i, num_trans = 0, colors;
1676 colors =
min(
This->colors, 1 <<
This->format->bit_depth);
1678 for (
i = 0;
i < colors;
i++)
1680 png_palette[
i].
red = (
This->palette[
i] >> 16) & 0xff;
1681 png_palette[
i].
green = (
This->palette[
i] >> 8) & 0xff;
1682 png_palette[
i].
blue =
This->palette[
i] & 0xff;
1683 trans[
i] = (
This->palette[
i] >> 24) & 0xff;
1684 if (trans[
i] != 0xff)
1688 ppng_set_PLTE(
This->png_ptr,
This->info_ptr, png_palette, colors);
1691 ppng_set_tRNS(
This->png_ptr,
This->info_ptr, trans, num_trans,
NULL);
1694 ppng_write_info(
This->png_ptr,
This->info_ptr);
1696 if (
This->format->remove_filler)
1699 if (
This->format->swap_rgb)
1700 ppng_set_bgr(
This->png_ptr);
1702 if (
This->interlace)
1703 This->passes = ppng_set_interlace_handling(
This->png_ptr);
1707 static const int png_filter_map[] =
1718 ppng_set_filter(
This->png_ptr, 0, png_filter_map[
This->filter]);
1724 if (
This->interlace)
1727 for (
i=0;
i<lineCount;
i++)
1729 pbPixels + cbStride *
i,
1732 This->lines_written += lineCount;
1745 for (
i=0;
i<lineCount;
i++)
1746 row_pointers[
i] = pbPixels + cbStride *
i;
1748 ppng_write_rows(
This->png_ptr, row_pointers, lineCount);
1749 This->lines_written += lineCount;
1765 if (!
This->frame_initialized)
1784 png_byte **row_pointers=
NULL;
1786 TRACE(
"(%p)\n", iface);
1790 if (!
This->info_written ||
This->lines_written !=
This->height ||
This->frame_committed)
1803 ppng_set_error_fn(
This->png_ptr,
jmpbuf, user_error_fn, user_warning_fn);
1805 if (
This->interlace)
1816 for (
i=0;
i<
This->height;
i++)
1817 row_pointers[
i] =
This->data +
This->stride *
i;
1820 ppng_write_rows(
This->png_ptr, row_pointers,
This->height);
1823 ppng_write_end(
This->png_ptr,
This->info_ptr);
1837 FIXME(
"(%p, %p): stub\n", iface, ppIMetadataQueryWriter);
1841static const IWICBitmapFrameEncodeVtbl PngEncoder_FrameVtbl = {
1842 PngFrameEncode_QueryInterface,
1843 PngFrameEncode_AddRef,
1844 PngFrameEncode_Release,
1845 PngFrameEncode_Initialize,
1846 PngFrameEncode_SetSize,
1847 PngFrameEncode_SetResolution,
1848 PngFrameEncode_SetPixelFormat,
1849 PngFrameEncode_SetColorContexts,
1850 PngFrameEncode_SetPalette,
1851 PngFrameEncode_SetThumbnail,
1852 PngFrameEncode_WritePixels,
1853 PngFrameEncode_WriteSource,
1854 PngFrameEncode_Commit,
1855 PngFrameEncode_GetMetadataQueryWriter
1869 *
ppv = &
This->IWICBitmapEncoder_iface;
1886 TRACE(
"(%p) refcount=%u\n", iface,
ref);
1896 TRACE(
"(%p) refcount=%u\n", iface,
ref);
1900 This->lock.DebugInfo->Spare[0] = 0;
1903 ppng_destroy_write_struct(&
This->png_ptr, &
This->info_ptr);
1905 IStream_Release(
This->stream);
1922 ppng_error(
png_ptr,
"failed writing data");
1936 TRACE(
"(%p,%p,%u)\n", iface, pIStream, cacheOption);
1954 This->info_ptr = ppng_create_info_struct(
This->png_ptr);
1955 if (!
This->info_ptr)
1957 ppng_destroy_write_struct(&
This->png_ptr,
NULL);
1963 IStream_AddRef(pIStream);
1964 This->stream = pIStream;
1969 ppng_destroy_write_struct(&
This->png_ptr, &
This->info_ptr);
1971 IStream_Release(
This->stream);
1976 ppng_set_error_fn(
This->png_ptr,
jmpbuf, user_error_fn, user_warning_fn);
1979 ppng_set_write_fn(
This->png_ptr,
This, user_write_data, user_flush);
2009 hr = IWICComponentInfo_QueryInterface(comp_info, &IID_IWICBitmapEncoderInfo, (
void **)
info);
2010 IWICComponentInfo_Release(comp_info);
2018 FIXME(
"(%p,%u,%p): stub\n", iface, cCount, ppIColorContext);
2040 TRACE(
"(%p,%p)\n", iface, pIThumbnail);
2046 TRACE(
"(%p,%p)\n", iface, pIPreview);
2055 static const PROPBAG2 opts[2] =
2057 { PROPBAG2_TYPE_DATA,
VT_BOOL, 0, 0, (
LPOLESTR)wszPngInterlaceOption },
2058 { PROPBAG2_TYPE_DATA,
VT_UI1, 0, 0, (
LPOLESTR)wszPngFilterOption },
2061 TRACE(
"(%p,%p,%p)\n", iface, ppIFrameEncode, ppIEncoderOptions);
2065 if (
This->frame_count != 0)
2077 if (ppIEncoderOptions)
2087 This->frame_count = 1;
2091 IWICBitmapEncoder_AddRef(iface);
2092 *ppIFrameEncode = &
This->IWICBitmapFrameEncode_iface;
2100 TRACE(
"(%p)\n", iface);
2104 if (!
This->frame_committed ||
This->committed)
2120 FIXME(
"(%p,%p): stub\n", iface, ppIMetadataQueryWriter);
2124static const IWICBitmapEncoderVtbl PngEncoder_Vtbl = {
2125 PngEncoder_QueryInterface,
2128 PngEncoder_Initialize,
2129 PngEncoder_GetContainerFormat,
2130 PngEncoder_GetEncoderInfo,
2131 PngEncoder_SetColorContexts,
2132 PngEncoder_SetPalette,
2133 PngEncoder_SetThumbnail,
2134 PngEncoder_SetPreview,
2135 PngEncoder_CreateNewFrame,
2137 PngEncoder_GetMetadataQueryWriter
2158 This->IWICBitmapEncoder_iface.lpVtbl = &PngEncoder_Vtbl;
2159 This->IWICBitmapFrameEncode_iface.lpVtbl = &PngEncoder_FrameVtbl;
2164 This->frame_count = 0;
2172 This->lines_written = 0;
2178 This->lock.DebugInfo->Spare[0] = (
DWORD_PTR)(__FILE__
": PngEncoder.lock");
2180 ret = IWICBitmapEncoder_QueryInterface(&
This->IWICBitmapEncoder_iface, iid,
ppv);
2181 IWICBitmapEncoder_Release(&
This->IWICBitmapEncoder_iface);
2190 ERR(
"Trying to load PNG picture, but PNG support is not compiled in.\n");
2196 ERR(
"Trying to save PNG picture, but PNG support is not compiled in.\n");
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static BmpDecoder * impl_from_IWICBitmapFrameDecode(IWICBitmapFrameDecode *iface)
static BmpDecoder * impl_from_IWICBitmapDecoder(IWICBitmapDecoder *iface)
static BmpFrameEncode * impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface)
static BmpEncoder * impl_from_IWICBitmapEncoder(IWICBitmapEncoder *iface)
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) DECLSPEC_HIDDEN
static const struct pixel_format_desc formats[]
void error_message(HWND hwnd, const char *msg)
#define HeapFree(x, y, z)
static GpStatus get_decoder_info(IStream *stream, const struct image_codec **result)
HRESULT CreateComponentInfo(REFCLSID clsid, IWICComponentInfo **ppIInfo)
HRESULT write_source(IWICBitmapFrameEncode *iface, IWICBitmapSource *source, const WICRect *prc, const WICPixelFormatGUID *format, UINT bpp, INT width, INT height)
HRESULT configure_write_source(IWICBitmapFrameEncode *iface, IWICBitmapSource *source, const WICRect *prc, const WICPixelFormatGUID *format, INT width, INT height, double xres, double yres)
HRESULT CreatePropertyBag2(const PROPBAG2 *options, UINT count, IPropertyBag2 **ppPropertyBag2)
HRESULT StreamImpl_Create(IWICStream **stream)
GLuint GLuint GLsizei GLenum type
GLclampf GLclampf GLclampf alpha
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLuint GLsizei GLsizei * length
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
HRESULT ImagingFactory_CreateInstance(REFIID iid, void **ppv)
void * wine_dlopen(const char *filename, int flag, char *error, size_t errorsize)
static GLint image_size(GLint width, GLint height, GLenum format, GLenum type)
#define memcpy(s1, s2, n)
#define PNG_COLOR_TYPE_RGB
#define PNG_COLOR_TYPE_RGB_ALPHA
#define PNG_COLOR_TYPE_GRAY_ALPHA
#define PNG_COLOR_TYPE_GRAY
#define PNG_COLOR_TYPE_PALETTE
png_voidp PNGAPI png_get_io_ptr(png_const_structrp png_ptr)
#define PNG_COMPRESSION_TYPE_DEFAULT
#define PNG_CRC_QUIET_USE
#define PNG_RESOLUTION_METER
#define PNG_INTERLACE_ADAM7
#define PNG_LIBPNG_VER_STRING
#define PNG_FILTER_TYPE_DEFAULT
#define PNG_INTERLACE_NONE
png_const_structrp png_const_inforp info_ptr
const char * png_const_charp
#define IsEqualIID(riid1, riid2)
int seek(void *fd, ulong off, int mode)
LIST_ENTRY ProcessLocksList
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
#define CONTAINING_RECORD(address, type, field)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
WICBitmapEncoderCacheOption
@ WICPngFilterUnspecified
@ WICDecodeMetadataCacheOnDemand
@ WICBitmapDecoderCapabilityCanDecodeSomeImages
@ WICBitmapDecoderCapabilityCanDecodeAllImages
static const char * debug_wic_rect(const WICRect *rect)
@ WICMetadataCreationAllowUnknown
#define WINCODEC_ERR_WRONGSTATE
#define WINCODEC_ERR_UNSUPPORTEDOPERATION
#define WINCODEC_ERR_NOTINITIALIZED
#define WINCODEC_ERR_PALETTEUNAVAILABLE
#define WINCODEC_ERR_CODECNOTHUMBNAIL
#define WINCODEC_ERR_UNKNOWNIMAGEFORMAT
#define WINCODEC_ERR_FRAMEMISSING