From 5a422aba704c375a307a902bafe658342e209906 Mon Sep 17 00:00:00 2001 From: scuri Date: Fri, 17 Oct 2008 06:10:15 +0000 Subject: First commit - moving from LuaForge to SourceForge --- src/im_colorutil.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/im_colorutil.cpp (limited to 'src/im_colorutil.cpp') diff --git a/src/im_colorutil.cpp b/src/im_colorutil.cpp new file mode 100644 index 0000000..9e96c65 --- /dev/null +++ b/src/im_colorutil.cpp @@ -0,0 +1,27 @@ +/** \file + * \brief Color Utilities + * + * See Copyright Notice in im_lib.h + * $Id: im_colorutil.cpp,v 1.1 2008/10/17 06:10:16 scuri Exp $ + */ + + +#include +#include +#include + +#include "im.h" +#include "im_util.h" + +long imColorEncode(unsigned char Red, unsigned char Green, unsigned char Blue) +{ + return (((long)Red) << 16) | (((long)Green) << 8) | ((long)Blue); +} + +void imColorDecode(unsigned char* Red, unsigned char* Green, unsigned char* Blue, long Color) +{ + if (Red) *Red = (imbyte)(Color >> 16); + if (Green) *Green = (imbyte)(Color >> 8); + if (Blue) *Blue = (imbyte)Color; +} + -- cgit v1.2.3