siox.cpp revision 893eb8472f33355dcb60a3c17347871b325fa1dc
88395eed42de4d59f54795b60c8c0a7ab881e153JazzyNico/*
40e5cf3e8f0ddda79b1650df77d0f847a22822bfJazzyNico Copyright 2005, 2006 by Gerald Friedland, Kristian Jantz and Lars Knipping
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNico
88395eed42de4d59f54795b60c8c0a7ab881e153JazzyNico Conversion to C++ for Inkscape by Bob Jamison
d048f1c15089c16b8ca1b264513a2f92ff86e703JazzyNico
88395eed42de4d59f54795b60c8c0a7ab881e153JazzyNico Released under GNU GPL, read the file 'COPYING' for more information
88395eed42de4d59f54795b60c8c0a7ab881e153JazzyNico */
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNico#include "siox.h"
88395eed42de4d59f54795b60c8c0a7ab881e153JazzyNico
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNico#include <math.h>
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNico#include <stdarg.h>
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNico#include <map>
40e5cf3e8f0ddda79b1650df77d0f847a22822bfJazzyNico#include <algorithm>
40e5cf3e8f0ddda79b1650df77d0f847a22822bfJazzyNico
40e5cf3e8f0ddda79b1650df77d0f847a22822bfJazzyNico
40e5cf3e8f0ddda79b1650df77d0f847a22822bfJazzyNiconamespace org
40e5cf3e8f0ddda79b1650df77d0f847a22822bfJazzyNico{
88395eed42de4d59f54795b60c8c0a7ab881e153JazzyNico
d048f1c15089c16b8ca1b264513a2f92ff86e703JazzyNiconamespace siox
88395eed42de4d59f54795b60c8c0a7ab881e153JazzyNico{
88395eed42de4d59f54795b60c8c0a7ab881e153JazzyNico
88395eed42de4d59f54795b60c8c0a7ab881e153JazzyNico
88395eed42de4d59f54795b60c8c0a7ab881e153JazzyNico
88395eed42de4d59f54795b60c8c0a7ab881e153JazzyNico//########################################################################
88395eed42de4d59f54795b60c8c0a7ab881e153JazzyNico//# C L A B
88395eed42de4d59f54795b60c8c0a7ab881e153JazzyNico//########################################################################
d048f1c15089c16b8ca1b264513a2f92ff86e703JazzyNico
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNico/**
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNico * Convert integer A, R, G, B values into an pixel value.
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNico */
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNicostatic unsigned long getRGB(int a, int r, int g, int b)
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNico{
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNico if (a<0) a=0;
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNico else if (a>255) a=255;
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNico
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNico if (r<0) r=0;
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNico else if (r>255) r=255;
88395eed42de4d59f54795b60c8c0a7ab881e153JazzyNico
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNico if (g<0) g=0;
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNico else if (g>255) g=255;
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNico
88395eed42de4d59f54795b60c8c0a7ab881e153JazzyNico if (b<0) b=0;
646e07284c35ae746e8a0cf0698098e116ebb5a3JazzyNico else if (b>255) b=255;
Error!

 

There was an error!

null

java.lang.NullPointerException