Esempio n. 1
0
	void GanttWidget::loadConfig (QString const & path)
	{
		QString const fname = path + "/" + g_GanttTag + "/" + m_config.m_tag;
		m_config2.clear();
		gantt::loadConfig(m_config2, fname);
		filterMgr()->loadConfig(fname);
	}
Esempio n. 2
0
void ColorCurveCommand::onExecute(Context* context)
{
    // Default curve
    if (!the_curve) {
        // TODO load the curve?

        the_curve = new ColorCurve(ColorCurve::Linear);
        the_curve->addPoint(gfx::Point(0, 0));
        the_curve->addPoint(gfx::Point(255, 255));

        App::instance()->Exit.connect(&on_exit_delete_curve);
    }

    ColorCurveFilter filter;
    filter.setCurve(the_curve);

    FilterManagerImpl filterMgr(context->getActiveDocument(), &filter);
    filterMgr.setTarget(TARGET_RED_CHANNEL |
                        TARGET_GREEN_CHANNEL |
                        TARGET_BLUE_CHANNEL |
                        TARGET_GRAY_CHANNEL |
                        TARGET_ALPHA_CHANNEL);

    ColorCurveWindow window(filter, filterMgr);
    if (window.doModal()) {
        // TODO save the curve?
    }
}
Esempio n. 3
0
	void GanttWidget::saveConfig (QString const & path)
	{
		QString const fname = path + "/" + g_GanttTag + "/" + m_config.m_tag;
		gantt::GanttConfig tmp = m_config;
		//normalizeConfig(tmp);
		gantt::saveConfig(tmp, fname);
		filterMgr()->saveConfig(fname);
	}
Esempio n. 4
0
void InvertColorCommand::onExecute(Context* context)
{
  InvertColorFilter filter;
  FilterManagerImpl filterMgr(context->getActiveDocument(), &filter);
  filterMgr.setTarget(TARGET_RED_CHANNEL |
                      TARGET_GREEN_CHANNEL |
                      TARGET_BLUE_CHANNEL |
                      TARGET_GRAY_CHANNEL);

  InvertColorWindow window(filter, filterMgr);
  window.doModal();
}
void BrightnessContrastCommand::onExecute(Context* context)
{
  BrightnessContrastFilter filter;
  FilterManagerImpl filterMgr(context, &filter);
  filterMgr.setTarget(TARGET_RED_CHANNEL |
                      TARGET_GREEN_CHANNEL |
                      TARGET_BLUE_CHANNEL |
                      TARGET_GRAY_CHANNEL |
                      TARGET_ALPHA_CHANNEL);

  BrightnessContrastWindow window(filter, filterMgr);
  window.doModal();
}
Esempio n. 6
0
void ReplaceColorCommand::onExecute(Context* context)
{
  Site site = context->activeSite();

  ReplaceColorFilterWrapper filter(site.layer());
  filter.setFrom(get_config_color(ConfigSection, "Color1", ColorBar::instance()->getFgColor()));
  filter.setTo(get_config_color(ConfigSection, "Color2", ColorBar::instance()->getBgColor()));
  filter.setTolerance(get_config_int(ConfigSection, "Tolerance", 0));

  FilterManagerImpl filterMgr(context, &filter);
  filterMgr.setTarget(TARGET_RED_CHANNEL |
                      TARGET_GREEN_CHANNEL |
                      TARGET_BLUE_CHANNEL |
                      TARGET_GRAY_CHANNEL |
                      TARGET_ALPHA_CHANNEL);

  ReplaceColorWindow window(filter, filterMgr);
  if (window.doModal()) {
    set_config_color(ConfigSection, "From", filter.getFrom());
    set_config_color(ConfigSection, "To", filter.getTo());
    set_config_int(ConfigSection, "Tolerance", filter.getTolerance());
  }
}