예제 #1
0
void
edit_options(FL_OBJECT *obj, int m)

{
  int n = state.control[state.control_num];
  /*  The window in not created yet, do it now  */
  if (state.options == NULL) {
    state.options = create_form_Options();
    fl_set_form_minsize(state.options->Options, 
		  state.options->Options->w, state.options->Options->h);
    set_match_defaults(frame, n);
  }
  /*  Deactivate OPTIONS item in the menu */
  fl_set_menu_item_mode(obj, m, FL_PUP_GREY);
  fl_show_form(state.options->Options,  FL_FIX_SIZE, FL_FULLBORDER | FL_PLACE_FREE_CENTER, "Image options");
  set_minconst(frame[n].match.min, state.options->minconstW);
  set_initconst(frame[n].match.firstbright, state.options->initconstW);
  set_starconst(frame[n].match.nstar, state.options->starconstW);
  set_starerror(frame[n].match.poserrmax, state.options->starerrorW);
  set_maxres(frame[n].match.maxres, state.options->maxresW);
  set_starminmag(frame[n].map.minmag, state.options->starminmagW);
  set_starmaxmag(frame[n].map.maxmag, state.options->starmaxmagW);
  fl_set_input(state.options->logfileW, state.logfile);
  set_starminsize(frame[n].fits.minstar, state.options->starminsizeW);
  set_gridsize(frame[n].fits.maxsize, state.options->stargridW); 
  set_edgesize(frame[n].fits.border, state.options->staredgeW); 
  set_countsigma(frame[n].fits.sg_num, state.options->countsigmaW);
  set_countminval(frame[n].fits.minbright, state.options->countminvalW);
  set_inner(frame[n].fits.inner, state.options->starinnerW);
  set_outer(frame[n].fits.outer, state.options->starouterW);
  fl_set_button(state.options->starapertureW, frame[n].fits.aperture);
}
예제 #2
0
float
proc_outer(FL_OBJECT *obj, float outer, float inner)

{
  float out;
  char a[40];

  out = strtod(fl_get_input(obj), NULL);
  if (out > 20.0 || out <= inner) {
    sprintf(a, "between %.1f and 50.0", inner);
    fl_show_message("Size of the outer circle radius should be", a, "");
    out = outer;
  }
  set_outer(out, obj);
  return out;
}
예제 #3
0
void defaultoptionsC(FL_OBJECT *obj, long val)

{
  int n = state.control[state.control_num];
  set_match_defaults(frame, n);
  set_minconst(frame[n].match.min, state.options->minconstW);
  set_initconst(frame[n].match.firstbright, state.options->initconstW);
  set_starconst(frame[n].match.nstar, state.options->starconstW);
  set_starerror(frame[n].match.poserrmax, state.options->starerrorW);
  set_maxres(frame[n].match.maxres, state.options->maxresW);
  set_starminmag(frame[n].map.minmag, state.options->starminmagW);
  set_starmaxmag(frame[n].map.maxmag, state.options->starmaxmagW);
  set_starminsize(frame[n].fits.minstar, state.options->starminsizeW);
  set_countsigma(frame[n].fits.sg_num, state.options->countsigmaW);
  set_countminval(frame[n].fits.minbright, state.options->countminvalW);
  set_gridsize(frame[n].fits.maxsize, state.options->stargridW);
  set_edgesize(frame[n].fits.border, state.options->staredgeW);
  set_inner(frame[n].fits.inner, state.options->starinnerW);
  set_outer(frame[n].fits.outer, state.options->starouterW);
}
예제 #4
0
esch_error_codes EschFastAttenLight::load(XFParseIFF *iff, const char *lname)
{
    assertMyth("EschFastAttenLight::load requries iff pointer",
               iff);

//ִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִ Floating-point format
    if (iff->chunkid == iff->makeid('E','F','A','1'))
    {
        EschFileLightAtten fatn;

        if (iff->chunkSize != sizeof(fatn))
            return ESCH_ERR_INVALIDDATA;

        //ִִ Read chunk and verify name, if given.
        if (iff->read(&fatn))
            return ESCH_ERR_FILEERROR;

        if (lname && strcmp(lname,fatn.name))
            return ESCH_ERR_NOTFOUND;

        //ִִ Found, so setup Fast Atten Light
        strcpy(name,fatn.name);
        flags = fatn.flags;

        VngoColor24bit  c(fatn.color);
        set_intensity( max( max(c.r, c.g), c.b ) );

        set_position(fatn.x,fatn.y,fatn.z);

        set_inner( fatn.inner );
        set_outer( fatn.outer );
    }
//ִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִִ Fixed-point format
    else if (iff->chunkid == iff->makeid('E','F','A','T'))
    {
        EschFileLightAttenV1 fatn;

        if (iff->chunkSize != sizeof(fatn))
            return ESCH_ERR_INVALIDDATA;

        //ִִ Read chunk and verify name, if given.
        if (iff->read(&fatn))
            return ESCH_ERR_FILEERROR;

        if (lname && strcmp(lname,fatn.name))
            return ESCH_ERR_NOTFOUND;

        //ִִ Found, so setup Fast Atten Light
        strcpy(name,fatn.name);
        flags = fatn.flags;

        VngoColor24bit  c(fatn.color);
        set_intensity( max( max(c.r, c.g), c.b ) );

        set_position(fatn.x / 65536.0f,fatn.y / 65536.0f,fatn.z / 65536.0f);

        set_inner( fatn.inner / 65536.0f );
        set_outer( fatn.outer / 65536.0f );
    }
    else
    {
        return ESCH_ERR_NOTFOUND;
    }

//ִִ Return ok
    return ESCH_ERR_NONE;
}