winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 2010
----- 2025 -----
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
919 discussions
Start a n
N
ew thread
Christian Costa : d3dx9_36: Add stubbed interface for ID3DXEffect.
by Alexandre Julliard
22 Mar '10
22 Mar '10
Module: wine Branch: master Commit: 4082920c3a319b64779d746a6a899db30c346fde URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4082920c3a319b64779d746a6…
Author: Christian Costa <titan.costa(a)wanadoo.fr> Date: Mon Mar 22 09:27:37 2010 +0100 d3dx9_36: Add stubbed interface for ID3DXEffect. --- dlls/d3dx9_36/effect.c | 850 ++++++++++++++++++++++++++++++++++++++- dlls/d3dx9_36/tests/Makefile.in | 1 + dlls/d3dx9_36/tests/effect.c | 86 ++++ 3 files changed, 935 insertions(+), 2 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=4082920c3a319b64779d7…
1
0
0
0
Vincent Povirk : gdiplus: Add a test for TIFF image loading.
by Alexandre Julliard
22 Mar '10
22 Mar '10
Module: wine Branch: master Commit: eabce3e05f597ea9b2d646837ab6f46cd4794e8a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=eabce3e05f597ea9b2d646837…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Mar 8 16:13:24 2010 -0600 gdiplus: Add a test for TIFF image loading. --- dlls/gdiplus/tests/image.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 5f20468..f0dc681 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -806,6 +806,26 @@ static const unsigned char jpgimage[285] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xda,0x00,0x0c,0x03,0x01, 0x00,0x02,0x11,0x03,0x11,0x00,0x3f,0x00,0xb2,0xc0,0x07,0xff,0xd9 }; +/* 1x1 pixel tiff */ +static const unsigned char tiffimage[] = { +0x49,0x49,0x2a,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0xfe,0x00, +0x04,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x00,0x01,0x00, +0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x01,0x03,0x00,0x01,0x00,0x00,0x00,0x01,0x00, +0x00,0x00,0x02,0x01,0x03,0x00,0x03,0x00,0x00,0x00,0xd2,0x00,0x00,0x00,0x03,0x01, +0x03,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x01,0x03,0x00,0x01,0x00, +0x00,0x00,0x02,0x00,0x00,0x00,0x0d,0x01,0x02,0x00,0x1b,0x00,0x00,0x00,0xd8,0x00, +0x00,0x00,0x11,0x01,0x04,0x00,0x01,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x12,0x01, +0x03,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x15,0x01,0x03,0x00,0x01,0x00, +0x00,0x00,0x03,0x00,0x00,0x00,0x16,0x01,0x03,0x00,0x01,0x00,0x00,0x00,0x40,0x00, +0x00,0x00,0x17,0x01,0x04,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x1a,0x01, +0x05,0x00,0x01,0x00,0x00,0x00,0xf4,0x00,0x00,0x00,0x1b,0x01,0x05,0x00,0x01,0x00, +0x00,0x00,0xfc,0x00,0x00,0x00,0x1c,0x01,0x03,0x00,0x01,0x00,0x00,0x00,0x01,0x00, +0x00,0x00,0x28,0x01,0x03,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x2f,0x68,0x6f,0x6d,0x65,0x2f,0x6d,0x65, +0x68,0x2f,0x44,0x65,0x73,0x6b,0x74,0x6f,0x70,0x2f,0x74,0x65,0x73,0x74,0x2e,0x74, +0x69,0x66,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x48, +0x00,0x00,0x00,0x01 +}; /* 320x320 twip wmf */ static const unsigned char wmfimage[180] = { 0xd7,0xcd,0xc6,0x9a,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x01,0x40,0x01,0xa0,0x05, @@ -827,6 +847,7 @@ static void test_getrawformat(void) test_bufferrawformat((void*)gifimage, sizeof(gifimage), &ImageFormatGIF, __LINE__, FALSE); test_bufferrawformat((void*)bmpimage, sizeof(bmpimage), &ImageFormatBMP, __LINE__, FALSE); test_bufferrawformat((void*)jpgimage, sizeof(jpgimage), &ImageFormatJPEG, __LINE__, FALSE); + test_bufferrawformat((void*)tiffimage, sizeof(tiffimage), &ImageFormatTIFF, __LINE__, FALSE); test_bufferrawformat((void*)wmfimage, sizeof(wmfimage), &ImageFormatWMF, __LINE__, FALSE); }
1
0
0
0
Vincent Povirk : gdiplus: Add support for decoding TIFF images.
by Alexandre Julliard
22 Mar '10
22 Mar '10
Module: wine Branch: master Commit: d24a421207faebb956f741bd1dd39dbad55f3d75 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d24a421207faebb956f741bd1…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Mar 8 16:42:51 2010 -0600 gdiplus: Add support for decoding TIFF images. --- dlls/gdiplus/image.c | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index f60f75c..bfed433 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -2459,6 +2459,11 @@ static GpStatus decode_image_gif(IStream* stream, REFCLSID clsid, GpImage **imag return decode_image_wic(stream, &CLSID_WICGifDecoder, image); } +static GpStatus decode_image_tiff(IStream* stream, REFCLSID clsid, GpImage **image) +{ + return decode_image_wic(stream, &CLSID_WICTiffDecoder, image); +} + static GpStatus decode_image_olepicture_metafile(IStream* stream, REFCLSID clsid, GpImage **image) { IPicture *pic; @@ -2505,6 +2510,7 @@ typedef enum { BMP, JPEG, GIF, + TIFF, EMF, WMF, PNG, @@ -2906,6 +2912,13 @@ static const WCHAR gif_format[] = {'G','I','F',0}; static const BYTE gif_sig_pattern[4] = "GIF8"; static const BYTE gif_sig_mask[] = { 0xFF, 0xFF, 0xFF, 0xFF }; +static const WCHAR tiff_codecname[] = {'B', 'u', 'i','l', 't', '-','i', 'n', ' ', 'T','I','F','F', 0}; +static const WCHAR tiff_extension[] = {'*','.','T','I','F','F',';','*','.','T','I','F',0}; +static const WCHAR tiff_mimetype[] = {'i','m','a','g','e','/','t','i','f','f', 0}; +static const WCHAR tiff_format[] = {'T','I','F','F',0}; +static const BYTE tiff_sig_pattern[] = {0x49,0x49,42,0,0x4d,0x4d,0,42}; +static const BYTE tiff_sig_mask[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; + static const WCHAR emf_codecname[] = {'B', 'u', 'i','l', 't', '-','i', 'n', ' ', 'E','M','F', 0}; static const WCHAR emf_extension[] = {'*','.','E','M','F',0}; static const WCHAR emf_mimetype[] = {'i','m','a','g','e','/','x','-','e','m','f', 0}; @@ -2993,6 +3006,25 @@ static const struct image_codec codecs[NUM_CODECS] = { decode_image_gif }, { + { /* TIFF */ + /* Clsid */ { 0x557cf405, 0x1a04, 0x11d3, { 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }, + /* FormatID */ { 0xb96b3cb1U, 0x0728U, 0x11d3U, {0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e} }, + /* CodecName */ tiff_codecname, + /* DllName */ NULL, + /* FormatDescription */ tiff_format, + /* FilenameExtension */ tiff_extension, + /* MimeType */ tiff_mimetype, + /* Flags */ ImageCodecFlagsDecoder | ImageCodecFlagsSupportBitmap | ImageCodecFlagsBuiltin, + /* Version */ 1, + /* SigCount */ 2, + /* SigSize */ 4, + /* SigPattern */ tiff_sig_pattern, + /* SigMask */ tiff_sig_mask, + }, + NULL, + decode_image_tiff + }, + { { /* EMF */ /* Clsid */ { 0x557cf403, 0x1a04, 0x11d3, { 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }, /* FormatID */ { 0xb96b3cacU, 0x0728U, 0x11d3U, {0x9d, 0x7b, 0x00, 0x00, 0xf8, 0x1e, 0xf3, 0x2e} },
1
0
0
0
Vincent Povirk : gdiplus: Support decoders with multiple signatures.
by Alexandre Julliard
22 Mar '10
22 Mar '10
Module: wine Branch: master Commit: 738059baf8ca921f8991e1f12264d53ced2bf69b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=738059baf8ca921f8991e1f12…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Mar 8 16:42:36 2010 -0600 gdiplus: Support decoders with multiple signatures. --- dlls/gdiplus/image.c | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 58f3c65..f60f75c 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -2517,10 +2517,11 @@ static const struct image_codec codecs[NUM_CODECS]; static GpStatus get_decoder_info(IStream* stream, const struct image_codec **result) { BYTE signature[8]; + const BYTE *pattern, *mask; LARGE_INTEGER seek; HRESULT hr; UINT bytesread; - int i, j; + int i, j, sig; /* seek to the start of the stream */ seek.QuadPart = 0; @@ -2528,7 +2529,7 @@ static GpStatus get_decoder_info(IStream* stream, const struct image_codec **res if (FAILED(hr)) return hresult_to_status(hr); /* read the first 8 bytes */ - /* FIXME: This assumes all codecs have one signature <= 8 bytes in length */ + /* FIXME: This assumes all codecs have signatures <= 8 bytes in length */ hr = IStream_Read(stream, signature, 8, &bytesread); if (FAILED(hr)) return hresult_to_status(hr); if (hr == S_FALSE || bytesread == 0) return GenericError; @@ -2537,13 +2538,18 @@ static GpStatus get_decoder_info(IStream* stream, const struct image_codec **res if ((codecs[i].info.Flags & ImageCodecFlagsDecoder) && bytesread >= codecs[i].info.SigSize) { - for (j=0; j<codecs[i].info.SigSize; j++) - if ((signature[j] & codecs[i].info.SigMask[j]) != codecs[i].info.SigPattern[j]) - break; - if (j == codecs[i].info.SigSize) + for (sig=0; sig<codecs[i].info.SigCount; sig++) { - *result = &codecs[i]; - return Ok; + pattern = &codecs[i].info.SigPattern[codecs[i].info.SigSize*sig]; + mask = &codecs[i].info.SigMask[codecs[i].info.SigSize*sig]; + for (j=0; j<codecs[i].info.SigSize; j++) + if ((signature[j] & mask[j]) != pattern[j]) + break; + if (j == codecs[i].info.SigSize) + { + *result = &codecs[i]; + return Ok; + } } } }
1
0
0
0
Vincent Povirk : windowscodecs: Add support for decoding RGB TIFF images.
by Alexandre Julliard
22 Mar '10
22 Mar '10
Module: wine Branch: master Commit: 416eb191cb555134eb0513a76d19d26f2e946f70 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=416eb191cb555134eb0513a76…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Fri Mar 19 17:11:50 2010 -0500 windowscodecs: Add support for decoding RGB TIFF images. --- dlls/windowscodecs/tiffformat.c | 45 +++++++++++++++++++++++++++++++++++++- 1 files changed, 43 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c index 2b93c74..fe87ddd 100644 --- a/dlls/windowscodecs/tiffformat.c +++ b/dlls/windowscodecs/tiffformat.c @@ -220,7 +220,7 @@ static const IWICBitmapFrameDecodeVtbl TiffFrameDecode_Vtbl; static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info) { - uint16 photometric, bps; + uint16 photometric, bps, samples, planar; int ret; decode_info->indexed = 0; @@ -256,6 +256,29 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info) return E_FAIL; } break; + case 2: /* RGB */ + if (bps != 8) + { + FIXME("unhandled RGB bit count %u\n", bps); + return E_FAIL; + } + ret = pTIFFGetField(tiff, TIFFTAG_SAMPLESPERPIXEL, &samples); + if (samples != 3) + { + FIXME("unhandled RGB sample count %u\n", samples); + return E_FAIL; + } + ret = pTIFFGetField(tiff, TIFFTAG_PLANARCONFIG, &planar); + if (!ret) planar = 1; + if (planar != 1) + { + FIXME("unhandled planar configuration %u\n", planar); + return E_FAIL; + } + decode_info->bpp = bps * samples; + decode_info->reverse_bgr = 1; + decode_info->format = &GUID_WICPixelFormat24bppBGR; + break; case 3: /* RGB Palette */ decode_info->indexed = 1; decode_info->bpp = bps; @@ -273,7 +296,6 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info) } break; case 0: /* WhiteIsZero */ - case 2: /* RGB */ case 4: /* Transparency mask */ case 5: /* CMYK */ case 6: /* YCbCr */ @@ -651,6 +673,25 @@ static HRESULT TiffFrameDecode_ReadTile(TiffFrameDecode *This, UINT tile_x, UINT hr = E_FAIL; } + if (hr == S_OK && This->decode_info.reverse_bgr) + { + if (This->decode_info.format == &GUID_WICPixelFormat24bppBGR) + { + UINT i, total_pixels; + BYTE *pixel, temp; + + total_pixels = This->decode_info.tile_width * This->decode_info.tile_height; + pixel = This->cached_tile; + for (i=0; i<total_pixels; i++) + { + temp = pixel[2]; + pixel[2] = pixel[0]; + pixel[0] = temp; + pixel += 3; + } + } + } + if (hr == S_OK) { This->cached_tile_x = tile_x;
1
0
0
0
Vincent Povirk : windowscodecs: Implement CopyPixels for the TIFF decoder.
by Alexandre Julliard
22 Mar '10
22 Mar '10
Module: wine Branch: master Commit: 2ed101f6fcfb27aed49c708a7c3739af824695c3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2ed101f6fcfb27aed49c708a7…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Fri Mar 19 16:35:07 2010 -0500 windowscodecs: Implement CopyPixels for the TIFF decoder. --- dlls/windowscodecs/tiffformat.c | 143 +++++++++++++++++++++++++++++++++++++- 1 files changed, 139 insertions(+), 4 deletions(-) diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c index ad8a81f..2b93c74 100644 --- a/dlls/windowscodecs/tiffformat.c +++ b/dlls/windowscodecs/tiffformat.c @@ -60,6 +60,7 @@ MAKE_FUNCPTR(TIFFClose); MAKE_FUNCPTR(TIFFCurrentDirectory); MAKE_FUNCPTR(TIFFGetField); MAKE_FUNCPTR(TIFFReadDirectory); +MAKE_FUNCPTR(TIFFReadEncodedStrip); MAKE_FUNCPTR(TIFFSetDirectory); #undef MAKE_FUNCPTR @@ -85,6 +86,7 @@ static void *load_libtiff(void) LOAD_FUNCPTR(TIFFCurrentDirectory); LOAD_FUNCPTR(TIFFGetField); LOAD_FUNCPTR(TIFFReadDirectory); + LOAD_FUNCPTR(TIFFReadEncodedStrip); LOAD_FUNCPTR(TIFFSetDirectory); #undef LOAD_FUNCPTR @@ -199,6 +201,9 @@ typedef struct { int indexed; int reverse_bgr; UINT width, height; + UINT tile_width, tile_height; + UINT tile_stride; + UINT tile_size; } tiff_decode_info; typedef struct { @@ -207,6 +212,8 @@ typedef struct { TiffDecoder *parent; UINT index; tiff_decode_info decode_info; + INT cached_tile_x, cached_tile_y; + BYTE *cached_tile; } TiffFrameDecode; static const IWICBitmapFrameDecodeVtbl TiffFrameDecode_Vtbl; @@ -290,6 +297,20 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info) return E_FAIL; } + ret = pTIFFGetField(tiff, TIFFTAG_ROWSPERSTRIP, &decode_info->tile_height); + if (ret) + { + decode_info->tile_width = decode_info->width; + decode_info->tile_stride = ((decode_info->bpp * decode_info->tile_width + 7)/8); + decode_info->tile_size = decode_info->tile_height * decode_info->tile_stride; + } + else + { + /* Probably a tiled image */ + FIXME("missing RowsPerStrip value\n"); + return E_FAIL; + } + return S_OK; } @@ -487,8 +508,16 @@ static HRESULT WINAPI TiffDecoder_GetFrame(IWICBitmapDecoder *iface, result->parent = This; result->index = index; result->decode_info = decode_info; - - *ppIBitmapFrame = (IWICBitmapFrameDecode*)result; + result->cached_tile_x = -1; + result->cached_tile = HeapAlloc(GetProcessHeap(), 0, decode_info.tile_size); + + if (result->cached_tile) + *ppIBitmapFrame = (IWICBitmapFrameDecode*)result; + else + { + hr = E_OUTOFMEMORY; + HeapFree(GetProcessHeap(), 0, result); + } } else hr = E_OUTOFMEMORY; } @@ -558,6 +587,7 @@ static ULONG WINAPI TiffFrameDecode_Release(IWICBitmapFrameDecode *iface) if (ref == 0) { + HeapFree(GetProcessHeap(), 0, This->cached_tile); HeapFree(GetProcessHeap(), 0, This); } @@ -603,11 +633,116 @@ static HRESULT WINAPI TiffFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, return E_NOTIMPL; } +static HRESULT TiffFrameDecode_ReadTile(TiffFrameDecode *This, UINT tile_x, UINT tile_y) +{ + HRESULT hr=S_OK; + tsize_t ret; + + ret = pTIFFSetDirectory(This->parent->tiff, This->index); + + if (ret == -1) + hr = E_FAIL; + + if (hr == S_OK) + { + ret = pTIFFReadEncodedStrip(This->parent->tiff, tile_y, This->cached_tile, This->decode_info.tile_size); + + if (ret == -1) + hr = E_FAIL; + } + + if (hr == S_OK) + { + This->cached_tile_x = tile_x; + This->cached_tile_y = tile_y; + } + + return hr; +} + static HRESULT WINAPI TiffFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer) { - FIXME("(%p,%p,%u,%u,%p)\n", iface, prc, cbStride, cbBufferSize, pbBuffer); - return E_NOTIMPL; + TiffFrameDecode *This = (TiffFrameDecode*)iface; + UINT min_tile_x, max_tile_x, min_tile_y, max_tile_y; + UINT tile_x, tile_y; + WICRect rc; + HRESULT hr=S_OK; + BYTE *dst_tilepos; + UINT bytesperrow; + + TRACE("(%p,%p,%u,%u,%p)\n", iface, prc, cbStride, cbBufferSize, pbBuffer); + + if (prc->X < 0 || prc->Y < 0 || prc->X+prc->Width > This->decode_info.width || + prc->Y+prc->Height > This->decode_info.height) + return E_INVALIDARG; + + bytesperrow = ((This->decode_info.bpp * prc->Width)+7)/8; + + if (cbStride < bytesperrow) + return E_INVALIDARG; + + if ((cbStride * prc->Height) > cbBufferSize) + return E_INVALIDARG; + + min_tile_x = prc->X / This->decode_info.tile_width; + min_tile_y = prc->Y / This->decode_info.tile_height; + max_tile_x = (prc->X+prc->Width-1) / This->decode_info.tile_width; + max_tile_y = (prc->Y+prc->Height-1) / This->decode_info.tile_height; + + EnterCriticalSection(&This->parent->lock); + + for (tile_x=min_tile_x; tile_x <= max_tile_x; tile_x++) + { + for (tile_y=min_tile_y; tile_y <= max_tile_y; tile_y++) + { + if (tile_x != This->cached_tile_x || tile_y != This->cached_tile_y) + { + hr = TiffFrameDecode_ReadTile(This, tile_x, tile_y); + } + + if (SUCCEEDED(hr)) + { + if (prc->X < tile_x * This->decode_info.tile_width) + rc.X = 0; + else + rc.X = prc->X - tile_x * This->decode_info.tile_width; + + if (prc->Y < tile_y * This->decode_info.tile_height) + rc.Y = 0; + else + rc.Y = prc->Y - tile_y * This->decode_info.tile_height; + + if (prc->X+prc->Width > (tile_x+1) * This->decode_info.tile_width) + rc.Width = This->decode_info.tile_width - rc.X; + else + rc.Width = prc->Width + rc.X - prc->X; + + if (prc->Y+prc->Height > (tile_y+1) * This->decode_info.tile_height) + rc.Height = This->decode_info.tile_height - rc.Y; + else + rc.Height = prc->Height + rc.Y - prc->Y; + + dst_tilepos = pbBuffer + (cbStride * (rc.Y - prc->Y)) + + ((This->decode_info.bpp * (rc.X - prc->X) + 7) / 8); + + hr = copy_pixels(This->decode_info.bpp, This->cached_tile, + This->decode_info.tile_width, This->decode_info.tile_height, This->decode_info.tile_stride, + &rc, cbStride, cbBufferSize, dst_tilepos); + } + + if (FAILED(hr)) + { + LeaveCriticalSection(&This->parent->lock); + TRACE("<-- 0x%x\n", hr); + return hr; + } + } + } + + LeaveCriticalSection(&This->parent->lock); + + return S_OK; } static HRESULT WINAPI TiffFrameDecode_GetMetadataQueryReader(IWICBitmapFrameDecode *iface,
1
0
0
0
Vincent Povirk : windowscodecs: Implement GetSize for the TIFF decoder.
by Alexandre Julliard
22 Mar '10
22 Mar '10
Module: wine Branch: master Commit: 8996ffbfc68de31d2059a9a1752b41565f49b55f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8996ffbfc68de31d2059a9a17…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Fri Mar 19 15:27:51 2010 -0500 windowscodecs: Implement GetSize for the TIFF decoder. --- dlls/windowscodecs/tiffformat.c | 25 +++++++++++++++++++++++-- 1 files changed, 23 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c index 83b9667..ad8a81f 100644 --- a/dlls/windowscodecs/tiffformat.c +++ b/dlls/windowscodecs/tiffformat.c @@ -198,6 +198,7 @@ typedef struct { int bpp; int indexed; int reverse_bgr; + UINT width, height; } tiff_decode_info; typedef struct { @@ -275,6 +276,20 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info) return E_FAIL; } + ret = pTIFFGetField(tiff, TIFFTAG_IMAGEWIDTH, &decode_info->width); + if (!ret) + { + WARN("missing image width\n"); + return E_FAIL; + } + + ret = pTIFFGetField(tiff, TIFFTAG_IMAGELENGTH, &decode_info->height); + if (!ret) + { + WARN("missing image length\n"); + return E_FAIL; + } + return S_OK; } @@ -552,8 +567,14 @@ static ULONG WINAPI TiffFrameDecode_Release(IWICBitmapFrameDecode *iface) static HRESULT WINAPI TiffFrameDecode_GetSize(IWICBitmapFrameDecode *iface, UINT *puiWidth, UINT *puiHeight) { - FIXME("(%p,%p,%p)\n", iface, puiWidth, puiHeight); - return E_NOTIMPL; + TiffFrameDecode *This = (TiffFrameDecode*)iface; + + *puiWidth = This->decode_info.width; + *puiHeight = This->decode_info.height; + + TRACE("(%p) <-- %ux%u\n", iface, *puiWidth, *puiHeight); + + return S_OK; } static HRESULT WINAPI TiffFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface,
1
0
0
0
Vincent Povirk : windowscodecs: Implement GetPixelFormat for TIFF decoder.
by Alexandre Julliard
22 Mar '10
22 Mar '10
Module: wine Branch: master Commit: 8066e9beca831275af101d5a9b13ded3b5af1f40 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8066e9beca831275af101d5a9…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Fri Mar 19 15:20:52 2010 -0500 windowscodecs: Implement GetPixelFormat for TIFF decoder. --- dlls/windowscodecs/tiffformat.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c index b351610..83b9667 100644 --- a/dlls/windowscodecs/tiffformat.c +++ b/dlls/windowscodecs/tiffformat.c @@ -559,8 +559,13 @@ static HRESULT WINAPI TiffFrameDecode_GetSize(IWICBitmapFrameDecode *iface, static HRESULT WINAPI TiffFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface, WICPixelFormatGUID *pPixelFormat) { - FIXME("(%p,%p)\n", iface, pPixelFormat); - return E_NOTIMPL; + TiffFrameDecode *This = (TiffFrameDecode*)iface; + + memcpy(pPixelFormat, This->decode_info.format, sizeof(GUID)); + + TRACE("(%p) <-- %s\n", This, debugstr_guid(This->decode_info.format)); + + return S_OK; } static HRESULT WINAPI TiffFrameDecode_GetResolution(IWICBitmapFrameDecode *iface,
1
0
0
0
Vincent Povirk : windowscodecs: Implement GetFrame for the TIFF decoder.
by Alexandre Julliard
22 Mar '10
22 Mar '10
Module: wine Branch: master Commit: ccaf1b1e5d26cec75053bf7d4014bb3c66d60362 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ccaf1b1e5d26cec75053bf7d4…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Wed Mar 17 16:25:12 2010 -0500 windowscodecs: Implement GetFrame for the TIFF decoder. --- dlls/windowscodecs/tiffformat.c | 247 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 245 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c index 3962f9a..b351610 100644 --- a/dlls/windowscodecs/tiffformat.c +++ b/dlls/windowscodecs/tiffformat.c @@ -58,7 +58,9 @@ static void *libtiff_handle; MAKE_FUNCPTR(TIFFClientOpen); MAKE_FUNCPTR(TIFFClose); MAKE_FUNCPTR(TIFFCurrentDirectory); +MAKE_FUNCPTR(TIFFGetField); MAKE_FUNCPTR(TIFFReadDirectory); +MAKE_FUNCPTR(TIFFSetDirectory); #undef MAKE_FUNCPTR static void *load_libtiff(void) @@ -81,7 +83,9 @@ static void *load_libtiff(void) LOAD_FUNCPTR(TIFFClientOpen); LOAD_FUNCPTR(TIFFClose); LOAD_FUNCPTR(TIFFCurrentDirectory); + LOAD_FUNCPTR(TIFFGetField); LOAD_FUNCPTR(TIFFReadDirectory); + LOAD_FUNCPTR(TIFFSetDirectory); #undef LOAD_FUNCPTR } @@ -189,6 +193,91 @@ typedef struct { BOOL initialized; } TiffDecoder; +typedef struct { + const WICPixelFormatGUID *format; + int bpp; + int indexed; + int reverse_bgr; +} tiff_decode_info; + +typedef struct { + const IWICBitmapFrameDecodeVtbl *lpVtbl; + LONG ref; + TiffDecoder *parent; + UINT index; + tiff_decode_info decode_info; +} TiffFrameDecode; + +static const IWICBitmapFrameDecodeVtbl TiffFrameDecode_Vtbl; + +static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info) +{ + uint16 photometric, bps; + int ret; + + decode_info->indexed = 0; + decode_info->reverse_bgr = 0; + + ret = pTIFFGetField(tiff, TIFFTAG_PHOTOMETRIC, &photometric); + if (!ret) + { + WARN("missing PhotometricInterpretation tag\n"); + return E_FAIL; + } + + ret = pTIFFGetField(tiff, TIFFTAG_BITSPERSAMPLE, &bps); + if (!ret) bps = 1; + + switch(photometric) + { + case 1: /* BlackIsZero */ + decode_info->bpp = bps; + switch (bps) + { + case 1: + decode_info->format = &GUID_WICPixelFormatBlackWhite; + break; + case 4: + decode_info->format = &GUID_WICPixelFormat4bppGray; + break; + case 8: + decode_info->format = &GUID_WICPixelFormat8bppGray; + break; + default: + FIXME("unhandled greyscale bit count %u\n", bps); + return E_FAIL; + } + break; + case 3: /* RGB Palette */ + decode_info->indexed = 1; + decode_info->bpp = bps; + switch (bps) + { + case 4: + decode_info->format = &GUID_WICPixelFormat4bppIndexed; + break; + case 8: + decode_info->format = &GUID_WICPixelFormat8bppIndexed; + break; + default: + FIXME("unhandled indexed bit count %u\n", bps); + return E_FAIL; + } + break; + case 0: /* WhiteIsZero */ + case 2: /* RGB */ + case 4: /* Transparency mask */ + case 5: /* CMYK */ + case 6: /* YCbCr */ + case 8: /* CIELab */ + default: + FIXME("unhandled PhotometricInterpretation %u\n", photometric); + return E_FAIL; + } + + return S_OK; +} + static HRESULT WINAPI TiffDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID iid, void **ppv) { @@ -355,8 +444,43 @@ static HRESULT WINAPI TiffDecoder_GetFrameCount(IWICBitmapDecoder *iface, static HRESULT WINAPI TiffDecoder_GetFrame(IWICBitmapDecoder *iface, UINT index, IWICBitmapFrameDecode **ppIBitmapFrame) { - FIXME("(%p,%u,%p)\n", iface, index, ppIBitmapFrame); - return E_NOTIMPL; + TiffDecoder *This = (TiffDecoder*)iface; + TiffFrameDecode *result; + int res; + tiff_decode_info decode_info; + HRESULT hr; + + TRACE("(%p,%u,%p)\n", iface, index, ppIBitmapFrame); + + if (!This->tiff) + return WINCODEC_ERR_WRONGSTATE; + + EnterCriticalSection(&This->lock); + res = pTIFFSetDirectory(This->tiff, index); + if (!res) hr = E_INVALIDARG; + else hr = tiff_get_decode_info(This->tiff, &decode_info); + LeaveCriticalSection(&This->lock); + + if (SUCCEEDED(hr)) + { + result = HeapAlloc(GetProcessHeap(), 0, sizeof(TiffFrameDecode)); + + if (result) + { + result->lpVtbl = &TiffFrameDecode_Vtbl; + result->ref = 1; + result->parent = This; + result->index = index; + result->decode_info = decode_info; + + *ppIBitmapFrame = (IWICBitmapFrameDecode*)result; + } + else hr = E_OUTOFMEMORY; + } + + if (FAILED(hr)) *ppIBitmapFrame = NULL; + + return hr; } static const IWICBitmapDecoderVtbl TiffDecoder_Vtbl = { @@ -376,6 +500,125 @@ static const IWICBitmapDecoderVtbl TiffDecoder_Vtbl = { TiffDecoder_GetFrame }; +static HRESULT WINAPI TiffFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface, REFIID iid, + void **ppv) +{ + TiffFrameDecode *This = (TiffFrameDecode*)iface; + TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); + + if (!ppv) return E_INVALIDARG; + + if (IsEqualIID(&IID_IUnknown, iid) || + IsEqualIID(&IID_IWICBitmapSource, iid) || + IsEqualIID(&IID_IWICBitmapFrameDecode, iid)) + { + *ppv = This; + } + else + { + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI TiffFrameDecode_AddRef(IWICBitmapFrameDecode *iface) +{ + TiffFrameDecode *This = (TiffFrameDecode*)iface; + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) refcount=%u\n", iface, ref); + + return ref; +} + +static ULONG WINAPI TiffFrameDecode_Release(IWICBitmapFrameDecode *iface) +{ + TiffFrameDecode *This = (TiffFrameDecode*)iface; + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) refcount=%u\n", iface, ref); + + if (ref == 0) + { + HeapFree(GetProcessHeap(), 0, This); + } + + return ref; +} + +static HRESULT WINAPI TiffFrameDecode_GetSize(IWICBitmapFrameDecode *iface, + UINT *puiWidth, UINT *puiHeight) +{ + FIXME("(%p,%p,%p)\n", iface, puiWidth, puiHeight); + return E_NOTIMPL; +} + +static HRESULT WINAPI TiffFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface, + WICPixelFormatGUID *pPixelFormat) +{ + FIXME("(%p,%p)\n", iface, pPixelFormat); + return E_NOTIMPL; +} + +static HRESULT WINAPI TiffFrameDecode_GetResolution(IWICBitmapFrameDecode *iface, + double *pDpiX, double *pDpiY) +{ + FIXME("(%p,%p,%p)\n", iface, pDpiX, pDpiY); + return E_NOTIMPL; +} + +static HRESULT WINAPI TiffFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, + IWICPalette *pIPalette) +{ + FIXME("(%p,%p)\n", iface, pIPalette); + return E_NOTIMPL; +} + +static HRESULT WINAPI TiffFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface, + const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer) +{ + FIXME("(%p,%p,%u,%u,%p)\n", iface, prc, cbStride, cbBufferSize, pbBuffer); + return E_NOTIMPL; +} + +static HRESULT WINAPI TiffFrameDecode_GetMetadataQueryReader(IWICBitmapFrameDecode *iface, + IWICMetadataQueryReader **ppIMetadataQueryReader) +{ + FIXME("(%p,%p): stub\n", iface, ppIMetadataQueryReader); + return E_NOTIMPL; +} + +static HRESULT WINAPI TiffFrameDecode_GetColorContexts(IWICBitmapFrameDecode *iface, + UINT cCount, IWICColorContext **ppIColorContexts, UINT *pcActualCount) +{ + FIXME("(%p,%u,%p,%p): stub\n", iface, cCount, ppIColorContexts, pcActualCount); + return E_NOTIMPL; +} + +static HRESULT WINAPI TiffFrameDecode_GetThumbnail(IWICBitmapFrameDecode *iface, + IWICBitmapSource **ppIThumbnail) +{ + FIXME("(%p,%p): stub\n", iface, ppIThumbnail); + return E_NOTIMPL; +} + +static const IWICBitmapFrameDecodeVtbl TiffFrameDecode_Vtbl = { + TiffFrameDecode_QueryInterface, + TiffFrameDecode_AddRef, + TiffFrameDecode_Release, + TiffFrameDecode_GetSize, + TiffFrameDecode_GetPixelFormat, + TiffFrameDecode_GetResolution, + TiffFrameDecode_CopyPalette, + TiffFrameDecode_CopyPixels, + TiffFrameDecode_GetMetadataQueryReader, + TiffFrameDecode_GetColorContexts, + TiffFrameDecode_GetThumbnail +}; + HRESULT TiffDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) { HRESULT ret;
1
0
0
0
Vincent Povirk : windowscodecs: Implement GetFrameCount for the TIFF decoder.
by Alexandre Julliard
22 Mar '10
22 Mar '10
Module: wine Branch: master Commit: c048bb07ca8a170b52215a6dc7537c1602835e79 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c048bb07ca8a170b52215a6dc…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Wed Mar 17 16:00:33 2010 -0500 windowscodecs: Implement GetFrameCount for the TIFF decoder. --- dlls/windowscodecs/tiffformat.c | 22 ++++++++++++++++++++-- 1 files changed, 20 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c index 38edf70..3962f9a 100644 --- a/dlls/windowscodecs/tiffformat.c +++ b/dlls/windowscodecs/tiffformat.c @@ -57,6 +57,8 @@ static void *libtiff_handle; #define MAKE_FUNCPTR(f) static typeof(f) * p##f MAKE_FUNCPTR(TIFFClientOpen); MAKE_FUNCPTR(TIFFClose); +MAKE_FUNCPTR(TIFFCurrentDirectory); +MAKE_FUNCPTR(TIFFReadDirectory); #undef MAKE_FUNCPTR static void *load_libtiff(void) @@ -78,6 +80,8 @@ static void *load_libtiff(void) } LOAD_FUNCPTR(TIFFClientOpen); LOAD_FUNCPTR(TIFFClose); + LOAD_FUNCPTR(TIFFCurrentDirectory); + LOAD_FUNCPTR(TIFFReadDirectory); #undef LOAD_FUNCPTR } @@ -330,8 +334,22 @@ static HRESULT WINAPI TiffDecoder_GetThumbnail(IWICBitmapDecoder *iface, static HRESULT WINAPI TiffDecoder_GetFrameCount(IWICBitmapDecoder *iface, UINT *pCount) { - FIXME("(%p,%p)\n", iface, pCount); - return E_NOTIMPL; + TiffDecoder *This = (TiffDecoder*)iface; + + if (!This->tiff) + { + WARN("(%p) <-- WINCODEC_ERR_WRONGSTATE\n", iface); + return WINCODEC_ERR_WRONGSTATE; + } + + EnterCriticalSection(&This->lock); + while (pTIFFReadDirectory(This->tiff)) { } + *pCount = pTIFFCurrentDirectory(This->tiff)+1; + LeaveCriticalSection(&This->lock); + + TRACE("(%p) <-- %i\n", iface, *pCount); + + return S_OK; } static HRESULT WINAPI TiffDecoder_GetFrame(IWICBitmapDecoder *iface,
1
0
0
0
← Newer
1
...
33
34
35
36
37
38
39
...
92
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Results per page:
10
25
50
100
200