colorred.c/.h: doxygen
This commit is contained in:
parent
50ac812f6a
commit
e72274d1ea
@ -47,6 +47,9 @@ void CT_Print(CT_Node* node)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* insert a node in the color tree
|
||||||
|
*/
|
||||||
void CT_set(CT_Tree* colorTree, byte Rmin, byte Gmin, byte Bmin,
|
void CT_set(CT_Tree* colorTree, byte Rmin, byte Gmin, byte Bmin,
|
||||||
byte Rmax, byte Gmax, byte Bmax, byte index)
|
byte Rmax, byte Gmax, byte Bmax, byte index)
|
||||||
{
|
{
|
||||||
@ -102,10 +105,13 @@ void CT_set(CT_Tree* colorTree, byte Rmin, byte Gmin, byte Bmin,
|
|||||||
++colorTree->nodecount;
|
++colorTree->nodecount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* find the leaf that also contains (rgb)
|
||||||
|
*
|
||||||
|
* pre condition: node contains (rgb)
|
||||||
|
*/
|
||||||
byte CT_get(CT_Tree* tree, byte r, byte g, byte b)
|
byte CT_get(CT_Tree* tree, byte r, byte g, byte b)
|
||||||
{
|
{
|
||||||
// pre condition: node contains (rgb)
|
|
||||||
// find the leaf that also contains (rgb)
|
|
||||||
|
|
||||||
CT_Node* node = &tree->nodes[0];
|
CT_Node* node = &tree->nodes[0];
|
||||||
|
|
||||||
|
|||||||
@ -16,15 +16,15 @@
|
|||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with Grafx2; if not, see <http://www.gnu.org/licenses/>
|
along with Grafx2; if not, see <http://www.gnu.org/licenses/>
|
||||||
|
|
||||||
********************************************************************************
|
|
||||||
|
|
||||||
24bit RGB to 8bit indexed functions
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "struct.h"
|
#include "struct.h"
|
||||||
|
|
||||||
/* Octree for mapping RGB to color. A bit slower than a plain conversion table in theory,
|
/**
|
||||||
|
* @file colorred.h
|
||||||
|
* 24bit RGB to 8bit indexed functions
|
||||||
|
*
|
||||||
|
* Octree for mapping RGB to color. A bit slower than a plain conversion table in theory,
|
||||||
but :
|
but :
|
||||||
* Faster than running a search in the palette
|
* Faster than running a search in the palette
|
||||||
* Takes less memory than the huge conversion table
|
* Takes less memory than the huge conversion table
|
||||||
@ -34,6 +34,9 @@ but :
|
|||||||
#ifndef __COLORRED_H
|
#ifndef __COLORRED_H
|
||||||
#define __COLORRED_H
|
#define __COLORRED_H
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Color Tree node
|
||||||
|
*/
|
||||||
typedef struct CT_Node_s
|
typedef struct CT_Node_s
|
||||||
{
|
{
|
||||||
// min
|
// min
|
||||||
@ -62,6 +65,9 @@ typedef struct CT_Node_s
|
|||||||
word children[2];
|
word children[2];
|
||||||
} CT_Node;
|
} CT_Node;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Color Tree
|
||||||
|
*/
|
||||||
typedef struct ColorTree_S {
|
typedef struct ColorTree_S {
|
||||||
short nodecount;
|
short nodecount;
|
||||||
CT_Node nodes[511];
|
CT_Node nodes[511];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user