glcolor.cpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:4k
- /*
- * ===========================================================================
- * PRODUCTION $Log: glcolor.cpp,v $
- * PRODUCTION Revision 1000.1 2004/06/01 20:50:37 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.8
- * PRODUCTION
- * ===========================================================================
- */
- /* $Id: glcolor.cpp,v 1000.1 2004/06/01 20:50:37 gouriano Exp $
- * ===========================================================================
- *
- * PUBLIC DOMAIN NOTICE
- * National Center for Biotechnology Information
- *
- * This software/database is a "United States Government Work" under the
- * terms of the United States Copyright Act. It was written as part of
- * the author's official duties as a United States Government employee and
- * thus cannot be copyrighted. This software/database is freely available
- * to the public for use. The National Library of Medicine and the U.S.
- * Government have not placed any restriction on its use or reproduction.
- *
- * Although all reasonable efforts have been taken to ensure the accuracy
- * and reliability of the software and data, the NLM and the U.S.
- * Government do not and cannot warrant the performance or results that
- * may be obtained by using this software or data. The NLM and the U.S.
- * Government disclaim all warranties, express or implied, including
- * warranties of performance, merchantability or fitness for any particular
- * purpose.
- *
- * Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Authors: Mike DiCuccio
- *
- * File Description:
- * CGlColor - provides explicit control and conversion for FLTK <-> OpenGL
- * colors
- */
- #include <ncbi_pch.hpp>
- #include <gui/opengl/glcolor.hpp>
- #include <FL/Fl.H>
- BEGIN_NCBI_SCOPE
- CGlColor::CGlColor(void)
- {
- }
- CGlColor::CGlColor(const float* color, size_t size)
- : CRgbaColor(color, size)
- {
- }
- CGlColor::CGlColor(float r, float g, float b)
- : CRgbaColor(r, g, b)
- {
- }
- CGlColor::CGlColor(float r, float g, float b, float a)
- : CRgbaColor(r, g, b, a)
- {
- }
- CGlColor::CGlColor(unsigned char r, unsigned char g, unsigned char b)
- : CRgbaColor(r, g, b)
- {
- }
- CGlColor::CGlColor(unsigned char r, unsigned char g,
- unsigned char b, unsigned char a)
- : CRgbaColor(r, g, b, a)
- {
- }
- CGlColor::CGlColor(Fl_Color c)
- {
- SetFltkColor(c);
- }
- CGlColor::CGlColor(const string& s)
- : CRgbaColor(s)
- {
- }
- CGlColor::~CGlColor()
- {
- }
- void CGlColor::SetFltkColor(Fl_Color c)
- {
- unsigned char r, g, b;
- Fl::get_color(c, r, g, b);
- Set(r, g, b);
- }
- Fl_Color CGlColor::GetFltkColor(void) const
- {
- return fl_rgb_color(GetRedUC(), GetGreenUC(), GetBlueUC());
- }
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- * $Log: glcolor.cpp,v $
- * Revision 1000.1 2004/06/01 20:50:37 gouriano
- * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.8
- *
- * Revision 1.8 2004/05/21 22:27:45 gorelenk
- * Added PCH ncbi_pch.hpp
- *
- * Revision 1.7 2003/10/29 22:28:09 yazhuk
- * Moved GetGlColor() to header and made inline
- *
- * Revision 1.6 2003/10/15 13:59:51 rsmith
- * add implementation to create a GlColor from an Fl_Color.
- *
- * Revision 1.5 2003/08/25 18:02:20 rsmith
- * Colors to and from strings.
- *
- * Revision 1.4 2003/06/18 18:16:17 meric
- * Moved inline interface from glcolor.hpp
- *
- * Revision 1.3 2003/05/14 21:21:27 meric
- * modify PrintTo() to optionally skip output of alpha value (not by default)
- *
- * Revision 1.2 2003/05/14 14:54:38 meric
- * modified CGlColor's operator<<() to use a const object reference
- *
- * Revision 1.1 2003/05/14 12:08:07 dicuccio
- * Initial revision
- *
- *
- * ===========================================================================
- */