www.pudn.com > src.rar
To Read all the content
[file head]:
/*---------------------------------------------------------------------------
* Arnold 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;
/*---------------------------------------------------------------------------
To generate the scrambling mapping-matrix of arnold transformation.
---------------------------------------------------------------------------*/
void fibonacci_matrix(int** r, int** c, int height, int width)
{
int i, j, x, y, x1, y1;
printf("\nFibonacci transform\n");
for(i = 0; i < height; i++)
for(j = 0; j < width; j++)
{
/*
x = j;
y = height - i -1;
x1 = (x + y) > width;
y1 = x;
... ...
[file tail]:
... ...
(tool)
{
tw_show_tool(tool);
return;
}
tool = (void *)tw_tool("Fibonacci 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/Fibonacci/Lena.gif");
tv = tv_create("Fibonacci original");
tv1 = tv_create("Fibonacci 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("Fibonacci", Fibonacci_Trans,NULL);
tw_button("R_Fibonacci", R_Fibonacci_Trans,NULL);
tw_newrow();
tw_newrow();
tw_end_tool();
}