Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Scott Petrovic
Krita
Commits
ac35d0e9
Commit
ac35d0e9
authored
Jan 13, 2021
by
Simon Repp
Committed by
Halla Rempt
Jan 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consistently use "Color Sampler (Tool)" terminology in interface and code
parent
149de529
Changes
85
Hide whitespace changes
Inline
Side-by-side
Showing
75 changed files
with
496 additions
and
425 deletions
+496
-425
krita/data/cursors/color-sampler_image_background.xpm
krita/data/cursors/color-sampler_image_background.xpm
+1
-1
krita/data/cursors/color-sampler_image_foreground.xpm
krita/data/cursors/color-sampler_image_foreground.xpm
+1
-1
krita/data/cursors/color-sampler_layer_background.xpm
krita/data/cursors/color-sampler_layer_background.xpm
+1
-1
krita/data/cursors/color-sampler_layer_foreground.xpm
krita/data/cursors/color-sampler_layer_foreground.xpm
+1
-1
krita/data/cursors/cursors.qrc
krita/data/cursors/cursors.qrc
+5
-5
krita/data/cursors/tool_color_sampler_cursor.png
krita/data/cursors/tool_color_sampler_cursor.png
+0
-0
krita/data/kritarc
krita/data/kritarc
+1
-1
krita/data/shortcuts/paint_tool_sai_compatible.shortcuts
krita/data/shortcuts/paint_tool_sai_compatible.shortcuts
+1
-1
krita/data/shortcuts/photoshop_compatible.shortcuts
krita/data/shortcuts/photoshop_compatible.shortcuts
+1
-1
krita/data/shortcuts/tablet_pro.shortcuts
krita/data/shortcuts/tablet_pro.shortcuts
+1
-1
krita/krita.action
krita/krita.action
+5
-5
krita/pics/tools/SVG/16/dark_krita_tool_color_sampler.svg
krita/pics/tools/SVG/16/dark_krita_tool_color_sampler.svg
+0
-0
krita/pics/tools/SVG/16/light_krita_tool_color_sampler.svg
krita/pics/tools/SVG/16/light_krita_tool_color_sampler.svg
+0
-0
krita/pics/tools/SVG/16/tools-svg-16-icons.qrc
krita/pics/tools/SVG/16/tools-svg-16-icons.qrc
+2
-2
libs/flake/KoToolBase.h
libs/flake/KoToolBase.h
+1
-1
libs/global/kis_acs_pixel_cache_renderer.h
libs/global/kis_acs_pixel_cache_renderer.h
+12
-12
libs/global/kis_acs_types.h
libs/global/kis_acs_types.h
+1
-1
libs/image/kis_base_node.cpp
libs/image/kis_base_node.cpp
+1
-1
libs/image/kis_base_node.h
libs/image/kis_base_node.h
+2
-2
libs/image/kis_cross_device_color_sampler.h
libs/image/kis_cross_device_color_sampler.h
+19
-19
libs/image/kis_paint_device.h
libs/image/kis_paint_device.h
+3
-3
libs/image/lazybrush/kis_colorize_mask.cpp
libs/image/lazybrush/kis_colorize_mask.cpp
+1
-1
libs/image/lazybrush/kis_colorize_mask.h
libs/image/lazybrush/kis_colorize_mask.h
+1
-1
libs/libqml/qml/images/svg/icon-colorsampler.svg
libs/libqml/qml/images/svg/icon-colorsampler.svg
+1
-1
libs/libqml/qml/panels/ColorPanel.qml
libs/libqml/qml/panels/ColorPanel.qml
+5
-5
libs/libqml/qml/qml.qrc
libs/libqml/qml/qml.qrc
+1
-1
libs/libqml/qmlthemes/default/icons/colorsampler.svg
libs/libqml/qmlthemes/default/icons/colorsampler.svg
+1
-1
libs/ui/CMakeLists.txt
libs/ui/CMakeLists.txt
+2
-2
libs/ui/KisApplication.cpp
libs/ui/KisApplication.cpp
+1
-1
libs/ui/input/kis_alternate_invocation_action.cpp
libs/ui/input/kis_alternate_invocation_action.cpp
+15
-15
libs/ui/input/kis_alternate_invocation_action.h
libs/ui/input/kis_alternate_invocation_action.h
+5
-5
libs/ui/tool/kis_tool.h
libs/ui/tool/kis_tool.h
+8
-8
libs/ui/tool/kis_tool_freehand.cc
libs/ui/tool/kis_tool_freehand.cc
+10
-10
libs/ui/tool/kis_tool_freehand.h
libs/ui/tool/kis_tool_freehand.h
+2
-2
libs/ui/tool/kis_tool_paint.cc
libs/ui/tool/kis_tool_paint.cc
+69
-69
libs/ui/tool/kis_tool_paint.h
libs/ui/tool/kis_tool_paint.h
+17
-17
libs/ui/tool/kis_tool_utils.cpp
libs/ui/tool/kis_tool_utils.cpp
+18
-18
libs/ui/tool/kis_tool_utils.h
libs/ui/tool/kis_tool_utils.h
+13
-13
libs/ui/tool/strokes/kis_color_sampler_stroke_strategy.cpp
libs/ui/tool/strokes/kis_color_sampler_stroke_strategy.cpp
+12
-12
libs/ui/tool/strokes/kis_color_sampler_stroke_strategy.h
libs/ui/tool/strokes/kis_color_sampler_stroke_strategy.h
+7
-7
libs/ui/widgets/KisScreenColorSampler.cpp
libs/ui/widgets/KisScreenColorSampler.cpp
+59
-59
libs/ui/widgets/KisScreenColorSampler.h
libs/ui/widgets/KisScreenColorSampler.h
+71
-0
libs/ui/widgets/KoFillConfigWidget.cpp
libs/ui/widgets/KoFillConfigWidget.cpp
+6
-6
libs/ui/widgets/KoFillConfigWidget.ui
libs/ui/widgets/KoFillConfigWidget.ui
+1
-1
libs/ui/widgets/kis_scratch_pad.cpp
libs/ui/widgets/kis_scratch_pad.cpp
+12
-12
libs/ui/widgets/kis_scratch_pad.h
libs/ui/widgets/kis_scratch_pad.h
+4
-4
libs/widgets/CMakeLists.txt
libs/widgets/CMakeLists.txt
+1
-1
libs/widgets/KisDlgInternalColorSelector.cpp
libs/widgets/KisDlgInternalColorSelector.cpp
+12
-12
libs/widgets/KisDlgInternalColorSelector.h
libs/widgets/KisDlgInternalColorSelector.h
+7
-7
libs/widgets/KisScreenColorSamplerBase.cpp
libs/widgets/KisScreenColorSamplerBase.cpp
+1
-1
libs/widgets/KisScreenColorSamplerBase.h
libs/widgets/KisScreenColorSamplerBase.h
+7
-7
libs/widgets/KisVisualColorSelector.cpp
libs/widgets/KisVisualColorSelector.cpp
+1
-1
libs/widgets/KisVisualColorSelectorShape.h
libs/widgets/KisVisualColorSelectorShape.h
+1
-1
libs/widgets/KoTriangleColorSelector.cpp
libs/widgets/KoTriangleColorSelector.cpp
+2
-2
libs/widgets/WdgDlgInternalColorSelector.ui
libs/widgets/WdgDlgInternalColorSelector.ui
+1
-1
libs/widgetutils/kis_cursor.cc
libs/widgetutils/kis_cursor.cc
+14
-14
libs/widgetutils/kis_cursor.h
libs/widgetutils/kis_cursor.h
+7
-7
libs/widgetutils/kis_cursor_cache.cpp
libs/widgetutils/kis_cursor_cache.cpp
+4
-4
libs/widgetutils/kis_cursor_cache.h
libs/widgetutils/kis_cursor_cache.h
+2
-2
plugins/dockers/advancedcolorselector/kis_color_selector_triangle.cpp
...ers/advancedcolorselector/kis_color_selector_triangle.cpp
+1
-1
plugins/dockers/advancedcolorselector/kis_my_paint_shade_selector.cpp
...ers/advancedcolorselector/kis_my_paint_shade_selector.cpp
+3
-3
plugins/dockers/advancedcolorselector/kis_shade_selector_line.cpp
...dockers/advancedcolorselector/kis_shade_selector_line.cpp
+2
-2
plugins/dockers/lut/tests/data/psyfiTestingConfig-master/config.ocio
...kers/lut/tests/data/psyfiTestingConfig-master/config.ocio
+1
-1
plugins/extensions/spensettings/KisSPenSettings.cpp
plugins/extensions/spensettings/KisSPenSettings.cpp
+1
-1
plugins/filters/colors/wdgcolortoalphabase.ui
plugins/filters/colors/wdgcolortoalphabase.ui
+2
-2
plugins/paintops/colorsmudge/kis_colorsmudgeop.cpp
plugins/paintops/colorsmudge/kis_colorsmudgeop.cpp
+3
-3
plugins/paintops/colorsmudge/kis_smudge_radius_option.cpp
plugins/paintops/colorsmudge/kis_smudge_radius_option.cpp
+1
-1
plugins/paintops/defaultpaintops/duplicate/kis_duplicateop_settings.h
...tops/defaultpaintops/duplicate/kis_duplicateop_settings.h
+1
-1
plugins/paintops/deform/deform_brush.cpp
plugins/paintops/deform/deform_brush.cpp
+5
-5
plugins/paintops/gridbrush/kis_grid_paintop.cpp
plugins/paintops/gridbrush/kis_grid_paintop.cpp
+5
-5
plugins/paintops/hairy/hairy_brush.cpp
plugins/paintops/hairy/hairy_brush.cpp
+3
-3
plugins/paintops/mypaint/MyPaintSurface.cpp
plugins/paintops/mypaint/MyPaintSurface.cpp
+1
-1
plugins/paintops/roundmarker/kis_roundmarkerop.cpp
plugins/paintops/roundmarker/kis_roundmarkerop.cpp
+1
-1
plugins/paintops/spray/spray_brush.cpp
plugins/paintops/spray/spray_brush.cpp
+3
-3
plugins/tools/basictools/CMakeLists.txt
plugins/tools/basictools/CMakeLists.txt
+2
-2
No files found.
krita/data/cursors/color-
pick
er_image_background.xpm
→
krita/data/cursors/color-
sampl
er_image_background.xpm
View file @
ac35d0e9
/* XPM */
/* XPM */
static char * color_
pick
er_image_background_xpm[] = {
static char * color_
sampl
er_image_background_xpm[] = {
"33 31 3 1",
"33 31 3 1",
" c None",
" c None",
". c #FFFFFF",
". c #FFFFFF",
...
...
krita/data/cursors/color-
pick
er_image_foreground.xpm
→
krita/data/cursors/color-
sampl
er_image_foreground.xpm
View file @
ac35d0e9
/* XPM */
/* XPM */
static char * color_
pick
er_image_foreground_xpm[] = {
static char * color_
sampl
er_image_foreground_xpm[] = {
"33 31 3 1",
"33 31 3 1",
" c None",
" c None",
". c #FFFFFF",
". c #FFFFFF",
...
...
krita/data/cursors/color-
pick
er_layer_background.xpm
→
krita/data/cursors/color-
sampl
er_layer_background.xpm
View file @
ac35d0e9
/* XPM */
/* XPM */
static char * color_
pick
er_layer_background_xpm[] = {
static char * color_
sampl
er_layer_background_xpm[] = {
"33 31 3 1",
"33 31 3 1",
" c None",
" c None",
". c #FFFFFF",
". c #FFFFFF",
...
...
krita/data/cursors/color-
pick
er_layer_foreground.xpm
→
krita/data/cursors/color-
sampl
er_layer_foreground.xpm
View file @
ac35d0e9
/* XPM */
/* XPM */
static char * color_
pick
er_layer_foreground_xpm[] = {
static char * color_
sampl
er_layer_foreground_xpm[] = {
"33 31 3 1",
"33 31 3 1",
" c None",
" c None",
". c #FFFFFF",
". c #FFFFFF",
...
...
krita/data/cursors/cursors.qrc
View file @
ac35d0e9
...
@@ -5,10 +5,10 @@
...
@@ -5,10 +5,10 @@
-->
-->
<RCC
version=
"1.0"
>
<RCC
version=
"1.0"
>
<qresource>
<qresource>
<file>
color-
pick
er_image_background.xpm
</file>
<file>
color-
sampl
er_image_background.xpm
</file>
<file>
color-
pick
er_image_foreground.xpm
</file>
<file>
color-
sampl
er_image_foreground.xpm
</file>
<file>
color-
pick
er_layer_background.xpm
</file>
<file>
color-
sampl
er_layer_background.xpm
</file>
<file>
color-
pick
er_layer_foreground.xpm
</file>
<file>
color-
sampl
er_layer_foreground.xpm
</file>
<file>
cursor-cross.xpm
</file>
<file>
cursor-cross.xpm
</file>
<file>
cursor-pixel-white.xpm
</file>
<file>
cursor-pixel-white.xpm
</file>
<file>
cursor-pixel-black.xpm
</file>
<file>
cursor-pixel-black.xpm
</file>
...
@@ -27,6 +27,6 @@
...
@@ -27,6 +27,6 @@
<file>
zoom_discrete.xpm
</file>
<file>
zoom_discrete.xpm
</file>
<file>
zoom_smooth.xpm
</file>
<file>
zoom_smooth.xpm
</file>
<file>
tool_freehand_cursor.png
</file>
<file>
tool_freehand_cursor.png
</file>
<file>
tool_color_
pick
er_cursor.png
</file>
<file>
tool_color_
sampl
er_cursor.png
</file>
</qresource>
</qresource>
</RCC>
</RCC>
krita/data/cursors/tool_color_
pick
er_cursor.png
→
krita/data/cursors/tool_color_
sampl
er_cursor.png
View file @
ac35d0e9
File moved
krita/data/kritarc
View file @
ac35d0e9
...
@@ -373,6 +373,6 @@ actionButtonDoubleClick=erase_action
...
@@ -373,6 +373,6 @@ actionButtonDoubleClick=erase_action
actionGestureCircleCCW=shift_brush_color_counter_clockwise
actionGestureCircleCCW=shift_brush_color_counter_clockwise
actionGestureCircleCW=shift_brush_color_clockwise
actionGestureCircleCW=shift_brush_color_clockwise
actionGestureSwipeDown=make_brush_color_darker
actionGestureSwipeDown=make_brush_color_darker
actionGestureSwipeRight=KritaSelected/KisToolColor
Pick
er
actionGestureSwipeRight=KritaSelected/KisToolColor
Sampl
er
actionGestureSwipeLeft=KritaShape/KisToolBrush
actionGestureSwipeLeft=KritaShape/KisToolBrush
actionGestureSwipeUp=make_brush_color_lighter
actionGestureSwipeUp=make_brush_color_lighter
krita/data/shortcuts/paint_tool_sai_compatible.shortcuts
View file @
ac35d0e9
...
@@ -220,7 +220,7 @@ krita_filter_top edge detections=none
...
@@ -220,7 +220,7 @@ krita_filter_top edge detections=none
krita_filter_unsharp=none
krita_filter_unsharp=none
krita_filter_waveletnoisereducer=none
krita_filter_waveletnoisereducer=none
krita_filter_wave=none
krita_filter_wave=none
KritaSelected/KisToolColor
Pick
er=none
KritaSelected/KisToolColor
Sampl
er=none
KritaShape/KisToolBrush=B
KritaShape/KisToolBrush=B
KritaShape/KisToolDyna=none
KritaShape/KisToolDyna=none
KritaShape/KisToolEllipse=none
KritaShape/KisToolEllipse=none
...
...
krita/data/shortcuts/photoshop_compatible.shortcuts
View file @
ac35d0e9
...
@@ -220,7 +220,7 @@ krita_filter_top edge detections=none
...
@@ -220,7 +220,7 @@ krita_filter_top edge detections=none
krita_filter_unsharp=none
krita_filter_unsharp=none
krita_filter_waveletnoisereducer=none
krita_filter_waveletnoisereducer=none
krita_filter_wave=none
krita_filter_wave=none
KritaSelected/KisToolColor
Pick
er=I
KritaSelected/KisToolColor
Sampl
er=I
KritaShape/KisToolBrush=B
KritaShape/KisToolBrush=B
KritaShape/KisToolDyna=none
KritaShape/KisToolDyna=none
KritaShape/KisToolEllipse=none
KritaShape/KisToolEllipse=none
...
...
krita/data/shortcuts/tablet_pro.shortcuts
View file @
ac35d0e9
...
@@ -222,7 +222,7 @@ krita_filter_top edge detections=none
...
@@ -222,7 +222,7 @@ krita_filter_top edge detections=none
krita_filter_unsharp=none
krita_filter_unsharp=none
krita_filter_waveletnoisereducer=none
krita_filter_waveletnoisereducer=none
krita_filter_wave=none
krita_filter_wave=none
KritaSelected/KisToolColor
Pick
er=I
KritaSelected/KisToolColor
Sampl
er=I
KritaShape/KisToolBrush=B
KritaShape/KisToolBrush=B
KritaShape/KisToolDyna=none
KritaShape/KisToolDyna=none
KritaShape/KisToolEllipse=none
KritaShape/KisToolEllipse=none
...
...
krita/krita.action
View file @
ac35d0e9
...
@@ -1402,12 +1402,12 @@
...
@@ -1402,12 +1402,12 @@
<isCheckable>
false
</isCheckable>
<isCheckable>
false
</isCheckable>
<statusTip></statusTip>
<statusTip></statusTip>
</Action>
</Action>
<Action
name=
"KritaSelected/KisToolColorPicker"
>
<icon>
krita_tool_color_
pick
er
</icon>
<icon>
krita_tool_color_
sampl
er
</icon>
<text>
Color
Pick
er
</text>
<text>
Color
Sampl
er
</text>
<whatsThis></whatsThis>
<whatsThis></whatsThis>
<toolTip>
S
elect
a color from the image or current layer
</toolTip>
<toolTip>
S
ample
a color from the image or current layer
</toolTip>
<iconText>
Color
Pick
er
</iconText>
<iconText>
Color
Sampl
er
</iconText>
<shortcut>
P
</shortcut>
<shortcut>
P
</shortcut>
<isCheckable>
false
</isCheckable>
<isCheckable>
false
</isCheckable>
<statusTip></statusTip>
<statusTip></statusTip>
...
...
krita/pics/tools/SVG/16/dark_krita_tool_color_
pick
er.svg
→
krita/pics/tools/SVG/16/dark_krita_tool_color_
sampl
er.svg
View file @
ac35d0e9
File moved
krita/pics/tools/SVG/16/light_krita_tool_color_
pick
er.svg
→
krita/pics/tools/SVG/16/light_krita_tool_color_
sampl
er.svg
View file @
ac35d0e9
File moved
krita/pics/tools/SVG/16/tools-svg-16-icons.qrc
View file @
ac35d0e9
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<file>dark_format-fill-color.svg</file>
<file>dark_format-fill-color.svg</file>
<file>dark_krita_draw_path.svg</file>
<file>dark_krita_draw_path.svg</file>
<file>dark_krita_tool_color_fill.svg</file>
<file>dark_krita_tool_color_fill.svg</file>
<file>dark_krita_tool_color_
pick
er.svg</file>
<file>dark_krita_tool_color_
sampl
er.svg</file>
<file>dark_krita_tool_dyna.svg</file>
<file>dark_krita_tool_dyna.svg</file>
<file>dark_krita_tool_ellipse.svg</file>
<file>dark_krita_tool_ellipse.svg</file>
<file>dark_krita_tool_freehand.svg</file>
<file>dark_krita_tool_freehand.svg</file>
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
<file>light_format-fill-color.svg</file>
<file>light_format-fill-color.svg</file>
<file>light_krita_draw_path.svg</file>
<file>light_krita_draw_path.svg</file>
<file>light_krita_tool_color_fill.svg</file>
<file>light_krita_tool_color_fill.svg</file>
<file>light_krita_tool_color_
pick
er.svg</file>
<file>light_krita_tool_color_
sampl
er.svg</file>
<file>light_krita_tool_dyna.svg</file>
<file>light_krita_tool_dyna.svg</file>
<file>light_krita_tool_ellipse.svg</file>
<file>light_krita_tool_ellipse.svg</file>
<file>light_krita_tool_freehand.svg</file>
<file>light_krita_tool_freehand.svg</file>
...
...
libs/flake/KoToolBase.h
View file @
ac35d0e9
...
@@ -398,7 +398,7 @@ Q_SIGNALS:
...
@@ -398,7 +398,7 @@ Q_SIGNALS:
* Emitted when this tool wants itself to temporarily be replaced by another tool.
* Emitted when this tool wants itself to temporarily be replaced by another tool.
* For instance, a paint tool could desire to be
* For instance, a paint tool could desire to be
* temporarily replaced by a pan tool which could be temporarily
* temporarily replaced by a pan tool which could be temporarily
* replaced by a color
pick
er.
* replaced by a color
sampl
er.
* @param id the identification of the desired tool
* @param id the identification of the desired tool
*/
*/
void
activateTemporary
(
const
QString
&
id
);
void
activateTemporary
(
const
QString
&
id
);
...
...
libs/global/kis_acs_pixel_cache_renderer.h
View file @
ac35d0e9
...
@@ -18,24 +18,24 @@ namespace Acs {
...
@@ -18,24 +18,24 @@ namespace Acs {
class
PixelCacheRenderer
{
class
PixelCacheRenderer
{
public:
public:
/**
/**
* \p
Pick
er class must provide one method:
* \p
Sampl
er class must provide one method:
* - KoColor
Pick
er::colorAt(float x, float y);
* - KoColor
Sampl
er::colorAt(float x, float y);
*
*
* How to handle High DPI:
* How to handle High DPI:
* -
pick
Rect - is in device independent pixels coordinates space
* -
sample
Rect - is in device independent pixels coordinates space
* (amount of space on the widget)
* (amount of space on the widget)
* - devicePixelRatioF - the amount of UI scaling
* - devicePixelRatioF - the amount of UI scaling
* - pixelCache and realPixelCache gets the size of
* - pixelCache and realPixelCache gets the size of
*
pick
Rect.size()*devicePixelRatioF
*
sample
Rect.size()*devicePixelRatioF
* and sets the device pixel ratio,
* and sets the device pixel ratio,
* and color
pick
ers need to take it into account.
* and color
sampl
ers need to take it into account.
* That way you can paint on the cache the same way you'd paint on a low dpi display
* That way you can paint on the cache the same way you'd paint on a low dpi display
* and then just use painter->drawImage() and it works.
* and then just use painter->drawImage() and it works.
*/
*/
template
<
class
Pick
er
>
template
<
class
Sampl
er
>
static
void
render
(
Picker
*
pick
er
,
static
void
render
(
Sampler
*
sampl
er
,
const
KisDisplayColorConverter
*
converter
,
const
KisDisplayColorConverter
*
converter
,
const
QRect
&
pick
Rect
,
const
QRect
&
sample
Rect
,
KisPaintDeviceSP
&
realPixelCache
,
KisPaintDeviceSP
&
realPixelCache
,
QImage
&
pixelCache
,
QImage
&
pixelCache
,
QPoint
&
pixelCacheOffset
,
QPoint
&
pixelCacheOffset
,
...
@@ -50,11 +50,11 @@ namespace Acs {
...
@@ -50,11 +50,11 @@ namespace Acs {
KoColor
color
;
KoColor
color
;
QRect
pick
RectHighDPI
=
QRect
(
pick
Rect
.
topLeft
(),
pick
Rect
.
size
()
*
devicePixelRatioF
);
QRect
sample
RectHighDPI
=
QRect
(
sample
Rect
.
topLeft
(),
sample
Rect
.
size
()
*
devicePixelRatioF
);
KisSequentialIterator
it
(
realPixelCache
,
pick
RectHighDPI
);
KisSequentialIterator
it
(
realPixelCache
,
sample
RectHighDPI
);
while
(
it
.
nextPixel
())
{
while
(
it
.
nextPixel
())
{
color
=
pick
er
->
colorAt
(
it
.
x
()
/
devicePixelRatioF
,
it
.
y
()
/
devicePixelRatioF
);
color
=
sampl
er
->
colorAt
(
it
.
x
()
/
devicePixelRatioF
,
it
.
y
()
/
devicePixelRatioF
);
memcpy
(
it
.
rawData
(),
color
.
data
(),
pixelSize
);
memcpy
(
it
.
rawData
(),
color
.
data
(),
pixelSize
);
}
}
...
@@ -62,7 +62,7 @@ namespace Acs {
...
@@ -62,7 +62,7 @@ namespace Acs {
// NOTE: toQImage() function of the converter copies exactBounds() only!
// NOTE: toQImage() function of the converter copies exactBounds() only!
pixelCache
=
converter
->
toQImage
(
realPixelCache
);
pixelCache
=
converter
->
toQImage
(
realPixelCache
);
pixelCache
.
setDevicePixelRatio
(
devicePixelRatioF
);
pixelCache
.
setDevicePixelRatio
(
devicePixelRatioF
);
pixelCacheOffset
=
realPixelCache
->
exactBounds
().
topLeft
()
/
devicePixelRatioF
-
pick
Rect
.
topLeft
();
pixelCacheOffset
=
realPixelCache
->
exactBounds
().
topLeft
()
/
devicePixelRatioF
-
sample
Rect
.
topLeft
();
}
}
};
};
}
}
...
...
libs/global/kis_acs_types.h
View file @
ac35d0e9
...
@@ -38,7 +38,7 @@ namespace Acs {
...
@@ -38,7 +38,7 @@ namespace Acs {
}
}
template
<
class
PaintDeviceSP
>
template
<
class
PaintDeviceSP
>
KoColor
pick
Color
(
PaintDeviceSP
device
,
const
QPoint
&
pt
)
{
KoColor
sample
Color
(
PaintDeviceSP
device
,
const
QPoint
&
pt
)
{
KoColor
color
;
KoColor
color
;
if
(
device
)
{
if
(
device
)
{
(
void
)
device
->
pixel
(
pt
.
x
(),
pt
.
y
(),
&
color
);
(
void
)
device
->
pixel
(
pt
.
x
(),
pt
.
y
(),
&
color
);
...
...
libs/image/kis_base_node.cpp
View file @
ac35d0e9
...
@@ -111,7 +111,7 @@ KisBaseNode::~KisBaseNode()
...
@@ -111,7 +111,7 @@ KisBaseNode::~KisBaseNode()
delete
m_d
;
delete
m_d
;
}
}
KisPaintDeviceSP
KisBaseNode
::
color
Pick
SourceDevice
()
const
KisPaintDeviceSP
KisBaseNode
::
color
Sample
SourceDevice
()
const
{
{
return
projection
();
return
projection
();
}
}
...
...
libs/image/kis_base_node.h
View file @
ac35d0e9
...
@@ -146,11 +146,11 @@ public:
...
@@ -146,11 +146,11 @@ public:
virtual
KisPaintDeviceSP
projection
()
const
=
0
;
virtual
KisPaintDeviceSP
projection
()
const
=
0
;
/**
/**
* @return a special device from where the color
pick
er tool should
pick
* @return a special device from where the color
sampl
er tool should
sample
* color when in layer-only mode. For most of the nodes just shortcuts
* color when in layer-only mode. For most of the nodes just shortcuts
* to projection() device. TODO: can it be null?
* to projection() device. TODO: can it be null?
*/
*/
virtual
KisPaintDeviceSP
color
Pick
SourceDevice
()
const
;
virtual
KisPaintDeviceSP
color
Sample
SourceDevice
()
const
;
virtual
const
KoColorSpace
*
colorSpace
()
const
=
0
;
virtual
const
KoColorSpace
*
colorSpace
()
const
=
0
;
...
...
libs/image/kis_cross_device_color_
pick
er.h
→
libs/image/kis_cross_device_color_
sampl
er.h
View file @
ac35d0e9
...
@@ -4,14 +4,14 @@
...
@@ -4,14 +4,14 @@
* SPDX-License-Identifier: GPL-2.0-or-later
* SPDX-License-Identifier: GPL-2.0-or-later
*/
*/
#ifndef __KIS_CROSS_DEVICE_COLOR_
PICK
ER_H
#ifndef __KIS_CROSS_DEVICE_COLOR_
SAMPL
ER_H
#define __KIS_CROSS_DEVICE_COLOR_
PICK
ER_H
#define __KIS_CROSS_DEVICE_COLOR_
SAMPL
ER_H
#include "KoColorSpace.h"
#include "KoColorSpace.h"
#include "kis_random_sub_accessor.h"
#include "kis_random_sub_accessor.h"
struct
Pick
erTraitReal
{
struct
Sampl
erTraitReal
{
typedef
qreal
coord_type
;
typedef
qreal
coord_type
;
typedef
KisRandomSubAccessorSP
accessor_type
;
typedef
KisRandomSubAccessorSP
accessor_type
;
static
inline
accessor_type
createAccessor
(
KisPaintDeviceSP
dev
)
{
static
inline
accessor_type
createAccessor
(
KisPaintDeviceSP
dev
)
{
...
@@ -28,7 +28,7 @@ struct PickerTraitReal {
...
@@ -28,7 +28,7 @@ struct PickerTraitReal {
}
}
};
};
struct
Pick
erTraitInt
{
struct
Sampl
erTraitInt
{
typedef
int
coord_type
;
typedef
int
coord_type
;
typedef
KisRandomConstAccessorSP
accessor_type
;
typedef
KisRandomConstAccessorSP
accessor_type
;
static
inline
accessor_type
createAccessor
(
KisPaintDeviceSP
dev
)
{
static
inline
accessor_type
createAccessor
(
KisPaintDeviceSP
dev
)
{
...
@@ -46,11 +46,11 @@ struct PickerTraitInt {
...
@@ -46,11 +46,11 @@ struct PickerTraitInt {
};
};
/**
/**
* The
pick
er class is supposed to help to
pick
color from one device
* The
sampl
er class is supposed to help to
sample
color from one device
* and automatically convert it to the color space of another device
* and automatically convert it to the color space of another device
*
*
* WARNING: Please note, that if you want to access correct rawData(),
* WARNING: Please note, that if you want to access correct rawData(),
* you shouldn't store the
pick
er class (as well as any
* you shouldn't store the
sampl
er class (as well as any
* random accessor class) across different calls to
* random accessor class) across different calls to
* paintAt. This is related to the fact that
* paintAt. This is related to the fact that
* KisRandomAccessor has an internal cache of the tiles, but
* KisRandomAccessor has an internal cache of the tiles, but
...
@@ -59,35 +59,35 @@ struct PickerTraitInt {
...
@@ -59,35 +59,35 @@ struct PickerTraitInt {
*/
*/
template
<
class
Traits
>
template
<
class
Traits
>
class
KisCrossDeviceColor
Pick
erImpl
class
KisCrossDeviceColor
Sampl
erImpl
{
{
public:
public:
KisCrossDeviceColor
Pick
erImpl
(
KisPaintDeviceSP
src
,
KisPaintDeviceSP
dst
)
{
KisCrossDeviceColor
Sampl
erImpl
(
KisPaintDeviceSP
src
,
KisPaintDeviceSP
dst
)
{
init
(
src
,
dst
);
init
(
src
,
dst
);
}
}
KisCrossDeviceColor
Pick
erImpl
(
KisPaintDeviceSP
src
,
KisFixedPaintDeviceSP
dst
)
{
KisCrossDeviceColor
Sampl
erImpl
(
KisPaintDeviceSP
src
,
KisFixedPaintDeviceSP
dst
)
{
init
(
src
,
dst
);
init
(
src
,
dst
);
}
}
KisCrossDeviceColor
Pick
erImpl
(
KisPaintDeviceSP
src
,
const
KoColor
&
dst
)
{
KisCrossDeviceColor
Sampl
erImpl
(
KisPaintDeviceSP
src
,
const
KoColor
&
dst
)
{
init
(
src
,
&
dst
);
init
(
src
,
&
dst
);
}
}
~
KisCrossDeviceColor
Pick
erImpl
()
{
~
KisCrossDeviceColor
Sampl
erImpl
()
{
delete
[]
m_data
;
delete
[]
m_data
;
}
}
inline
void
pick
Color
(
typename
Traits
::
coord_type
x
,
inline
void
sample
Color
(
typename
Traits
::
coord_type
x
,
typename
Traits
::
coord_type
y
,
typename
Traits
::
coord_type
y
,
quint8
*
dst
)
{
quint8
*
dst
)
{
pick
ColorImpl
<
false
>
(
x
,
y
,
dst
);
sample
ColorImpl
<
false
>
(
x
,
y
,
dst
);
}
}
inline
void
pick
OldColor
(
typename
Traits
::
coord_type
x
,
inline
void
sample
OldColor
(
typename
Traits
::
coord_type
x
,
typename
Traits
::
coord_type
y
,
typename
Traits
::
coord_type
y
,
quint8
*
dst
)
{
quint8
*
dst
)
{
pick
ColorImpl
<
true
>
(
x
,
y
,
dst
);
sample
ColorImpl
<
true
>
(
x
,
y
,
dst
);
}
}
private:
private:
...
@@ -101,7 +101,7 @@ private:
...
@@ -101,7 +101,7 @@ private:
}
}
template
<
bool
useOldData
>
template
<
bool
useOldData
>
inline
void
pick
ColorImpl
(
typename
Traits
::
coord_type
x
,
inline
void
sample
ColorImpl
(
typename
Traits
::
coord_type
x
,
typename
Traits
::
coord_type
y
,
typename
Traits
::
coord_type
y
,
quint8
*
dst
)
{
quint8
*
dst
)
{
m_accessor
->
moveTo
(
x
,
y
);
m_accessor
->
moveTo
(
x
,
y
);
...
@@ -120,7 +120,7 @@ private:
...
@@ -120,7 +120,7 @@ private:
quint8
*
m_data
;
quint8
*
m_data
;
};
};
typedef
KisCrossDeviceColor
Pick
erImpl
<
Pick
erTraitReal
>
KisCrossDeviceColor
Pick
er
;
typedef
KisCrossDeviceColor
Sampl
erImpl
<
Sampl
erTraitReal
>
KisCrossDeviceColor
Sampl
er
;
typedef
KisCrossDeviceColor
Pick
erImpl
<
Pick
erTraitInt
>
KisCrossDeviceColor
Pick
erInt
;
typedef
KisCrossDeviceColor
Sampl
erImpl
<
Sampl
erTraitInt
>
KisCrossDeviceColor
Sampl
erInt
;
#endif
/* __KIS_CROSS_DEVICE_COLOR_
PICK
ER_H */
#endif
/* __KIS_CROSS_DEVICE_COLOR_
SAMPL
ER_H */
libs/image/kis_paint_device.h
View file @
ac35d0e9
...
@@ -665,13 +665,13 @@ public:
...
@@ -665,13 +665,13 @@ public:
* 2) Do *not* expect that the color spaces of the destination and
* 2) Do *not* expect that the color spaces of the destination and
* the temporary device would coincide. If you need to copy a
* the temporary device would coincide. If you need to copy a
* single pixel from one device to another, you can use
* single pixel from one device to another, you can use
* KisCrossDeviceColor
Pick
er class, that will handle all the
* KisCrossDeviceColor
Sampl
er class, that will handle all the
* necessary conversions for you.
* necessary conversions for you.
*
*
* \see createCompositionSourceDeviceFixed()
* \see createCompositionSourceDeviceFixed()
* \see compositionSourceColorSpace()
* \see compositionSourceColorSpace()
* \see KisCrossDeviceColor
Pick
er
* \see KisCrossDeviceColor
Sampl
er
* \see KisCrossDeviceColor
Pick
erInt
* \see KisCrossDeviceColor
Sampl
erInt
*/
*/
KisPaintDeviceSP
createCompositionSourceDevice
()
const
;
KisPaintDeviceSP
createCompositionSourceDevice
()
const
;
...
...
libs/image/lazybrush/kis_colorize_mask.cpp
View file @
ac35d0e9
...
@@ -464,7 +464,7 @@ KisPaintDeviceSP KisColorizeMask::coloringProjection() const
...
@@ -464,7 +464,7 @@ KisPaintDeviceSP KisColorizeMask::coloringProjection() const
return
m_d
->
coloringProjection
;
return
m_d
->
coloringProjection
;
}
}
KisPaintDeviceSP
KisColorizeMask
::
color
Pick
SourceDevice
()
const
KisPaintDeviceSP
KisColorizeMask
::
color
Sample
SourceDevice
()
const
{
{
return
return
m_d
->
shouldShowColoring
()
&&
!
m_d
->
coloringProjection
->
extent
().
isEmpty
()
?
m_d
->
shouldShowColoring
()
&&
!
m_d
->
coloringProjection
->
extent
().
isEmpty
()
?
...
...
libs/image/lazybrush/kis_colorize_mask.h
View file @
ac35d0e9
...
@@ -50,7 +50,7 @@ public:
...
@@ -50,7 +50,7 @@ public:
KisPaintDeviceSP
paintDevice
()
const
override
;
KisPaintDeviceSP
paintDevice
()
const
override
;
KisPaintDeviceSP
coloringProjection
()
const
;
KisPaintDeviceSP
coloringProjection
()
const
;
KisPaintDeviceSP
color
Pick
SourceDevice
()
const
override
;
KisPaintDeviceSP
color
Sample
SourceDevice
()
const
override
;
KisNodeSP
clone
()
const
override
{
KisNodeSP
clone
()
const
override
{
return
KisNodeSP
(
new
KisColorizeMask
(
*
this
));
return
KisNodeSP
(
new
KisColorizeMask
(
*
this
));
...
...
libs/libqml/qml/images/svg/icon-color
pick
er.svg
→
libs/libqml/qml/images/svg/icon-color
sampl
er.svg
View file @
ac35d0e9
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
id=
"svg3531"
id=
"svg3531"
version=
"1.1"
version=
"1.1"
inkscape:version=
"0.48.3.1 r9886"
inkscape:version=
"0.48.3.1 r9886"
sodipodi:docname=
"icon-color
pick
er.svg"
>
sodipodi:docname=
"icon-color
sampl
er.svg"
>
<defs
<defs
id=
"defs3533"
>
id=
"defs3533"
>
<linearGradient
<linearGradient
...
...
libs/libqml/qml/panels/ColorPanel.qml
View file @
ac35d0e9
...
@@ -19,17 +19,17 @@ Panel {
...
@@ -19,17 +19,17 @@ Panel {
height
:
parent
.
height
;
height
:
parent
.
height
;
width
:
height
;
width
:
height
;
onChooseBGChanged
:
{
onChooseBGChanged
:
{
if
(
toolManager
.
currentTool
!==
null
&&
toolManager
.
currentTool
.
toolId
()
===
"
KritaSelected/KisToolColor
Pick
er
"
)
{
if
(
toolManager
.
currentTool
!==
null
&&
toolManager
.
currentTool
.
toolId
()
===
"
KritaSelected/KisToolColor
Sampl
er
"
)
{
toolManager
.
currentTool
.
toForeground
=
!
swatch
.
chooseBG
;
toolManager
.
currentTool
.
toForeground
=
!
swatch
.
chooseBG
;
}
}
}
}
},
},
Button
{
Button
{
id
:
color
Pick
er
;
id
:
color
Sampl
er
;
width
:
height
;
width
:
height
;
height
:
Constants
.
ToolbarButtonSize
;
height
:
Constants
.
ToolbarButtonSize
;
image
:
Settings
.
theme
.
icon
(
"
color
pick
er
"
);
image
:
Settings
.
theme
.
icon
(
"
color
sampl
er
"
);
onClicked
:
toolManager
.
requestToolChange
(
"
KritaSelected/KisToolColor
Pick
er
"
);
onClicked
:
toolManager
.
requestToolChange
(
"
KritaSelected/KisToolColor
Sampl
er
"
);
},
},
Item
{