void redraw (int w, int h, int mx, int my)
{
  vapi_clear ();

  rulers (w, h);
  instructions (w, h);
  mouse_pos (w, h, mx, my);
  term_size (w, h);

  vapi_moveto (1, 1);
  vapi_refresh ();
}
示例#2
0
文件: test_pat_G.c 项目: ttill/frei0r
//--------------------------------------------------
void f0r_set_param_value(f0r_instance_t instance, f0r_param_t param, int param_index)
{
  tp_inst_t* inst = (tp_inst_t*)instance;

  f0r_param_double* p = (f0r_param_double*) param;

  int chg,tmpi;
  float tmpf;

  chg=0;
  switch (param_index)
    {
    case 0:	//type
      tmpf=*((double*)p);
      if (tmpf>=1.0)
        tmpi=(int)tmpf;
      else
        tmpi = map_value_forward(tmpf, 0.0, 12.9999);
      if ((tmpi<0)||(tmpi>12.0)) break;
      if (inst->type != tmpi) chg=1;
      inst->type = tmpi;
      break;
    case 1:	//size 1
      tmpi = map_value_forward(*((double*)p), 0.0, 256.0);
      if (inst->size1 != tmpi) chg=1;
      inst->size1 = tmpi;
      break;
    case 2:	//size 2
      tmpi = map_value_forward(*((double*)p), 0.0, 64.0);
      if (inst->size2 != tmpi) chg=1;
      inst->size2 = tmpi;
      break;
    case 3:	//negative
      tmpi = map_value_forward(*((double*)p), 0.0, 1.0);
      if (inst->neg != tmpi) chg=1;
      inst->neg = tmpi;
      make_char2color_table(inst->c2c,inst->neg);
      break;
    case 4:	//aspect type
      tmpf=*((double*)p);
      if (tmpf>=1.0)
        tmpi=(int)tmpf;
      else
        tmpi = map_value_forward(*((double*)p), 0.0, 6.9999);
      if ((tmpi<0)||(tmpi>6.0)) break;
      if (inst->aspt != tmpi) chg=1;
      inst->aspt = tmpi;
      switch (inst->aspt)	//pixel aspect ratio
        {
        case 0: inst->par=1.000;break;		//square pixels
        case 1: inst->par=1.067;break;		//PAL DV
        case 2: inst->par=1.455;break;		//PAL wide
        case 3: inst->par=0.889;break;		//NTSC DV
        case 4: inst->par=1.212;break;		//NTSC wide
        case 5: inst->par=1.333;break;		//HDV
        case 6: inst->par=inst->mpar;break;	//manual
        }
      break;
    case 5:	//manual aspect
      tmpf = map_value_forward_log(*((double*)p), 0.5, 2.0);
      if (inst->mpar !=tmpf) chg=1;
      inst->mpar = tmpf;
      if (inst->aspt==4) inst->par=inst->mpar;
      break;
    }

  if (chg==0) return;

  switch (inst->type)
    {
    case 0:		//checkerboard
      sah1(inst->sl, inst->w, inst->h, inst->size1, inst->par, 0);
      break;
    case 1:		//checkerboard with border
      sah1(inst->sl, inst->w, inst->h, inst->size1, inst->par, 1);
      break;
    case 2:		//horizontal lines
      hlines(inst->sl, inst->w, inst->h, inst->size1, inst->size2, inst->par, 1);
      break;
    case 3:		//vertical lines
      vlines(inst->sl, inst->w, inst->h, inst->size1, inst->size2, inst->par, 1);
      break;
    case 4:		//grid
      mreza(inst->sl, inst->w, inst->h, inst->size1, inst->size2, inst->par);
      break;
    case 5:		//points
      pike(inst->sl, inst->w, inst->h, inst->size1, inst->size2, inst->par);
      break;
    case 6:		//bullseye
      tarca(inst->sl, inst->w, inst->h, inst->size1, inst->size2+1, inst->par);
      break;
    case 7:		//edge marks
      robovi(inst->sl, inst->w, inst->h);
      break;
    case 8:		//color quadrants  are drawn in update()
      break;
    case 9:		//pixel rulers
    case 11:
      rulers(inst->sl, inst->w, inst->h, inst->alpha);
      break;
    case 10:		//measurement grid
    case 12:
      grid(inst->sl, inst->w, inst->h, inst->alpha);
      break;
    default:
      break;
    }

}