コード例 #1
0
        //图片无参考清理
        private void imageClear_none_Click(object sender, EventArgs e)
        {
            sortObject[] sortArray = new sortObject[tot];
            for (int i = 0; i < tot; i++)
            {
                if (!picInfo[path_name[i]].state_none)
                {
                    picInfo[path_name[i]].grade_none = picInfo[path_name[i]].tenengrad();
                    picInfo[path_name[i]].state_none = true;
                }
                sortArray[i] = new sortObject(picInfo[path_name[i]].grade_none, path_name[i], name[i]);
            }
            Array.Sort(sortArray, new sortObjectComparer());

            ClearSetting cs = new ClearSetting(this, sortArray);

            cs.Show();
        }
コード例 #2
0
        //图片全参考清理
        private void imageClear_full_Click(object sender, EventArgs e)
        {
            int cnt = 0;
            int id  = 0;

            for (int i = 0; i < tot; i++)
            {
                if (selected[i])
                {
                    cnt++;
                    id = i;
                }
            }
            if (cnt == 0)
            {
                MessageBox.Show("请选一张图片作为参考图像");
                return;
            }
            else if (cnt > 1)
            {
                MessageBox.Show("只能选一张图片作为参考图像");
                return;
            }

            sortObject[] sortArray = new sortObject[tot];
            for (int i = 0; i < tot; i++)
            {
                if (!picInfo[path_name[i]].state_full || last_pic != path_name[id])
                {
                    picInfo[path_name[i]].grade_full = picInfo[path_name[i]].psnr(picInfo[path_name[id]], picInfo[path_name[i]].height, picInfo[path_name[i]].width);
                    picInfo[path_name[i]].state_full = true;
                }
                sortArray[i] = new sortObject(picInfo[path_name[i]].grade_full, path_name[i], name[i]);
            }
            Array.Sort(sortArray, new sortObjectComparer());
            last_pic = path_name[id];

            ClearSetting cs = new ClearSetting(this, sortArray);

            cs.Show();
        }