Skip to content

Commit

Permalink
xcalib-source-0.5.tar.gz
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Doehla authored and beku committed Feb 17, 2013
1 parent 32d1955 commit cefcb10
Show file tree
Hide file tree
Showing 10 changed files with 574 additions and 422 deletions.
47 changes: 34 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,54 @@
# MA 02111-1307 USA.
#

# there is a bool conflict between lcms and X that can be handled by
# undeffing it at the beginning of the code
CFLAGS = -DBOOL_CONFLICT -Os
XCALIB_VERSION = 0.5
CFLAGS = -Os
XINCLUDEDIR = /usr/X11R6/include
XLIBDIR = /usr/X11R6/lib
LCMSINCLUDEDIR = /usr/local/include
LCMSLIBDIR = /usr/local/lib

# default make target
all: lo_xcalib


# low overhead version (internal parser)
lo_xcalib: xcalib.c
$(CC) $(CFLAGS) -c xcalib.c -I./icclib -I/usr/X11R6/include
$(CC) $(CFLAGS) -L/usr/X11R6/lib -lm -o xcalib xcalib.o -lX11 -lXxf86vm -lXext
$(CC) $(CFLAGS) -c xcalib.c -I$(XINCLUDEDIR) -DXCALIB_VERSION=\"$(XCALIB_VERSION)\"
$(CC) $(CFLAGS) -L$(XLIBDIR) -lm -o xcalib xcalib.o -lX11 -lXxf86vm -lXext

win_xcalib: xcalib.c
$(CC) $(CFLAGS) -c xcalib.c -DXCALIB_VERSION=\"$(XCALIB_VERSION)\" -DWIN32GDI
windres.exe resource.rc resource.o
$(CC) $(CFLAGS) -mwindows -lm resource.o -o xcalib xcalib.o

# there is a bool conflict between lcms and X that can be handled by
# undeffing it at the beginning of the code - therefore use -DBOOL_CONFLICT
# as defined in the lcms patch
lcms_xcalib: xcalib.c
$(CC) $(CFLAGS) -DPATCHED_LCMS -c xcalib.c -I./icclib -I/usr/X11R6/include
$(CC) $(CFLAGS) -L/usr/X11R6/lib -L/usr/local/lib -lm -o xcalib xcalib.o -llcms -lX11 -lXxf86vm -lXext
$(CC) $(CFLAGS) -DPATCHED_LCMS -DBOOL_CONFLICT -c xcalib.c -I$(XINCLUDEDIR) \
-I$(LCMSINCLUDEDIR) -DXCALIB_VERSION=\"$(XCALIB_VERSION)\"
$(CC) $(CFLAGS) -L$(XLIBDIR) -L$(LCMSLIBDIR) -lm -o xcalib xcalib.o -llcms -lX11 -lXxf86vm -lXext

# icclib version
icclib_xcalib: xcalib.c
$(CC) $(CFLAGS) -DICCLIB -c xcalib.c -I./icclib -I/usr/X11R6/include
$(CC) $(CFLAGS) -DICCLIB -c xcalib.c -I./icclib -I$(XINCLUDEDIR) -DXCALIB_VERSION=\"$(XCALIB_VERSION)\"
$(MAKE) -C icclib libicc.a
$(CC) $(CFLAGS) -L/usr/X11R6/lib -lm -o xcalib xcalib.o icclib/libicc.a -lX11 -lXxf86vm -lXext
$(CC) $(CFLAGS) -L$(XLIBDIR) -lm -o xcalib xcalib.o icclib/libicc.a -lX11 -lXxf86vm -lXext

install:
cp ./xcalib $(DESTDIR)/usr/local/bin/
chmod 0644 $(DESTDIR)/usr/local/bin/xcalib

clean:
rm xcalib.o
rm xcalib
$(MAKE) -C icclib clean-lib

rm -f xcalib.o
rm -f resource.o
rm -f xcalib
rm -f xcalib.exe
$(MAKE) -C icclib clean

dist:
cd ..
tar czf xcalib-source-$(XCALIB_VERSION).tar.gz xcalib-$(XCALIB_VERSION)
cd xcalib-$(XCALIB_VERSION)/

54 changes: 45 additions & 9 deletions README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
xcalib 0.4
xcalib 0.5
====================================================
(c) 2004-2005 Stefan D�hla <stefan AT doehla DOT de>
This program is GPL-licensed postcardware! More infos at end of README.
Expand All @@ -9,6 +9,8 @@ purpose:
--------
load 'vcgt'-tag of ICC profiles to X-server like MS-Windows or MacOS
do it to calibrate your display.
Versions 0.5 and higher are also usable with Microsoft Windows. They
can be used as a free alternative to other calibration loaders.

