Пример #1
0
void TXshMeshColumn::saveData(TOStream &os) {
  os.child("status") << getStatusWord();
  if (getOpacity() < 255) os.child("camerastand_opacity") << (int)getOpacity();

  int r0, r1;
  if (getRange(r0, r1)) {
    os.openChild("cells");
    {
      for (int r = r0; r <= r1; ++r) {
        TXshCell cell = getCell(r);
        if (cell.isEmpty()) continue;

        TFrameId fid = cell.m_frameId;
        int n = 1, inc = 0, dr = fid.getNumber();

        // If fid has no letter save more than one cell and its increment -
        // otherwise save just one cell
        if (r < r1 && fid.getLetter() == 0) {
          TXshCell cell2 = getCell(r + 1);
          TFrameId fid2  = cell2.m_frameId;

          if (cell2.m_level.getPointer() == cell.m_level.getPointer() &&
              fid2.getLetter() == 0) {
            inc = cell2.m_frameId.getNumber() - dr;
            for (++n;; ++n) {
              if (r + n > r1) break;

              cell2         = getCell(r + n);
              TFrameId fid2 = cell2.m_frameId;

              if (cell2.m_level.getPointer() != cell.m_level.getPointer() ||
                  fid2.getLetter() != 0)
                break;

              if (fid2.getNumber() != dr + n * inc) break;
            }
          }
        }

        os.child("cell") << r << n << cell.m_level.getPointer() << fid.expand()
                         << inc;
        r += n - 1;
      }
    }
    os.closeChild();
  }
}
Пример #2
0
void CleanupParameters::saveData(TOStream &os) const
{
	CleanupParameters::LastSavedParameters.assign(this);

	os.openChild("cleanupCamera");
	m_camera.saveData(os);
	os.closeChild();

	os.openChild("cleanupPalette");
	m_cleanupPalette->saveData(os);
	os.closeChild();

	std::map<std::string, std::string> attr;
	if (m_autocenterType != AUTOCENTER_NONE) {
		attr.clear();
		attr["type"] = toString((int)m_autocenterType);
		attr["pegHoles"] = toString((int)m_pegSide);
		//attr["fieldGuide"] = toString((int)m_pegSide);
		os.openCloseChild("autoCenter", attr);
	}

	if (m_flipx || m_flipy || m_rotate != 0 //|| m_scale!=1
		|| m_offx != 0 || m_offy != 0) {
		attr.clear();
		std::string flip = std::string(m_flipx ? "x" : "") + std::string(m_flipy ? "y" : "");
		if (flip != "")
			attr["flip"] = flip;
		if (m_rotate != 0)
			attr["rotate"] = toString(m_rotate);
		//if(m_scale!=1) attr["scale"] = toString(m_scale);
		if (m_offx != 0.0)
			attr["xoff"] = toString(m_offx);
		if (m_offy != 0.0)
			attr["yoff"] = toString(m_offy);
		os.openCloseChild("transform", attr);
	}

	if (m_lineProcessingMode != lpNone) {
		attr.clear();
		attr["sharpness"] = toString(m_sharpness);
		attr["autoAdjust"] = toString((int)m_autoAdjustMode);
		attr["mode"] = (m_lineProcessingMode == lpGrey ? "grey" : "color");
		os.openCloseChild("lineProcessing", attr);
	}
	if (m_noAntialias) {
		attr.clear();
		os.openCloseChild("noAntialias", attr);
	}
	if (m_postAntialias) {
		attr.clear();
		os.openCloseChild("MLAA", attr);
	}
	attr.clear();
	attr["value"] = toString(m_despeckling);
	os.openCloseChild("despeckling", attr);
	attr.clear();
	attr["value"] = toString(m_aaValue);
	os.openCloseChild("aaValue", attr);
	attr.clear();
	attr["value"] = toString(m_closestField);
	os.openCloseChild("closestField", attr);
	attr.clear();
	attr["name"] = m_fdgInfo.m_name;
	os.openCloseChild("fdg", attr);
	attr.clear();
	if (m_path != TFilePath())
		os.child("path") << m_path;

	// attr["path"] = toString(m_path.getWideString());
	// os.openCloseChild("path", attr);

	//m_closestField = param->m_closestField;
	//m_autoAdjustMode = param->m_autoAdjustMode;
	//m_sharpness = param->m_sharpness;
	//m_transparencyCheckEnabled = param->m_transparencyCheckEnabled;
}
Пример #3
0
void TSceneProperties::saveData(TOStream &os) const
{
	if (!m_hGuides.empty()) {
		os.openChild("hGuides");
		for (int i = 0; i < (int)m_hGuides.size(); i++)
			os << m_hGuides[i];
		os.closeChild();
	}
	if (!m_vGuides.empty()) {
		os.openChild("vGuides");
		for (int i = 0; i < (int)m_vGuides.size(); i++)
			os << m_vGuides[i];
		os.closeChild();
	}

	int i;
	if (!m_cameras.empty()) {
		os.openChild("cameras");
		for (i = 0; i < (int)m_cameras.size(); i++) {
			os.openChild("camera");
			m_cameras[i]->saveData(os);
			os.closeChild();
		}
		os.closeChild();
	}

	os.openChild("outputs");
	std::vector<TOutputProperties *> outputs;
	outputs.push_back(getOutputProperties());
	outputs.push_back(getPreviewProperties());
	for (i = 0; i < (int)outputs.size(); i++) {
		TOutputProperties &out = *outputs[i];
		const TRenderSettings &rs = out.getRenderSettings();
		std::map<std::string, std::string> attr;
		attr["name"] = i == 0 ? "main" : "preview";
		os.openChild("output", attr);

		TFilePath outPath = out.getPath();
		int from, to, step;
		out.getRange(from, to, step);
		os.child("range") << from << to;
		os.child("step") << step;
		os.child("shrink") << rs.m_shrinkX;
		os.child("applyShrinkToViewer") << (rs.m_applyShrinkToViewer ? 1 : 0);
		os.child("fps") << out.getFrameRate();
		os.child("path") << outPath;
		os.child("bpp") << rs.m_bpp;
		os.child("multimedia") << out.getMultimediaRendering();
		os.child("threadsIndex") << out.getThreadIndex();
		os.child("maxTileSizeIndex") << out.getMaxTileSizeIndex();
		os.child("subcameraPrev") << (out.isSubcameraPreview() ? 1 : 0);
		os.child("stereoscopic") << (rs.m_stereoscopic ? 1 : 0) << rs.m_stereoscopicShift;

		switch (rs.m_quality) {
		case TRenderSettings::StandardResampleQuality:
			os.child("resquality") << (int)0;
			break;
		case TRenderSettings::ImprovedResampleQuality:
			os.child("resquality") << (int)1;
			break;
		case TRenderSettings::HighResampleQuality:
			os.child("resquality") << (int)2;

		case TRenderSettings::Triangle_FilterResampleQuality:
			os.child("resquality") << (int)100;
			break;
		case TRenderSettings::Mitchell_FilterResampleQuality:
			os.child("resquality") << (int)101;
			break;
		case TRenderSettings::Cubic5_FilterResampleQuality:
			os.child("resquality") << (int)102;
			break;
		case TRenderSettings::Cubic75_FilterResampleQuality:
			os.child("resquality") << (int)103;
			break;
		case TRenderSettings::Cubic1_FilterResampleQuality:
			os.child("resquality") << (int)104;
			break;
		case TRenderSettings::Hann2_FilterResampleQuality:
			os.child("resquality") << (int)105;
			break;
		case TRenderSettings::Hann3_FilterResampleQuality:
			os.child("resquality") << (int)106;
			break;
		case TRenderSettings::Hamming2_FilterResampleQuality:
			os.child("resquality") << (int)107;
			break;
		case TRenderSettings::Hamming3_FilterResampleQuality:
			os.child("resquality") << (int)108;
			break;
		case TRenderSettings::Lanczos2_FilterResampleQuality:
			os.child("resquality") << (int)109;
			break;
		case TRenderSettings::Lanczos3_FilterResampleQuality:
			os.child("resquality") << (int)110;
			break;
		case TRenderSettings::Gauss_FilterResampleQuality:
			os.child("resquality") << (int)111;
			break;
		case TRenderSettings::ClosestPixel_FilterResampleQuality:
			os.child("resquality") << (int)112;
			break;
		case TRenderSettings::Bilinear_FilterResampleQuality:
			os.child("resquality") << (int)113;
			break;
			break;
		DEFAULT:
			assert(false);
		}
		switch (rs.m_fieldPrevalence) {
		case TRenderSettings::NoField:
			os.child("fieldprevalence") << (int)0;
			break;
		case TRenderSettings::EvenField:
			os.child("fieldprevalence") << (int)1;
			break;
		case TRenderSettings::OddField:
			os.child("fieldprevalence") << (int)2;
			break;
		DEFAULT:
			assert(false);
		}
		os.child("gamma") << rs.m_gamma;
		os.child("timestretch") << rs.m_timeStretchFrom << rs.m_timeStretchTo;

		if (out.getOffset() != 0)
			os.child("offset") << out.getOffset();

		os.openChild("formatsProperties");
		std::vector<std::string> fileExtensions;
		out.getFileFormatPropertiesExtensions(fileExtensions);
		for (int i = 0; i < (int)fileExtensions.size(); i++) {
			std::string ext = fileExtensions[i];
			TPropertyGroup *pg = out.getFileFormatProperties(ext);
			assert(pg);
			std::map<std::string, std::string> attr;
			attr["ext"] = ext;
			os.openChild("formatProperties", attr);
			pg->saveData(os);
			os.closeChild();
		}
		os.closeChild();

		os.closeChild(); // </output>
	}
	os.closeChild();
	os.openChild("cleanupParameters");
	m_cleanupParameters->saveData(os);
	os.closeChild();
	os.openChild("scanParameters");
	m_scanParameters->saveData(os);
	os.closeChild();
	os.openChild("vectorizerParameters");
	m_vectorizerParameters->saveData(os);
	os.closeChild();
	os.child("bgColor") << m_bgColor;
	os.child("markers") << m_markerDistance << m_markerOffset;
	os.child("subsampling") << m_fullcolorSubsampling << m_tlvSubsampling;
	os.child("fieldguide") << m_fieldGuideSize << m_fieldGuideAspectRatio;

	os.openChild("noteColors");
	for (i = 0; i < m_notesColor.size(); i++)
		os << m_notesColor.at(i);
	os.closeChild();
}
void SkVD::saveData(TOStream &os)
{
	for (int p = 0; p < PARAMS_COUNT; ++p)
		if (!m_params[p]->isDefault())
			os.child(::parNames[p]) << *m_params[p];
}