Changeset View
Changeset View
Standalone View
Standalone View
krita/plugins/extensions/gmic/kis_gmic_simple_convertor.cpp
Show First 20 Lines • Show All 546 Lines • ▼ Show 20 Line(s) | 546 | const KoColorSpace *rgbaFloat32bitcolorSpace = KoColorSpaceRegistry::instance()->colorSpace(RGBAColorModelID.id(), | |||
---|---|---|---|---|---|
547 | Float32BitsColorDepthID.id(), | 547 | Float32BitsColorDepthID.id(), | ||
548 | KoColorSpaceRegistry::instance()->rgb8()->profile()); | 548 | KoColorSpaceRegistry::instance()->rgb8()->profile()); | ||
549 | Q_CHECK_PTR(rgbaFloat32bitcolorSpace); | 549 | Q_CHECK_PTR(rgbaFloat32bitcolorSpace); | ||
550 | 550 | | |||
551 | int greenOffset = gmicImage._width * gmicImage._height; | 551 | int greenOffset = gmicImage._width * gmicImage._height; | ||
552 | int blueOffset = greenOffset * 2; | 552 | int blueOffset = greenOffset * 2; | ||
553 | int alphaOffset = greenOffset * 3; | 553 | int alphaOffset = greenOffset * 3; | ||
554 | 554 | | |||
555 | KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent; | 555 | KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::internalRenderingIntent(); | ||
556 | KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags; | 556 | KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::internalConversionFlags(); | ||
557 | 557 | | |||
558 | const KoColorSpace * colorSpace = dev->colorSpace(); | 558 | const KoColorSpace * colorSpace = dev->colorSpace(); | ||
559 | KisRandomConstAccessorSP it = dev->createRandomConstAccessorNG(0,0); | 559 | KisRandomConstAccessorSP it = dev->createRandomConstAccessorNG(0,0); | ||
560 | 560 | | |||
561 | int optimalBufferSize = 64; // most common numContiguousColumns, tile size? | 561 | int optimalBufferSize = 64; // most common numContiguousColumns, tile size? | ||
562 | quint8 * floatRGBApixel = new quint8[rgbaFloat32bitcolorSpace->pixelSize() * optimalBufferSize]; | 562 | quint8 * floatRGBApixel = new quint8[rgbaFloat32bitcolorSpace->pixelSize() * optimalBufferSize]; | ||
563 | quint32 pixelSize = rgbaFloat32bitcolorSpace->pixelSize(); | 563 | quint32 pixelSize = rgbaFloat32bitcolorSpace->pixelSize(); | ||
564 | int pos = 0; | 564 | int pos = 0; | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 593 | { | |||
610 | KisRandomAccessorSP it = dev->createRandomAccessorNG(0,0); | 610 | KisRandomAccessorSP it = dev->createRandomAccessorNG(0,0); | ||
611 | int pos; | 611 | int pos; | ||
612 | float r,g,b,a; | 612 | float r,g,b,a; | ||
613 | 613 | | |||
614 | int optimalBufferSize = 64; // most common numContiguousColumns, tile size? | 614 | int optimalBufferSize = 64; // most common numContiguousColumns, tile size? | ||
615 | quint8 * floatRGBApixel = new quint8[rgbaFloat32bitcolorSpace->pixelSize() * optimalBufferSize]; | 615 | quint8 * floatRGBApixel = new quint8[rgbaFloat32bitcolorSpace->pixelSize() * optimalBufferSize]; | ||
616 | quint32 pixelSize = rgbaFloat32bitcolorSpace->pixelSize(); | 616 | quint32 pixelSize = rgbaFloat32bitcolorSpace->pixelSize(); | ||
617 | 617 | | |||
618 | KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent; | 618 | KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::internalRenderingIntent(); | ||
619 | KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags; | 619 | KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::internalConversionFlags(); | ||
620 | 620 | | |||
621 | // Krita needs rgba in 0.0...1.0 | 621 | // Krita needs rgba in 0.0...1.0 | ||
622 | float multiplied = KoColorSpaceMathsTraits<float>::unitValue / gmicMaxChannelValue; | 622 | float multiplied = KoColorSpaceMathsTraits<float>::unitValue / gmicMaxChannelValue; | ||
623 | 623 | | |||
624 | switch (gmicImage._spectrum) | 624 | switch (gmicImage._spectrum) | ||
625 | { | 625 | { | ||
626 | case 1: | 626 | case 1: | ||
627 | { | 627 | { | ||
▲ Show 20 Lines • Show All 245 Lines • Show Last 20 Lines |