www.pudn.com > src.rar
To Read all the content
[file head]:
/*---------------------------------------------------------------------------
* hilbert transformation
* ---------------------------------------------------------------------------*/
#include <tina/all_tina.h>
#include "bmp.h"
#define MAXPATHLEN 64
static char directory_name[MAXPATHLEN];
static char file_name[MAXPATHLEN];
static char pathname[MAXPATHLEN];
static void *pdir=0, *pfile=0;
static int SCRAM_n = 1;
static Tv *tv = NULL;
static Tv *tv1=NULL;
static int x = -1, y = 0;
static int i = 0, j = 0;
static int width;
static void step(int dir, int **r, int **c)
{
/*int x0 = x, y0 = y;*/
switch(dir &amt; 3)
{
case 0: x = x + 1; break;
case 1: y = y + 1; break;
case 2: x = x - 1; break;
case 3: y = y - 1; break;
}
/*if(x0 >= 0) tv_linexy(tv, x0*10, y0*10, x*10, y*10);*/
if(j == width)
{
j = 0;
++i;
}
r[y][x] = i;
c[y][x] = j++;
}
static void hilbert(int dir, int rot, int order, int **r, int **c)
{
if(order == 0) return;
dir
... ...
[file tail]:
... ...
oice_proc();
if (tool)
{
tw_show_tool(tool);
return;
}
tool = (void *)tw_tool("Hilbert Scrambling tool", x, y);
/* Initialise pathname from environment variable (or #define) */
(void) environ_pathname_get(directory_name, file_name,
"TINA_IMAGE_DEFAULT",
"/home/wzz/newimscramdegree/result/Hilbert/gRGB.gif");
tv = tv_create("Hilbert original");
tv1 = tv_create("Hilbert scrambled");
tw_choice("Tv choice", tv_choice_proc, 0, "original","scrambled", NULL);
tw_newrow();
tw_newrow();
/*---------------------------*/
pdir = (void *) tw_sglobal("Directory:", directory_name, 32);
tw_button("scan", scan_proc, NULL);
tw_newrow();
pfile = (void*) tw_sglobal("File:", file_name, 32);
tw_newrow();
/*---------------------------*/
tw_iglobal("Scrambling times = ", &amt;SCRAM_n, 5);
tw_newrow();
tw_button("Hilbert", Hilbert_Trans,NULL);
tw_button("R_Hilbert", R_Hilbert_Trans,NULL);
tw_newrow();
tw_newrow();
tw_end_tool();
}