Revision: 4309
http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4309&view=rev
Author: ossman_
Date: 2011-03-02 12:45:57 +0000 (Wed, 02 Mar 2011)
Log Message:
-----------
Provide a simple helper class for basic colour map usage.
Modified Paths:
--------------
trunk/common/rfb/ColourMap.h
Modified: trunk/common/rfb/ColourMap.h
===================================================================
--- trunk/common/rfb/ColourMap.h 2011-03-02 12:44:46 UTC (rev 4308)
+++ trunk/common/rfb/ColourMap.h 2011-03-02 12:45:57 UTC (rev 4309)
@@ -1,4 +1,5 @@
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
+ * Copyright 2011 Pierre Ossman <[email protected]> for Cendio AB
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -30,5 +31,20 @@
public:
virtual void lookup(int index, int* r, int* g, int* b)=0;
};
+
+ class SimpleColourMap : public ColourMap {
+ public:
+ SimpleColourMap(int size = 256) { table = new Colour[size]; };
+ ~SimpleColourMap() { delete [] table; };
+
+ void lookup(int index, int* r, int* g, int* b)
+ { *r = table[index].r; *g = table[index].g; *b = table[index].b; };
+
+ void set(int index, int r, int g, int b)
+ { table[index].r = r; table[index].g = g; table[index].b = b; };
+
+ protected:
+ Colour *table;
+ };
}
#endif
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
Tigervnc-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits