diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2004-11-26 19:51:18 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2004-11-26 19:51:18 +0000 |
commit | 64cf5088175def826a0b6581e985679533c59c12 (patch) | |
tree | 46413dd21785033518d23b4038227cc9e00e83f5 /cppcanvas/inc/cppcanvas | |
parent | 8c24f67b4644099cb307094206405729b1b8c557 (diff) |
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED
2004/08/13 20:35:39 thb 1.2.2.3: #110496# Improved color tooling
2004/07/20 19:08:42 thb 1.2.2.2: #110496# Unified include statements; removed external prefix from boost includes
2004/04/05 15:58:43 thb 1.2.2.1: Resync with canvas01 changes
Diffstat (limited to 'cppcanvas/inc/cppcanvas')
-rw-r--r-- | cppcanvas/inc/cppcanvas/color.hxx | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/cppcanvas/inc/cppcanvas/color.hxx b/cppcanvas/inc/cppcanvas/color.hxx index 9e7a9b6dd22f..22c0eaea3141 100644 --- a/cppcanvas/inc/cppcanvas/color.hxx +++ b/cppcanvas/inc/cppcanvas/color.hxx @@ -2,9 +2,9 @@ * * $RCSfile: color.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: rt $ $Date: 2004-09-08 16:57:17 $ + * last change: $Author: rt $ $Date: 2004-11-26 20:51:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -93,6 +93,31 @@ namespace cppcanvas typedef ::boost::shared_ptr< ::cppcanvas::Color > ColorSharedPtr; + inline sal_uInt8 getRed( Color::IntSRGBA nCol ) + { + return static_cast<sal_uInt8>( (nCol&0xFF000000U) >> 24U ); + } + + inline sal_uInt8 getGreen( Color::IntSRGBA nCol ) + { + return static_cast<sal_uInt8>( (nCol&0x00FF0000U) >> 16U ); + } + + inline sal_uInt8 getBlue( Color::IntSRGBA nCol ) + { + return static_cast<sal_uInt8>( (nCol&0x0000FF00U) >> 8U ); + } + + inline sal_uInt8 getAlpha( Color::IntSRGBA nCol ) + { + return static_cast<sal_uInt8>( nCol&0x000000FFU ); + } + + inline Color::IntSRGBA makeColor( sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue, sal_uInt8 nAlpha ) + { + return (nRed << 24U)|(nGreen << 16U)|(nBlue << 8U)|(nAlpha); + } + } #endif /* _CPPCANVAS_COLOR_HXX */ |