scramble.c

来自「图像置乱代码」· C语言 代码 · 共 140 行

C
140
字号
/********************************************************************
 *
 * image scrambling tool
 *
 ********************************************************************/

#include<tina/all_tina.h>
static void Hilbert_tool_proc(void)
{
    	Hilbert_tool(0,350);
}
static void QATLIG_tool_proc(void)
{
    	QATLIG_tool(240,350);
}static void Convey_tool_proc(void)
{
	Convey_tool(0,490);
}static void Latin_tool_proc(void)
{
	Latin_tool(240,490);
}static void Baker_tool_proc(void)
{
	Baker_tool(0,350);
}static void Logistic_tool_proc(void)
{
	Logistic_tool(0,350);
}static void Random_tool_proc(void)
{
	Random_tool(0,350);
}static void GrayCode_tool_proc(void)
{
	GrayCode_tool(0,350);
}static void Fibonacci_tool_proc(void)
{
	Fibonacci_tool(0,350);
}static void Arnold_tool_proc(void)
{
    	Arnold_tool(0,200);
}
static void MagicSquare_tool_proc(void)
{
	
}


static void Gyroidal_tool_proc(void)
{

}
static void Sobseq_tool_proc(void)
{
	Sobseq_tool(0,350);
}static void Sampling_tool_proc(void)
{
	Sampling_tool(0,350);
}static void Geometrical_tool_proc(void)
{
	Geometrical_tool(0,350);
}static void zigzag_tool_proc(void)
{
	zigzag_tool(0,350);
}
/********** Tool creation **********/
void            scramble_tool(int x, int y)
{
	static void *tool = NULL;	if (tool)
	{
		tw_show_tool(tool);
		return;
	}
	tool = (void *)tw_tool("Image Scrambling tool", x, y);

/*   tw_sglobal("src_file name=", src_file, 32);
   tw_button("read",read_proc,NULL);
*/
  	tw_newrow();
	tw_label("image scrambling method:");
	tw_newrow();	tw_label("Based on point:");	tw_button("Random",Random_tool_proc,NULL);        tw_button("Logistic", Logistic_tool_proc, NULL);	tw_button("Convey", Convey_tool_proc, NULL);	tw_button("Sobseq", Sobseq_tool_proc, NULL);	tw_newrow();	tw_label("Based on line:");	tw_button("Hilbert", Hilbert_tool_proc, NULL);	tw_button("Zigzag", zigzag_tool_proc, NULL);	tw_newrow();	tw_label("Based on area:");	tw_button("Arnold", Arnold_tool_proc, NULL);	tw_button("Fibonacci", Fibonacci_tool_proc, NULL);	tw_button("Baker", Baker_tool_proc, NULL);	tw_button("Geometrical", Geometrical_tool_proc, NULL);
	tw_newrow();	tw_button("QATLIG", QATLIG_tool_proc, NULL);	tw_button("Latin", Latin_tool_proc, NULL);	tw_button("GrayCode", GrayCode_tool_proc, NULL);	tw_button("Sampling", Sampling_tool_proc, NULL);

	//tw_button("MagicSquare", MagicSquare_tool_proc, NULL);	//tw_button("Gyroidal", Gyroidal_tool_proc, NULL);
		//tw_newrow();	tw_newrow();
	tw_end_tool();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?