Skip to content

Commit 11278f1

Browse files
committed
CxImage Linux port
1 parent a7d1f14 commit 11278f1

File tree

6 files changed

+59
-7
lines changed

6 files changed

+59
-7
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
cmake_minimum_required(VERSION 2.8.0)
2+
project(cximage)
3+
4+
set(SOURCES
5+
ximacfg.cpp
6+
ximaenc.cpp
7+
ximaexif.cpp
8+
ximage.cpp
9+
ximainfo.cpp
10+
ximaint.cpp
11+
ximajpg.cpp
12+
ximalpha.cpp
13+
ximalyr.cpp
14+
ximapal.cpp
15+
ximasel.cpp
16+
ximath.cpp
17+
xmemfile.cpp
18+
)
19+
20+
set(HEADERS
21+
xfile.h
22+
ximacfg.h
23+
ximadef.h
24+
ximage.h
25+
ximaiter.h
26+
ximajpg.h
27+
ximath.h
28+
xiofile.h
29+
xmemfile.h
30+
)
31+
32+
add_definitions(-DCXIMAGE_BUILD)
33+
34+
include_directories("." ${CMAKE_SOURCE_DIR})
35+
36+
add_library(cximage STATIC ${SOURCES} ${HEADERS})
37+
38+
set_target_properties(cximage PROPERTIES PREFIX "")
39+
target_link_libraries(cximage)

src/Externals/cximage/ximacfg.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#if !defined(__ximaCFG_h)
22
#define __ximaCFG_h
3+
#if !defined(WIN32)
4+
#include <cstddef>
5+
#endif
36

47
extern "C" void* cxalloc(size_t size);
58
extern "C" void cxfree(void* ptr);

src/Externals/cximage/ximadef.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,16 @@ typedef unsigned char BYTE;
9898
typedef unsigned short WORD;
9999
typedef unsigned long DWORD;
100100
typedef unsigned int UINT;
101+
typedef const char* LPCTSTR;
101102

102103
typedef DWORD COLORREF;
103104
typedef unsigned int HANDLE;
104105
typedef void* HRGN;
106+
typedef void* HDC;
107+
108+
typedef int boolean;
109+
110+
#define _tfopen fopen
105111

106112
#ifndef BOOL
107113
#define BOOL bool

src/Externals/cximage/ximainfo.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
#include "ximage.h"
77

8+
#if !defined(WIN32)
9+
#define _tcsnicmp(a,b,c) strcasecmp(a,b)
10+
#endif
11+
812
////////////////////////////////////////////////////////////////////////////////
913
/**
1014
* \return the color used for transparency, and/or for background color
@@ -538,7 +542,7 @@ void CxImage::SetOffset(long x,long y)
538542
////////////////////////////////////////////////////////////////////////////////
539543
/**
540544
* \sa SetJpegQuality, GetJpegQualityF
541-
* \author [DP]; changes [Stefan Schürmans]
545+
* \author [DP]; changes [Stefan Sch�rmans]
542546
*/
543547
BYTE CxImage::GetJpegQuality() const
544548
{
@@ -547,7 +551,7 @@ BYTE CxImage::GetJpegQuality() const
547551
////////////////////////////////////////////////////////////////////////////////
548552
/**
549553
* \sa SetJpegQuality, GetJpegQuality
550-
* \author [Stefan Schürmans]
554+
* \author [Stefan Sch�rmans]
551555
*/
552556
float CxImage::GetJpegQualityF() const
553557
{
@@ -557,7 +561,7 @@ float CxImage::GetJpegQualityF() const
557561
/**
558562
* quality level for JPEG and JPEG2000
559563
* \param q: can be from 0 to 100
560-
* \author [DP]; changes [Stefan Schürmans]
564+
* \author [DP]; changes [Stefan Sch�rmans]
561565
*/
562566
void CxImage::SetJpegQuality(BYTE q){
563567
info.fQuality = (float)q;
@@ -567,7 +571,7 @@ void CxImage::SetJpegQuality(BYTE q){
567571
* quality level for JPEG and JPEG2000
568572
* necessary for JPEG2000 when quality is between 0.0 and 1.0
569573
* \param q: can be from 0.0 to 100.0
570-
* \author [Stefan Schürmans]
574+
* \author [Stefan Sch�rmans]
571575
*/
572576
void CxImage::SetJpegQualityF(float q){
573577
if (q>0) info.fQuality = q;

src/Externals/cximage/ximajpg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#define XMD_H
1313
#define HAVE_BOOLEAN
14-
#include <jpeg/jmorecfg.h>
14+
#include <jmorecfg.h>
1515
#undef HAVE_BOOLEAN
1616
#undef XMD_H
1717

src/Externals/cximage/ximajpg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
#define XMD_H
3232
#define HAVE_BOOLEAN
3333
extern "C" {
34-
#include <jpeg/jpeglib.h>
35-
#include <jpeg/jerror.h>
34+
#include <jpeglib.h>
35+
#include <jerror.h>
3636
}
3737
#undef HAVE_BOOLEAN
3838
#undef XMD_H

0 commit comments

Comments
 (0)