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