Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Krita
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mathias Wein
Krita
Commits
d4358901
Commit
d4358901
authored
Jun 13, 2016
by
Wolthera van Hövell
🛍
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add base implementation softproofing with toggles.
It doesn't really work yet :/ Ref: T210 Ref: T2337
parent
7de02569
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
148 additions
and
16 deletions
+148
-16
krita/krita.xmlgui
krita/krita.xmlgui
+3
-1
krita/kritamenu.action
krita/kritamenu.action
+20
-0
libs/image/CMakeLists.txt
libs/image/CMakeLists.txt
+1
-0
libs/image/KisProofingConfiguration.h
libs/image/KisProofingConfiguration.h
+20
-6
libs/image/kis_image.cc
libs/image/kis_image.cc
+7
-2
libs/pigment/KoColorSpace.cpp
libs/pigment/KoColorSpace.cpp
+4
-3
libs/ui/KisView.cpp
libs/ui/KisView.cpp
+8
-0
libs/ui/KisView.h
libs/ui/KisView.h
+2
-0
libs/ui/KisViewManager.cpp
libs/ui/KisViewManager.cpp
+7
-0
libs/ui/canvas/kis_canvas2.cpp
libs/ui/canvas/kis_canvas2.cpp
+50
-0
libs/ui/canvas/kis_canvas2.h
libs/ui/canvas/kis_canvas2.h
+5
-1
libs/ui/opengl/kis_opengl_canvas2.cpp
libs/ui/opengl/kis_opengl_canvas2.cpp
+2
-0
libs/ui/opengl/kis_opengl_image_textures.cpp
libs/ui/opengl/kis_opengl_image_textures.cpp
+16
-2
libs/ui/opengl/kis_opengl_image_textures.h
libs/ui/opengl/kis_opengl_image_textures.h
+3
-1
No files found.
krita/krita.xmlgui
View file @
d4358901
...
...
@@ -2,7 +2,7 @@
<kpartgui
xmlns=
"http://www.kde.org/standards/kxmlgui/1.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
name=
"Krita"
version=
"9
2
"
version=
"9
3
"
xsi:schemaLocation=
"http://www.kde.org/standards/kxmlgui/1.0 http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd"
>
<MenuBar>
<Menu
name=
"file"
noMerge=
"1"
>
...
...
@@ -62,6 +62,8 @@ xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0 http://www.kde.org
<Action
name=
"fullscreen"
/>
<Action
name=
"wrap_around_mode"
/>
<Action
name=
"level_of_detail_mode"
/>
<Action
name=
"softProof"
/>
<Action
name=
"gamutCheck"
/>
<Separator/>
<Menu
name=
"Canvas"
>
<text>
&
Canvas
</text>
...
...
krita/kritamenu.action
View file @
d4358901
...
...
@@ -528,6 +528,26 @@
<isCheckable>
true
</isCheckable>
<statusTip></statusTip>
</Action>
<Action
name=
"softProof"
>
<icon></icon>
<text>
Soft Proofing
</text>
<whatsThis></whatsThis>
<toolTip>
Turns on Softproofing
</toolTip>
<iconText>
Turns on Softproofing
</iconText>
<shortcut>
Ctrl+Y
</shortcut>
<isCheckable>
true
</isCheckable>
<statusTip></statusTip>
</Action>
<Action
name=
"gamutCheck"
>
<icon></icon>
<text>
Out of Gamut Warnings
</text>
<whatsThis></whatsThis>
<toolTip>
Turns on Warnings for colors our of proofed gamut, needs soft proofing to be turned on.
</toolTip>
<iconText>
Turns on Warnings for colors our of proofed gamut, needs soft proofing to be turned on.
</iconText>
<shortcut>
Ctrl+Shift+Y
</shortcut>
<isCheckable>
true
</isCheckable>
<statusTip></statusTip>
</Action>
<Action
name=
"mirror_canvas"
>
<icon></icon>
<text>
Mirror View
</text>
...
...
libs/image/CMakeLists.txt
View file @
d4358901
...
...
@@ -247,6 +247,7 @@ set(kritaimage_LIB_SRCS
kis_outline_generator.cpp
kis_layer_composition.cpp
kis_selection_filters.cpp
KisProofingConfiguration.h
metadata/kis_meta_data_entry.cc
metadata/kis_meta_data_filter.cc
metadata/kis_meta_data_filter_p.cc
...
...
libs/image/KisProofingConfiguration.h
View file @
d4358901
#ifndef KISPROOFINGCONFIGURATION_H
#define KISPROOFINGCONFIGURATION_H
#include "KoColor.h"
#include "KoColorSpace.h"
#include "KoColorConversionTransformation.h"
/**
* @brief The KisProofingConfiguration struct
* Little struct that stores the proofing configuration for a given file.
* The actual softproofing and gamutcheck toggles are set in the canvas.
* intet, conversionflags and warning color have default set to them. This
* wasn't possible for profileSpace.
*/
struct
KisProofingConfiguration
{
// Proofing colorspace
// Warning color
// Rendering intent
KisProofingConfiguration
()
:
intent
(
KoColorConversionTransformation
::
IntentAbsoluteColorimetric
),
conversionFlags
(
KoColorConversionTransformation
::
BlackpointCompensation
),
warningColor
(
KoColor
()),
proofingProfile
(
"Chemical proof"
),
proofingModel
(
"CMYKA"
),
proofingDepth
(
"U8"
){}
KoColorConversionTransformation
::
Intent
intent
;
KoColorConversionTransformation
::
ConversionFlags
conversionFlags
;
KoColor
warningColor
;
QString
proofingProfile
;
QString
proofingModel
;
QString
proofingDepth
;
// Conversion flags (except for the SOFTPROOFING and GAMUTCHECK flags, which are per-view)
};
#endif // KISPROOFINGCONFIGURATION_H
libs/image/kis_image.cc
View file @
d4358901
...
...
@@ -38,6 +38,7 @@
#include "KoColor.h"
#include "KoColorProfile.h"
#include <KoCompositeOpRegistry.h>
#include "KisProofingConfiguration.h"
#include "recorder/kis_action_recorder.h"
#include "kis_adjustment_layer.h"
...
...
@@ -145,6 +146,7 @@ public:
double
yres
=
1.0
;
const
KoColorSpace
*
colorSpace
;
KisProofingConfiguration
*
proofingConfig
=
0
;
KisSelectionSP
deselectedGlobalSelection
;
KisGroupLayerSP
rootLayer
;
// The layers are contained in here
...
...
@@ -1597,6 +1599,9 @@ KisImageAnimationInterface* KisImage::animationInterface() const
KisProofingConfiguration
*
KisImage
::
proofingConfiguration
()
const
{
// XXXX
return
0
;
if
(
!
m_d
->
proofingConfig
)
{
qDebug
()
<<
"Image: No proofing config found, generating one."
;
m_d
->
proofingConfig
=
new
KisProofingConfiguration
();
}
return
m_d
->
proofingConfig
;
}
libs/pigment/KoColorSpace.cpp
View file @
d4358901
...
...
@@ -443,15 +443,16 @@ bool KoColorSpace::proofPixelsTo(const quint8 * src,
KoColorConversionTransformation
::
Intent
renderingIntent
,
KoColorConversionTransformation
::
ConversionFlags
conversionFlags
)
const
{
if
(
*
this
==
*
dstColorSpace
&&
*
this
==
*
proofing
Space
)
{
/*if (*this == *dstColor
Space) {
if (src != dst) {
memcpy(dst, src, numPixels * sizeof(quint8) * pixelSize());
}
return true;
}
}
*/
// Only the icc engine can do this kind of stuff
//Can we cache this, maybe???
KoColorSpaceEngine
*
engine
=
KoColorSpaceEngineRegistry
::
instance
()
->
get
(
"icc"
);
qDebug
()
<<
">>>>>>>>>>>>>>>>>>>> we got a proofing engine"
;
//
qDebug() << ">>>>>>>>>>>>>>>>>>>> we got a proofing engine";
if
(
!
engine
)
return
false
;
KoColorConversionTransformation
*
transform
=
engine
->
createColorProofingTransformation
(
this
,
dstColorSpace
,
proofingSpace
,
renderingIntent
,
conversionFlags
);
...
...
libs/ui/KisView.cpp
View file @
d4358901
...
...
@@ -147,6 +147,9 @@ public:
QPointer
<
KisFloatingMessage
>
savedFloatingMessage
;
KisSignalCompressor
floatingMessageCompressor
;
bool
softProofing
;
bool
gamutCheck
;
// Hmm sorry for polluting the private class with such a big inner class.
// At the beginning it was a little struct :)
class
StatusBarItem
...
...
@@ -881,3 +884,8 @@ void KisView::slotImageSizeChanged(const QPointF &oldStillPoint, const QPointF &
zoomManager
()
->
updateImageBoundsSnapping
();
zoomManager
()
->
updateGUI
();
}
void
KisView
::
setProofingOptions
(
bool
softProofing
,
bool
gamutCheck
)
{
canvasBase
()
->
setProofingOptions
(
softProofing
,
gamutCheck
);
}
libs/ui/KisView.h
View file @
d4358901
...
...
@@ -254,7 +254,9 @@ public Q_SLOTS:
void
slotImageResolutionChanged
();
void
slotImageSizeChanged
(
const
QPointF
&
oldStillPoint
,
const
QPointF
&
newStillPoint
);
private:
void
setProofingOptions
(
bool
softProofing
,
bool
gamutCheck
);
class
Private
;
Private
*
const
d
;
...
...
libs/ui/KisViewManager.cpp
View file @
d4358901
...
...
@@ -208,6 +208,8 @@ public:
KisAction
*
zoomTo100pct
;
KisAction
*
zoomIn
;
KisAction
*
zoomOut
;
KisAction
*
softProof
;
KisAction
*
gamutCheck
;
KisSelectionManager
selectionManager
;
KisGuidesManager
guidesManager
;
...
...
@@ -385,6 +387,9 @@ void KisViewManager::setCurrentView(KisView *view)
d
->
viewConnections
.
addUniqueConnection
(
d
->
zoomIn
,
SIGNAL
(
triggered
()),
imageView
->
zoomController
()
->
zoomAction
(),
SLOT
(
zoomIn
()));
d
->
viewConnections
.
addUniqueConnection
(
d
->
zoomOut
,
SIGNAL
(
triggered
()),
imageView
->
zoomController
()
->
zoomAction
(),
SLOT
(
zoomOut
()));
d
->
viewConnections
.
addUniqueConnection
(
d
->
softProof
,
SIGNAL
(
toggled
(
bool
)),
d
->
currentImageView
->
canvasBase
(),
SLOT
(
slotSoftProofing
(
bool
))
);
d
->
viewConnections
.
addUniqueConnection
(
d
->
gamutCheck
,
SIGNAL
(
toggled
(
bool
)),
d
->
currentImageView
->
canvasBase
(),
SLOT
(
slotGamutCheck
(
bool
))
);
imageView
->
zoomManager
()
->
setShowRulers
(
d
->
showRulersAction
->
isChecked
());
imageView
->
zoomManager
()
->
setRulersTrackMouse
(
d
->
rulersTrackMouseAction
->
isChecked
());
...
...
@@ -603,6 +608,8 @@ void KisViewManager::createActions()
d
->
resetCanvasRotation
=
actionManager
()
->
createAction
(
"reset_canvas_rotation"
);
d
->
wrapAroundAction
=
actionManager
()
->
createAction
(
"wrap_around_mode"
);
d
->
levelOfDetailAction
=
actionManager
()
->
createAction
(
"level_of_detail_mode"
);
d
->
softProof
=
actionManager
()
->
createAction
(
"softProof"
);
d
->
gamutCheck
=
actionManager
()
->
createAction
(
"gamutCheck"
);
KisAction
*
tAction
=
actionManager
()
->
createAction
(
"showStatusBar"
);
tAction
->
setChecked
(
cfg
.
showStatusBar
());
...
...
libs/ui/canvas/kis_canvas2.cpp
View file @
d4358901
...
...
@@ -74,6 +74,9 @@
#include "opengl/kis_opengl.h"
#include "kis_fps_decoration.h"
#include "KoColorConversionTransformation.h"
#include "KisProofingConfiguration.h"
#include <kis_favorite_resource_manager.h>
#include <kis_popup_palette.h>
...
...
@@ -110,6 +113,9 @@ public:
QRect
savedUpdateRect
;
QBitArray
channelFlags
;
KisProofingConfiguration
*
proofingConfig
=
0
;
bool
softProofing
=
false
;
bool
gamutCheck
=
false
;
KisPopupPalette
*
popupPalette
=
0
;
KisDisplayColorConverter
displayColorConverter
;
...
...
@@ -544,6 +550,50 @@ KisExposureGammaCorrectionInterface* KisCanvas2::exposureGammaCorrectionInterfac
KisDumbExposureGammaCorrectionInterface
::
instance
();
}
void
KisCanvas2
::
setProofingOptions
(
bool
softProof
,
bool
gamutCheck
)
{
m_d
->
proofingConfig
=
this
->
image
()
->
proofingConfiguration
();
if
(
!
m_d
->
proofingConfig
)
{
qDebug
()
<<
"Canvas: No proofing config found, generating one."
;
m_d
->
proofingConfig
=
new
KisProofingConfiguration
();
}
KoColorConversionTransformation
::
ConversionFlags
conversionFlags
=
m_d
->
proofingConfig
->
conversionFlags
;
if
(
softProof
)
{
conversionFlags
|=
KoColorConversionTransformation
::
SoftProofing
;
qDebug
()
<<
"setting softproofing in canvas"
;
}
if
(
gamutCheck
)
{
conversionFlags
|=
KoColorConversionTransformation
::
GamutCheck
;
qDebug
()
<<
"setting gamutChecking in canvas"
;
}
m_d
->
proofingConfig
->
conversionFlags
=
conversionFlags
;
startUpdateInPatches
(
this
->
image
()
->
bounds
());
}
void
KisCanvas2
::
slotSoftProofing
(
bool
softProofing
)
{
m_d
->
softProofing
=
softProofing
;
setProofingOptions
(
m_d
->
softProofing
,
m_d
->
gamutCheck
);
}
void
KisCanvas2
::
slotGamutCheck
(
bool
gamutCheck
)
{
m_d
->
gamutCheck
=
gamutCheck
;
setProofingOptions
(
m_d
->
softProofing
,
m_d
->
gamutCheck
);
}
KisProofingConfiguration
*
KisCanvas2
::
proofingConfiguration
()
const
{
if
(
!
m_d
->
proofingConfig
)
{
qDebug
()
<<
"No proofing config found, generating one"
;
m_d
->
proofingConfig
=
new
KisProofingConfiguration
();
}
return
m_d
->
proofingConfig
;
}
void
KisCanvas2
::
startResizingImage
()
{
KisImageWSP
image
=
this
->
image
();
...
...
libs/ui/canvas/kis_canvas2.h
View file @
d4358901
...
...
@@ -164,8 +164,10 @@ public: // KisCanvas2 methods
void
setDisplayFilter
(
KisDisplayFilter
*
displayFilter
);
KisDisplayFilter
*
displayFilter
()
const
;
KisDisplayColorConverter
*
displayColorConverter
()
const
;
KisDisplayColorConverter
*
displayColorConverter
()
const
;
KisExposureGammaCorrectionInterface
*
exposureGammaCorrectionInterface
()
const
;
void
setProofingOptions
(
bool
softProof
,
bool
gamutCheck
);
KisProofingConfiguration
*
proofingConfiguration
()
const
;
void
setCursor
(
const
QCursor
&
cursor
);
KisAnimationFrameCacheSP
frameCache
()
const
;
...
...
@@ -196,6 +198,8 @@ public Q_SLOTS:
/// Bools indicating canvasmirroring.
bool
xAxisMirrored
()
const
;
bool
yAxisMirrored
()
const
;
void
slotSoftProofing
(
bool
softProofing
);
void
slotGamutCheck
(
bool
gamutCheck
);
void
channelSelectionChanged
();
...
...
libs/ui/opengl/kis_opengl_canvas2.cpp
View file @
d4358901
...
...
@@ -217,6 +217,7 @@ void KisOpenGLCanvas2::initializeGL()
initializeOpenGLFunctions
();
KisConfig
cfg
;
d
->
openGLImageTextures
->
setProofingConfig
(
canvas
()
->
proofingConfiguration
());
d
->
openGLImageTextures
->
initGL
(
context
()
->
functions
());
d
->
openGLImageTextures
->
generateCheckerTexture
(
createCheckersImage
(
cfg
.
checkSize
()));
initializeCheckerShader
();
...
...
@@ -788,6 +789,7 @@ void KisOpenGLCanvas2::finishResizingImage(qint32 w, qint32 h)
KisUpdateInfoSP
KisOpenGLCanvas2
::
startUpdateCanvasProjection
(
const
QRect
&
rc
,
const
QBitArray
&
channelFlags
)
{
d
->
openGLImageTextures
->
setChannelFlags
(
channelFlags
);
d
->
openGLImageTextures
->
setProofingConfig
(
canvas
()
->
proofingConfiguration
());
return
d
->
openGLImageTextures
->
updateCache
(
rc
);
}
...
...
libs/ui/opengl/kis_opengl_image_textures.cpp
View file @
d4358901
...
...
@@ -58,6 +58,7 @@ KisOpenGLImageTextures::KisOpenGLImageTextures()
,
m_allChannelsSelected
(
true
)
,
m_useOcio
(
false
)
,
m_initialized
(
false
)
,
m_proofingConfig
(
0
)
{
KisConfig
cfg
;
m_renderingIntent
=
(
KoColorConversionTransformation
::
Intent
)
cfg
.
monitorRenderIntent
();
...
...
@@ -65,7 +66,6 @@ KisOpenGLImageTextures::KisOpenGLImageTextures()
m_conversionFlags
=
KoColorConversionTransformation
::
HighQuality
;
if
(
cfg
.
useBlackPointCompensation
())
m_conversionFlags
|=
KoColorConversionTransformation
::
BlackpointCompensation
;
if
(
!
cfg
.
allowLCMSOptimization
())
m_conversionFlags
|=
KoColorConversionTransformation
::
NoOptimization
;
m_useOcio
=
cfg
.
useOcio
();
}
...
...
@@ -325,7 +325,16 @@ KisOpenGLUpdateInfoSP KisOpenGLImageTextures::updateCacheImpl(const QRect& rect,
tileInfo
->
retrieveData
(
m_image
,
channelFlags
,
m_onlyOneChannelSelected
,
m_selectedChannelIndex
);
if
(
convertColorSpace
)
{
tileInfo
->
convertTo
(
dstCS
,
m_renderingIntent
,
m_conversionFlags
);
if
(
m_proofingConfig
&&
m_proofingConfig
->
conversionFlags
.
testFlag
(
KoColorConversionTransformation
::
SoftProofing
))
{
//qDebug()<<"model: "<<m_proofingConfig->proofingModel<<", depth: "<<m_proofingConfig->proofingDepth<<", profile: "<<m_proofingConfig->proofingProfile;
const
KoColorSpace
*
proofingSpace
=
KoColorSpaceRegistry
::
instance
()
->
colorSpace
(
m_proofingConfig
->
proofingModel
,
m_proofingConfig
->
proofingDepth
,
m_proofingConfig
->
proofingProfile
);
if
(
!
proofingSpace
){
qDebug
()
<<
"Proofing space is incorrect"
;
}
tileInfo
->
proofTo
(
dstCS
,
proofingSpace
,
m_proofingConfig
->
intent
,
m_proofingConfig
->
conversionFlags
);
}
else
{
tileInfo
->
convertTo
(
dstCS
,
m_renderingIntent
,
m_conversionFlags
);
}
}
info
->
tileList
.
append
(
tileInfo
);
...
...
@@ -449,6 +458,11 @@ void KisOpenGLImageTextures::setChannelFlags(const QBitArray &channelFlags)
m_onlyOneChannelSelected
=
(
selectedChannels
==
1
);
}
void
KisOpenGLImageTextures
::
setProofingConfig
(
KisProofingConfiguration
*
proofingConfig
)
{
m_proofingConfig
=
proofingConfig
;
}
void
KisOpenGLImageTextures
::
getTextureSize
(
KisGLTexturesInfo
*
texturesInfo
)
{
KisConfig
cfg
;
...
...
libs/ui/opengl/kis_opengl_image_textures.h
View file @
d4358901
...
...
@@ -27,6 +27,7 @@
#include "canvas/kis_update_info.h"
#include "opengl/kis_texture_tile.h"
#include "KisProofingConfiguration.h"
class
KisOpenGLImageTextures
;
class
QOpenGLFunctions
;
...
...
@@ -79,6 +80,7 @@ public:
void
initGL
(
QOpenGLFunctions
*
f
);
void
setChannelFlags
(
const
QBitArray
&
channelFlags
);
void
setProofingConfig
(
KisProofingConfiguration
*
);
bool
internalColorManagementActive
()
const
;
bool
setInternalColorManagementActive
(
bool
value
);
...
...
@@ -157,9 +159,9 @@ private:
KisImageWSP
m_image
;
QRect
m_storedImageBounds
;
const
KoColorProfile
*
m_monitorProfile
;
const
KoColorProfile
*
m_proofingProfile
;
KoColorConversionTransformation
::
Intent
m_renderingIntent
;
KoColorConversionTransformation
::
ConversionFlags
m_conversionFlags
;
KisProofingConfiguration
*
m_proofingConfig
;
/**
* If the destination color space coincides with the one of the image,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment