Skip to content

Commit

Permalink
xcalib-source-0.6.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 cefcb10 commit 9294494
Show file tree
Hide file tree
Showing 10 changed files with 367 additions and 49 deletions.
Binary file added AdobeGammaTest.icm
Binary file not shown.
34 changes: 31 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Makefile for xcalib
#
# (c) 2004 Stefan Doehla <stefan AT doehla DOT de>
# (c) 2004-2005 Stefan Doehla <stefan AT doehla DOT de>
#
# This program is GPL-ed postcardware! please see README
#
Expand All @@ -20,12 +20,36 @@
# MA 02111-1307 USA.
#

XCALIB_VERSION = 0.5
#
# the following targets are defined:
# - lo_xcalib
# xcalib in its standard version (internal parser)
# - icclib_xcalib
# xcalib using Graeme Gill's icclib
# - lcms_xcalib
# xcalib using a patched version of Marti Maria's LCMS
# - win_xcalib
# version for MS-Windows systems with MinGW (internal parser)
# - fglrx_xcalib
# version for ATI's proprietary fglrx driver (internal parser)
#
# - clean
# delete all objects and binaries
# - dist
# create .tar.gz archive
#
# if it doesn't compile right-out-of-the-box, it may be sufficient
# to change the following variables

XCALIB_VERSION = 0.6
CFLAGS = -Os
XINCLUDEDIR = /usr/X11R6/include
XLIBDIR = /usr/X11R6/lib
LCMSINCLUDEDIR = /usr/local/include
LCMSLIBDIR = /usr/local/lib
# for ATI's proprietary driver (must contain the header file fglrx_gamma.h)
FGLRXINCLUDEDIR = ./fglrx
FGLRXLIBDIR = ./fglrx

# default make target
all: lo_xcalib
Expand All @@ -36,6 +60,10 @@ lo_xcalib: xcalib.c
$(CC) $(CFLAGS) -c xcalib.c -I$(XINCLUDEDIR) -DXCALIB_VERSION=\"$(XCALIB_VERSION)\"
$(CC) $(CFLAGS) -L$(XLIBDIR) -lm -o xcalib xcalib.o -lX11 -lXxf86vm -lXext

fglrx_xcalib: xcalib.c
$(CC) $(CFLAGS) -c xcalib.c -I$(XINCLUDEDIR) -DXCALIB_VERSION=\"$(XCALIB_VERSION)\" -I$(FGLRXINCLUDEDIR) -DFGLRX
$(CC) $(CFLAGS) -L$(XLIBDIR) -L$(FGLRXLIBDIR) -lm -o xcalib xcalib.o -lX11 -lXxf86vm -lXext -lfglrx_gamma

win_xcalib: xcalib.c
$(CC) $(CFLAGS) -c xcalib.c -DXCALIB_VERSION=\"$(XCALIB_VERSION)\" -DWIN32GDI
windres.exe resource.rc resource.o
Expand Down Expand Up @@ -68,6 +96,6 @@ clean:

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