usage:
------
Expand All @@ -20,15 +22,16 @@ usage:
-clear or -c
-noaction or -n
-verbose or -v
-printramps or -p
-help or -h
-version

last parameter MUST be an ICC profile containing vcgt-tag

use profiles gamma_1_0.icc and gamma_2_2.icc for testing. Profiles
with vcgt-tables can be created with some profile creation suites.
Examples with tables are not bundled since most profiles are copy-
righted by the profiler manufacturer.
with vcg-tables can be created with some profile creation suites.
An example profile with a vcg-table is inclued, named bluish.icc,
which simulates a very high whitepoint (without further intentions).

requirements:
-------------
Expand Down Expand Up @@ -68,10 +71,26 @@ install:
distribution, then don't forget to make the patched library
active (e.g. by deinstalling the unpatched one or setting
LD_LIBRARY_PATH ...)
I decided to use internal lcms gamma calculation and smoothing to
allow extrapolation for big video LUTs. This leads to slightly
different values compared to the other exact methods. The error
is not dramatic, but check this on your own if you really want to
use it and fear the introduced error.
- the included but limited one can read vcgt tags only and is meant
for low overhead or standalone versions of xcalib
It is in a very early stage and needs further testing!
for low overhead or standalone versions of xcalib. It was tested
on little-endian systems only. Please contact me if you encounter
any problems.

The Win32 version was made with and tested for MinGW. Since most
users do not have a running MinGW environment, a binary executable is
provided. To compile it on yout own, the following command creates a
working Win32-build (tested with MSys):

$ make win_xcalib

Win32 was only tested with the internal parser - lcms and icclib
support are not planned.

motivation:
-----------
ICC profiles created and used with MS-Windows can now also be used
Expand Down Expand Up @@ -113,7 +132,7 @@ motivation:
creation by having a linear (or linear with respect to a fixed gamma
value) display device.

Linux was missing a tool like 'AdobeGamma' or 'Logo Calibration
Linux was missing a tool like 'AdobeGammaLoader' or 'Logo Calibration
Loader' which applied the vcgt-tag to the video-LUT (a matrix which
assigns one color value to another). Under Linux we can not set the
video-LUT itself but a X-server gamma ramp (which does practically
Expand Down Expand Up @@ -154,6 +173,23 @@ limitations:

history:
--------
0.5: 2005-03-03
- Win32 version added (compilable with MinGW)
+ support for command line options as usual
+ support for loading the default display profile
- fixed bug with 8bit vcg-tables in internal and icclib version
this applied to Pantone ColorVision Spyder profiles only
thanks to John Ackerman who found this really grave bug
- fixed bug in lcms patch regarding gamma table endpoints
use a unpatched version of lcms for patching
- introduced macro for little-endian parsing in internal parser
- got rid of some compiler warnings because of multi-byte
constants
- introduced variables in Makefile so that the user can set
locations for X11 and patched lcms libs and headers
- beautified code for better readability
- added sample profile which contains a vcg-table

0.4: 2005-01-30
- own implementation for parsing the vcgt tags added.
- switch to lcms-1.13 (patched) instead of icclib
Expand Down Expand Up @@ -184,7 +220,7 @@ todo:
-----
[ ] gamma limits of vcgt-spec need to be implemented
[ ] further code review for memory leaks
[ ] use platform independent types for better portability
[x] use platform independent types for better portability
[X] use lcms instead of icclib: worse vcgt-parsing but functions
for gamma ramp building and smoothing

Expand Down Expand Up @@ -237,6 +273,6 @@ license:
GERMANY

Please write on it your name and email-address and that you use
xcalib-0.4 .
xcalib-0.5 .

EOF
21 changes: 21 additions & 0 deletions README.profilers
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
This document tries to compare the calibration data embedded in
ICC profiles created with different display profilers.

Pantone Colorvision Spyder:
---------------------------
vcgt, table with 256 * 8bit entries

BasiCColor display:
-------------------
vcgt, table with 256 * 16bit entries

Gretag ProfileMaker 4.1:
------------------------
vcgt, table with 256 * 16bit entries

lprof, Marti's little profiler (unmaintained):
----------------------------------------------
no calibration

(c) 2005 - Stefan Doehla
EOF
Binary file added bluish.icc
Binary file not shown.
19 changes: 9 additions & 10 deletions icclib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,17 @@ clean: clean-lib clean-progs


clean-lib:
rm libicc.a
rm icc.o
echo "icclib cleaned up"
rm -f libicc.a
rm -f icc.o

clean-progs:
rm fbtest
rm iccdump
rm icclu
rm iccrw
rm icctest
rm lutest
rm *.o
rm -f fbtest
rm -f iccdump
rm -f icclu
rm -f iccrw
rm -f icctest
rm -f lutest
rm -f *.o



Expand Down
Binary file removed icclib/xxxx.icm
Binary file not shown.
Binary file added icon.ico
Binary file not shown.
16 changes: 11 additions & 5 deletions lcms1.13_patch → lcms1.13_patch_b
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ diff -r -U3 lcms-1.13/NEWS lcms-1.13_vcgt/NEWS
===============
diff -r -U3 lcms-1.13/src/cmsio1.c lcms-1.13_vcgt/src/cmsio1.c
--- lcms-1.13/src/cmsio1.c 2004-05-19 11:09:56.000000000 +0200
+++ lcms-1.13_vcgt/src/cmsio1.c 2005-01-04 23:17:09.000000000 +0100
+++ lcms-1.13_vcgt/src/cmsio1.c 2005-02-26 19:34:00.000000000 +0100
@@ -46,6 +46,12 @@
BOOL LCMSEXPORT cmsTakeMediaBlackPoint(LPcmsCIEXYZ Dest, cmsHPROFILE hProfile);
BOOL LCMSEXPORT cmsTakeIluminant(LPcmsCIEXYZ Dest, cmsHPROFILE hProfile);
Expand All @@ -72,7 +72,7 @@ diff -r -U3 lcms-1.13/src/cmsio1.c lcms-1.13_vcgt/src/cmsio1.c
BOOL LCMSEXPORT cmsIsTag(cmsHPROFILE hProfile, icTagSignature sig);

const char* LCMSEXPORT cmsTakeManufacturer(cmsHPROFILE hProfile);
@@ -1892,6 +1898,124 @@
@@ -1892,6 +1898,130 @@

}

