📄 tsvqlib.h
字号:
/*************************************************************************** * tsvqlib.h * written by: Stephanie Wojtkowski * * Description: A library that provides tree-structured VQ tools for * performing the Wei-Levoy texture synthesis method. * ------------------------------------------------------------------------- * BuildTree(image, rows, cols, maxdepth) * Input: image - the input image from which a new texture will be * generated * rows - the number of rows in the image * cols - the number of columns in the image * maxdepth - the maximum depth of the VQ tree * * Description: This function creates a vector-quantized tree of pixel * neighborhoods based on the input image. * ------------------------------------------------------------------------- * FindMatch(point) * Inputs: point - the pixel neighborhood in the target image that is * being processed * Output: a pixel value containg the best match from the tree * * Description: Given a pixel neighborhood, FindMatch traverses the tree to * find the best match for that neighborhood ***************************************************************************/#define TSVQLIB_H#ifdef TSVQLIB_H#include <stdio.h>#include <stdlib.h>#include <math.h>#include <time.h>#include "ppmIO.h"#define NRAD 1 //Neighborhood radius//The amount of space necessary to store a pixel and its neighborhood#define SIZE (2*NRAD+1)*NRAD + NRAD + 1typedef Pixel Vector[SIZE];typedef struct node { Vector data; //The neighborhood plus the neighborhood origin struct node *left; struct node *right;} node;node *root;void BuildTree(Pixel *image, int rows, int cols, int depth);Pixel FindMatch(Vector point);#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -