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
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
October 2010
----- 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
2 participants
1174 discussions
Start a n
N
ew thread
Vincent Povirk : windowscodecs: Support Run-length encoded TGA images.
by Alexandre Julliard
22 Oct '10
22 Oct '10
Module: wine Branch: master Commit: a5a7d6c9f0ad400338dffb7714e9536f23765daf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a5a7d6c9f0ad400338dffb771…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Wed Oct 20 15:36:35 2010 -0500 windowscodecs: Support Run-length encoded TGA images. --- dlls/windowscodecs/tgaformat.c | 60 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 58 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/tgaformat.c b/dlls/windowscodecs/tgaformat.c index e088bbc..2e469bf 100644 --- a/dlls/windowscodecs/tgaformat.c +++ b/dlls/windowscodecs/tgaformat.c @@ -577,6 +577,63 @@ static HRESULT WINAPI TgaDecoder_Frame_CopyPalette(IWICBitmapFrameDecode *iface, return E_NOTIMPL; } +static HRESULT TgaDecoder_ReadRLE(TgaDecoder *This, BYTE *imagebits, int datasize) +{ + int i=0, j, bytesperpixel; + ULONG bytesread; + HRESULT hr=S_OK; + + bytesperpixel = This->header.depth / 8; + + while (i<datasize) + { + BYTE rc; + int count, size; + BYTE pixeldata[4]; + + hr = IStream_Read(This->stream, &rc, 1, &bytesread); + if (bytesread != 1) hr = E_FAIL; + if (FAILED(hr)) break; + + count = (rc&0x7f)+1; + size = count * bytesperpixel; + + if (size + i > datasize) + { + WARN("RLE packet too large\n"); + hr = E_FAIL; + break; + } + + if (rc&0x80) + { + /* Run-length packet */ + hr = IStream_Read(This->stream, pixeldata, bytesperpixel, &bytesread); + if (bytesread != bytesperpixel) hr = E_FAIL; + if (FAILED(hr)) break; + + if (bytesperpixel == 1) + memset(&imagebits[i], pixeldata[0], count); + else + { + for (j=0; j<count; j++) + memcpy(&imagebits[i+j*bytesperpixel], pixeldata, bytesperpixel); + } + } + else + { + /* Raw packet */ + hr = IStream_Read(This->stream, &imagebits[i], size, &bytesread); + if (bytesread != size) hr = E_FAIL; + if (FAILED(hr)) break; + } + + i += size; + } + + return hr; +} + static HRESULT TgaDecoder_ReadImage(TgaDecoder *This) { HRESULT hr=S_OK; @@ -614,8 +671,7 @@ static HRESULT TgaDecoder_ReadImage(TgaDecoder *This) { if (This->header.image_type & IMAGETYPE_RLE) { - FIXME("RLE decoding not implemented\n"); - hr = E_NOTIMPL; + hr = TgaDecoder_ReadRLE(This, This->imagebits, datasize); } else {
1
0
0
0
Vincent Povirk : windowscodecs: Add support for 32-bit TGA images.
by Alexandre Julliard
22 Oct '10
22 Oct '10
Module: wine Branch: master Commit: a64400ec988ffc43f70eab3a0f868d00a484a083 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a64400ec988ffc43f70eab3a0…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Wed Oct 20 15:04:10 2010 -0500 windowscodecs: Add support for 32-bit TGA images. --- dlls/windowscodecs/tgaformat.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/tgaformat.c b/dlls/windowscodecs/tgaformat.c index 9de35c2..e088bbc 100644 --- a/dlls/windowscodecs/tgaformat.c +++ b/dlls/windowscodecs/tgaformat.c @@ -517,6 +517,25 @@ static HRESULT WINAPI TgaDecoder_Frame_GetPixelFormat(IWICBitmapFrameDecode *ifa case 24: memcpy(pPixelFormat, &GUID_WICPixelFormat24bppBGR, sizeof(GUID)); break; + case 32: + switch (attribute_type) + { + case ATTRIBUTE_NO_ALPHA: + case ATTRIBUTE_UNDEFINED: + case ATTRIBUTE_UNDEFINED_PRESERVE: + memcpy(pPixelFormat, &GUID_WICPixelFormat32bppBGR, sizeof(GUID)); + break; + case ATTRIBUTE_ALPHA: + memcpy(pPixelFormat, &GUID_WICPixelFormat32bppBGRA, sizeof(GUID)); + break; + case ATTRIBUTE_PALPHA: + memcpy(pPixelFormat, &GUID_WICPixelFormat32bppPBGRA, sizeof(GUID)); + break; + default: + FIXME("Unhandled 32-bit attribute type %u\n", attribute_type); + return E_NOTIMPL; + } + break; default: FIXME("Unhandled truecolor depth %u\n", This->header.depth); return E_NOTIMPL;
1
0
0
0
Vincent Povirk : windowscodecs: Handle TGA attribute bits.
by Alexandre Julliard
22 Oct '10
22 Oct '10
Module: wine Branch: master Commit: 6ecb81976ffabc852e63d1b3130f8288cf03f175 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6ecb81976ffabc852e63d1b31…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Wed Oct 20 14:59:12 2010 -0500 windowscodecs: Handle TGA attribute bits. --- dlls/windowscodecs/tgaformat.c | 123 +++++++++++++++++++++++++++++++++++++--- include/wincodec.idl | 1 + 2 files changed, 115 insertions(+), 9 deletions(-) diff --git a/dlls/windowscodecs/tgaformat.c b/dlls/windowscodecs/tgaformat.c index 57dca7d..9de35c2 100644 --- a/dlls/windowscodecs/tgaformat.c +++ b/dlls/windowscodecs/tgaformat.c @@ -63,6 +63,41 @@ typedef struct { #define IMAGE_RIGHTTOLEFT 0x10 #define IMAGE_TOPTOBOTTOM 0x20 +typedef struct { + DWORD extension_area_offset; + DWORD developer_directory_offset; + char magic[18]; +} tga_footer; + +static const BYTE tga_footer_magic[18] = "TRUEVISION-XFILE."; + +typedef struct { + WORD size; + char author_name[41]; + char author_comments[324]; + WORD timestamp[6]; + char job_name[41]; + WORD job_timestamp[6]; + char software_id[41]; + WORD software_version; + char software_version_letter; + DWORD key_color; + WORD pixel_width; + WORD pixel_height; + WORD gamma_numerator; + WORD gamma_denominator; + DWORD color_correction_offset; + DWORD thumbnail_offset; + DWORD scanline_offset; + BYTE attributes_type; +} tga_extension_area; + +#define ATTRIBUTE_NO_ALPHA 0 +#define ATTRIBUTE_UNDEFINED 1 +#define ATTRIBUTE_UNDEFINED_PRESERVE 2 +#define ATTRIBUTE_ALPHA 3 +#define ATTRIBUTE_PALPHA 4 + #include "poppack.h" typedef struct { @@ -72,6 +107,7 @@ typedef struct { BOOL initialized; IStream *stream; tga_header header; + tga_extension_area extension_area; BYTE *imagebits; BYTE *origin; int stride; @@ -79,6 +115,8 @@ typedef struct { ULONG colormap_length; ULONG colormap_offset; ULONG image_offset; + ULONG extension_area_offset; + ULONG developer_directory_offset; CRITICAL_SECTION lock; } TgaDecoder; @@ -153,6 +191,8 @@ static HRESULT WINAPI TgaDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p HRESULT hr=S_OK; DWORD bytesread; LARGE_INTEGER seek; + tga_footer footer; + int attribute_bitcount; TRACE("(%p,%p,%u)\n", iface, pIStream, cacheOptions); @@ -207,8 +247,15 @@ static HRESULT WINAPI TgaDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p This->header.depth != 24 && This->header.depth != 32) hr = E_FAIL; - if ((This->header.image_descriptor & IMAGE_ATTRIBUTE_BITCOUNT_MASK) > 8 || - (This->header.image_descriptor & 0xc0) != 0) + if ((This->header.image_descriptor & 0xc0) != 0) + hr = E_FAIL; + + attribute_bitcount = This->header.image_descriptor & IMAGE_ATTRIBUTE_BITCOUNT_MASK; + + if (attribute_bitcount && + !((This->header.image_type & IMAGETYPE_TRUECOLOR) && + ((This->header.depth == 32 && attribute_bitcount == 8) || + (This->header.depth == 16 && attribute_bitcount == 1)))) hr = E_FAIL; if (FAILED(hr)) @@ -226,7 +273,49 @@ static HRESULT WINAPI TgaDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p This->colormap_length = 0; This->image_offset = This->colormap_offset + This->colormap_length; - /* FIXME: Read footer if there is one. */ + /* Read footer if there is one */ + seek.QuadPart = -sizeof(tga_footer); + hr = IStream_Seek(pIStream, seek, STREAM_SEEK_END, NULL); + if (FAILED(hr)) goto end; + + hr = IStream_Read(pIStream, &footer, sizeof(tga_footer), &bytesread); + if (SUCCEEDED(hr) && bytesread != sizeof(tga_footer)) + { + TRACE("got only %u footer bytes\n", bytesread); + hr = E_FAIL; + } + if (FAILED(hr)) goto end; + + if (memcmp(footer.magic, tga_footer_magic, sizeof(tga_footer_magic)) == 0) + { + This->extension_area_offset = footer.extension_area_offset; + This->developer_directory_offset = footer.developer_directory_offset; + } + else + { + This->extension_area_offset = 0; + This->developer_directory_offset = 0; + } + + if (This->extension_area_offset) + { + seek.QuadPart = This->extension_area_offset; + hr = IStream_Seek(pIStream, seek, STREAM_SEEK_SET, NULL); + if (FAILED(hr)) goto end; + + hr = IStream_Read(pIStream, &This->extension_area, sizeof(tga_extension_area), &bytesread); + if (SUCCEEDED(hr) && bytesread != sizeof(tga_extension_area)) + { + TRACE("got only %u extension area bytes\n", bytesread); + hr = E_FAIL; + } + if (SUCCEEDED(hr) && This->extension_area.size < 495) + { + TRACE("extension area is only %u bytes long\n", This->extension_area.size); + hr = E_FAIL; + } + if (FAILED(hr)) goto end; + } IStream_AddRef(pIStream); This->stream = pIStream; @@ -379,16 +468,18 @@ static HRESULT WINAPI TgaDecoder_Frame_GetPixelFormat(IWICBitmapFrameDecode *ifa { TgaDecoder *This = decoder_from_frame(iface); int attribute_bitcount; + byte attribute_type; TRACE("(%p,%p)\n", iface, pPixelFormat); attribute_bitcount = This->header.image_descriptor & IMAGE_ATTRIBUTE_BITCOUNT_MASK; - if (attribute_bitcount) - { - FIXME("Need to read footer to find meaning of attribute bits\n"); - return E_NOTIMPL; - } + if (attribute_bitcount && This->extension_area_offset) + attribute_type = This->extension_area.attributes_type; + else if (attribute_bitcount) + attribute_type = ATTRIBUTE_ALPHA; + else + attribute_type = ATTRIBUTE_NO_ALPHA; switch (This->header.image_type & ~IMAGETYPE_RLE) { @@ -407,7 +498,21 @@ static HRESULT WINAPI TgaDecoder_Frame_GetPixelFormat(IWICBitmapFrameDecode *ifa switch (This->header.depth) { case 16: - memcpy(pPixelFormat, &GUID_WICPixelFormat16bppBGR555, sizeof(GUID)); + switch (attribute_type) + { + case ATTRIBUTE_NO_ALPHA: + case ATTRIBUTE_UNDEFINED: + case ATTRIBUTE_UNDEFINED_PRESERVE: + memcpy(pPixelFormat, &GUID_WICPixelFormat16bppBGR555, sizeof(GUID)); + break; + case ATTRIBUTE_ALPHA: + case ATTRIBUTE_PALPHA: + memcpy(pPixelFormat, &GUID_WICPixelFormat16bppBGRA5551, sizeof(GUID)); + break; + default: + FIXME("Unhandled 16-bit attribute type %u\n", attribute_type); + return E_NOTIMPL; + } break; case 24: memcpy(pPixelFormat, &GUID_WICPixelFormat24bppBGR, sizeof(GUID)); diff --git a/include/wincodec.idl b/include/wincodec.idl index 8cc6500..6343350 100644 --- a/include/wincodec.idl +++ b/include/wincodec.idl @@ -158,6 +158,7 @@ cpp_quote("DEFINE_GUID(GUID_WICPixelFormat16bppGray, 0x6fddc324,0x4e03,0x4bfe,0x cpp_quote("DEFINE_GUID(GUID_WICPixelFormat16bppBGR555, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x09);") cpp_quote("DEFINE_GUID(GUID_WICPixelFormat16bppBGR565, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x0a);") +cpp_quote("DEFINE_GUID(GUID_WICPixelFormat16bppBGRA5551, 0x05ec7c2b,0xf1e6,0x4961,0xad,0x46,0xe1,0xcc,0x81,0x0a,0x87,0xd2);") cpp_quote("DEFINE_GUID(GUID_WICPixelFormat24bppBGR, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x0c);") cpp_quote("DEFINE_GUID(GUID_WICPixelFormat32bppBGR, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x0e);") cpp_quote("DEFINE_GUID(GUID_WICPixelFormat32bppBGRA, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x0f);")
1
0
0
0
Vincent Povirk : d3dx9_36: Check for the TGA container format.
by Alexandre Julliard
22 Oct '10
22 Oct '10
Module: wine Branch: master Commit: a2e5321b0135f176ab8ef2d3d271ce001e55f8f2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a2e5321b0135f176ab8ef2d3d…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Aug 24 14:29:38 2010 -0500 d3dx9_36: Check for the TGA container format. --- dlls/d3dx9_36/surface.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index f82f1b1..221e5f7 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -27,6 +27,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx); +/* Wine-specific WIC GUIDs */ + +DEFINE_GUID(GUID_WineContainerFormatTga, 0x0c44fda1,0xa5c5,0x4298,0x96,0x85,0x47,0x3f,0xc1,0x7c,0xd3,0x22); + /************************************************************ * D3DXGetImageInfoFromFileInMemory * @@ -93,6 +97,9 @@ HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(LPCVOID data, UINT datasize, D3D } else if(IsEqualGUID(&container_format, &GUID_ContainerFormatJpeg)) { TRACE("File type is JPG\n"); info->ImageFileFormat = D3DXIFF_JPG; + } else if(IsEqualGUID(&container_format, &GUID_WineContainerFormatTga)) { + TRACE("File type is TGA\n"); + info->ImageFileFormat = D3DXIFF_TGA; } else { WARN("Unsupported image file format %s\n", debugstr_guid(&container_format)); hr = D3DXERR_INVALIDDATA;
1
0
0
0
Vincent Povirk : windowscodecs: Implement CopyPixels for the TGA decoder.
by Alexandre Julliard
22 Oct '10
22 Oct '10
Module: wine Branch: master Commit: c2533f36913b7af66383ebeb772ad9abcb423bd1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c2533f36913b7af66383ebeb7…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Jun 7 17:13:56 2010 -0500 windowscodecs: Implement CopyPixels for the TGA decoder. --- dlls/windowscodecs/tgaformat.c | 108 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 106 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/tgaformat.c b/dlls/windowscodecs/tgaformat.c index f778cd4..57dca7d 100644 --- a/dlls/windowscodecs/tgaformat.c +++ b/dlls/windowscodecs/tgaformat.c @@ -72,6 +72,13 @@ typedef struct { BOOL initialized; IStream *stream; tga_header header; + BYTE *imagebits; + BYTE *origin; + int stride; + ULONG id_offset; + ULONG colormap_length; + ULONG colormap_offset; + ULONG image_offset; CRITICAL_SECTION lock; } TgaDecoder; @@ -125,6 +132,7 @@ static ULONG WINAPI TgaDecoder_Release(IWICBitmapDecoder *iface) DeleteCriticalSection(&This->lock); if (This->stream) IStream_Release(This->stream); + HeapFree(GetProcessHeap(), 0, This->imagebits); HeapFree(GetProcessHeap(), 0, This); } @@ -209,6 +217,15 @@ static HRESULT WINAPI TgaDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p goto end; } + /* Locate data in the file based on the header. */ + This->id_offset = sizeof(tga_header); + This->colormap_offset = This->id_offset + This->header.id_length; + if (This->header.colormap_type == 1) + This->colormap_length = ((This->header.colormap_entrysize+7)/8) * This->header.colormap_length; + else + This->colormap_length = 0; + This->image_offset = This->colormap_offset + This->colormap_length; + /* FIXME: Read footer if there is one. */ IStream_AddRef(pIStream); @@ -436,11 +453,97 @@ static HRESULT WINAPI TgaDecoder_Frame_CopyPalette(IWICBitmapFrameDecode *iface, return E_NOTIMPL; } +static HRESULT TgaDecoder_ReadImage(TgaDecoder *This) +{ + HRESULT hr=S_OK; + int datasize; + LARGE_INTEGER seek; + ULONG bytesread; + + if (This->imagebits) + return S_OK; + + EnterCriticalSection(&This->lock); + + if (!This->imagebits) + { + if (This->header.image_descriptor & IMAGE_RIGHTTOLEFT) + { + FIXME("Right to left image reading not implemented\n"); + hr = E_NOTIMPL; + } + + if (SUCCEEDED(hr)) + { + datasize = This->header.width * This->header.height * (This->header.depth / 8); + This->imagebits = HeapAlloc(GetProcessHeap(), 0, datasize); + if (!This->imagebits) hr = E_OUTOFMEMORY; + } + + if (SUCCEEDED(hr)) + { + seek.QuadPart = This->image_offset; + hr = IStream_Seek(This->stream, seek, STREAM_SEEK_SET, NULL); + } + + if (SUCCEEDED(hr)) + { + if (This->header.image_type & IMAGETYPE_RLE) + { + FIXME("RLE decoding not implemented\n"); + hr = E_NOTIMPL; + } + else + { + hr = IStream_Read(This->stream, This->imagebits, datasize, &bytesread); + if (SUCCEEDED(hr) && bytesread != datasize) + hr = E_FAIL; + } + } + + if (SUCCEEDED(hr)) + { + if (This->header.image_descriptor & IMAGE_TOPTOBOTTOM) + { + This->origin = This->imagebits; + This->stride = This->header.width * (This->header.depth / 8); + } + else + { + This->stride = -This->header.width * (This->header.depth / 8); + This->origin = This->imagebits + This->header.width * (This->header.height - 1) * (This->header.depth / 8); + } + } + else + { + HeapFree(GetProcessHeap(), 0, This->imagebits); + This->imagebits = NULL; + } + } + + LeaveCriticalSection(&This->lock); + + return hr; +} + static HRESULT WINAPI TgaDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer) { - FIXME("(%p,%p,%u,%u,%p):stub\n", iface, prc, cbStride, cbBufferSize, pbBuffer); - return E_NOTIMPL; + TgaDecoder *This = decoder_from_frame(iface); + HRESULT hr; + + TRACE("(%p,%p,%u,%u,%p)\n", iface, prc, cbStride, cbBufferSize, pbBuffer); + + hr = TgaDecoder_ReadImage(This); + + if (SUCCEEDED(hr)) + { + hr = copy_pixels(This->header.depth, This->origin, + This->header.width, This->header.height, This->stride, + prc, cbStride, cbBufferSize, pbBuffer); + } + + return hr; } static HRESULT WINAPI TgaDecoder_Frame_GetMetadataQueryReader(IWICBitmapFrameDecode *iface, @@ -497,6 +600,7 @@ HRESULT TgaDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) This->ref = 1; This->initialized = FALSE; This->stream = NULL; + This->imagebits = NULL; InitializeCriticalSection(&This->lock); This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": TgaDecoder.lock");
1
0
0
0
Alexandre Julliard : widl: Add a separate function to write the proc format string for a function.
by Alexandre Julliard
22 Oct '10
22 Oct '10
Module: wine Branch: master Commit: a638c663b5aca2680c0a3ee72b54c9ed221c6111 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a638c663b5aca2680c0a3ee72…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Oct 16 13:51:50 2010 +0200 widl: Add a separate function to write the proc format string for a function. --- tools/widl/typegen.c | 78 +++++++++++++++++++++----------------------------- 1 files changed, 33 insertions(+), 45 deletions(-) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index fdc0989..eb305b4 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -879,6 +879,35 @@ static unsigned int write_procformatstring_type(FILE *file, int indent, return size; } +static void write_procformatstring_func( FILE *file, int indent, + const var_t *func, unsigned int *offset ) +{ + /* emit argument data */ + if (type_get_function_args(func->type)) + { + const var_t *var; + LIST_FOR_EACH_ENTRY( var, type_get_function_args(func->type), const var_t, entry ) + { + print_file( file, 0, "/* %u (parameter %s) */\n", *offset, var->name ); + *offset += write_procformatstring_type(file, indent, var->type, var->attrs, FALSE); + } + } + + /* emit return value data */ + if (is_void(type_function_get_rettype(func->type))) + { + print_file(file, 0, "/* %u (void) */\n", *offset); + print_file(file, indent, "0x5b, /* FC_END */\n"); + print_file(file, indent, "0x5c, /* FC_PAD */\n"); + *offset += 2; + } + else + { + print_file( file, 0, "/* %u (return value) */\n", *offset ); + *offset += write_procformatstring_type(file, indent, type_function_get_rettype(func->type), NULL, TRUE); + } +} + static void write_procformatstring_stmts(FILE *file, int indent, const statement_list_t *stmts, type_pred_t pred, unsigned int *offset) { @@ -894,30 +923,7 @@ static void write_procformatstring_stmts(FILE *file, int indent, const statement { const var_t *func = stmt_func->u.var; if (is_local(func->attrs)) continue; - /* emit argument data */ - if (type_get_function_args(func->type)) - { - const var_t *var; - LIST_FOR_EACH_ENTRY( var, type_get_function_args(func->type), const var_t, entry ) - { - print_file( file, 0, "/* %u (parameter %s) */\n", *offset, var->name ); - *offset += write_procformatstring_type(file, indent, var->type, var->attrs, FALSE); - } - } - - /* emit return value data */ - if (is_void(type_function_get_rettype(func->type))) - { - print_file( file, 0, "/* %u (void) */\n", *offset ); - print_file(file, indent, "0x5b, /* FC_END */\n"); - print_file(file, indent, "0x5c, /* FC_PAD */\n"); - *offset += 2; - } - else - { - print_file( file, 0, "/* %u (return value) */\n", *offset ); - *offset += write_procformatstring_type(file, indent, type_function_get_rettype(func->type), NULL, TRUE); - } + write_procformatstring_func( file, indent, func, offset ); } } else if (stmt->type == STMT_LIBRARY) @@ -3867,29 +3873,11 @@ void write_remoting_arguments(FILE *file, int indent, const var_t *func, const c } -static unsigned int get_size_procformatstring_type(const type_t *type, const attr_list_t *attrs) -{ - return write_procformatstring_type(NULL, 0, type, attrs, FALSE); -} - - unsigned int get_size_procformatstring_func(const var_t *func) { - const var_t *var; - unsigned int size = 0; - - /* argument list size */ - if (type_get_function_args(func->type)) - LIST_FOR_EACH_ENTRY( var, type_get_function_args(func->type), const var_t, entry ) - size += get_size_procformatstring_type(var->type, var->attrs); - - /* return value size */ - if (is_void(type_function_get_rettype(func->type))) - size += 2; /* FC_END and FC_PAD */ - else - size += get_size_procformatstring_type(type_function_get_rettype(func->type), NULL); - - return size; + unsigned int offset = 0; + write_procformatstring_func( NULL, 0, func, &offset ); + return offset; } unsigned int get_size_procformatstring(const statement_list_t *stmts, type_pred_t pred)
1
0
0
0
Alexandre Julliard : widl: Output some comments for proc format strings.
by Alexandre Julliard
22 Oct '10
22 Oct '10
Module: wine Branch: master Commit: 63d5217fd674cba049d1a6a3519ea21507067f96 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=63d5217fd674cba049d1a6a35…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Oct 16 12:37:39 2010 +0200 widl: Output some comments for proc format strings. --- tools/widl/typegen.c | 32 +++++++++++++++++++++----------- tools/widl/typegen.h | 1 - 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 717e2c8..fdc0989 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -823,7 +823,6 @@ int decl_indirect(const type_t *t) } static unsigned int write_procformatstring_type(FILE *file, int indent, - const char *name, const type_t *type, const attr_list_t *attrs, int is_return) @@ -873,13 +872,15 @@ static unsigned int write_procformatstring_type(FILE *file, int indent, print_file(file, indent, "0x4d, /* FC_IN_PARAM */\n"); print_file(file, indent, "0x01,\n"); - print_file(file, indent, "NdrFcShort(0x%hx),\n", (unsigned short)type->typestring_offset); + print_file(file, indent, "NdrFcShort(0x%x), /* type offset = %u */\n", + type->typestring_offset, type->typestring_offset); size = 4; /* includes param type prefix */ } return size; } -static void write_procformatstring_stmts(FILE *file, int indent, const statement_list_t *stmts, type_pred_t pred) +static void write_procformatstring_stmts(FILE *file, int indent, const statement_list_t *stmts, + type_pred_t pred, unsigned int *offset) { const statement_t *stmt; if (stmts) LIST_FOR_EACH_ENTRY( stmt, stmts, const statement_t, entry ) @@ -898,27 +899,36 @@ static void write_procformatstring_stmts(FILE *file, int indent, const statement { const var_t *var; LIST_FOR_EACH_ENTRY( var, type_get_function_args(func->type), const var_t, entry ) - write_procformatstring_type(file, indent, var->name, var->type, var->attrs, FALSE); + { + print_file( file, 0, "/* %u (parameter %s) */\n", *offset, var->name ); + *offset += write_procformatstring_type(file, indent, var->type, var->attrs, FALSE); + } } /* emit return value data */ if (is_void(type_function_get_rettype(func->type))) { + print_file( file, 0, "/* %u (void) */\n", *offset ); print_file(file, indent, "0x5b, /* FC_END */\n"); print_file(file, indent, "0x5c, /* FC_PAD */\n"); + *offset += 2; } else - write_procformatstring_type(file, indent, "return value", type_function_get_rettype(func->type), NULL, TRUE); + { + print_file( file, 0, "/* %u (return value) */\n", *offset ); + *offset += write_procformatstring_type(file, indent, type_function_get_rettype(func->type), NULL, TRUE); + } } } else if (stmt->type == STMT_LIBRARY) - write_procformatstring_stmts(file, indent, stmt->u.lib->stmts, pred); + write_procformatstring_stmts(file, indent, stmt->u.lib->stmts, pred, offset); } } void write_procformatstring(FILE *file, const statement_list_t *stmts, type_pred_t pred) { int indent = 0; + unsigned int offset = 0; print_file(file, indent, "static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =\n"); print_file(file, indent, "{\n"); @@ -927,7 +937,7 @@ void write_procformatstring(FILE *file, const statement_list_t *stmts, type_pred print_file(file, indent, "{\n"); indent++; - write_procformatstring_stmts(file, indent, stmts, pred); + write_procformatstring_stmts(file, indent, stmts, pred, &offset); print_file(file, indent, "0x0\n"); indent--; @@ -3857,9 +3867,9 @@ void write_remoting_arguments(FILE *file, int indent, const var_t *func, const c } -unsigned int get_size_procformatstring_type(const char *name, const type_t *type, const attr_list_t *attrs) +static unsigned int get_size_procformatstring_type(const type_t *type, const attr_list_t *attrs) { - return write_procformatstring_type(NULL, 0, name, type, attrs, FALSE); + return write_procformatstring_type(NULL, 0, type, attrs, FALSE); } @@ -3871,13 +3881,13 @@ unsigned int get_size_procformatstring_func(const var_t *func) /* argument list size */ if (type_get_function_args(func->type)) LIST_FOR_EACH_ENTRY( var, type_get_function_args(func->type), const var_t, entry ) - size += get_size_procformatstring_type(var->name, var->type, var->attrs); + size += get_size_procformatstring_type(var->type, var->attrs); /* return value size */ if (is_void(type_function_get_rettype(func->type))) size += 2; /* FC_END and FC_PAD */ else - size += get_size_procformatstring_type("return value", type_function_get_rettype(func->type), NULL); + size += get_size_procformatstring_type(type_function_get_rettype(func->type), NULL); return size; } diff --git a/tools/widl/typegen.h b/tools/widl/typegen.h index 57a914a..e519ee0 100644 --- a/tools/widl/typegen.h +++ b/tools/widl/typegen.h @@ -69,7 +69,6 @@ void print_phase_basetype(FILE *file, int indent, const char *local_var_prefix, enum pass pass, const var_t *var, const char *varname); void write_remoting_arguments(FILE *file, int indent, const var_t *func, const char *local_var_prefix, enum pass pass, enum remoting_phase phase); -unsigned int get_size_procformatstring_type(const char *name, const type_t *type, const attr_list_t *attrs); unsigned int get_size_procformatstring_func(const var_t *func); unsigned int get_size_procformatstring(const statement_list_t *stmts, type_pred_t pred); unsigned int get_size_typeformatstring(const statement_list_t *stmts, type_pred_t pred);
1
0
0
0
Alexandre Julliard : widl: Use get_size_procformatstring_func() for clients too instead of duplicating the code.
by Alexandre Julliard
22 Oct '10
22 Oct '10
Module: wine Branch: master Commit: 226e96342925b6c17d61f0ed16c1ec95a9700d96 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=226e96342925b6c17d61f0ed1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Oct 21 21:35:21 2010 +0200 widl: Use get_size_procformatstring_func() for clients too instead of duplicating the code. --- tools/widl/client.c | 11 +---------- 1 files changed, 1 insertions(+), 10 deletions(-) diff --git a/tools/widl/client.c b/tools/widl/client.c index 569a18b..693227f 100644 --- a/tools/widl/client.c +++ b/tools/widl/client.c @@ -76,7 +76,6 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset) { const statement_t *stmt; const char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); - const var_t *var; int method_count = 0; if (!implicit_handle) @@ -297,15 +296,7 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset) } /* update proc_offset */ - if (args) - { - LIST_FOR_EACH_ENTRY( var, args, const var_t, entry ) - *proc_offset += get_size_procformatstring_type(var->name, var->type, var->attrs); - } - if (!is_void(type_function_get_rettype(func->type))) - *proc_offset += get_size_procformatstring_type("return value", type_function_get_rettype(func->type), NULL); - else - *proc_offset += 2; /* FC_END and FC_PAD */ + *proc_offset += get_size_procformatstring_func( func ); indent--; print_client("}\n");
1
0
0
0
Alexandre Julliard : widl: Add support for some more typelib flags based on the added attributes.
by Alexandre Julliard
22 Oct '10
22 Oct '10
Module: wine Branch: master Commit: 2debb114e3f1a926962ef4f9a0ac2db3556fd778 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2debb114e3f1a926962ef4f9a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Oct 21 21:34:33 2010 +0200 widl: Add support for some more typelib flags based on the added attributes. --- tools/widl/write_msft.c | 28 +++++++++++++++++++++------- 1 files changed, 21 insertions(+), 7 deletions(-) diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c index 1ac34d0..da4eb25 100644 --- a/tools/widl/write_msft.c +++ b/tools/widl/write_msft.c @@ -1312,7 +1312,9 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index) case ATTR_BINDABLE: funcflags |= 0x4; /* FUNCFLAG_FBINDABLE */ break; - /* FIXME: FUNCFLAG_FDEFAULTBIND */ + case ATTR_DEFAULTBIND: + funcflags |= 0x20; /* FUNCFLAG_FDEFAULTBIND */ + break; case ATTR_DEFAULTCOLLELEM: funcflags |= 0x100; /* FUNCFLAG_FDEFAULTCOLLELEM */ break; @@ -1373,8 +1375,12 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index) case ATTR_SOURCE: funcflags |= 0x2; /* FUNCFLAG_FSOURCE */ break; - /* FIXME: FUNCFLAG_FUIDEFAULT */ - /* FIXME: FUNCFLAG_FUSESGETLASTERROR */ + case ATTR_UIDEFAULT: + funcflags |= 0x200; /* FUNCFLAG_FUIDEFAULT */ + break; + case ATTR_USESGETLASTERROR: + funcflags |= 0x80; /* FUNCFLAG_FUSESGETLASTERROR */ + break; case ATTR_VARARG: if (num_optional || num_defaults) warning("add_func_desc: ignoring vararg in function with optional or defaultvalue params\n"); @@ -1612,7 +1618,9 @@ static HRESULT add_var_desc(msft_typeinfo_t *typeinfo, UINT index, var_t* var) case ATTR_BINDABLE: varflags |= 0x04; /* VARFLAG_FBINDABLE */ break; - /* FIXME: VARFLAG_FDEFAULTBIND */ + case ATTR_DEFAULTBIND: + varflags |= 0x20; /* VARFLAG_FDEFAULTBIND */ + break; case ATTR_DEFAULTCOLLELEM: varflags |= 0x100; /* VARFLAG_FDEFAULTCOLLELEM */ break; @@ -1644,7 +1652,9 @@ static HRESULT add_var_desc(msft_typeinfo_t *typeinfo, UINT index, var_t* var) case ATTR_SOURCE: varflags |= 0x02; /* VARFLAG_FSOURCE */ break; - /* FIXME: VARFLAG_FUIDEFAULT */ + case ATTR_UIDEFAULT: + varflags |= 0x0200; /* VARFLAG_FUIDEFAULT */ + break; default: break; } @@ -1869,7 +1879,9 @@ static msft_typeinfo_t *create_msft_typeinfo(msft_typelib_t *typelib, enum type_ typeinfo->flags |= 0x10; /* TYPEFLAG_FHIDDEN */ break; - /* FIXME: TYPEFLAG_FLICENSED */ + case ATTR_LICENSED: + typeinfo->flags |= 0x04; /* TYPEFLAG_FLICENSED */ + break; case ATTR_NONCREATABLE: typeinfo->flags &= ~0x2; /* TYPEFLAG_FCANCREATE */ @@ -1885,7 +1897,9 @@ static msft_typeinfo_t *create_msft_typeinfo(msft_typelib_t *typelib, enum type_ /* FIXME: TYPEFLAG_FPREDCLID */ - /* FIXME: TYPEFLAG_FPROXY */ + case ATTR_PROXY: + typeinfo->flags |= 0x4000; /* TYPEFLAG_FPROXY */ + break; /* FIXME: TYPEFLAG_FREPLACEABLE */
1
0
0
0
Alexandre Julliard : widl: Add some more attribute keywords.
by Alexandre Julliard
22 Oct '10
22 Oct '10
Module: wine Branch: master Commit: 537773fbf4ef4d90f8e39e06f68b12c31ec1d829 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=537773fbf4ef4d90f8e39e06f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Oct 21 14:13:38 2010 +0200 widl: Add some more attribute keywords. --- tools/widl/parser.l | 28 +++++++++++++++++ tools/widl/parser.y | 76 +++++++++++++++++++++++++++++++++++++++--------- tools/widl/widltypes.h | 23 ++++++++++++++ 3 files changed, 113 insertions(+), 14 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=537773fbf4ef4d90f8e39…
1
0
0
0
← Newer
1
...
23
24
25
26
27
28
29
...
118
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
Results per page:
10
25
50
100
200