Commit 8a7691fa authored by Thomas Zander's avatar Thomas Zander

Rename KoColorSpaceRegistry methods:

    getColorSpace -> colorSpace
    getAlpha8 -> alpha8
    getRGB8 -> rgb8
    getProfileByName -> profileByName
Add more extensive api docs to the class.
Add a const to profileByName()

svn path=/trunk/koffice/; revision=565511
parent 9d6574b2
......@@ -212,7 +212,7 @@ QImage KisRgbColorSpace::convertToQImage(const quint8 *data, qint32 width, qint3
img = img.copy();
if (dstProfile != 0) {
KoColorSpace *dstCS = m_parent->getColorSpace(KoID("RGBA",""), dstProfile->productName());
KoColorSpace *dstCS = m_parent->colorSpace(KoID("RGBA",""), dstProfile->productName());
convertPixelsTo(img.bits(),
img.bits(), dstCS,
width * height, renderingIntent);
......
......@@ -200,7 +200,7 @@ void KisWetPaletteWidget::update(KisCanvasSubject *subject)
void KisWetPaletteWidget::slotFGColorSelected(const QColor& c)
{
KisWetColorSpace* cs = dynamic_cast<KisWetColorSpace*>(KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID("WET", ""), ""));
KisWetColorSpace* cs = dynamic_cast<KisWetColorSpace*>(KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID("WET", ""), ""));
Q_ASSERT(cs);
WetPack pack;
......@@ -220,7 +220,7 @@ void KisWetPaletteWidget::slotWetnessChanged(int n)
if (!m_subject)
return;
KisWetColorSpace* cs = dynamic_cast<KisWetColorSpace*>(KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID("WET", ""), ""));
KisWetColorSpace* cs = dynamic_cast<KisWetColorSpace*>(KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID("WET", ""), ""));
Q_ASSERT(cs);
KoColor color = m_subject->fgColor();
......@@ -238,7 +238,7 @@ void KisWetPaletteWidget::slotStrengthChanged(double n)
return;
KisWetColorSpace* cs = dynamic_cast<KisWetColorSpace*>(
KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID("WET", ""), ""));
KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID("WET", ""), ""));
Q_ASSERT(cs);
KoColor color = m_subject->fgColor();
......
......@@ -43,7 +43,7 @@ void WetnessVisualisationFilter::setAction(KToggleAction* action) {
if (!m_action)
return;
KisWetColorSpace* cs = dynamic_cast<KisWetColorSpace*>(
KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID("WET", ""),"") );
KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID("WET", ""),"") );
Q_ASSERT(cs);
m_action->setChecked(cs->paintWetness());
}
......@@ -55,7 +55,7 @@ void WetnessVisualisationFilter::slotActivated() {
return;
}
KisWetColorSpace* cs = dynamic_cast<KisWetColorSpace*>(
KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID("WET", ""),"") );
KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID("WET", ""),"") );
Q_ASSERT(cs);
if (!m_action->isChecked()) {
m_timer.stop();
......@@ -68,7 +68,7 @@ void WetnessVisualisationFilter::slotActivated() {
void WetnessVisualisationFilter::slotTimeout() {
KisWetColorSpace* cs = dynamic_cast<KisWetColorSpace*>(
KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID("WET", ""),"") );
KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID("WET", ""),"") );
Q_ASSERT(cs);
if (!cs) return;
cs->resetPhase();
......
......@@ -120,11 +120,11 @@ void KisWetOp::paintAt(const KisPoint &pos, const KisPaintInformation& info)
KisPaintDeviceSP dab = KisPaintDeviceSP(0);
if (brush->brushType() == IMAGE || brush->brushType() == PIPE_IMAGE) {
dab = brush->image(KisMetaRegistry::instance()->csRegistry()->getAlpha8(), inf);
dab = brush->image(KisMetaRegistry::instance()->csRegistry()->alpha8(), inf);
}
else {
KisAlphaMaskSP mask = brush->mask(inf);
dab = computeDab(mask, KisMetaRegistry::instance()->csRegistry()->getAlpha8());
dab = computeDab(mask, KisMetaRegistry::instance()->csRegistry()->alpha8());
}
KoColorSpace * cs = device->colorSpace();
......
......@@ -104,7 +104,7 @@ void KisAdjustmentLayer::setSelection(KisSelectionSP selection)
{
m_selection = new KisSelection();
KisFillPainter gc(KisPaintDeviceSP(m_selection.data()));
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getRGB8();
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->rgb8();
if (selection) {
gc.bitBlt(0, 0, COMPOSITE_COPY, KisPaintDeviceSP(selection.data()),
......
......@@ -31,7 +31,7 @@
void KisAutogradientResource::createSegment( int interpolation, int colorInterpolation, double startOffset, double endOffset, double middleOffset, QColor left, QColor right )
{
m_colorSpace = KisMetaRegistry::instance()->csRegistry()->getRGB8();
m_colorSpace = KisMetaRegistry::instance()->csRegistry()->rgb8();
pushSegment(new KisGradientSegment(interpolation, colorInterpolation, startOffset, middleOffset, endOffset, KoColor( left, m_colorSpace ), KoColor( right, m_colorSpace )));
}
......
......@@ -462,7 +462,7 @@ KisPaintDeviceSP KisBrush::image(KoColorSpace * /*colorSpace*/, const KisPaintIn
int outputWidth = outputImage.width();
int outputHeight = outputImage.height();
KisPaintDevice *layer = new KisPaintDevice(KisMetaRegistry::instance()->csRegistry()->getRGB8(), "brush");
KisPaintDevice *layer = new KisPaintDevice(KisMetaRegistry::instance()->csRegistry()->rgb8(), "brush");
Q_CHECK_PTR(layer);
......@@ -1246,7 +1246,7 @@ void KisBrush::setHeight(qint32 h)
}
/*QImage KisBrush::outline(double pressure) {
KisLayerSP layer = image(KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID("RGBA",""),""),
KisLayerSP layer = image(KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID("RGBA",""),""),
KisPaintInformation(pressure));
KisBoundary bounds(layer.data());
int w = maskWidth(pressure);
......@@ -1265,10 +1265,10 @@ void KisBrush::generateBoundary() {
int h = maskHeight(KisPaintInformation());
if (brushType() == IMAGE || brushType() == PIPE_IMAGE) {
dev = image(KisMetaRegistry::instance()->csRegistry() ->getColorSpace(KoID("RGBA",""),""), KisPaintInformation());
dev = image(KisMetaRegistry::instance()->csRegistry() ->colorSpace(KoID("RGBA",""),""), KisPaintInformation());
} else {
KisAlphaMaskSP amask = mask(KisPaintInformation());
KoColorSpace* cs = KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID("RGBA",""),"");
KoColorSpace* cs = KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID("RGBA",""),"");
dev = new KisPaintDevice(cs, "tmp for generateBoundary");
for (int y = 0; y < h; y++) {
KisHLineIteratorPixel it = dev->createHLineIterator(0, y, w, true);
......
......@@ -172,7 +172,7 @@ void KisFillPainter::fillRect(const QRect& rc, const KoColor& c)
inline
void KisFillPainter::eraseRect(qint32 x1, qint32 y1, qint32 w, qint32 h)
{
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getRGB8();
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->rgb8();
KoColor c(Qt::black, cs);
fillRect(x1, y1, w, h, c, OPACITY_TRANSPARENT);
}
......@@ -180,7 +180,7 @@ void KisFillPainter::eraseRect(qint32 x1, qint32 y1, qint32 w, qint32 h)
inline
void KisFillPainter::eraseRect(const QRect& rc)
{
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getRGB8();
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->rgb8();
KoColor c(Qt::black, cs);
fillRect(rc.x(), rc.y(), rc.width(), rc.height(), c, OPACITY_TRANSPARENT);
}
......
......@@ -54,7 +54,7 @@ KisGradientSegment::SphereDecreasingInterpolationStrategy *KisGradientSegment::S
KisGradient::KisGradient(const QString& file) : super(file)
{
m_colorSpace = KisMetaRegistry::instance()->csRegistry()->getRGB8();
m_colorSpace = KisMetaRegistry::instance()->csRegistry()->rgb8();
}
KisGradient::~KisGradient()
......@@ -105,7 +105,7 @@ bool KisGradient::init()
data[0] = static_cast<quint8>(colstop->color3 * 255 + 0.5);
data[3] = static_cast<quint8>(colstop->opacity * OPACITY_OPAQUE + 0.5);
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getRGB8();
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->rgb8();
KoColor leftColor(data, cs);
data[2] = static_cast<quint8>(colstopNext->color1 * 255 + 0.5);
......@@ -438,7 +438,7 @@ bool KisGradientSegment::isValid() const
KisGradientSegment::RGBColorInterpolationStrategy::RGBColorInterpolationStrategy()
{
m_colorSpace = KisMetaRegistry::instance()->csRegistry()->getRGB8();
m_colorSpace = KisMetaRegistry::instance()->csRegistry()->rgb8();
}
KisGradientSegment::RGBColorInterpolationStrategy *KisGradientSegment::RGBColorInterpolationStrategy::instance()
......@@ -473,7 +473,7 @@ KoColor KisGradientSegment::RGBColorInterpolationStrategy::colorAt(double t, KoC
KisGradientSegment::HSVCWColorInterpolationStrategy::HSVCWColorInterpolationStrategy()
{
m_colorSpace = KisMetaRegistry::instance()->csRegistry()->getRGB8();
m_colorSpace = KisMetaRegistry::instance()->csRegistry()->rgb8();
}
KisGradientSegment::HSVCWColorInterpolationStrategy *KisGradientSegment::HSVCWColorInterpolationStrategy::instance()
......@@ -515,13 +515,13 @@ KoColor KisGradientSegment::HSVCWColorInterpolationStrategy::colorAt(double t, K
QColor result;
result.setHsv( h, s, v);
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getRGB8();
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->rgb8();
return KoColor( result, opacity, cs);
}
KisGradientSegment::HSVCCWColorInterpolationStrategy::HSVCCWColorInterpolationStrategy()
{
m_colorSpace = KisMetaRegistry::instance()->csRegistry()->getRGB8();
m_colorSpace = KisMetaRegistry::instance()->csRegistry()->rgb8();
}
......
......@@ -558,7 +558,7 @@ bool KisGradientPainter::paintGradient(const KisPoint& gradientVectorStart,
totalPixels *= 2;
}*/
KisPaintDeviceSP dev = KisPaintDeviceSP(new KisPaintDevice(KisMetaRegistry::instance()->csRegistry()->getRGB8(), "temporary device for gradient"));
KisPaintDeviceSP dev = KisPaintDeviceSP(new KisPaintDevice(KisMetaRegistry::instance()->csRegistry()->rgb8(), "temporary device for gradient"));
for (int y = starty; y <= endy; y++) {
......
......@@ -607,7 +607,7 @@ void KisImage::init(KisUndoAdapter *adapter, qint32 width, qint32 height, KoCol
Q_ASSERT(colorSpace);
if (colorSpace == 0) {
colorSpace = KisMetaRegistry::instance()->csRegistry()->getRGB8();
colorSpace = KisMetaRegistry::instance()->csRegistry()->rgb8();
kWarning(41010) << "No colorspace specified: using RGBA\n";
}
......@@ -915,7 +915,7 @@ void KisImage::setProfile(const KoColorProfile * profile)
{
if (profile == 0) return;
KoColorSpace * dstCs= KisMetaRegistry::instance()->csRegistry()->getColorSpace( colorSpace()->id(),
KoColorSpace * dstCs= KisMetaRegistry::instance()->csRegistry()->colorSpace( colorSpace()->id(),
profile);
if (dstCs) {
......
......@@ -439,7 +439,7 @@ KisImagePipeBrush* KisImagePipeBrush::clone() const {
for (int i = 0; i < m_brushes.count(); i++) {
KisPaintDevice* pd = new KisPaintDevice(
KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID("RGBA",""),""), "clone pd" );
KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID("RGBA",""),""), "clone pd" );
pd->convertFromQImage(m_brushes.at(i)->img(), "");
devices[0].append(pd);
}
......
......@@ -661,7 +661,7 @@ void KisPaintDevice::setProfile(KoColorProfile * profile)
if (profile == 0) return;
KoColorSpace * dstSpace =
KisMetaRegistry::instance()->csRegistry()->getColorSpace( colorSpace()->id(),
KisMetaRegistry::instance()->csRegistry()->colorSpace( colorSpace()->id(),
profile);
if (dstSpace)
m_colorSpace = dstSpace;
......@@ -699,14 +699,14 @@ void KisPaintDevice::convertFromQImage(const QImage& image, const QString &srcPr
}
#if 0
// XXX: Apply import profile
if (colorSpace() == KisMetaRegistry::instance()->csRegistry() ->getColorSpace(KoID("RGBA",""),"")) {
if (colorSpace() == KisMetaRegistry::instance()->csRegistry() ->colorSpace(KoID("RGBA",""),"")) {
writeBytes(img.bits(), 0, 0, img.width(), img.height());
}
else {
#endif
quint8 * dstData = new quint8[img.width() * img.height() * pixelSize()];
KisMetaRegistry::instance()->csRegistry()
->getColorSpace(KoID("RGBA",""),srcProfileName)->
->colorSpace(KoID("RGBA",""),srcProfileName)->
convertPixelsTo(img.bits(), dstData, colorSpace(), img.width() * img.height());
writeBytes(dstData, offsetX, offsetY, img.width(), img.height());
// }
......
......@@ -36,14 +36,14 @@
#include "kis_selection.h"
KisSelection::KisSelection(KisPaintDeviceSP dev)
: super(dev->parentLayer(), KisMetaRegistry::instance()->csRegistry()->getAlpha8(), QString("selection for ") + dev->objectName())
: super(dev->parentLayer(), KisMetaRegistry::instance()->csRegistry()->alpha8(), QString("selection for ") + dev->objectName())
, m_parentPaintDevice(dev)
{
Q_ASSERT(dev);
}
KisSelection::KisSelection()
: super(KisMetaRegistry::instance()->csRegistry()->getAlpha8(), "anonymous selection")
: super(KisMetaRegistry::instance()->csRegistry()->alpha8(), "anonymous selection")
, m_parentPaintDevice(0)
{
}
......@@ -110,7 +110,7 @@ QImage KisSelection::maskImage()
void KisSelection::select(QRect r)
{
KisFillPainter painter(KisPaintDeviceSP(this));
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getRGB8();
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->rgb8();
painter.fillRect(r, KoColor(Qt::white, cs), MAX_SELECTED);
qint32 x, y, w, h;
extent(x, y, w, h);
......@@ -119,7 +119,7 @@ void KisSelection::select(QRect r)
void KisSelection::clear(QRect r)
{
KisFillPainter painter(KisPaintDeviceSP(this));
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getRGB8();
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->rgb8();
painter.fillRect(r, KoColor(Qt::white, cs), MIN_SELECTED);
}
......
......@@ -45,7 +45,7 @@ void KisImageTester::allTests()
void KisImageTester::mergeTests()
{
KoColorSpace * colorSpace = KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID("RGBA", ""), "");
KoColorSpace * colorSpace = KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID("RGBA", ""), "");
KisImageSP image = new KisImage(0, IMAGE_WIDTH, IMAGE_HEIGHT, colorSpace, "merge test");
......
......@@ -175,7 +175,7 @@ void KisCImgFilter::process(KisPaintDeviceSP src, KisPaintDeviceSP dst, KisFilte
img = CImg<>(width, height, 1, 3);
KoColorSpace * cs = src->colorSpace();
KoColorSpace* rgb16CS = KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID("RGBA16"),"");
KoColorSpace* rgb16CS = KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID("RGBA16"),"");
KisPaintDeviceSP srcRGB16;
if(rgb16CS)
{
......@@ -705,7 +705,7 @@ KisFilterConfiguration* KisCImgFilter::configuration(QWidget* nwidget)
ColorSpaceIndependence KisCImgFilter::colorSpaceIndependence()
{
KoColorSpace* rgb16CS = KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID("RGBA16"),"");
KoColorSpace* rgb16CS = KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID("RGBA16"),"");
if(rgb16CS)
{
return TO_RGBA16;
......
......@@ -91,7 +91,7 @@ void KisCubismFilter::process(KisPaintDeviceSP src, KisPaintDeviceSP dst,
else {
if (src->image()) src->image()->lock();
KisPaintDeviceSP dev = new KisPaintDevice(KisMetaRegistry::instance()->csRegistry()->getRGB8(), "temporary");
KisPaintDeviceSP dev = new KisPaintDevice(KisMetaRegistry::instance()->csRegistry()->rgb8(), "temporary");
KisPainter gc(dev);
gc.bitBlt(0, 0, COMPOSITE_COPY, src, rect.x(), rect.y(), rect.width(), rect.height());
gc.end();
......
......@@ -118,7 +118,7 @@ void KisDuplicateOp::paintAt(const KisPoint &pos, const KisPaintInformation& inf
copyPainter.end();
// Convert the dab to the colorspace of a selection
dab->convertTo(KisMetaRegistry::instance()->csRegistry()->getAlpha8());
dab->convertTo(KisMetaRegistry::instance()->csRegistry()->alpha8());
// Add the dab as selection to the srcdev
KisPainter copySelection(KisPaintDeviceSP(srcdev->selection().data()));
......
......@@ -106,7 +106,7 @@ void ColorSpaceConversion::slotImgColorSpaceConversion()
if (dlgColorSpaceConversion->exec() == QDialog::Accepted) {
// XXX: Do the rest of the stuff
KoID cspace = dlgColorSpaceConversion->m_page->cmbColorSpaces->currentItem();
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getColorSpace(cspace, dlgColorSpaceConversion->m_page->cmbDestProfile->currentText());
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->colorSpace(cspace, dlgColorSpaceConversion->m_page->cmbDestProfile->currentText());
QApplication::setOverrideCursor(KisCursor::waitCursor());
image->convertTo(cs, dlgColorSpaceConversion->m_intentButtonGroup.checkedId());
......@@ -143,7 +143,7 @@ void ColorSpaceConversion::slotLayerColorSpaceConversion()
if (dlgColorSpaceConversion->exec() == QDialog::Accepted) {
KoID cspace = dlgColorSpaceConversion->m_page->cmbColorSpaces->currentItem();
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry() ->
getColorSpace(cspace, dlgColorSpaceConversion->m_page->cmbDestProfile->currentText());
colorSpace(cspace, dlgColorSpaceConversion->m_page->cmbDestProfile->currentText());
QApplication::setOverrideCursor(KisCursor::waitCursor());
dev->convertTo(cs, dlgColorSpaceConversion->m_intentButtonGroup.checkedId());
......
......@@ -87,7 +87,7 @@ void KisDropshadow::dropshadow(KisProgressDisplayInterface * progress, qint32 xo
image->undoAdapter()->beginMacro(i18n("Add Drop Shadow"));
}
KisPaintDeviceSP shadowDev = KisPaintDeviceSP(new KisPaintDevice( KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID("RGBA",""),"" ), "Shadow"));
KisPaintDeviceSP shadowDev = KisPaintDeviceSP(new KisPaintDevice( KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID("RGBA",""),"" ), "Shadow"));
KisPaintDeviceSP bShadowDev;
KoColorSpace *rgb8cs = shadowDev->colorSpace();
......@@ -113,7 +113,7 @@ void KisDropshadow::dropshadow(KisProgressDisplayInterface * progress, qint32 xo
if( blurradius > 0 )
{
bShadowDev = new KisPaintDevice( KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID("RGBA",""),"" ), "bShadow");
bShadowDev = new KisPaintDevice( KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID("RGBA",""),"" ), "bShadow");
gaussianblur(shadowDev, bShadowDev, rect, blurradius, blurradius, BLUR_RLE, progress);
shadowDev = bShadowDev;
}
......
......@@ -67,7 +67,7 @@ true);
// QImage img;
// if(img.load(locate("data","krita/images/previewfilter.png")))
// {
// KisPaintDeviceSP preview = new KisPaintDevice(KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID("RGBA",""),""));
// KisPaintDeviceSP preview = new KisPaintDevice(KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID("RGBA",""),""));
// preview->convertFromQImage(img,"");
// m_view->canvasSubject()->paletteManager()->addWidget(new KisFiltersListView(preview,m_view),"filterslist",krita::EFFECTSBOX, 0);
// }
......
......@@ -43,7 +43,7 @@ KisPaintDeviceShape::KisPaintDeviceShape()
: KoShape()
{
/*
KisColorSpace * cs = KisColorspaceFactoryRegistry::instance()->getRGB8();
KisColorSpace * cs = KisColorspaceFactoryRegistry::instance()->rgb8();
m_device = new KisPaintDevice(cs, "Krita PaintDevice Shape");
KisFillPainter painter;
......
......@@ -138,7 +138,7 @@ void KritaHistogramDocker::producerChanged(QAction *action)
// use dummy layer as a source; we are not going to actually use or need it
// All of these are SP, no need to delete them afterwards
m_histogram = new KisHistogram( KisPaintDeviceSP(new KisPaintDevice(KisMetaRegistry::instance()->csRegistry()->getAlpha8(), "dummy histogram")),
m_histogram = new KisHistogram( KisPaintDeviceSP(new KisPaintDevice(KisMetaRegistry::instance()->csRegistry()->alpha8(), "dummy histogram")),
KisHistogramProducerSP(m_producer), LOGARITHMIC);
if (m_hview) {
......
......@@ -203,7 +203,7 @@ Kross::Api::Object::Ptr KritaCoreFactory::newImage(Kross::Api::List::Ptr args)
throw Kross::Api::Exception::Ptr( new Kross::Api::Exception( i18n("Invalid image size") ) );
return Kross::Api::Object::Ptr(0);
}
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID(csname, ""), "");
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID(csname, ""), "");
if(!cs)
{
throw Kross::Api::Exception::Ptr( new Kross::Api::Exception( i18n("Colorspace %1 is not available, please check your installation.", csname ) ) );
......
......@@ -78,7 +78,7 @@ Kross::Api::Object::Ptr Image::getHeight(Kross::Api::List::Ptr)
}
Kross::Api::Object::Ptr Image::convertToColorspace(Kross::Api::List::Ptr args)
{
KoColorSpace * dstCS = KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID(Kross::Api::Variant::toString(args->item(0)), ""), "");
KoColorSpace * dstCS = KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID(Kross::Api::Variant::toString(args->item(0)), ""), "");
if(!dstCS)
{
throw Kross::Api::Exception::Ptr( new Kross::Api::Exception( i18n("Colorspace %1 is not available, please check your installation.",Kross::Api::Variant::toString(args->item(0))) ) );
......@@ -106,7 +106,7 @@ Kross::Api::Object::Ptr Image::createPaintLayer(Kross::Api::List::Ptr args)
} else {
csname = m_image->colorSpace()->id().id();
}
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID(csname, ""), "");
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID(csname, ""), "");
KisPaintLayer* layer;
if(cs)
{
......
......@@ -168,7 +168,7 @@ Kross::Api::Object::Ptr PaintLayer::endPainting(Kross::Api::List::Ptr)
Kross::Api::Object::Ptr PaintLayer::convertToColorspace(Kross::Api::List::Ptr args)
{
KoColorSpace * dstCS = KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID(Kross::Api::Variant::toString(args->item(0)), ""), "");
KoColorSpace * dstCS = KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID(Kross::Api::Variant::toString(args->item(0)), ""), "");
if(!dstCS)
{
// FIXME: inform user
......
......@@ -127,10 +127,10 @@ void KisChannelSeparator::separate(KisProgressDisplayInterface * progress, enumS
}
else {
if (channelSize == 1 || downscale) {
dev = new KisPaintDevice( KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID("GRAYA",""),"" ), "8 bit grayscale sep");
dev = new KisPaintDevice( KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID("GRAYA",""),"" ), "8 bit grayscale sep");
}
else {
dev = new KisPaintDevice( KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID("GRAYA16",""),"" ), "16 bit grayscale sep");
dev = new KisPaintDevice( KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID("GRAYA16",""),"" ), "16 bit grayscale sep");
destSize = 2;
}
}
......
......@@ -129,7 +129,7 @@ void KisClipboard::setClip(KisPaintDeviceSP selection)
QImage qimg;
KisConfig cfg;
QString monitorProfileName = cfg.monitorProfile();
KoColorProfile * monitorProfile = KisMetaRegistry::instance()->csRegistry()->getProfileByName(monitorProfileName);
KoColorProfile * monitorProfile = KisMetaRegistry::instance()->csRegistry()->profileByName(monitorProfileName);
qimg = selection->convertToQImage(monitorProfile);
QMimeData *mimeData = new QMimeData;
......@@ -177,7 +177,7 @@ KisPaintDeviceSP KisClipboard::clip()
store->close();
}
KoColorSpace *cs = KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID(csName, ""), profile);
KoColorSpace *cs = KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID(csName, ""), profile);
m_clip = new KisPaintDevice(cs, "clip");
......@@ -210,7 +210,7 @@ KisPaintDeviceSP KisClipboard::clip()
if (behaviour == PASTE_ASSUME_MONITOR)
profileName = cfg.monitorProfile();
cs = KisMetaRegistry::instance()->csRegistry() ->getColorSpace(KoID("RGBA",""), profileName);
cs = KisMetaRegistry::instance()->csRegistry() ->colorSpace(KoID("RGBA",""), profileName);
m_clip = new KisPaintDevice(cs, "from paste");
Q_CHECK_PTR(m_clip);
m_clip->convertFromQImage(qimg, profileName);
......@@ -275,7 +275,7 @@ QSize KisClipboard::clipSize()
store->close();
}
KoColorSpace *cs = KisMetaRegistry::instance()->csRegistry()->getColorSpace(KoID(csName, ""), profile);
KoColorSpace *cs = KisMetaRegistry::instance()->csRegistry()->colorSpace(KoID(csName, ""), profile);
clip = new KisPaintDevice(cs, "clip");
......
......@@ -58,7 +58,7 @@ KisCustomImageWidget::KisCustomImageWidget(QWidget *parent, KisDoc *doc, qint32
}
void KisCustomImageWidget::buttonClicked() {
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getColorSpace(cmbColorSpaces->currentItem(), cmbProfile->currentText());
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->colorSpace(cmbColorSpaces->currentItem(), cmbProfile->currentText());
QColor qc(cmbColor->color());
......
......@@ -75,7 +75,7 @@ KoColorProfile * KisDlgApplyProfile::profile() const
profileName = m_page->cmbProfile->currentText();
return KisMetaRegistry::instance()->csRegistry()->getProfileByName(profileName);
return KisMetaRegistry::instance()->csRegistry()->profileByName(profileName);
}
int KisDlgApplyProfile::renderIntent() const
......
......@@ -134,7 +134,7 @@ QString KisDlgImageProperties::description()
KoColorSpace * KisDlgImageProperties::colorSpace()
{
return KisMetaRegistry::instance()->csRegistry()->getColorSpace(m_page->cmbColorSpaces->currentItem(), m_page->cmbProfile->currentText());
return KisMetaRegistry::instance()->csRegistry()->colorSpace(m_page->cmbColorSpaces->currentItem(), m_page->cmbProfile->currentText());
}
KoColorProfile * KisDlgImageProperties::profile()
......
......@@ -118,7 +118,7 @@ void NewLayerDialog::fillCmbComposite(const KoID & s)
return;
}
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getColorSpace(s,"");
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->colorSpace(s,"");
if (cs) {
m_page->cmbComposite->setCompositeOpList(cs->userVisiblecompositeOps());
}
......
......@@ -371,10 +371,10 @@ KisImageSP KisDoc::loadImage(const QDomElement& element)
if ((profileProductName = element.attribute("profile")).isNull()) {
// no mention of profile so get default profile
cs = KisMetaRegistry::instance()->csRegistry()->getColorSpace(colorspacename,"");
cs = KisMetaRegistry::instance()->csRegistry()->colorSpace(colorspacename,"");
}
else {
cs = KisMetaRegistry::instance()->csRegistry()->getColorSpace(colorspacename, profileProductName);
cs = KisMetaRegistry::instance()->csRegistry()->colorSpace(colorspacename, profileProductName);
}
if (cs == 0) {
......@@ -515,7 +515,7 @@ KisLayerSP KisDoc::loadPaintLayer(const QDomElement& element, KisImageSP img,
cs = img->colorSpace();
else
// use default profile - it will be replaced later in completLoading
cs = KisMetaRegistry::instance()->csRegistry()->getColorSpace(colorspacename,"");
cs = KisMetaRegistry::instance()->csRegistry()->colorSpace(colorspacename,"");
layer = new KisPaintLayer(img.data(), name, opacity, cs);
Q_CHECK_PTR(layer);
......@@ -801,7 +801,7 @@ KisImageSP KisDoc::newImage(const QString& name, qint32 width, qint32 height, Ko
KisPaintLayer *layer = new KisPaintLayer(img.data(), img->nextLayerName(), OPACITY_OPAQUE,colorstrategy);
Q_CHECK_PTR(layer);
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getRGB8();
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->rgb8();
KisFillPainter painter;
painter.begin(layer->paintDevice());
......@@ -880,7 +880,7 @@ void KisDoc::paintContent(QPainter& painter, const QRect& rc, bool transparent,
{
KisConfig cfg;
QString monitorProfileName = cfg.monitorProfile();
KoColorProfile * profile = KisMetaRegistry::instance()->csRegistry()->getProfileByName(monitorProfileName);
KoColorProfile * profile = KisMetaRegistry::instance()->csRegistry()->profileByName(monitorProfileName);
painter.scale(zoomX, zoomY);
QRect rect = rc & m_currentImage->bounds();
KisImage::PaintFlags paintFlags;
......@@ -1100,7 +1100,7 @@ void KisDoc::setCurrentImage(KisImageSP image)
void KisDoc::initEmpty()
{
KisConfig cfg;
KoColorSpace * rgb = KisMetaRegistry::instance()->csRegistry()->getRGB8();
KoColorSpace * rgb = KisMetaRegistry::instance()->csRegistry()->rgb8();
newImage("", cfg.defImgWidth(), cfg.defImgHeight(), rgb);
}
......
......@@ -78,7 +78,7 @@ public:
data = m_store->read(m_store->size());
m_store->close();
// Create a colorspace with the embedded profile
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getColorSpace(layer->paintDevice()->colorSpace()->id(),
KoColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->colorSpace(layer->paintDevice()->colorSpace()->id(),