?? 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
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -