www.pudn.com > src.rar
To Read all the content
[file head]:
#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 int percent_choice = 0;
static Imrect *orig_im = NULL;
static Imrect *dest_im = NULL;
static Tv *tv = NULL;
static Tv *tv1=NULL;
static percent_choice_proc(int val)
{
percent_choice = val;
}
static Imrect *read_image(void)
{
Imrect *srcIm;
/*----------------Read the image---------------------------*/
(void) strip_spaces(file_name);
(void) strip_spaces(directory_name);
(void) string_append(pathname, directory_name, "/", file_name, NULL);
srcIm = BmpToImrect(pathname);
return(srcIm);
}
static void mypush_proc(void)
{
Imrect *srcIm,*srcIm0;
int width, height;
Imregion *roi;
int i,j;
//BYTE pix;
int pix;
srcIm = read_image();
width = srcIm->width;
height = srcIm->height;
roi = srcIm->region;
if (roi == NULL) return ;
/*
... ...
[file tail]:
... ...
nviron_pathname_get(directory_name, file_name,
"TINA_IMAGE_DEFAULT",
"/home/wzz/newimscramdegree/result/addnoise/Lena.bmp");
tv = tv_create("addnoise original");
tv1 = tv_create("addnoise scrambled");
tw_choice("Tv choice", tv_choice_proc, 0, "original","scrambled", NULL);
tv_set_fulldraw(tv, fulldraw);
tv_set_fulldraw(tv1,fulldraw1);
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_newrow();
tw_choice("> choice", percent_choice_proc, 0, "5>","15>","25>","50>","75>", NULL);
tw_newrow();
tw_iglobal("(Hilbert)Scrambling times = ", &amt;SCRAM_n, 5);
tw_newrow();
tw_button("addnoise", addnoise_Trans,NULL);
tw_button("push",mypush_proc,NULL);
tw_button("pop",mypop_proc,NULL);
tw_newrow();
tw_newrow();
tw_end_tool();
}