www.pudn.com > src.rar
To Read all the content
[file head]:
/*---------------------------------------------------------------------------
* random 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 long R0 = 2097152;
static long LAMBDA = 2045;
static long MOD = 2097153;
//#define R0 2097151
//#define LAMBDA 2045
//#define MOD 2097152
//#define R0 2097152
//#define MOD 2097153
/*-------------------------Random -----------------------------------
double uniform_random(double a, double b, int ar0, int lamda, int mod)
{
static double x;
long entier;
if(ar0 != 0) x = (double)ar0/(double)mod;
x *= (double)lamda;
entier = (x > 0.0)? floor(x) : ceil(x);
x -= (double)entier;
... ...
[file tail]:
... ...
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/Random/Lena.gif");
tv = tv_create("Random original");
tv1 = tv_create("Random 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("R0 = ", &amt;R0, 10);
tw_iglobal("LAMBDA = ", &amt;LAMBDA, 10);
tw_iglobal("MOD = ", &amt;MOD, 10);
tw_newrow();
tw_iglobal("Scrambling times = ", &amt;SCRAM_n, 5);
tw_newrow();
tw_button("Random", Random_Trans,NULL);
tw_button("R_Random", R_Random_Trans,NULL);
tw_newrow();
tw_newrow();
tw_end_tool();
}