Commit 57153b48 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@55195 954022d7-b5bf-4e40-9824-e11837661b57
parent b5ff5120
...@@ -7,7 +7,11 @@ ...@@ -7,7 +7,11 @@
#define CXIMAGE_SUPPORT_SELECTION 1 #define CXIMAGE_SUPPORT_SELECTION 1
#define CXIMAGE_SUPPORT_TRANSFORMATION 1 #define CXIMAGE_SUPPORT_TRANSFORMATION 1
#define CXIMAGE_SUPPORT_DSP 1 #define CXIMAGE_SUPPORT_DSP 1
#ifdef WIN32
#define CXIMAGE_SUPPORT_LAYERS 1 #define CXIMAGE_SUPPORT_LAYERS 1
else
#define CXIMAGE_SUPPORT_LAYERS 0
#endif
#define CXIMAGE_SUPPORT_INTERPOLATION 1 #define CXIMAGE_SUPPORT_INTERPOLATION 1
#define CXIMAGE_SUPPORT_DECODE 1 #define CXIMAGE_SUPPORT_DECODE 1
......
...@@ -1234,9 +1234,9 @@ void CxImage::Mix(CxImage & imgsrc2, ImageOpType op, int32_t lXOffset, int32_t l ...@@ -1234,9 +1234,9 @@ void CxImage::Mix(CxImage & imgsrc2, ImageOpType op, int32_t lXOffset, int32_t l
// New transparency assume (a0 == 0 is the restriction s.o. (range 5-250) intercepted) // New transparency assume (a0 == 0 is the restriction s.o. (range 5-250) intercepted)
if (bEditAlpha) rgbDest.rgbReserved = a0; if (bEditAlpha) rgbDest.rgbReserved = a0;
// each color channel to calculate // each color channel to calculate
rgbDest.rgbBlue = (BYTE)((rgb2.rgbBlue * a2 + a1 * rgb1.rgbBlue )/a0); rgbDest.rgbBlue = (unsigned char)((rgb2.rgbBlue * a2 + a1 * rgb1.rgbBlue )/a0);
rgbDest.rgbGreen = (BYTE)((rgb2.rgbGreen * a2 + a1 * rgb1.rgbGreen)/a0); rgbDest.rgbGreen = (unsigned char)((rgb2.rgbGreen * a2 + a1 * rgb1.rgbGreen)/a0);
rgbDest.rgbRed = (BYTE)((rgb2.rgbRed * a2 + a1 * rgb1.rgbRed )/a0); rgbDest.rgbRed = (unsigned char)((rgb2.rgbRed * a2 + a1 * rgb1.rgbRed )/a0);
} }
} else { } else {
rgbDest = rgb1; rgbDest = rgb1;
...@@ -3579,6 +3579,12 @@ bool CxImage::Trace(RGBQUAD color_target, RGBQUAD color_trace) ...@@ -3579,6 +3579,12 @@ bool CxImage::Trace(RGBQUAD color_target, RGBQUAD color_trace)
#ifndef __MINGW32__ #ifndef __MINGW32__
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#include <queue> #include <queue>
#ifndef min
#define min(a,b) (((a)<(b))?(a):(b))
#endif
#ifndef max
#define max(a,b) (((a)>(b))?(a):(b))
#endif
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/** /**
* Flood Fill * Flood Fill
......
...@@ -153,12 +153,14 @@ CxImageMNG::CxImageMNG(): CxImage(CXIMAGE_FORMAT_MNG) ...@@ -153,12 +153,14 @@ CxImageMNG::CxImageMNG(): CxImage(CXIMAGE_FORMAT_MNG)
CxImageMNG::~CxImageMNG() CxImageMNG::~CxImageMNG()
{ {
// cleanup and return // cleanup and return
#ifdef WIN32
if (mnginfo.thread){ //close the animation thread if (mnginfo.thread){ //close the animation thread
mnginfo.animation_enabled=0; mnginfo.animation_enabled=0;
ResumeThread(mnginfo.thread); ResumeThread(mnginfo.thread);
WaitForSingleObject(mnginfo.thread,500); WaitForSingleObject(mnginfo.thread,500);
CloseHandle(mnginfo.thread); CloseHandle(mnginfo.thread);
} }
#endif
// free objects // free objects
if (mnginfo.image) free(mnginfo.image); if (mnginfo.image) free(mnginfo.image);
if (mnginfo.alpha) free(mnginfo.alpha); if (mnginfo.alpha) free(mnginfo.alpha);
...@@ -384,8 +386,8 @@ void CxImageMNG::WritePNG( mng_handle hMNG, int32_t Frame, int32_t FrameCount ) ...@@ -384,8 +386,8 @@ void CxImageMNG::WritePNG( mng_handle hMNG, int32_t Frame, int32_t FrameCount )
uint32_t dstbufferSize=(mymng->effwdt+1)*OffsetH; uint32_t dstbufferSize=(mymng->effwdt+1)*OffsetH;
// Compress data: // Compress data:
if(Z_OK != compress2((Bytef *)dstbuffer,(ULONG *)&dstbufferSize,(const Bytef*)tmpbuffer, if(Z_OK != compress2((Bytef *)dstbuffer,(uLongf *)&dstbufferSize,(const Bytef*)tmpbuffer,
(ULONG) (mymng->effwdt+1)*OffsetH,9 )) return; (uLong) (mymng->effwdt+1)*OffsetH,9 )) return;
// Write Data into MNG File: // Write Data into MNG File:
mng_putchunk_idat( hMNG, dstbufferSize, (mng_ptr*)dstbuffer); mng_putchunk_idat( hMNG, dstbufferSize, (mng_ptr*)dstbuffer);
......
...@@ -367,7 +367,7 @@ bool CxImagePNG::Encode(CxFile *hFile) ...@@ -367,7 +367,7 @@ bool CxImagePNG::Encode(CxFile *hFile)
info_ptr->valid = 0; info_ptr->valid = 0;
// set interlace type // set interlace type
DWORD codec_opt = GetCodecOption(CXIMAGE_FORMAT_PNG); uint32_t codec_opt = GetCodecOption(CXIMAGE_FORMAT_PNG);
if (codec_opt & CxImagePNG::ENCODE_INTERLACE) if (codec_opt & CxImagePNG::ENCODE_INTERLACE)
info_ptr->interlace_type = PNG_INTERLACE_ADAM7; info_ptr->interlace_type = PNG_INTERLACE_ADAM7;
else else
......
...@@ -269,7 +269,7 @@ bool CxImageRAW::GetExifThumbnail(const TCHAR *filename, const TCHAR *outname, i ...@@ -269,7 +269,7 @@ bool CxImageRAW::GetExifThumbnail(const TCHAR *filename, const TCHAR *outname, i
// THUMB. // THUMB.
if (dcr.thumb_offset != 0) if (dcr.thumb_offset != 0)
{ {
FILE* file = _tfopen(outname, _T("wb")); FILE* file = fopen(outname, _T("wb"));
DCRAW* p = &dcr; DCRAW* p = &dcr;
dcr_fseek(dcr.obj_, dcr.thumb_offset, SEEK_SET); dcr_fseek(dcr.obj_, dcr.thumb_offset, SEEK_SET);
dcr.write_thumb(&dcr, file); dcr.write_thumb(&dcr, file);
......
...@@ -20,12 +20,14 @@ public: ...@@ -20,12 +20,14 @@ public:
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
bool Open(const TCHAR * filename, const TCHAR * mode) bool Open(const TCHAR * filename, const TCHAR * mode)
{ {
#ifdef WIN32
if (m_fp) return false; // Can't re-open without closing first if (m_fp) return false; // Can't re-open without closing first
m_fp = _tfopen(filename, mode); m_fp = _tfopen(filename, mode);
if (!m_fp) return false; if (!m_fp) return false;
m_bCloseFile = true; m_bCloseFile = true;
#endif
return true; return true;
} }
......
...@@ -81,12 +81,13 @@ ...@@ -81,12 +81,13 @@
#include <ctype.h> #include <ctype.h>
#if defined(HAVE_UNISTD_H) #if defined(HAVE_UNISTD_H)
#include <unistd.h> #include <unistd.h>
#define _lseek lseek
#endif #endif
#if defined(WIN32) || defined(HAVE_IO_H) || defined(_WIN32_WCE) #if defined(WIN32) || defined(HAVE_IO_H) || defined(_WIN32_WCE)
#include <io.h> #include <io.h>
#endif #endif
#include "jasper/jas_config.h" #include "jasper/jas_config.h"
#include "jasper/jas_types.h" #include "jasper/jas_types.h"
#include "jasper/jas_stream.h" #include "jasper/jas_stream.h"
#include "jasper/jas_malloc.h" #include "jasper/jas_malloc.h"
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "psd_config.h" #include "psd_config.h"
#ifdef PSD_INCLUDE_ZLIB #ifdef PSD_INCLUDE_ZLIB
#include "..\zlib\zlib.h" #include "../zlib/zlib.h"
#include <memory.h> #include <memory.h>
psd_status psd_unzip_without_prediction(psd_uchar *src_buf, psd_int src_len, psd_status psd_unzip_without_prediction(psd_uchar *src_buf, psd_int src_len,
......
...@@ -132,6 +132,9 @@ static dcr_stream_ops dcr_stream_fileops = { ...@@ -132,6 +132,9 @@ static dcr_stream_ops dcr_stream_fileops = {
#error Do not link it with ljpeg_decode. #error Do not link it with ljpeg_decode.
#endif #endif
#ifndef max
#define max(A,B) (((A)>(B))?(A):(B))
#endif
/* /*
In order to inline this calculation, I make the risky In order to inline this calculation, I make the risky
...@@ -7429,7 +7432,7 @@ konica_400z: ...@@ -7429,7 +7432,7 @@ konica_400z:
} }
} else if (!strcmp(p->make,"LEICA") || !strcmp(p->make,"Panasonic")) { } else if (!strcmp(p->make,"LEICA") || !strcmp(p->make,"Panasonic")) {
p->maximum = 0xfff0; p->maximum = 0xfff0;
if ((fsize-p->data_offset) / (max(1,p->width*8/7)) == p->height) if ((fsize-p->data_offset) / max(1, p->width*8/7) == p->height)
p->load_raw = &DCR_CLASS dcr_panasonic_load_raw; p->load_raw = &DCR_CLASS dcr_panasonic_load_raw;
if (!p->load_raw) p->load_raw = &DCR_CLASS dcr_unpacked_load_raw; if (!p->load_raw) p->load_raw = &DCR_CLASS dcr_unpacked_load_raw;
switch (p->width) { switch (p->width) {
...@@ -7988,7 +7991,7 @@ void DCR_CLASS dcr_convert_to_rgb(DCRAW* p) ...@@ -7988,7 +7991,7 @@ void DCR_CLASS dcr_convert_to_rgb(DCRAW* p)
strcpy ((char *)p->oprof+pbody[5]+12, name[p->opt.output_color-1]); strcpy ((char *)p->oprof+pbody[5]+12, name[p->opt.output_color-1]);
for (i=0; i < 3; i++) for (i=0; i < 3; i++)
for (j=0; j < p->colors; j++) for (j=0; j < p->colors; j++)
for (out_cam[i][j] = (float)k=0; k < 3; k++) for (out_cam[i][j] = 0, k=0; k < 3; k++)
out_cam[i][j] += (float)out_rgb[p->opt.output_color-1][i][k] * p->rgb_cam[k][j]; out_cam[i][j] += (float)out_rgb[p->opt.output_color-1][i][k] * p->rgb_cam[k][j];
} }
if (p->opt.verbose) if (p->opt.verbose)
......
...@@ -18,7 +18,9 @@ ...@@ -18,7 +18,9 @@
#define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <io.h> header file. */ /* Define to 1 if you have the <io.h> header file. */
#ifndef _LINUX
#define HAVE_IO_H 1 #define HAVE_IO_H 1
#endif
/* Define to 1 if you have the <search.h> header file. */ /* Define to 1 if you have the <search.h> header file. */
#define HAVE_SEARCH_H 1 #define HAVE_SEARCH_H 1
...@@ -32,11 +34,24 @@ ...@@ -32,11 +34,24 @@
/* The size of a `long', as computed by sizeof. */ /* The size of a `long', as computed by sizeof. */
#define SIZEOF_LONG 4 #define SIZEOF_LONG 4
#ifndef _LINUX
/* Signed 64-bit type */ /* Signed 64-bit type */
#define TIFF_INT64_T signed __int64 #define TIFF_INT64_T signed __int64
/* Unsigned 64-bit type */ /* Unsigned 64-bit type */
#define TIFF_UINT64_T unsigned __int64 #define TIFF_UINT64_T unsigned __int64
#endif
#ifdef _LINUX
#include <inttypes.h>
/* Signed 64-bit type */
#define TIFF_INT64_T int64_t
/* Unsigned 64-bit type */
#define TIFF_UINT64_T uint64_t
#endif
/* Set the native cpu bit order */ /* Set the native cpu bit order */
#define HOST_FILLORDER FILLORDER_LSB2MSB #define HOST_FILLORDER FILLORDER_LSB2MSB
...@@ -53,7 +68,9 @@ ...@@ -53,7 +68,9 @@
# endif # endif
#endif #endif
#ifndef _LINUX
#define lfind _lfind #define lfind _lfind
#endif
/* /*
* Local Variables: * Local Variables:
* mode: c * mode: c
......
...@@ -84,8 +84,8 @@ int TIFFFillTile(TIFF*, ttile_t); ...@@ -84,8 +84,8 @@ int TIFFFillTile(TIFF*, ttile_t);
# define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ # define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
#endif #endif
#include "..\jpeg\jpeglib.h" #include "../jpeg/jpeglib.h"
#include "..\jpeg\jerror.h" #include "../jpeg/jerror.h"
/* /*
* We are using width_in_blocks which is supposed to be private to * We are using width_in_blocks which is supposed to be private to
......
...@@ -189,8 +189,8 @@ static const TIFFFieldInfo ojpeg_field_info[] = { ...@@ -189,8 +189,8 @@ static const TIFFFieldInfo ojpeg_field_info[] = {
#include <setjmp.h> #include <setjmp.h>
#endif #endif
#include "..\jpeg\jpeglib.h" #include "../jpeg/jpeglib.h"
#include "..\jpeg\jerror.h" #include "../jpeg/jerror.h"
typedef struct jpeg_error_mgr jpeg_error_mgr; typedef struct jpeg_error_mgr jpeg_error_mgr;
typedef struct jpeg_common_struct jpeg_common_struct; typedef struct jpeg_common_struct jpeg_common_struct;
......
...@@ -25,14 +25,26 @@ ...@@ -25,14 +25,26 @@
/* Signed 64-bit type formatter */ /* Signed 64-bit type formatter */
#define TIFF_INT64_FORMAT "%I64d" #define TIFF_INT64_FORMAT "%I64d"
#ifndef _LINUX
/* Signed 64-bit type */ /* Signed 64-bit type */
#define TIFF_INT64_T signed __int64 #define TIFF_INT64_T signed __int64
/* Unsigned 64-bit type formatter */
#define TIFF_UINT64_FORMAT "%I64u"
/* Unsigned 64-bit type */ /* Unsigned 64-bit type */
#define TIFF_UINT64_T unsigned __int64 #define TIFF_UINT64_T unsigned __int64
#endif
#ifdef _LINUX
#include <inttypes.h>
/* Signed 64-bit type */
#define TIFF_INT64_T int64_t
/* Unsigned 64-bit type */
#define TIFF_UINT64_T uint64_t
#endif
/* Unsigned 64-bit type formatter */
#define TIFF_UINT64_FORMAT "%I64u"
/* Compatibility stuff. */ /* Compatibility stuff. */
...@@ -52,7 +64,7 @@ ...@@ -52,7 +64,7 @@
/* Support JPEG compression (requires IJG JPEG library) */ /* Support JPEG compression (requires IJG JPEG library) */
/* #undef JPEG_SUPPORT */ /* #undef JPEG_SUPPORT */
#define JPEG_SUPPORT 1 #define JPEG_SUPPORT 1
/* Support LogLuv high dynamic range encoding */ /* Support LogLuv high dynamic range encoding */
#define LOGLUV_SUPPORT 1 #define LOGLUV_SUPPORT 1
...@@ -66,7 +78,7 @@ ...@@ -66,7 +78,7 @@
/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation /* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation
fails with unpatched IJG JPEG library) */ fails with unpatched IJG JPEG library) */
/* #undef OJPEG_SUPPORT */ /* #undef OJPEG_SUPPORT */
#define OJPEG_SUPPORT 1 #define OJPEG_SUPPORT 1
/* Support Macintosh PackBits algorithm */ /* Support Macintosh PackBits algorithm */
#define PACKBITS_SUPPORT 1 #define PACKBITS_SUPPORT 1
...@@ -79,7 +91,7 @@ ...@@ -79,7 +91,7 @@
/* Support Deflate compression */ /* Support Deflate compression */
/* #undef ZIP_SUPPORT */ /* #undef ZIP_SUPPORT */
#define ZIP_SUPPORT 1 #define ZIP_SUPPORT 1
/* Support strip chopping (whether or not to convert single-strip uncompressed /* Support strip chopping (whether or not to convert single-strip uncompressed
images to mutiple strips of ~8Kb to reduce memory usage) */ images to mutiple strips of ~8Kb to reduce memory usage) */
......
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