9#define COLOR_CLUSTER_LENGTH 2
10#define CHANNEL_SOURCES_LENGTH 3
11#define CHANNEL_CLUSTER_LENGTH 3
59 unsigned int *colorTypes = calloc(length,
sizeof(
unsigned int));
72 for (
unsigned int index = 0; index < length; index ++) {
74 unsigned int colorType = colorTypes[index];
86 unsigned int color = colorCluster[1];
138 unsigned int index = (redValue << 16) | (greenValue << 8) | blueValue;
146unsigned int Colors_writeColor(
struct Colors *
this,
unsigned char redValue,
unsigned char greenValue,
unsigned char blueValue,
int *error)
148 unsigned int index = (redValue << 16) | (greenValue << 8) | blueValue;
170 if (0 == redClusterStart) {
193 unsigned int red = redCluster[0];
209 if (0 == greenClusterStart) {
232 unsigned int green = greenCluster[1];
248 if (0 == blueClusterStart) {
271 unsigned int blue = blueCluster[2];
275 unsigned int colorCluster[2];
283 unsigned int color = colorCluster[0];
284 unsigned int type = colorCluster[1];
318void Colors_readColor(
const struct Colors *
this,
unsigned int color,
unsigned char *redValue,
unsigned char *greenValue,
unsigned char *blueValue,
int *error)
328 if (0 == colorCluster[0] && 0 == colorCluster[1]) {
unsigned int Binary_writeCode(struct Binary *this, unsigned int input, int *error)
It writes binary value from an unsigned integer into a graph.
struct Binary * Binary_destruct(struct Binary *this)
unsigned int Binary_readCode(struct Binary *this, unsigned int code, int *error)
It reads binary value into an unsigned integer when given a vertex from a binary cluster.
#define CHANNEL_CLUSTER_LENGTH
void Colors_initialize(struct Colors *this, int *error)
unsigned int Colors_writeColor(struct Colors *this, unsigned char redValue, unsigned char greenValue, unsigned char blueValue, int *error)
struct Colors * Colors_construct(unsigned int colorType, struct Binary *binary, struct Graph *graph, int *error)
void Colors_readColor(const struct Colors *this, unsigned int color, unsigned char *redValue, unsigned char *greenValue, unsigned char *blueValue, int *error)
struct Colors * Colors_destruct(struct Colors *this)
#define COLOR_CLUSTER_LENGTH
#define CHANNEL_SOURCES_LENGTH
void Graph_readSources(const struct Graph *this, unsigned int target, unsigned int length, unsigned int *sources, int *error)
It reads all source vertices that have an edge leading to a particular target vertex.
void Graph_addEdge(struct Graph *this, unsigned int source, unsigned int target, int *error)
It adds a directed edge from a source vertex to a target vertex.
unsigned int Graph_readLastTarget(const struct Graph *this, unsigned int source, int *error)
It reads the last target vertex of a source vertex, if it exists.
unsigned int Graph_readLastSource(const struct Graph *this, unsigned int target, int *error)
It reads the last source vertex of a target vertex, if it exists.
void Graph_readCluster(const struct Graph *this, unsigned int predecessor, unsigned int length, unsigned int *vertices, int *error)
void Graph_readTargets(const struct Graph *this, unsigned int source, unsigned int length, unsigned int *targets, int *error)
It reads all target vertices that have an edge leading from a particular source vertex.
void Graph_addCluster(struct Graph *this, unsigned int length, unsigned int *vertices, int *error)
#define ERROR_NOT_A_COLOR
unsigned int * colorCache