void colorMark(jbyte* data, Count width, Count height, Count x, Count y, int fillColor) {
  set_color_value(data,x,y,width,fillColor);
  fillColor= 80;
  for (int delta_x= -1; delta_x <= 1; delta_x++) {
    for (int delta_y= -1; delta_y <= 1; delta_y++) {
      if ((delta_x != 0 || delta_y != 0)) {
        if (get_color_value(data,x+delta_x,y+delta_y,width) == 255) {
          colorMark(data,width,height,x+delta_x,y+delta_y,fillColor);
        }
      }
    }
  }
}
示例#2
0
文件: Scene.C 项目: tmd-gpat/MOLding
///  constructor 
Scene::Scene() : root(this) {
  set_background_mode(0);
  reset_lights();

  // initialize color names and values
  int i;
  for (i=BEGREGCLRS; i<REGCLRS; i++) {
    colorNames.add_name(defColorNames[i], i);
    set_color_value(i, defaultColor + 3*i);
  }
  //initialize color scale info
  for (i=0; i<num_scalemethods; i++) 
    colorScales.append(defScales[i]);
  scaleMethod = 0;
  scaleMin = 0.1f;
  scaleMax = 1.0f;
  scaleMid = 0.5f;
  create_colorscale();

  // background color 
  background = new DisplayColor(&root, "Background", REGBLACK);
  background_color_changed = 0;
  background_color_id = 0;

  // background gradient colors
  backgradtop = new DisplayColor(&root, "BackgroundTop", REGBLACK);
  backgradtop_color_changed = 0;
  backgradtop_color_id = 0;
  backgradbot = new DisplayColor(&root, "BackgroundBot", REGBLUE2);
  backgradbot_color_changed = 0;
  backgradbot_color_id = 0;

  // foreground color
  foreground = new DisplayColor(&root, "Foreground", REGWHITE);
  foreground_color_changed = 0;
  foreground_color_id = 0;
}
 void setColor(uint8_t color) {
     set_color_value(bitmap.data,x,y,bitmap.width,color);
 }