本文整理汇总了C++中KisConfig类的典型用法代码示例。如果您正苦于以下问题:C++ KisConfig类的具体用法?C++ KisConfig怎么用?C++ KisConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KisConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Q_UNUSED
void KisInfinityManager::drawDecoration(QPainter& gc, const QRectF& updateArea, const KisCoordinatesConverter *converter, KisCanvas2 *canvas)
{
Q_UNUSED(updateArea);
Q_UNUSED(converter);
Q_UNUSED(canvas);
if (!m_filteringEnabled) return;
gc.save();
gc.setTransform(QTransform(), false);
KisConfig cfg;
QColor color = cfg.canvasBorderColor();
gc.fillPath(m_decorationPath, color.darker(115));
QPainterPath p;
p.moveTo(5, 2);
p.lineTo(-3, 8);
p.lineTo(-5, 5);
p.lineTo( 2, 0);
p.lineTo(-5,-5);
p.lineTo(-3,-8);
p.lineTo( 5,-2);
p.arcTo(QRectF(3, -2, 4, 4), 90, -180);
foreach (const QTransform &t, m_handleTransform) {
gc.fillPath(t.map(p), color);
}
示例2: renderCanvasGL
void KisOpenGLCanvas2::paintGL()
{
if (!OPENGL_SUCCESS) {
KisConfig cfg;
cfg.writeEntry("canvasState", "OPENGL_PAINT_STARTED");
}
KisOpenglCanvasDebugger::instance()->nofityPaintRequested();
renderCanvasGL();
if (d->glSyncObject) {
Sync::deleteSync(d->glSyncObject);
}
d->glSyncObject = Sync::getSync();
QPainter gc(this);
renderDecorations(&gc);
gc.end();
if (!OPENGL_SUCCESS) {
KisConfig cfg;
cfg.writeEntry("canvasState", "OPENGL_SUCCESS");
OPENGL_SUCCESS = true;
}
}
示例3: q
KisInputManager::Private::Private(KisInputManager *qq)
: q(qq)
, canvas(0)
, toolProxy(0)
, forwardAllEventsToTool(false)
, disableTouchOnCanvas(false)
, touchHasBlockedPressEvents(false)
, lastTouchEvent(0)
, defaultInputAction(0)
, eventsReceiver(0)
, moveEventCompressor(10 /* ms */, KisSignalCompressor::FIRST_ACTIVE)
, testingAcceptCompressedTabletEvents(false)
, testingCompressBrushEvents(false)
, focusOnEnter(true)
, containsPointer(true)
{
KisConfig cfg;
disableTouchOnCanvas = cfg.disableTouchOnCanvas();
moveEventCompressor.setDelay(cfg.tabletEventsDelay());
testingAcceptCompressedTabletEvents = cfg.testingAcceptCompressedTabletEvents();
testingCompressBrushEvents = cfg.testingCompressBrushEvents();
setupActions();
canvasSwitcher = new CanvasSwitcher(this, q);
qApp->installEventFilter(globalEventEater);
}
示例4: qRound
void KisToolFreehandHelper::stabilizerStart(KisPaintInformation firstPaintInfo)
{
// FIXME: Ugly hack, this is no a "distance" in any way
int sampleSize = qRound(m_d->effectiveSmoothnessDistance());
sampleSize = qMax(3, sampleSize);
// Fill the deque with the current value repeated until filling the sample
m_d->stabilizerDeque.clear();
for (int i = sampleSize; i > 0; i--) {
m_d->stabilizerDeque.enqueue(firstPaintInfo);
}
// Poll and draw regularly
KisConfig cfg;
int stabilizerSampleSize = cfg.stabilizerSampleSize();
m_d->stabilizerPollTimer.setInterval(stabilizerSampleSize);
m_d->stabilizerPollTimer.start();
int delayedPaintInterval = cfg.stabilizerDelayedPaintInterval();
if (delayedPaintInterval < stabilizerSampleSize) {
m_d->stabilizerDelayedPaintHelper.start(delayedPaintInterval, firstPaintInfo);
}
m_d->stabilizedSampler.clear();
m_d->stabilizedSampler.addEvent(firstPaintInfo);
}
示例5: imageCanUseHDRExposureProgram
bool KisOpenGLImageTextures::imageCanUseHDRExposureProgram(KisImageSP image)
{
#ifdef HAVE_GLEW
if (!image->colorSpace()->hasHighDynamicRange()) {
return false;
}
KisConfig cfg;
if (!cfg.useOpenGLShaders()) {
return false;
}
if (HDRExposureProgram == 0) {
return false;
}
if (!HDRExposureProgram->isValid()) {
return false;
}
if (!haveHDRTextureFormat(image->colorSpace())) {
return false;
}
return true;
#else
Q_UNUSED(image);
return false;
#endif
}
示例6: imageRectInViewportPixels
void KisCoordinatesConverter::getQPainterCheckersInfo(QTransform *transform,
QPointF *brushOrigin,
QPolygonF *polygon) const
{
/**
* Qt has different rounding for QPainter::drawRect/drawImage.
* The image is rounded mathematically, while rect in aligned
* to the next integer. That causes transparent line appear on
* the canvas.
*
* See: https://bugreports.qt.nokia.com/browse/QTBUG-22827
*/
QRectF imageRect = imageRectInViewportPixels();
imageRect.adjust(0,0,-0.5,-0.5);
KisConfig cfg;
if (cfg.scrollCheckers()) {
*transform = viewportToWidgetTransform();
*polygon = imageRect;
*brushOrigin = imageToViewport(QPointF(0,0));
}
else {
*transform = QTransform();
*polygon = viewportToWidgetTransform().map(imageRect);
*brushOrigin = QPoint(0,0);
}
}
示例7: updateSettings
void KisPaintingInformationBuilder::updateSettings()
{
KisConfig cfg;
KisCubicCurve curve;
curve.fromString(cfg.pressureTabletCurve());
m_pressureSamples = curve.floatTransfer(LEVEL_OF_PRESSURE_RESOLUTION + 1);
}
示例8: eventFilter
bool PaletteDockerDock::eventFilter(QObject* object, QEvent* event)
{
if (object == m_wdgPaletteDock->paletteView->viewport() && event->type() == QEvent::Wheel) {
QWheelEvent* qwheel = dynamic_cast<QWheelEvent* >(event);
if (qwheel->modifiers() & Qt::ControlModifier) {
int numDegrees = qwheel->delta() / 8;
int numSteps = numDegrees / 7;
int curSize = m_wdgPaletteDock->paletteView->horizontalHeader()->sectionSize(0);
int setSize = numSteps + curSize;
if ( setSize >= 12 ) {
m_wdgPaletteDock->paletteView->horizontalHeader()->setDefaultSectionSize(setSize);
m_wdgPaletteDock->paletteView->verticalHeader()->setDefaultSectionSize(setSize);
KisConfig cfg;
cfg.setPaletteDockerPaletteViewSectionSize(setSize);
}
return true;
} else {
return false;
}
} else {
return QWidget::eventFilter(object, event);
}
}
示例9: loadSettings
void KisColorSelector::loadSettings()
{
KisConfig cfg;
setColorSpace(KisColor::Type(cfg.readEntry<qint32>("ArtColorSel.ColorSpace" , KisColor::HSY)));
setNumLightPieces(cfg.readEntry("ArtColorSel.LightPieces", 19));
m_selectedColor.setH(cfg.readEntry<float>("ArtColorSel.SelColorH", 0.0f));
m_selectedColor.setS(cfg.readEntry<float>("ArtColorSel.SelColorS", 0.0f));
m_selectedColor.setX(cfg.readEntry<float>("ArtColorSel.SelColorX", 0.0f));
m_selectedColor.setA(1.0f);
setInverseSaturation(cfg.readEntry<bool>("ArtColorSel.InversedSaturation", false));
setLight(cfg.readEntry<float>("ArtColorSel.Light", 0.5f), cfg.readEntry<bool>("ArtColorSel.RelativeLight", false));
recalculateRings(
cfg.readEntry("ArtColorSel.NumRings" , 11),
cfg.readEntry("ArtColorSel.RingPieces", 12)
);
QList<float> angles = cfg.readList<float>("ArtColorSel.RingAngles");
for (int i = 0; i < m_colorRings.size(); ++i) {
if (i < angles.size() && i < m_colorRings.size()) {
m_colorRings[i].angle = angles[i];
}
}
selectColor(m_selectedColor);
update();
}
示例10: saveStaticData
void KisGridConfig::saveStaticData() const
{
KisConfig cfg;
cfg.setGridMainStyle(m_lineTypeMain);
cfg.setGridSubdivisionStyle(m_lineTypeSubdivision);
cfg.setGridMainColor(m_colorMain);
cfg.setGridSubdivisionColor(m_colorSubdivision);
}
示例11: QWidget
KisFilterPreviewWidget::KisFilterPreviewWidget(QWidget* parent): QWidget(parent)
{
KisConfig cfg;
// for preview make it smaller than on canvas
qint32 checkSize = qMax(1,cfg.checkSize() / 2);
QImage checkImage = KisCanvasWidgetBase::createCheckersImage(checkSize);
m_checkBrush = QBrush(checkImage);
m_pixmap = QPixmap::fromImage(checkImage);
}
示例12:
PaletteDockerDock::~PaletteDockerDock()
{
KoResourceServer<KoColorSet>* rServer = KoResourceServerProvider::instance()->paletteServer();
rServer->removeObserver(this);
if (m_currentColorSet) {
KisConfig cfg;
cfg.setDefaultPalette(m_currentColorSet->name());
}
}
示例13: glDeleteTextures
KisTextureTile::~KisTextureTile()
{
#ifdef USE_PIXEL_BUFFERS
KisConfig cfg;
if (cfg.useOpenGLTextureBuffer()) {
delete m_glBuffer;
}
#endif
glDeleteTextures(1, &m_textureId);
}
示例14: loadStaticData
void KisGridConfig::loadStaticData()
{
KisConfig cfg;
m_lineTypeMain = LineTypeInternal(cfg.getGridMainStyle());
m_lineTypeSubdivision = LineTypeInternal(cfg.getGridSubdivisionStyle());
m_colorMain = cfg.getGridMainColor();
m_colorSubdivision = cfg.getGridSubdivisionColor();
}
示例15: initializeOpenGLFunctions
void KisOpenGLCanvas2::initializeGL()
{
KisOpenGL::initializeContext(context());
initializeOpenGLFunctions();
KisConfig cfg;
d->openGLImageTextures->setProofingConfig(canvas()->proofingConfiguration());
d->openGLImageTextures->initGL(context()->functions());
d->openGLImageTextures->generateCheckerTexture(createCheckersImage(cfg.checkSize()));
initializeShaders();
// If we support OpenGL 3.2, then prepare our VAOs and VBOs for drawing
if (KisOpenGL::hasOpenGL3()) {
d->quadVAO.create();
d->quadVAO.bind();
glEnableVertexAttribArray(PROGRAM_VERTEX_ATTRIBUTE);
glEnableVertexAttribArray(PROGRAM_TEXCOORD_ATTRIBUTE);
// Create the vertex buffer object, it has 6 vertices with 3 components
d->quadBuffers[0].create();
d->quadBuffers[0].setUsagePattern(QOpenGLBuffer::StaticDraw);
d->quadBuffers[0].bind();
d->quadBuffers[0].allocate(d->vertices, 6 * 3 * sizeof(float));
glVertexAttribPointer(PROGRAM_VERTEX_ATTRIBUTE, 3, GL_FLOAT, GL_FALSE, 0, 0);
// Create the texture buffer object, it has 6 texture coordinates with 2 components
d->quadBuffers[1].create();
d->quadBuffers[1].setUsagePattern(QOpenGLBuffer::StaticDraw);
d->quadBuffers[1].bind();
d->quadBuffers[1].allocate(d->texCoords, 6 * 2 * sizeof(float));
glVertexAttribPointer(PROGRAM_TEXCOORD_ATTRIBUTE, 2, GL_FLOAT, GL_FALSE, 0, 0);
// Create the outline buffer, this buffer will store the outlines of
// tools and will frequently change data
d->outlineVAO.create();
d->outlineVAO.bind();
glEnableVertexAttribArray(PROGRAM_VERTEX_ATTRIBUTE);
// The outline buffer has a StreamDraw usage pattern, because it changes constantly
d->lineBuffer.create();
d->lineBuffer.setUsagePattern(QOpenGLBuffer::StreamDraw);
d->lineBuffer.bind();
glVertexAttribPointer(PROGRAM_VERTEX_ATTRIBUTE, 3, GL_FLOAT, GL_FALSE, 0, 0);
}
ptr_glLogicOp = (kis_glLogicOp)(context()->getProcAddress("glLogicOp"));
Sync::init(context());
d->canvasInitialized = true;
}