Esempio n. 1
0
void CameraTab::updateImageInfo()
{
	CleanupSettingsModel *model = CleanupSettingsModel::instance();
	CleanupParameters *params = model->getCurrentParameters();

	TDimension outRes(0, 0);
	TPointD outDpi;

	params->getOutputImageInfo(outRes, outDpi.x, outDpi.y);
	setImageInfo(outRes.lx, outRes.ly, outDpi.x, outDpi.y);

	TXshSimpleLevel *sl;
	TFrameId fid;
	model->getCleanupFrame(sl, fid);

	ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene();
	TFilePath outputPath(sl ? scene->decodeFilePath(model->getOutputPath(sl, params)) : TFilePath());

	setImageInfo(outputPath);
}
Esempio n. 2
0
void CameraTestToggleCommand::onPreviewDataChanged() {
  CleanupSettingsModel *model = CleanupSettingsModel::instance();

  // Retrieve level under cleanup
  TXshSimpleLevel *sl;
  TFrameId fid;
  model->getCleanupFrame(sl, fid);

  // In case the level changes, release all previously previewed images
  if (m_sl.getPointer() != sl) clean();

  m_sl = sl;
  if (sl) {
    if (!(sl->getFrameStatus(fid) & TXshSimpleLevel::CleanupPreview)) {
      m_fids.push_back(fid);
      sl->setFrameStatus(
          fid, sl->getFrameStatus(fid) | TXshSimpleLevel::CleanupPreview);
    }

    postProcess();
  }
}
Esempio n. 3
0
void CameraTestToggleCommand::postProcess() {
  TApp *app                   = TApp::instance();
  CleanupSettingsModel *model = CleanupSettingsModel::instance();

  TXshSimpleLevel *sl;
  TFrameId fid;
  model->getCleanupFrame(sl, fid);

  assert(sl);
  if (!sl) return;

  // Retrieve transformed image
  TRasterImageP transformed;
  {
    TRasterImageP original;
    model->getCameraTestData(original, transformed);
  }

  // Substitute current frame image with previewed one
  sl->setFrame(fid, transformed);

  TApp::instance()->getCurrentLevel()->notifyLevelChange();
}
Esempio n. 4
0
void PreviewToggleCommand::postProcess() {
  TApp *app                   = TApp::instance();
  CleanupSettingsModel *model = CleanupSettingsModel::instance();

  TXshSimpleLevel *sl;
  TFrameId fid;
  model->getCleanupFrame(sl, fid);

  assert(sl);
  if (!sl) return;

  // Retrieve transformed image
  TRasterImageP transformed;
  {
    TRasterImageP original;
    TAffine transform;

    model->getPreviewData(original, transformed, transform);
    if (!transformed) return;
  }

  // Perform post-processing
  TRasterImageP preview(
      TCleanupper::instance()->processColors(transformed->getRaster()));

  TPointD dpi;
  transformed->getDpi(dpi.x, dpi.y);
  preview->setDpi(dpi.x, dpi.y);

  transformed = TRasterImageP();

  // Substitute current frame image with previewed one
  sl->setFrame(fid, preview);

  TApp::instance()->getCurrentLevel()->notifyLevelChange();
}