コード例 #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
ファイル: JlibSDL.cpp プロジェクト: jaztec/Herder
    /**
     * Button
     */
    Button::Button(std::string text, TTF_Font* font, int x_pos, int y_pos, Uint32 flags) {
        visual = SDL_CreateRGBSurface(SDL_HWSURFACE, BUTTON_DEFAULT_WIDTH, BUTTON_DEFAULT_HEIGHT, 32, 0, 0, 0, 0);
        click_sound = NULL;

        set_inner(&visual->clip_rect);
        set_pos(x_pos, y_pos);
        set_size(BUTTON_DEFAULT_WIDTH, BUTTON_DEFAULT_HEIGHT);

        set_active(); // Set the inner object active
        if (flags) i_settings |= flags; // Set the button with the given flags
        set_caption(text, font);
    }
コード例 #3
0
float
proc_inner(FL_OBJECT *obj, float inner, float outer)

{
  float inn;
  char a[40];

  inn = strtod(fl_get_input(obj), NULL);
  if (inn < 0.1 || inn >= outer) {
    sprintf(a, "between 0.1 and %.1f", outer);
    fl_show_message("Size of the inner circle radius should be", a, "");
    inn = inner;
  }
  set_inner(inn, obj);
  return inn;
}
コード例 #4
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);
}
コード例 #5
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;
}