Initial import
git-svn-id: http://moon:8086/svn/software/trunk/libsrc/_to_be_added@1 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
// ------------------------------------------------------------
|
||||
// clob.h
|
||||
//
|
||||
// A color quantizer using binary-split technique
|
||||
// From:
|
||||
// "Color Quantization of Images", Orchard, Bouman
|
||||
// IEEE Trans. on Sig. Proc., vol. 39, no. 12, pp. 2677-2690, Dec. 1991.
|
||||
//
|
||||
// 10.03.2005, J.Ahrensfeld
|
||||
// ------------------------------------------------------------
|
||||
#ifndef CLOB_H
|
||||
#define CLOB_H
|
||||
|
||||
#include "bintree.h"
|
||||
#include "colortypes.h"
|
||||
|
||||
// ------------------------------------------------------------
|
||||
#define ROW_DIM 3
|
||||
|
||||
// ------------------------------------------------------------
|
||||
typedef struct _node_data_t
|
||||
{
|
||||
int N, *pC, len_C;
|
||||
color_vector_t R[ROW_DIM];
|
||||
color_vector_t cov[ROW_DIM];
|
||||
color_vector_t m;
|
||||
color_vector_t q;
|
||||
color_vector_t e;
|
||||
double lambda;
|
||||
double *pExpr_left, expr_right;
|
||||
|
||||
} node_data_t;
|
||||
|
||||
typedef struct _colorquant_t
|
||||
{
|
||||
int nRow, nCol, N_max, M_max, nPixel;
|
||||
double *pTemp;
|
||||
color_vector_t *pX, *pXs;
|
||||
node_data_t *pRootData, *pData;
|
||||
|
||||
} colorquant_t;
|
||||
|
||||
typedef struct _codebook_t
|
||||
{
|
||||
int num_colors, max_colors, max_samples;
|
||||
|
||||
color_vector_t *pColor;
|
||||
int **ppC, *pC, *size_C;
|
||||
|
||||
} codebook_t;
|
||||
|
||||
// ------------------------------------------------------------
|
||||
void ColorQuant_Init(colorquant_t *pCQ, int N_max, int M_max);
|
||||
void ColorQuant_Free(colorquant_t *pCQ);
|
||||
void FreeNodeData(node_data_t *pObj);
|
||||
void ColorNodeStat(colorquant_t *pCQ, node_data_t *pObj, color_vector_t *pXs);
|
||||
double ColorLambda(colorquant_t *pCQ, node_data_t *pObj, color_vector_t *pXs);
|
||||
void ColorNodeSplit(colorquant_t *pCQ, node_data_t *pObj, node_data_t *pData2n, node_data_t *pData2n1);
|
||||
int ColorQuant(colorquant_t *pCQ, codebook_t *pCB, color_vector_t *pX, int K, int N, int M, double lambda_min);
|
||||
void CodebookAlloc(codebook_t *pObj, int N_max, int M_max);
|
||||
void CodebookFree(codebook_t *pObj);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
#endif // CLOB_H
|
||||
Reference in New Issue
Block a user