www.pudn.com > src.rar   To Read all the content


[file head]:
/*---------------------------------------------------------------------------
* sampling 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 sampling transformation.
---------------------------------------------------------------------------*/
void sampling_matrix(int** r, int** c, int height, int width)
{
int k, l, i, j, p, q, x, y, x0, y0;
int m_nM = 64, m_nN = 64;
printf("\nSampling transform\n");
p = height / m_nM; q = width / m_nN;
for(i = 0; i < p; i++)
for(j = 0; j < q; j++)
for(k = 0; k < m_nM;
... ...

[file tail]:
... ...
c();
if (tool)
{
tw_show_tool(tool);
return;
}
tool = (void *)tw_tool("Sampling 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/Sampling/Lena.gif");

tv = tv_create("Sampling original");
tv1 = tv_create("Sampling 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("Sampling", Sampling_Trans,NULL);
tw_button("R_Sampling", R_Sampling_Trans,NULL);
tw_newrow();
tw_newrow();
tw_end_tool();
}