本文整理汇总了C++中ScColor::setRegistrationColor方法的典型用法代码示例。如果您正苦于以下问题:C++ ScColor::setRegistrationColor方法的具体用法?C++ ScColor::setRegistrationColor怎么用?C++ ScColor::setRegistrationColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScColor
的用法示例。
在下文中一共展示了ScColor::setRegistrationColor方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: defColor
void XtgScanner::defColor()
{
bool isSpot = false;
ScColor tmp;
enterState(stringMode);
token = getToken();
while (lookAhead() != '>' )
{
token = getToken();
if ((token == "CMJN") || (token == "CMYK"))
{
enterState(tagMode);
token = getToken();
if (token == "S")
{
token = getToken();
isSpot = true;
}
double c = getToken().toDouble();
double m = getToken().toDouble();
double y = getToken().toDouble();
double k = getToken().toDouble();
tmp.setColor(qRound(c * 2.55), qRound(m * 255), qRound(y * 255), qRound(k * 255));
tmp.setSpotColor(isSpot);
tmp.setRegistrationColor(false);
doc->PageColors.tryAddColor(sfcName, tmp);
}
else if (token == "RGB")
{
enterState(tagMode);
token = getToken();
if (token == "S")
{
token = getToken();
isSpot = true;
}
double r = getToken().toDouble();
double g = getToken().toDouble();
double b = getToken().toDouble();
tmp.setColorRGB(qRound(r * 2.55), qRound(g * 255), qRound(b * 255));
tmp.setSpotColor(isSpot);
tmp.setRegistrationColor(false);
doc->PageColors.tryAddColor(sfcName, tmp);
}
}
top++;
enterState(textMode);
}
示例2: processColor
QString SmlPlug::processColor(QDomElement &elem)
{
QString colnam = elem.attribute("color","#ffffff");
QColor stroke;
stroke.setNamedColor("#"+colnam.right(6));
ScColor tmp;
tmp.fromQColor(stroke);
tmp.setSpotColor(false);
tmp.setRegistrationColor(false);
QString newColorName = "FromSML"+tmp.name();
QString fNam = m_Doc->PageColors.tryAddColor(newColorName, tmp);
if (fNam == newColorName)
importedColors.append(newColorName);
return fNam;
}
示例3: parseColor
void XfigPlug::parseColor(QString data)
{
if (data.isEmpty())
return;
int colorNum, dummy;
QString colorValues;
ScColor tmp;
ScTextStream Code(&data, QIODevice::ReadOnly);
Code >> dummy >> colorNum >> colorValues;
tmp.setNamedColor(colorValues);
tmp.setSpotColor(false);
tmp.setRegistrationColor(false);
QString namPrefix = "FromXfig%1-"+colorValues;
CustColors.insert(namPrefix.arg(colorNum), tmp);
importedColors.insert(colorNum, namPrefix.arg(colorNum));
}
示例4: selSwatch
void CMYKChoose::selSwatch()
{
QTreeWidgetItem *c = Swatches->currentItem();
if (c == hsvSelector)
TabStack->setCurrentIndex(0);
else
{
CurrSwatch.clear();
QString pfadC2 = "";
QString txt = c->data(0, Qt::UserRole).toString() + "/" + c->text(0);
if (!customColSet.contains(txt))
pfadC2 = csm.paletteFileFromName(txt);
else
pfadC2 = csm.userPaletteFileFromName(txt);
if (importColorsFromFile(pfadC2, CurrSwatch))
{
CurrSwatch.insert("White", ScColor(0, 0, 0, 0));
CurrSwatch.insert("Black", ScColor(0, 0, 0, 255));
}
else
{
CurrSwatch.insert("White", ScColor(0, 0, 0, 0));
CurrSwatch.insert("Black", ScColor(0, 0, 0, 255));
ScColor cc = ScColor(255, 255, 255, 255);
cc.setRegistrationColor(true);
CurrSwatch.insert("Registration", cc);
CurrSwatch.insert("Blue", ScColor(255, 255, 0, 0));
CurrSwatch.insert("Cyan", ScColor(255, 0, 0, 0));
CurrSwatch.insert("Green", ScColor(255, 0, 255, 0));
CurrSwatch.insert("Red", ScColor(0, 255, 255, 0));
CurrSwatch.insert("Yellow", ScColor(0, 0, 255, 0));
CurrSwatch.insert("Magenta", ScColor(0, 255, 0, 0));
}
ColorSwatch->clear();
ColorSwatch->insertFancyPixmapItems(CurrSwatch);
ColorSwatch->setCurrentRow( 0 );
TabStack->setCurrentIndex(1);
}
}
示例5: ensureRegistration
void ColorList::ensureRegistration(void)
{
ScColor cc = ScColor(255, 255, 255, 255);
cc.setRegistrationColor(true);
insert("Registration", cc);
}
示例6: parseGroup
void ShapePlug::parseGroup(QDomNode &DOC)
{
QString tmp = "";
QString FillCol = "White";
QString StrokeCol = "Black";
QString defFillCol = "White";
QString defStrokeCol = "Black";
QColor stroke = Qt::black;
QColor fill = Qt::white;
// Qt::PenStyle Dash = Qt::SolidLine;
Qt::PenCapStyle LineEnd = Qt::FlatCap;
Qt::PenJoinStyle LineJoin = Qt::MiterJoin;
// int fillStyle = 1;
double strokewidth = 0.1;
// bool poly = false;
while(!DOC.isNull())
{
double x1, y1, x2, y2;
StrokeCol = defStrokeCol;
FillCol = defFillCol;
stroke = Qt::black;
fill = Qt::white;
// fillStyle = 1;
strokewidth = 1.0;
// Dash = Qt::SolidLine;
LineEnd = Qt::FlatCap;
LineJoin = Qt::MiterJoin;
FPointArray PoLine;
PoLine.resize(0);
QDomElement pg = DOC.toElement();
QString STag = pg.tagName();
QString style = pg.attribute( "style", "" ).simplified();
if (style.isEmpty())
style = pg.attribute( "svg:style", "" ).simplified();
QStringList substyles = style.split(';', QString::SkipEmptyParts);
for( QStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it )
{
QStringList substyle = (*it).split(':', QString::SkipEmptyParts);
QString command(substyle[0].trimmed());
QString params(substyle[1].trimmed());
if (command == "fill")
{
if (!((params == "foreground") || (params == "background") || (params == "fg") || (params == "bg") || (params == "none") || (params == "default") || (params == "inverse")))
{
if (params == "nofill")
FillCol = CommonStrings::None;
else
{
fill.setNamedColor( params );
FillCol = "FromDia"+fill.name();
ScColor tmp;
tmp.fromQColor(fill);
tmp.setSpotColor(false);
tmp.setRegistrationColor(false);
QString fNam = m_Doc->PageColors.tryAddColor(FillCol, tmp);
if (fNam == FillCol)
importedColors.append(FillCol);
FillCol = fNam;
}
}
}
else if (command == "stroke")
{
if (!((params == "foreground") || (params == "background") || (params == "fg") || (params == "bg") || (params == "none") || (params == "default")) || (params == "inverse"))
{
stroke.setNamedColor( params );
StrokeCol = "FromDia"+stroke.name();
ScColor tmp;
tmp.fromQColor(stroke);
tmp.setSpotColor(false);
tmp.setRegistrationColor(false);
QString fNam = m_Doc->PageColors.tryAddColor(StrokeCol, tmp);
if (fNam == StrokeCol)
importedColors.append(StrokeCol);
StrokeCol = fNam;
}
}
else if (command == "stroke-width")
strokewidth = ScCLocale::toDoubleC(params);
else if( command == "stroke-linejoin" )
{
if( params == "miter" )
LineJoin = Qt::MiterJoin;
else if( params == "round" )
LineJoin = Qt::RoundJoin;
else if( params == "bevel" )
LineJoin = Qt::BevelJoin;
}
else if( command == "stroke-linecap" )
{
if( params == "butt" )
LineEnd = Qt::FlatCap;
else if( params == "round" )
LineEnd = Qt::RoundCap;
else if( params == "square" )
LineEnd = Qt::SquareCap;
}
}
if (STag == "svg:line")
{
//.........这里部分代码省略.........
示例7: importFile
bool PaletteLoader_Swatchbook::importFile(const QString& fileName, bool /*merge*/)
{
ScColor lf;
int oldCount = m_colors->count();
QScopedPointer<ScZipHandler> uz(new ScZipHandler());
if (!uz->open(fileName))
return false;
if (!uz->contains("swatchbook.xml"))
return false;
QByteArray docBytes;
if (!uz->read("swatchbook.xml", docBytes))
return false;
QString docText = QString::fromUtf8(docBytes);
QDomDocument docu("scridoc");
if (!docu.setContent(docText))
return false;
QDomElement docElem = docu.documentElement();
for (QDomElement drawPag = docElem.firstChildElement(); !drawPag.isNull(); drawPag = drawPag.nextSiblingElement())
{
if (drawPag.tagName() == "materials")
{
for (QDomElement spf = drawPag.firstChildElement(); !spf.isNull(); spf = spf.nextSiblingElement() )
{
if (spf.tagName() == "color")
{
bool isSpot = spf.attribute("usage") == "spot";
QString colorName = "";
ScColor tmp;
tmp.setRegistrationColor(false);
for (QDomElement spp = spf.firstChildElement(); !spp.isNull(); spp = spp.nextSiblingElement() )
{
if (spp.tagName() == "metadata")
{
for (QDomElement spm = spp.firstChildElement(); !spm.isNull(); spm = spm.nextSiblingElement() )
{
if (spm.tagName() == "dc:identifier")
colorName = spm.text();
}
}
else if (spp.tagName() == "values")
{
QString colorVals = spp.text();
ScTextStream CoE(&colorVals, QIODevice::ReadOnly);
if (spp.attribute("model") == "Lab")
{
double inC[3];
CoE >> inC[0];
CoE >> inC[1];
CoE >> inC[2];
tmp.setLabColor(inC[0], inC[1], inC[2]);
tmp.setSpotColor(isSpot);
}
else if (spp.attribute("model") == "CMYK")
{
double c, m, y, k;
CoE >> c >> m >> y >> k;
tmp.setColorF(c, m, y, k);
tmp.setSpotColor(isSpot);
}
else if (spp.attribute("model") == "RGB")
{
double r, g, b;
CoE >> r >> g >> b;
tmp.setRgbColorF(r, g, b);
tmp.setSpotColor(false);
}
示例8: initialiseDefaultPrefs
void ColorSetManager::initialiseDefaultPrefs(struct ApplicationPrefs& appPrefs)
{
QString defaultSwatch = ScPaths::instance().shareDir() + "swatches/" + "Scribus_Basic.xml";
QFile fiC(defaultSwatch);
if (!fiC.exists())
{
appPrefs.colorPrefs.DColors.insert("White", ScColor(0, 0, 0, 0));
appPrefs.colorPrefs.DColors.insert("Black", ScColor(0, 0, 0, 255));
ScColor cc = ScColor(255, 255, 255, 255);
cc.setRegistrationColor(true);
appPrefs.colorPrefs.DColors.insert("Registration", cc);
appPrefs.colorPrefs.DColors.insert("Blue", ScColor(255, 255, 0, 0));
appPrefs.colorPrefs.DColors.insert("Cyan", ScColor(255, 0, 0, 0));
appPrefs.colorPrefs.DColors.insert("Green", ScColor(255, 0, 255, 0));
appPrefs.colorPrefs.DColors.insert("Red", ScColor(0, 255, 255, 0));
appPrefs.colorPrefs.DColors.insert("Yellow", ScColor(0, 0, 255, 0));
appPrefs.colorPrefs.DColors.insert("Magenta", ScColor(0, 255, 0, 0));
appPrefs.colorPrefs.DColorSet = "Scribus_Small";
}
else
{
if (fiC.open(QIODevice::ReadOnly))
{
QString ColorEn, Cname;
int Rval, Gval, Bval;
QTextStream tsC(&fiC);
ColorEn = tsC.readLine();
if (ColorEn.startsWith("<?xml version="))
{
QByteArray docBytes("");
loadRawText(defaultSwatch, docBytes);
QString docText("");
docText = QString::fromUtf8(docBytes);
QDomDocument docu("scridoc");
docu.setContent(docText);
ScColor lf = ScColor();
QDomElement elem = docu.documentElement();
QDomNode PAGE = elem.firstChild();
while(!PAGE.isNull())
{
QDomElement pg = PAGE.toElement();
if(pg.tagName()=="COLOR" && pg.attribute("NAME")!=CommonStrings::None)
{
if (pg.hasAttribute("CMYK"))
lf.setNamedColor(pg.attribute("CMYK"));
else
lf.fromQColor(QColor(pg.attribute("RGB")));
if (pg.hasAttribute("Spot"))
lf.setSpotColor(static_cast<bool>(pg.attribute("Spot").toInt()));
else
lf.setSpotColor(false);
if (pg.hasAttribute("Register"))
lf.setRegistrationColor(static_cast<bool>(pg.attribute("Register").toInt()));
else
lf.setRegistrationColor(false);
appPrefs.colorPrefs.DColors.insert(pg.attribute("NAME"), lf);
}
PAGE=PAGE.nextSibling();
}
}
else
{
while (!tsC.atEnd())
{
ColorEn = tsC.readLine();
QTextStream CoE(&ColorEn, QIODevice::ReadOnly);
CoE >> Rval;
CoE >> Gval;
CoE >> Bval;
CoE >> Cname;
ScColor tmp;
tmp.setColorRGB(Rval, Gval, Bval);
appPrefs.colorPrefs.DColors.insert(Cname, tmp);
}
}
fiC.close();
}
appPrefs.colorPrefs.DColorSet = ScPaths::instance().shareDir() + "swatches/" + "Scribus Basic";
}
示例9: importFile
bool PaletteLoader_Autocad_acb::importFile(const QString& fileName, bool /*merge*/)
{
QByteArray docBytes;
loadRawText(fileName, docBytes);
QString docText = QString::fromUtf8(docBytes);
QDomDocument docu("scridoc");
if (!docu.setContent(docText))
return false;
ScColor lf;
int oldCount = m_colors->count();
QDomElement elem = docu.documentElement();
QDomNode PAGE = elem.firstChild();
while (!PAGE.isNull())
{
QDomElement pg = PAGE.toElement();
if (pg.tagName() == "colorPage")
{
QDomNode colNode = pg.firstChild();
while (!colNode.isNull())
{
QDomElement cg = colNode.toElement();
if (cg.tagName() == "colorEntry")
{
int r (0), g(0), b(0);
QString colorName = "";
QDomNode colEntry = cg.firstChild();
while (!colEntry.isNull())
{
QDomElement cc = colEntry.toElement();
if (cc.tagName() == "colorName")
colorName = cc.text();
else if (cc.tagName() == "RGB8")
{
QDomNode colVal = cc.firstChild();
while (!colVal.isNull())
{
QDomElement cv = colVal.toElement();
if (cv.tagName() == "red")
r = cv.text().toInt();
else if (cv.tagName() == "green")
g = cv.text().toInt();
else if (cv.tagName() == "blue")
b = cv.text().toInt();
colVal = colVal.nextSibling();
}
}
colEntry = colEntry.nextSibling();
}
if (!colorName.isEmpty())
{
lf.setRgbColor(r, g, b);
lf.setSpotColor(false);
lf.setRegistrationColor(false);
m_colors->tryAddColor(colorName, lf);
}
}
colNode = colNode.nextSibling();
}
}
PAGE = PAGE.nextSibling();
}
return (m_colors->count() != oldCount);
}
示例10: importColorsFromFile
//.........这里部分代码省略.........
lf.setCmykColorF(c, m, y, k);
}
else if (space == "RGB")
{
double r = pg.attribute("R", "0").toDouble() / 255.0;
double g = pg.attribute("G", "0").toDouble() / 255.0;
double b = pg.attribute("B", "0").toDouble() / 255.0;
lf.setRgbColorF(r, g, b);
}
else if (space == "Lab")
{
double L = pg.attribute("L", "0").toDouble();
double a = pg.attribute("A", "0").toDouble();
double b = pg.attribute("B", "0").toDouble();
lf.setLabColor(L, a, b);
}
}
else if (pg.hasAttribute("CMYK"))
lf.setNamedColor(pg.attribute("CMYK"));
else if (pg.hasAttribute("RGB"))
lf.fromQColor(QColor(pg.attribute("RGB")));
else
{
double L = pg.attribute("L", "0").toDouble();
double a = pg.attribute("A", "0").toDouble();
double b = pg.attribute("B", "0").toDouble();
lf.setLabColor(L, a, b);
}
if (pg.hasAttribute("Spot"))
lf.setSpotColor(static_cast<bool>(pg.attribute("Spot").toInt()));
else
lf.setSpotColor(false);
if (pg.hasAttribute("Register"))
lf.setRegistrationColor(static_cast<bool>(pg.attribute("Register").toInt()));
else
lf.setRegistrationColor(false);
EditColors.tryAddColor(pg.attribute("NAME"), lf);
}
else if (pg.tagName() == "Gradient")
{
if (dialogGradients != NULL)
{
VGradient gra = VGradient(VGradient::linear);
gra.clearStops();
QDomNode grad = pg.firstChild();
while (!grad.isNull())
{
QDomElement stop = grad.toElement();
QString name = stop.attribute("NAME");
double ramp = ScCLocale::toDoubleC(stop.attribute("RAMP"), 0.0);
int shade = stop.attribute("SHADE", "100").toInt();
double opa = ScCLocale::toDoubleC(stop.attribute("TRANS"), 1.0);
QColor color;
if (name == CommonStrings::None)
color = QColor(255, 255, 255, 0);
else
{
const ScColor& col = EditColors[name];
color = ScColorEngine::getShadeColorProof(col, NULL, shade);
}
gra.addStop(color, ramp, 0.5, opa, name, shade);
grad = grad.nextSibling();
}
if ((!dialogGradients->contains(pg.attribute("Name"))) || (merge))
dialogGradients->insert(pg.attribute("Name"), gra);
else