home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / evbl0627.zip / everblue_20010627.zip / x11 / Xcms_QGreen.c < prev    next >
C/C++ Source or Header  |  1999-11-02  |  3KB  |  84 lines

  1. /* $XConsortium: QGreen.c,v 1.3 93/09/07 21:32:21 rws Exp $ */
  2.  
  3. /*
  4.  * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
  5.  *     All Rights Reserved
  6.  * 
  7.  * This file is a component of an X Window System-specific implementation
  8.  * of Xcms based on the TekColor Color Management System.  Permission is
  9.  * hereby granted to use, copy, modify, sell, and otherwise distribute this
  10.  * software and its documentation for any purpose and without fee, provided
  11.  * that this copyright, permission, and disclaimer notice is reproduced in
  12.  * all copies of this software and in supporting documentation.  TekColor
  13.  * is a trademark of Tektronix, Inc.
  14.  * 
  15.  * Tektronix makes no representation about the suitability of this software
  16.  * for any purpose.  It is provided "as is" and with all faults.
  17.  * 
  18.  * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
  19.  * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  20.  * PARTICULAR PURPOSE.  IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
  21.  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
  22.  * RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER IN AN ACTION OF
  23.  * CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  24.  * CONNECTION WITH THE USE OR THE PERFORMANCE OF THIS SOFTWARE.
  25.  *
  26.  *
  27.  *    NAME
  28.  *        XcmsQGreen.c - Query Green
  29.  *
  30.  *    DESCRIPTION
  31.  *        Routine to obtain a color specification for full
  32.  *        green intensity and zero red and blue intensities.
  33.  *
  34.  *
  35.  */
  36.  
  37. #include "Xlib_private.h"
  38. #include "Xcms.h"
  39.  
  40.  
  41.  
  42. /************************************************************************
  43.  *                                    *
  44.  *            PUBLIC INTERFACES                *
  45.  *                                    *
  46.  ************************************************************************/
  47.  
  48. /*
  49.  *    NAME
  50.  *        XcmsQueryGreen
  51.  *
  52.  *    SYNOPSIS
  53.  */
  54.  
  55. Status
  56. XcmsQueryGreen(ccc, target_format, pColor_ret)
  57.     XcmsCCC ccc;
  58.     XcmsColorFormat target_format;
  59.     XcmsColor *pColor_ret;
  60. /*
  61.  *    DESCRIPTION
  62.  *        Returns the color specification in the target format for
  63.  *        full intensity green and zero intensity red and blue.
  64.  *
  65.  *    RETURNS
  66.  *        Returns XcmsSuccess, if failed; otherwise XcmsFailure
  67.  *
  68.  */
  69. {
  70.     DBUG_ENTER("XcmsQueryGreen")
  71.     XcmsColor tmp;
  72.  
  73.     tmp.format = XcmsRGBiFormat;
  74.     tmp.pixel = 0;
  75.     tmp.spec.RGBi.red = 0.0;
  76.     tmp.spec.RGBi.green = 1.0;
  77.     tmp.spec.RGBi.blue = 0.0;
  78.     if (XcmsConvertColors(ccc, &tmp, 1, target_format, NULL) != XcmsSuccess) {
  79.     DBUG_RETURN(XcmsFailure);
  80.     }
  81.     memcpy((char *)pColor_ret, (char *)&tmp, sizeof(XcmsColor));
  82.     DBUG_RETURN(XcmsSuccess);
  83. }
  84.