Commit d94d6c0f authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

открытие картинок формата WindowsHD Photo https://ru.wikipedia.org/wiki/JPEG_XR

ТОЛЬКО для windows систем, работа по unix/linux ЗАПРЕЩЕНА

открытие будет только по наличию в системе длл - windowcodecs.dll (net 3.5)

файл для теста Удивительная история рождения MS-Dos.docx

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@57778 954022d7-b5bf-4e40-9824-e11837661b57
parent b5aba0d2
......@@ -78,7 +78,7 @@
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="false"
AdditionalDependencies="graydither.lib Msimg32.lib"
AdditionalDependencies="graydither.lib Msimg32.lib Windowscodecs.lib"
OutputFile="$(OutDir)/ASCImageFile3.dll"
LinkIncremental="2"
AdditionalLibraryDirectories="Libs"
......@@ -178,7 +178,7 @@
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="false"
AdditionalDependencies="graydither.lib Msimg32.lib"
AdditionalDependencies="graydither.lib Msimg32.lib Windowscodecs.lib"
OutputFile="$(OutDir)/ASCImageFile3.dll"
LinkIncremental="1"
AdditionalLibraryDirectories="Libs"
......
......@@ -1155,6 +1155,12 @@ protected:
ImageStudio::IO::Tga oReaderTga;
bLoading = oReaderTga.FromFile( sFilePath, nFormat, &oImage );
}
else
if( eFileType ==_ImageFileFormats::c_Wdp)
{
ImageStudio::IO::Wdp oReaderWdp;
bLoading = oReaderWdp.FromFile( sFilePath, nFormat, &oImage );
}
else
if( eFileType ==_ImageFileFormats::c_Pcx)
{
......
......@@ -52,10 +52,10 @@ using namespace ATL;
#include "../../Common/VideoFileInterface.h"
#import "../../Redist/ASCMediaCore3.dll" named_guids rename_namespace("MediaCore"), exclude("tagRECT")
#import "../../Redist/ASCMediaFormatSettings3.dll" named_guids rename_namespace("MediaFormat"), exclude("tagRECT")
#import "../../Redist/ASCGraphics.dll" named_guids rename_namespace("AVSGraphics")
#import "../../Redist/ASCImageJpeg2000.dll" named_guids rename_namespace("Jpeg2000")
#import "../../Redist/ASCMediaCore3.dll" named_guids rename_namespace("MediaCore"), exclude("tagRECT") raw_interfaces_only
#import "../../Redist/ASCMediaFormatSettings3.dll" named_guids rename_namespace("MediaFormat"), exclude("tagRECT") raw_interfaces_only
#import "../../Redist/ASCGraphics.dll" named_guids rename_namespace("AVSGraphics") raw_interfaces_only
#import "../../Redist/ASCImageJpeg2000.dll" named_guids rename_namespace("Jpeg2000") raw_interfaces_only
#ifndef NO_SWF_CHECKER
#import "../../Redist/ASCSWFFile3.dll" named_guids rename_namespace("SWF")
......
......@@ -2,6 +2,6 @@
//3
//4
//0
//83
#define INTVER 3,4,0,83
#define STRVER "3,4,0,83\0"
//90
#define INTVER 3,4,0,90
#define STRVER "3,4,0,90\0"
......@@ -78,7 +78,7 @@
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
AdditionalDependencies=" Msimg32.lib"
AdditionalDependencies=" Msimg32.lib Windowscodecs.lib"
OutputFile="$(OutDir)/ASCImageStudio3.dll"
LinkIncremental="2"
AdditionalLibraryDirectories="../Common/libs/Debug"
......@@ -186,7 +186,7 @@
Name="VCLinkerTool"
RegisterOutput="true"
IgnoreImportLibrary="true"
AdditionalDependencies=" Msimg32.lib"
AdditionalDependencies=" Msimg32.lib Windowscodecs.lib"
OutputFile="$(OutDir)/ASCImageStudio3.dll"
LinkIncremental="1"
AdditionalLibraryDirectories="..\Common\libs\Release\"
......
......@@ -2,6 +2,6 @@
//3
//4
//0
//82
#define INTVER 3,4,0,82
#define STRVER "3,4,0,82\0"
//84
#define INTVER 3,4,0,84
#define STRVER "3,4,0,84\0"
......@@ -23,7 +23,8 @@ enum _ImageFileFormats
c_Swf,
c_Wbz,
c_Wbc,
c_Svm
c_Svm,
c_Wdp
};
struct _ImageFileExtension
......@@ -87,7 +88,10 @@ static _ImageFileExtension tableSupportImageFormats[] =
{_T("wbz"), c_Wbz},
{_T("wbc"), c_Wbc},
{_T("svm"), c_Svm},
{_T("mj2"), c_Jpeg2000}
{_T("mj2"), c_Jpeg2000},
{_T("wdp"), c_Wdp},
{_T("hdp"), c_Wdp},
{_T("jxr"), c_Wdp}
};
......
......@@ -37,6 +37,8 @@
#endif
#include "Wincodec.h"
namespace ImageStudio
{
......@@ -1385,6 +1387,78 @@ namespace ImageStudio
return Utils::ToFile(pSourceImage, strFilePath, nFormat, TRUE, _T("image/gif"), NULL);
}
};
#define DIB_WIDTHBYTES(bits) ((((bits) + 31)>>5)<<2)
class Wdp
{
public:
virtual BOOL FromFile(const CString& strFilePath, int& nFormat, ImageStudio::Core::Image* pResultImage)
{
IWICImagingFactory *m_pIWICFactory = NULL;
HRESULT hr = CoCreateInstance(CLSID_WICImagingFactory,NULL,CLSCTX_INPROC_SERVER,IID_PPV_ARGS(&m_pIWICFactory));
if (hr || m_pIWICFactory ==NULL) return FALSE;
IWICBitmapDecoder *pDecoder = NULL;
hr = m_pIWICFactory->CreateDecoderFromFilename(strFilePath, &CLSID_WICWmpDecoder,GENERIC_READ,WICDecodeMetadataCacheOnDemand,&pDecoder);
IWICBitmapFrameDecode *pFrame = NULL;
if (SUCCEEDED(hr && pDecoder))
{
hr = pDecoder->GetFrame(0, &pFrame);
pDecoder->Release();
}
UINT Width =0, Height =0;
IWICFormatConverter *m_pConvertedFrame = NULL;
if (pFrame)
{
m_pIWICFactory->CreateFormatConverter(&m_pConvertedFrame);
m_pConvertedFrame->Initialize(
pFrame, // Source frame to convert
GUID_WICPixelFormat32bppBGR, // The desired pixel format
WICBitmapDitherTypeNone, // The desired dither pattern
NULL, // The desired palette
0.f, // The desired alpha threshold
WICBitmapPaletteTypeCustom // Palette translation type
);
pFrame->GetSize(&Width, &Height);
pFrame->Release();
}
IMediaFrame* pMediaFrame = NULL;
if (m_pConvertedFrame)
{
BYTE* pPixels = NULL;
pMediaFrame = CreateFrame( Width, Height, CSP_BGRA | CSP_VFLIP, &pPixels);
if( pFrame &&pPixels)
{
UINT nStride = DIB_WIDTHBYTES(Width * 32);
UINT nImage = nStride * Height;
m_pConvertedFrame->CopyPixels(NULL,nStride,nImage,pPixels);
}
m_pConvertedFrame->Release();
}
m_pIWICFactory->Release();
BOOL bRetValue = pResultImage->FromMediaData( (IUnknown *)pMediaFrame, FALSE );
RELEASEINTERFACE( pMediaFrame );
return bRetValue;
}
virtual BOOL ToFile(ImageStudio::Core::Image* pSourceImage, const CString& strFilePath, int nFormat)
{
return FALSE;
}
};
class Jpeg
{
public:
......@@ -1410,8 +1484,17 @@ namespace ImageStudio
if( !pFile )
return FALSE;
BOOL bSuccess = SaveToFile( pFile, pSourceImage->GetBuffer(), pSourceImage->GetWidth(), pSourceImage->GetHeight(), pSourceImage->GetWidth() * 4, nQuality );
BYTE *pPixels = pSourceImage->GetBuffer();
BOOL bSuccess = FALSE;
if (pPixels)
{
bSuccess = SaveToFile( pFile, pSourceImage->GetBuffer(), pSourceImage->GetWidth(), pSourceImage->GetHeight(), pSourceImage->GetWidth() * 4, nQuality/*,SubSampling */);
}
else
{
bSuccess = SaveToFile( pFile, pSourceImage->GetMediaData().GetMediaData(FALSE), nQuality/*,SubSampling*/ );
}
fclose(pFile);
return bSuccess;
......@@ -7145,16 +7228,16 @@ namespace ImageStudio
int G = 128 - 100 * U - 208 * V;
int B = 128 + 516 * U;
dst[0] = IntToByte( (Y + B) >> 8 );
dst[1] = IntToByte( (Y + G) >> 8 );
dst[2] = IntToByte( (Y + R) >> 8 );
dst[0] = _IntToByte( (Y + B) >> 8 );
dst[1] = _IntToByte( (Y + G) >> 8 );
dst[2] = _IntToByte( (Y + R) >> 8 );
dst[3] = 255;
Y = (int(src[3]) - 16) * 298;
dst[4] = IntToByte( (Y + B) >> 8 );
dst[5] = IntToByte( (Y + G) >> 8 );
dst[6] = IntToByte( (Y + R) >> 8 );
dst[4] = _IntToByte( (Y + B) >> 8 );
dst[5] = _IntToByte( (Y + G) >> 8 );
dst[6] = _IntToByte( (Y + R) >> 8 );
dst[7] = 255;
//
......@@ -7166,16 +7249,16 @@ namespace ImageStudio
G = 128 - 100 * U - 208 * V;
B = 128 + 516 * U;
dst[0 + nWidth * 4] = IntToByte( (Y + B) >> 8 );
dst[1 + nWidth * 4] = IntToByte( (Y + G) >> 8 );
dst[2 + nWidth * 4] = IntToByte( (Y + R) >> 8 );
dst[0 + nWidth * 4] = _IntToByte( (Y + B) >> 8 );
dst[1 + nWidth * 4] = _IntToByte( (Y + G) >> 8 );
dst[2 + nWidth * 4] = _IntToByte( (Y + R) >> 8 );
dst[3 + nWidth * 4] = 255;
Y = (int(src[3 + offset]) - 16) * 298;
dst[4 + nWidth * 4] = IntToByte( (Y + B) >> 8 );
dst[5 + nWidth * 4] = IntToByte( (Y + G) >> 8 );
dst[6 + nWidth * 4] = IntToByte( (Y + R) >> 8 );
dst[4 + nWidth * 4] = _IntToByte( (Y + B) >> 8 );
dst[5 + nWidth * 4] = _IntToByte( (Y + G) >> 8 );
dst[6 + nWidth * 4] = _IntToByte( (Y + R) >> 8 );
dst[7 + nWidth * 4] = 255;
}
}
......@@ -7205,16 +7288,16 @@ namespace ImageStudio
int G = 128 - 100 * U - 208 * V;
int B = 128 + 516 * U;
dst[0] = IntToByte( (Y + B) >> 8 );
dst[1] = IntToByte( (Y + G) >> 8 );
dst[2] = IntToByte( (Y + R) >> 8 );
dst[0] = _IntToByte( (Y + B) >> 8 );
dst[1] = _IntToByte( (Y + G) >> 8 );
dst[2] = _IntToByte( (Y + R) >> 8 );
dst[3] = 255;
Y = (int(src[3]) - 16) * 298;
dst[4] = IntToByte( (Y + B) >> 8 );
dst[5] = IntToByte( (Y + G) >> 8 );
dst[6] = IntToByte( (Y + R) >> 8 );
dst[4] = _IntToByte( (Y + B) >> 8 );
dst[5] = _IntToByte( (Y + G) >> 8 );
dst[6] = _IntToByte( (Y + R) >> 8 );
dst[7] = 255;
}
}
......@@ -7245,30 +7328,30 @@ namespace ImageStudio
int G = 128 - 100 * U - 208 * V;
int B = 128 + 516 * U;
dst[0] = IntToByte( (Y + B) >> 8 );
dst[1] = IntToByte( (Y + G) >> 8 );
dst[2] = IntToByte( (Y + R) >> 8 );
dst[0] = _IntToByte( (Y + B) >> 8 );
dst[1] = _IntToByte( (Y + G) >> 8 );
dst[2] = _IntToByte( (Y + R) >> 8 );
dst[3] = 255;
Y = (int(pY[1]) - 16) * 298;
dst[4] = IntToByte( (Y + B) >> 8 );
dst[5] = IntToByte( (Y + G) >> 8 );
dst[6] = IntToByte( (Y + R) >> 8 );
dst[4] = _IntToByte( (Y + B) >> 8 );
dst[5] = _IntToByte( (Y + G) >> 8 );
dst[6] = _IntToByte( (Y + R) >> 8 );
dst[7] = 255;
Y = (int(pY[0 + nWidth]) - 16) * 298;
dst[0 + nWidth * 4] = IntToByte( (Y + B) >> 8 );
dst[1 + nWidth * 4] = IntToByte( (Y + G) >> 8 );
dst[2 + nWidth * 4] = IntToByte( (Y + R) >> 8 );
dst[0 + nWidth * 4] = _IntToByte( (Y + B) >> 8 );
dst[1 + nWidth * 4] = _IntToByte( (Y + G) >> 8 );
dst[2 + nWidth * 4] = _IntToByte( (Y + R) >> 8 );
dst[3 + nWidth * 4] = 255;
Y = (int(pY[1 + nWidth]) - 16) * 298;
dst[4 + nWidth * 4] = IntToByte( (Y + B) >> 8 );
dst[5 + nWidth * 4] = IntToByte( (Y + G) >> 8 );
dst[6 + nWidth * 4] = IntToByte( (Y + R) >> 8 );
dst[4 + nWidth * 4] = _IntToByte( (Y + B) >> 8 );
dst[5 + nWidth * 4] = _IntToByte( (Y + G) >> 8 );
dst[6 + nWidth * 4] = _IntToByte( (Y + R) >> 8 );
dst[7 + nWidth * 4] = 255;
}
}
......
......@@ -352,9 +352,9 @@ namespace ImageStudio
// nG = int(nG * dK + 0.5);
// nB = int(nB * dK + 0.5);
// pPixels[0] = IntToByte(nB);
// pPixels[1] = IntToByte(nG);
// pPixels[2] = IntToByte(nR);
// pPixels[0] = _IntToByte(nB);
// pPixels[1] = _IntToByte(nG);
// pPixels[2] = _IntToByte(nR);
//}
/* */
......@@ -379,9 +379,9 @@ namespace ImageStudio
nG = (nG * nK + 512) >> 10;
nB = (nB * nK + 512) >> 10;
pPixels[0] = IntToByte(nB);
pPixels[1] = IntToByte(nG);
pPixels[2] = IntToByte(nR);
pPixels[0] = _IntToByte(nB);
pPixels[1] = _IntToByte(nG);
pPixels[2] = _IntToByte(nR);
}
return ImageStudio::Transforms::Core::c_nErrorNone;
......@@ -448,9 +448,9 @@ namespace ImageStudio
// nG = int(nG * dK + 0.5);
// nB = int(nB * dK + 0.5);
// pPixels[0] = IntToByte(nB);
// pPixels[1] = IntToByte(nG);
// pPixels[2] = IntToByte(nR);
// pPixels[0] = _IntToByte(nB);
// pPixels[1] = _IntToByte(nG);
// pPixels[2] = _IntToByte(nR);
//}
/* */
......@@ -477,9 +477,9 @@ namespace ImageStudio
nG = (nG * nK + 512) >> 10;
nB = (nB * nK + 512) >> 10;
pPixels[0] = IntToByte(nB);
pPixels[1] = IntToByte(nG);
pPixels[2] = IntToByte(nR);
pPixels[0] = _IntToByte(nB);
pPixels[1] = _IntToByte(nG);
pPixels[2] = _IntToByte(nR);
}
return ImageStudio::Transforms::Core::c_nErrorNone;
......@@ -802,9 +802,9 @@ namespace ImageStudio
nG = int(nG * dFactor + dOffset);
nB = int(nB * dFactor + dOffset);
pPixels[0] = IntToByte(nB);
pPixels[1] = IntToByte(nG);
pPixels[2] = IntToByte(nR);
pPixels[0] = _IntToByte(nB);
pPixels[1] = _IntToByte(nG);
pPixels[2] = _IntToByte(nR);
}
return ImageStudio::Transforms::Core::c_nErrorNone;
......@@ -891,9 +891,9 @@ namespace ImageStudio
nG = int(nG * (nG * dFactor + dOffset));
nB = int(nB * (nB * dFactor + dOffset));
pPixels[0] = IntToByte(nB);
pPixels[1] = IntToByte(nG);
pPixels[2] = IntToByte(nR);
pPixels[0] = _IntToByte(nB);
pPixels[1] = _IntToByte(nG);
pPixels[2] = _IntToByte(nR);
}
return ImageStudio::Transforms::Core::c_nErrorNone;
......@@ -1183,7 +1183,7 @@ namespace ImageStudio
GetBValue(nColor),
GetGValue(nColor),
GetRValue(nColor),
IntToByte(alpha)
_IntToByte(alpha)
};
IppiSize oImageSize = {nWidth, nHeight};
......@@ -1867,7 +1867,7 @@ namespace ImageStudio
if (nAlpha == 0 || dCompleteness < 0.0001)
return c_nErrorNone;
double dAlpha = IntToByte( nAlpha ) / 255.0;
double dAlpha = _IntToByte( nAlpha ) / 255.0;
if (dCompleteness >= 0.999 || nWidth < 2 || nHeight < 2)
return BGRA_Fog( pBGRA, nWidth, nHeight, nColor, dAlpha );
......@@ -3220,7 +3220,7 @@ namespace ImageStudio
// Table[nIndex] = BYTE((unsigned)(nIndex * (255 + Level) + 127) * 0x8081u >> 23);
//}
Table[nIndex] = IntToByte( nIndex + Level );
Table[nIndex] = _IntToByte( nIndex + Level );
}
// apply table
......@@ -3247,9 +3247,9 @@ namespace ImageStudio
// compose table
for (int i = 0; i < 256; ++i)
{
Table[2][i] = IntToByte( i + LevelR );
Table[1][i] = IntToByte( i + LevelG );
Table[0][i] = IntToByte( i + LevelB );
Table[2][i] = _IntToByte( i + LevelR );
Table[1][i] = _IntToByte( i + LevelG );
Table[0][i] = _IntToByte( i + LevelB );
}
// apply table
......@@ -3278,7 +3278,7 @@ namespace ImageStudio
// compose table
for (int i = 0; i < 256; ++i)
{
Table[i] = IntToByte( int(127.5 + (i - 127.5)*dLevel) );
Table[i] = _IntToByte( int(127.5 + (i - 127.5)*dLevel) );
}
// apply table
......@@ -3588,9 +3588,9 @@ namespace ImageStudio
// compose table
for( int i = 0; i < 256; ++i )
{
Table[2][i] = IntToByte(i + nDeltaRed);
Table[1][i] = IntToByte(i + nDeltaGreen);
Table[0][i] = IntToByte(i + nDeltaBlue);
Table[2][i] = _IntToByte(i + nDeltaRed);
Table[1][i] = _IntToByte(i + nDeltaGreen);
Table[0][i] = _IntToByte(i + nDeltaBlue);
}
// apply table
......@@ -3606,9 +3606,9 @@ namespace ImageStudio
if( Type < 0 || Type > 3 )
return c_nErrorNone;
Blue = IntToByte( Blue );
Green = IntToByte( Green );
Red = IntToByte( Red );
Blue = _IntToByte( Blue );
Green = _IntToByte( Green );
Red = _IntToByte( Red );
// color tables
BYTE oTableB[256];
......@@ -4062,9 +4062,9 @@ namespace ImageStudio
g = int( (g - gray) * dLevel + g + 0.5 );
r = int( (r - gray) * dLevel + r + 0.5 );
src[0] = IntToByte( b );
src[1] = IntToByte( g );
src[2] = IntToByte( r );
src[0] = _IntToByte( b );
src[1] = _IntToByte( g );
src[2] = _IntToByte( r );
}
return c_nErrorNone;
......@@ -6598,9 +6598,9 @@ namespace ImageStudio
g += pBackup[1] * 31;
r += pBackup[2] * 31;
r = IntToByte( r );
g = IntToByte( g );
b = IntToByte( b );
r = _IntToByte( r );
g = _IntToByte( g );
b = _IntToByte( b );
int clr = Intensity2( r, g, b ) > level ? 255 : 0;
......@@ -6915,9 +6915,9 @@ namespace ImageStudio
dSumV *= 0.25;
// 8 YUV -> RGB
pPixel[nX * 4 + 0] = IntToByte( int(dSumY + 1.772 * dSumU) );
pPixel[nX * 4 + 1] = IntToByte( int(dSumY - 0.34414 * dSumU - 0.71414 * dSumV) );
pPixel[nX * 4 + 2] = IntToByte( int(dSumY + 1.402 * dSumV) );
pPixel[nX * 4 + 0] = _IntToByte( int(dSumY + 1.772 * dSumU) );
pPixel[nX * 4 + 1] = _IntToByte( int(dSumY - 0.34414 * dSumU - 0.71414 * dSumV) );
pPixel[nX * 4 + 2] = _IntToByte( int(dSumY + 1.402 * dSumV) );
}
}
}
......@@ -7032,7 +7032,7 @@ namespace ImageStudio
int nMaxLight = Round(dIntensity);
for( int i = 0; i < 256; i++ )
{
oTable[i] = IntToByte(i + nMaxLight);
oTable[i] = _IntToByte(i + nMaxLight);
}
dAngle *= IPP_PI180;
......@@ -7091,9 +7091,9 @@ namespace ImageStudio
g = int(g + t);
r = int(r + t);
pPixels[0] = IntToByte( b );
pPixels[1] = IntToByte( g );
pPixels[2] = IntToByte( r );
pPixels[0] = _IntToByte( b );
pPixels[1] = _IntToByte( g );
pPixels[2] = _IntToByte( r );
}
}
......@@ -7114,7 +7114,7 @@ namespace ImageStudio
for( int i = 0; i < 256; i++ )
{
oTable[i] = IntToByte(i + nMaxLight);
oTable[i] = _IntToByte(i + nMaxLight);
}
dFeather = max(0, min(100, dFeather )) / 100.0;
......@@ -7202,9 +7202,9 @@ namespace ImageStudio
int disp = Round( t );
pPixels[0] = IntToByte( pPixels[0] + disp );
pPixels[1] = IntToByte( pPixels[1] + disp );
pPixels[2] = IntToByte( pPixels[2] + disp );
pPixels[0] = _IntToByte( pPixels[0] + disp );
pPixels[1] = _IntToByte( pPixels[1] + disp );
pPixels[2] = _IntToByte( pPixels[2] + disp );
}
else
{
......@@ -7255,9 +7255,9 @@ namespace ImageStudio
int disp = Round( t );
pPixels[0] = IntToByte( pPixels[0] + disp );
pPixels[1] = IntToByte( pPixels[1] + disp );
pPixels[2] = IntToByte( pPixels[2] + disp );
pPixels[0] = _IntToByte( pPixels[0] + disp );
pPixels[1] = _IntToByte( pPixels[1] + disp );
pPixels[2] = _IntToByte( pPixels[2] + disp );
}
}
else
......@@ -7282,9 +7282,9 @@ namespace ImageStudio
int disp = Round( t );
pPixels[0] = IntToByte( pPixels[0] + disp );
pPixels[1] = IntToByte( pPixels[1] + disp );
pPixels[2] = IntToByte( pPixels[2] + disp );
pPixels[0] = _IntToByte( pPixels[0] + disp );
pPixels[1] = _IntToByte( pPixels[1] + disp );
pPixels[2] = _IntToByte( pPixels[2] + disp );
}
}
}
......@@ -10036,7 +10036,7 @@ namespace ImageStudio
GetBValue(nBackColor),
GetGValue(nBackColor),
GetRValue(nBackColor),
IntToByte(nBackAlpha),
_IntToByte(nBackAlpha),
};
nDstStride -= nWidth * 4;
......@@ -11376,9 +11376,9 @@ namespace ImageStudio
g += c * 24615;
r += c * -714;
pDst[0] = IntToByte( (b + 32768) >> 16 );
pDst[1] = IntToByte( (g + 32768) >> 16 );
pDst[2] = IntToByte( (r + 32768) >> 16 );
pDst[0] = _IntToByte( (b + 32768) >> 16 );
pDst[1] = _IntToByte( (g + 32768) >> 16 );
pDst[2] = _IntToByte( (r + 32768) >> 16 );
}
break;
......
......@@ -1191,6 +1191,11 @@ namespace ImageStudio
bLoading = IO::Utils::FromFile( sFilePath, nFormatOutput, oImage, nFrame, 0, 0, cxType );
break;
}
case c_Wdp:
{
ImageStudio::IO::Wdp oReaderWdp;
bLoading = oReaderWdp.FromFile( sFilePath, nFormatOutput, oImage);
}break;
case c_Psd:
{
ImageStudio::IO::Psd oReaderPsd;
......
This diff is collapsed.
......@@ -71,7 +71,7 @@ namespace ImageStudio
return DWORD(value + 127) * 0x8081U >> 23;
}
inline int IntToByte( int value )
inline int _IntToByte( int value )
{
if( value < 0 ) value = 0; else
if( value > 255 ) value = 255;
......@@ -89,7 +89,7 @@ namespace ImageStudio
inline int RealToByte( double value )
{
return IntToByte( RealToInt( value ) );
return _IntToByte( RealToInt( value ) );
}
int ColorBlend( int dst, int src, double alpha )
......@@ -98,7 +98,7 @@ namespace ImageStudio
}
Gdiplus::Color GetColor( int color, int alpha )
{
return Gdiplus::Color( IntToByte(alpha), GetRValue(color), GetGValue(color), GetBValue(color) );
return Gdiplus::Color( _IntToByte(alpha), GetRValue(color), GetGValue(color), GetBValue(color) );
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment