~ubuntu-branches/ubuntu/lucid/libx11/lucid

« back to all changes in this revision

Viewing changes to src/xcms/HVCMxV.c

  • Committer: Bazaar Package Importer
  • Author(s): Timo Aaltonen
  • Date: 2009-01-17 16:34:54 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20090117163454-gaey3cd32xyavueo
Tags: 2:1.1.99.2-1build1
Fakesync with Debian, all previous Ubuntu changes are included
in the new upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
/*
4
4
 * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
5
5
 *      All Rights Reserved
6
 
 * 
 
6
 *
7
7
 * This file is a component of an X Window System-specific implementation
8
8
 * of Xcms based on the TekColor Color Management System.  TekColor is a
9
9
 * trademark of Tektronix, Inc.  The term "TekHVC" designates a particular
11
11
 * foreign patents pending).  Permission is hereby granted to use, copy,
12
12
 * modify, sell, and otherwise distribute this software and its
13
13
 * documentation for any purpose and without fee, provided that:
14
 
 * 
 
14
 *
15
15
 * 1. This copyright, permission, and disclaimer notice is reproduced in
16
16
 *    all copies of this software and any modification thereof and in
17
 
 *    supporting documentation; 
 
17
 *    supporting documentation;
18
18
 * 2. Any color-handling application which displays TekHVC color
19
19
 *    cooordinates identifies these as TekHVC color coordinates in any
20
20
 *    interface that displays these coordinates and in any associated
24
24
 *    including those provided in this file and any equivalent pathways and
25
25
 *    mathematical derivations, regardless of digital (e.g., floating point
26
26
 *    or integer) representation.
27
 
 * 
 
27
 *
28
28
 * Tektronix makes no representation about the suitability of this software
29
29
 * for any purpose.  It is provided "as is" and with all faults.
30
 
 * 
 
30
 *
31
31
 * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
32
32
 * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
33
33
 * PARTICULAR PURPOSE.  IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
144
144
 
145
145
    if (max_vc.spec.TekHVC.C < tmp.spec.TekHVC.C) {
146
146
        /*
147
 
         *  If the chroma is greater than the chroma for the 
 
147
         *  If the chroma is greater than the chroma for the
148
148
         *  maximum value/chroma point then the value is the
149
149
         *  the value for the maximum value, chroma point.
150
150
         *  This is an error but it I return the best approximation I can.
156
156
        return(XcmsSuccess);
157
157
    } else if (max_vc.spec.TekHVC.C == tmp.spec.TekHVC.C) {
158
158
        /*
159
 
         *  If the chroma is equal to the chroma for the 
 
159
         *  If the chroma is equal to the chroma for the
160
160
         *  maximum value/chroma point then the value is the
161
161
         *  the value for the maximum value, chroma point.
162
162
         */
198
198
                tmp.spec.TekHVC.H = hue;  /* use the saved hue */
199
199
                memcpy ((char *) pColor_return, (char *) &tmp, sizeof (XcmsColor));
200
200
                return(XcmsSuccess);
201
 
            } 
 
201
            }
202
202
            nChroma += savedChroma - tmp.spec.TekHVC.C;
203
203
            if (nChroma > max_vc.spec.TekHVC.C) {
204
204
                nChroma = max_vc.spec.TekHVC.C;