65 changes: 58 additions & 7 deletions README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
xcalib 0.5
Xcalib 0.6
====================================================
(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 @@ -23,13 +23,14 @@ usage:
-noaction or -n
-verbose or -v
-printramps or -p
-loss or -l
-help or -h
-version

last parameter MUST be an ICC profile containing vcgt-tag
last parameter MUST be an ICC profile containing a vcgt or mLUT tag.

use profiles gamma_1_0.icc and gamma_2_2.icc for testing. Profiles
with vcg-tables can be created with some profile creation suites.
with vcg-tables can be created with most profile creation suites.
An example profile with a vcg-table is inclued, named bluish.icc,
which simulates a very high whitepoint (without further intentions).

Expand All @@ -40,6 +41,12 @@ requirements:
is available. Other X-servers like OpenWin do not contain XVidMode
stuff - so please don't ask me for support if XVidMode isn't
supported.

Since version 0.5, Win32-support was added. The program will work
with most video cards, that have correctly implemented drivers.

As of version 0.6, a special treatment for the close-source ATI FGLRX
X11 driver was added. XVidMode is still required.

You need a profile which contains the 'vcgt' tag to achieve
monitor calibration. You can create it with some commercial
Expand All @@ -57,6 +64,9 @@ install:
$ make lcms_xcalib
$ make lo_xcalib

$ make win_xcalib
$ make fglrx_xcalib

The make targets correspond to the possible ICC reader
implementations:
- Graeme Gill's "icclib"
Expand All @@ -83,13 +93,21 @@ install:

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
provided. To compile it on your 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.

For ATI's proprietary FGLRX driver for X11, a special version can be
built. Issue the command

$ make fglrx_xcalib

on the commandline. For now, only the internal parser can be used
in combination with this server backend.

motivation:
-----------
Expand Down Expand Up @@ -124,6 +142,7 @@ motivation:
live with it since it's common. They use a tag called Video Card
Gamma Tag (or vcgt) in ICC-profiles that contains calibration values.
The calibration is applied before profile creation, where the vcgt

will be saved in your profile for convenience reasons: All color
settings for the display device are stored in a common file.

Expand Down Expand Up @@ -160,6 +179,7 @@ limitations:

Known not-working drivers:
- vesa (generic driver without any calibration knobs)
- fglrx (but you can build fglrx_xcalib)

If you see both/only one/no display changing it's behaviour, test if
it's a bug of xcalib by cross-checking with the 'xgamma' tool that
Expand All @@ -169,10 +189,36 @@ limitations:
vcgt. The vcgt contains 2.2 in all cases, whereas the real LUT-values
that are downloaded to the X-server are located somewhere else in the
system - but nobody know's where. Please tell me where they are - if
you find them.
you find them. A newer version of AdobeGamma (from 2003) writes a
vcgt tag with useful data. Nevertheless, the size field is wrong. As
of version 0.6, basic concealment for wrong AdobeGamma profiles
(created with the 2003 version) was added to the internal parser.

On Win32-systems, some drivers are not correctly implemented. E.g.
the NVidia Riva driver for Windows2000 and WindowsXP wrote nonsense
values to the video cards RAMDAC (resulting in a gray display). I
used for these cards an old NT-driver from a video card vendor.

The source code became messy in the last time because of numerous
workarounds and a bad mixture of Win32, X11, ATI code and code for
the different parsers used to get the gamma ramps from the profile.
This makes it hard to find the important code sections for others
than me and might have lead to bugs or leaks. A following version
will most likely be ported to C++ to ease modularisation of the code
and allow utilization by other software.

history:
--------
0.6:
- added 0-interpolated upscaling if LUT>vcgt
- added reading of mLUT instead of vcgt (not memory-safe for now)
this is used for profiles, created by ProfileMechanic Monitor
- added concealment for obviously wrong profiles made by AdobeGamma
- added fglrx version for ATI's proprietary driver
- added loss calculation (option "-loss" or "-l") which shows how
many steps are lost by calibrating the device
- added limits of VideoCardGammaFormula to internal parser

0.5: 2005-03-03
- Win32 version added (compilable with MinGW)
+ support for command line options as usual
Expand Down Expand Up @@ -218,11 +264,15 @@ history:

todo:
-----
[ ] gamma limits of vcgt-spec need to be implemented
[ ] integrate the _ICC_PROFILE atom
[ ] interpolated upscaling
[X] use ATI's API when using the closed-source X11 ATI driver
[ ] gamma limits of vcgt-spec for icclib and LCMS version
[ ] further code review for memory leaks
[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
[ ] add multi-monitor support to Win32 version

bugs:
-----
Expand Down Expand Up @@ -260,6 +310,7 @@ links:
http://www.littlecms.com
http://www.argyllcms.com
http://www.coloraid.de
http://www.behrmann.name

license:
--------
Expand All @@ -273,6 +324,6 @@ license:
GERMANY

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

EOF
11 changes: 10 additions & 1 deletion README.profilers
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,22 @@ BasiCColor display:
-------------------
vcgt, table with 256 * 16bit entries

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

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

Profile Mechanic Monitor (by Jonathan Sachs)
--------------------------------------------
mLUT, table with 256 * 16bit entries

AdobeGamma (came with Photoshop CS)
-----------------------------------
vcgt, table with 256 * 16bit entries, signalled as 8bit entries!


(c) 2005 - Stefan Doehla
EOF
83 changes: 83 additions & 0 deletions fglrx/fglrx_gamma.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*****************************************************************************/
/* */
/* NAME: fglrx_gamma.h */
/* */
/* FGLRXGAMMA extension interface library */
/* */
/* Copyright (c) 2002,2003 ATI Research, Starnberg, Germany */
/* */
/*****************************************************************************/

#ifndef __FGLRX_GAMMA_H__
#define __FGLRX_GAMMA_H__

//////////////////////////////////////////////////////////////////////////////
// includes

#include <X11/extensions/xf86vmode.h>


//////////////////////////////////////////////////////////////////////////////
// macro defines

// boolean constants
#define FALSE (1==0)
#define TRUE (1==1)

// ordinal constants
#define FGLRX_GAMMA_RAMP_SIZE 256


//////////////////////////////////////////////////////////////////////////////
// type defines

// basic types
typedef unsigned long DWORD;
typedef unsigned long ULONG;
typedef unsigned int UINT;
typedef unsigned int HANDLE;
#ifndef ULONG_PTR
typedef ULONG ULONG_PTR;
#endif // ULONG_PTR

// structured types
typedef XF86VidModeGamma FGLRX_X11Gamma_float;

typedef struct {
UINT red; /* red color value for gamma correction table */
UINT green; /* green color value for gamma correction table */
UINT blue; /* blue color value for gamma correction table */
} FGLRX_X11Gamma_UINT, FGLRX_X11Gamma_uint_1024;

typedef struct {
CARD16 red; /* red color value for gamma correction table */
CARD16 green; /* green color value for gamma correction table */
CARD16 blue; /* blue color value for gamma correction table */
} FGLRX_X11Gamma_C16, FGLRX_X11Gamma_C16_1024;

typedef struct {
CARD16 RGamma[FGLRX_GAMMA_RAMP_SIZE]; /* red color value for gamma correction table */
CARD16 GGamma[FGLRX_GAMMA_RAMP_SIZE]; /* green color value for gamma correction table */
CARD16 BGamma[FGLRX_GAMMA_RAMP_SIZE]; /* blue color value for gamma correction table */
} FGLRX_X11Gamma_C16native, FGLRX_X11Gamma_C16native_1024;


//////////////////////////////////////////////////////////////////////////////
// exported functions from libfglrx_gamma.h

extern Bool FGLRX_X11SetGammaRamp_float
(Display *dpy, int screen, int controller, int size, FGLRX_X11Gamma_float *Gamma);
extern Bool FGLRX_X11SetGammaRamp_uint_1024
(Display *dpy, int screen, int controller, int size, FGLRX_X11Gamma_uint_1024 *Gamma);
extern Bool FGLRX_X11SetGammaRamp_C16_1024
(Display *dpy, int screen, int controller, int size, FGLRX_X11Gamma_C16_1024 *Gamma);
extern Bool FGLRX_X11SetGammaRamp_C16native_1024
(Display *dpy, int screen, int controller, int size, FGLRX_X11Gamma_C16native_1024 *Gamma);

extern Bool FGLRX_X11GetGammaRampSize
(Display *dpy, int screen, int *size);

#endif /* __FGLRX_GAMMA_H__ */

//////////////////////////////////////////////////////////////////////////////
// EOF
Binary file added fglrx/libfglrx_gamma.a
Binary file not shown.
Binary file added fglrx/libfglrx_gamma.so.1.0
Binary file not shown.
Binary file added gamma_2_2_bright.icc
Binary file not shown.
Binary file added gamma_2_2_lowContrast.icc
Binary file not shown.
Loading

0 comments on commit 9294494

Please sign in to comment.