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