Expand Down Expand Up @@ -171,20 +171,26 @@ diff -r -U3 lcms-1.13/src/cmsio1.c lcms-1.13_vcgt/src/cmsio1.c
+ vcgB = cmsAllocGamma(entryCount);
+ for(i=0; i<entryCount; i++) {
+ Icc -> Read(&(vcgR->GammaTable[i]), entrySize, 1, Icc -> stream);
+ if(entrySize == 1)
+ vcgR->GammaTable[i] *= 0xff;
+ }
+ for(i=0; i<entryCount; i++) {
+ Icc -> Read(&(vcgG->GammaTable[i]), entrySize, 1, Icc -> stream);
+ if(entrySize == 1)
+ vcgG->GammaTable[i] *= 0xff;
+ }
+ for(i=0; i<entryCount; i++) {
+ Icc -> Read(&(vcgB->GammaTable[i]), entrySize, 1, Icc -> stream);
+ if(entrySize == 1)
+ vcgB->GammaTable[i] *= 0xff;
+ }
+ AdjustEndianessArray16(vcgR->GammaTable, entryCount);
+ AdjustEndianessArray16(vcgG->GammaTable, entryCount);
+ AdjustEndianessArray16(vcgB->GammaTable, entryCount);
+
+ rGammaTable = cmsJoinGammaEx(linearGamma, vcgR, nEntries);
+ gGammaTable = cmsJoinGammaEx(linearGamma, vcgG, nEntries);
+ bGammaTable = cmsJoinGammaEx(linearGamma, vcgB, nEntries);
+ rGammaTable = cmsJoinGammaEx(vcgR, linearGamma, nEntries);
+ gGammaTable = cmsJoinGammaEx(vcgG, linearGamma, nEntries);
+ bGammaTable = cmsJoinGammaEx(vcgB, linearGamma, nEntries);
+ break;
+ }
+ *rVideoCardGamma=rGammaTable;
Expand Down
31 changes: 31 additions & 0 deletions resource.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
LANGUAGE 0, 0
100 ICON icon.ico

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,5,0,0
PRODUCTVERSION 0,5,0,0
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "Comments", "xcalib calibration loader\0"
VALUE "FileDescription", "xcalib\0"
VALUE "LegalCopyright", "Copyright (c) 2004-2005 Stefan Doehla\0"
VALUE "OriginalFilename", "xcalib.exe\0"
VALUE "ProductVersion", "0,5\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 0x04B0
END
END
Loading

0 comments on commit cefcb10

Please sign in to comment.