#ifndef	CSPACE_H
#define CSPACE_H

#include <v_lib.h>
#include "framebuf.h"
#include "eval.h"

#define	CSPACE_RGB	0
#define	CSPACE_HSV	1
#define	CSPACE_CIE	2

void
ctransFill3Matrices(framebuf_p pixels,u32_t target_cspace,
	matrix_p *c1_ret,matrix_p *c2_ret,matrix_p *c3_ret);

void
ctransStore3Matrices(framebuf_p pixels,u32_t orig_cspace,
	matrix_p c1,matrix_p c2,matrix_p c3);

void
ctransFill1Matrix(framebuf_p pixels,matrix_p *m_ret,
	vboolean from_r,vboolean from_g,vboolean from_b,vboolean from_a);

void
ctransStore1Matrix(framebuf_p pixels,matrix_p m,
	vboolean to_r,vboolean to_g,vboolean to_b,vboolean to_a);

vboolean
cspaceHistogram(vector_p dest,matrix_p src,vboolean normalize);

vboolean
cspaceGammaCorrection(matrix_p dest,matrix_p src,vector_p gamma,
	vboolean unit_input);

vboolean
cspaceMaximizeContrast(matrix_p dest,matrix_p src);

matrix_p
inputGetMatrix(eval_state_p state,char *image_name,char *channel_id);

void
inputCollectGarbage(void);

#endif	/* CSPACE_H */

