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
Tusooa Zhu
Krita
Commits
00d7dded
Commit
00d7dded
authored
Mar 30, 2006
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qt3to4
svn path=/trunk/koffice/; revision=524300
parent
f680c683
Changes
157
Hide whitespace changes
Inline
Side-by-side
Showing
157 changed files
with
933 additions
and
691 deletions
+933
-691
krita/colorspaces/cmyk_u16/kis_cmyk_u16_colorspace.cc
krita/colorspaces/cmyk_u16/kis_cmyk_u16_colorspace.cc
+21
-21
krita/colorspaces/cmyk_u8/kis_cmyk_colorspace.cc
krita/colorspaces/cmyk_u8/kis_cmyk_colorspace.cc
+1
-1
krita/colorspaces/gray_u16/kis_gray_u16_colorspace.cc
krita/colorspaces/gray_u16/kis_gray_u16_colorspace.cc
+7
-7
krita/colorspaces/gray_u8/kis_gray_colorspace.cc
krita/colorspaces/gray_u8/kis_gray_colorspace.cc
+3
-3
krita/colorspaces/lms_f32/kis_lms_f32_colorspace.cc
krita/colorspaces/lms_f32/kis_lms_f32_colorspace.cc
+7
-7
krita/colorspaces/rgb_f16half/kis_rgb_f16half_colorspace.cc
krita/colorspaces/rgb_f16half/kis_rgb_f16half_colorspace.cc
+34
-34
krita/colorspaces/rgb_f16half/tests/kis_rgb_f16half_colorspace_tester.cc
...es/rgb_f16half/tests/kis_rgb_f16half_colorspace_tester.cc
+1
-1
krita/colorspaces/rgb_f32/kis_rgb_f32_colorspace.cc
krita/colorspaces/rgb_f32/kis_rgb_f32_colorspace.cc
+34
-34
krita/colorspaces/rgb_f32/tests/kis_strategy_colorspace_rgb_f32_tester.cc
...s/rgb_f32/tests/kis_strategy_colorspace_rgb_f32_tester.cc
+1
-1
krita/colorspaces/rgb_u16/kis_rgb_u16_colorspace.cc
krita/colorspaces/rgb_u16/kis_rgb_u16_colorspace.cc
+23
-23
krita/colorspaces/rgb_u16/tests/kis_strategy_colorspace_rgb_u16_tester.cc
...s/rgb_u16/tests/kis_strategy_colorspace_rgb_u16_tester.cc
+1
-1
krita/colorspaces/rgb_u8/kis_rgb_colorspace.cc
krita/colorspaces/rgb_u8/kis_rgb_colorspace.cc
+7
-7
krita/colorspaces/wet/kis_wet_colorspace.cc
krita/colorspaces/wet/kis_wet_colorspace.cc
+6
-4
krita/colorspaces/wet/kis_wet_palette_widget.cc
krita/colorspaces/wet/kis_wet_palette_widget.cc
+7
-4
krita/colorspaces/wet/wet_plugin.cc
krita/colorspaces/wet/wet_plugin.cc
+1
-1
krita/colorspaces/wetsticky/kis_wet_sticky_colorspace.cc
krita/colorspaces/wetsticky/kis_wet_sticky_colorspace.cc
+38
-38
krita/core/kis_alpha_mask.cc
krita/core/kis_alpha_mask.cc
+1
-1
krita/core/kis_autogradient_resource.cc
krita/core/kis_autogradient_resource.cc
+9
-9
krita/core/kis_boundary.cc
krita/core/kis_boundary.cc
+4
-2
krita/core/kis_brush.cc
krita/core/kis_brush.cc
+93
-91
krita/core/kis_convolution_painter.cc
krita/core/kis_convolution_painter.cc
+6
-4
krita/core/kis_fill_painter.cc
krita/core/kis_fill_painter.cc
+2
-2
krita/core/kis_filter_config_widget.cc
krita/core/kis_filter_config_widget.cc
+1
-1
krita/core/kis_filter_registry.cc
krita/core/kis_filter_registry.cc
+1
-1
krita/core/kis_gradient_painter.cc
krita/core/kis_gradient_painter.cc
+13
-13
krita/core/kis_histogram.cc
krita/core/kis_histogram.cc
+2
-2
krita/core/kis_image.cc
krita/core/kis_image.cc
+2
-2
krita/core/kis_imagepipe_brush.cc
krita/core/kis_imagepipe_brush.cc
+11
-9
krita/core/kis_paint_device.cc
krita/core/kis_paint_device.cc
+6
-6
krita/core/kis_painter.cc
krita/core/kis_painter.cc
+2
-2
krita/core/kis_palette.cc
krita/core/kis_palette.cc
+3
-3
krita/core/kis_pattern.cc
krita/core/kis_pattern.cc
+6
-3
krita/core/kis_rotate_visitor.cc
krita/core/kis_rotate_visitor.cc
+1
-1
krita/core/kis_selection.cc
krita/core/kis_selection.cc
+3
-1
krita/core/tiles/kis_tileddatamanager.cc
krita/core/tiles/kis_tileddatamanager.cc
+1
-1
krita/kritacolor/colorspaces/kis_alpha_colorspace.cc
krita/kritacolor/colorspaces/kis_alpha_colorspace.cc
+1
-1
krita/kritacolor/colorspaces/kis_lab_colorspace.cc
krita/kritacolor/colorspaces/kis_lab_colorspace.cc
+1
-1
krita/kritacolor/colorspaces/kis_xyz_colorspace.cc
krita/kritacolor/colorspaces/kis_xyz_colorspace.cc
+1
-1
krita/kritacolor/kis_abstract_colorspace.cc
krita/kritacolor/kis_abstract_colorspace.cc
+7
-7
krita/kritacolor/kis_basic_histogram_producers.cc
krita/kritacolor/kis_basic_histogram_producers.cc
+9
-9
krita/kritacolor/kis_color.cc
krita/kritacolor/kis_color.cc
+4
-4
krita/kritacolor/kis_colorspace_factory_registry.cc
krita/kritacolor/kis_colorspace_factory_registry.cc
+4
-4
krita/kritacolor/kis_histogram_producer.cc
krita/kritacolor/kis_histogram_producer.cc
+5
-3
krita/plugins/filters/bumpmap/bumpmap.cc
krita/plugins/filters/bumpmap/bumpmap.cc
+6
-4
krita/plugins/filters/cimg/kis_cimg_filter.cc
krita/plugins/filters/cimg/kis_cimg_filter.cc
+3
-3
krita/plugins/filters/cimg/kis_cimgconfig_widget.cc
krita/plugins/filters/cimg/kis_cimgconfig_widget.cc
+4
-2
krita/plugins/filters/colorsfilters/kis_brightness_contrast_filter.cc
...s/filters/colorsfilters/kis_brightness_contrast_filter.cc
+4
-2
krita/plugins/filters/colorsfilters/kis_perchannel_filter.cc
krita/plugins/filters/colorsfilters/kis_perchannel_filter.cc
+10
-7
krita/plugins/filters/convolutionfilters/kis_custom_convolution_filter_configuration_widget.cc
...ers/kis_custom_convolution_filter_configuration_widget.cc
+3
-1
krita/plugins/filters/cubismfilter/kis_polygon.cc
krita/plugins/filters/cubismfilter/kis_polygon.cc
+1
-1
krita/plugins/filters/oilpaintfilter/kis_oilpaint_filter.cc
krita/plugins/filters/oilpaintfilter/kis_oilpaint_filter.cc
+3
-3
krita/plugins/filters/pixelizefilter/kis_pixelize_filter.cc
krita/plugins/filters/pixelizefilter/kis_pixelize_filter.cc
+3
-1
krita/plugins/filters/smalltilesfilter/kis_small_tiles_filter.cc
...lugins/filters/smalltilesfilter/kis_small_tiles_filter.cc
+1
-1
krita/plugins/paintops/defaultpaintops/kis_brushop.cc
krita/plugins/paintops/defaultpaintops/kis_brushop.cc
+3
-1
krita/plugins/tools/defaulttools/kis_tool_brush.cc
krita/plugins/tools/defaulttools/kis_tool_brush.cc
+4
-2
krita/plugins/tools/defaulttools/kis_tool_colorpicker.cc
krita/plugins/tools/defaulttools/kis_tool_colorpicker.cc
+8
-6
krita/plugins/tools/defaulttools/kis_tool_duplicate.cc
krita/plugins/tools/defaulttools/kis_tool_duplicate.cc
+1
-1
krita/plugins/tools/defaulttools/kis_tool_fill.cc
krita/plugins/tools/defaulttools/kis_tool_fill.cc
+4
-4
krita/plugins/tools/defaulttools/kis_tool_gradient.cc
krita/plugins/tools/defaulttools/kis_tool_gradient.cc
+2
-2
krita/plugins/tools/defaulttools/kis_tool_line.cc
krita/plugins/tools/defaulttools/kis_tool_line.cc
+2
-2
krita/plugins/tools/defaulttools/kis_tool_move.cc
krita/plugins/tools/defaulttools/kis_tool_move.cc
+2
-0
krita/plugins/tools/defaulttools/kis_tool_text.cc
krita/plugins/tools/defaulttools/kis_tool_text.cc
+5
-3
krita/plugins/tools/selectiontools/kis_tool_select_brush.cc
krita/plugins/tools/selectiontools/kis_tool_select_brush.cc
+3
-1
krita/plugins/tools/selectiontools/kis_tool_select_contiguous.cc
...lugins/tools/selectiontools/kis_tool_select_contiguous.cc
+7
-4
krita/plugins/tools/selectiontools/kis_tool_select_elliptical.cc
...lugins/tools/selectiontools/kis_tool_select_elliptical.cc
+3
-1
krita/plugins/tools/selectiontools/kis_tool_select_eraser.cc
krita/plugins/tools/selectiontools/kis_tool_select_eraser.cc
+3
-1
krita/plugins/tools/selectiontools/kis_tool_select_outline.cc
...a/plugins/tools/selectiontools/kis_tool_select_outline.cc
+5
-3
krita/plugins/tools/selectiontools/kis_tool_select_polygonal.cc
...plugins/tools/selectiontools/kis_tool_select_polygonal.cc
+7
-5
krita/plugins/tools/selectiontools/kis_tool_select_rectangular.cc
...ugins/tools/selectiontools/kis_tool_select_rectangular.cc
+3
-1
krita/plugins/tools/tool_crop/kis_tool_crop.cc
krita/plugins/tools/tool_crop/kis_tool_crop.cc
+6
-4
krita/plugins/tools/tool_filter/kis_tool_filter.cc
krita/plugins/tools/tool_filter/kis_tool_filter.cc
+3
-1
krita/plugins/tools/tool_polygon/kis_tool_polygon.cc
krita/plugins/tools/tool_polygon/kis_tool_polygon.cc
+4
-2
krita/plugins/tools/tool_polyline/kis_tool_polyline.cc
krita/plugins/tools/tool_polyline/kis_tool_polyline.cc
+2
-0
krita/plugins/tools/tool_selectsimilar/kis_tool_selectsimilar.cc
...lugins/tools/tool_selectsimilar/kis_tool_selectsimilar.cc
+6
-3
krita/plugins/tools/tool_star/kis_tool_star.cc
krita/plugins/tools/tool_star/kis_tool_star.cc
+3
-1
krita/plugins/viewplugins/colorrange/dlg_colorrange.cc
krita/plugins/viewplugins/colorrange/dlg_colorrange.cc
+1
-1
krita/plugins/viewplugins/colorspaceconversion/colorspaceconversion.cc
.../viewplugins/colorspaceconversion/colorspaceconversion.cc
+1
-1
krita/plugins/viewplugins/colorspaceconversion/dlg_colorspaceconversion.cc
...wplugins/colorspaceconversion/dlg_colorspaceconversion.cc
+3
-3
krita/plugins/viewplugins/dropshadow/dlg_dropshadow.cc
krita/plugins/viewplugins/dropshadow/dlg_dropshadow.cc
+2
-2
krita/plugins/viewplugins/filtersgallery/kis_dlg_filtersgallery.cc
...gins/viewplugins/filtersgallery/kis_dlg_filtersgallery.cc
+3
-3
krita/plugins/viewplugins/histogram/dlg_histogram.cc
krita/plugins/viewplugins/histogram/dlg_histogram.cc
+1
-1
krita/plugins/viewplugins/histogram/kis_histogram_widget.cc
krita/plugins/viewplugins/histogram/kis_histogram_widget.cc
+1
-1
krita/plugins/viewplugins/histogram_docker/kis_accumulating_producer.cc
...viewplugins/histogram_docker/kis_accumulating_producer.cc
+3
-1
krita/plugins/viewplugins/imagesize/dlg_imagesize.cc
krita/plugins/viewplugins/imagesize/dlg_imagesize.cc
+1
-1
krita/plugins/viewplugins/imagesize/dlg_layersize.cc
krita/plugins/viewplugins/imagesize/dlg_layersize.cc
+1
-1
krita/plugins/viewplugins/modify_selection/dlg_border_selection.cc
...gins/viewplugins/modify_selection/dlg_border_selection.cc
+1
-1
krita/plugins/viewplugins/modify_selection/dlg_grow_selection.cc
...lugins/viewplugins/modify_selection/dlg_grow_selection.cc
+1
-1
krita/plugins/viewplugins/modify_selection/dlg_shrink_selection.cc
...gins/viewplugins/modify_selection/dlg_shrink_selection.cc
+1
-1
krita/plugins/viewplugins/performancetest/perftest.cc
krita/plugins/viewplugins/performancetest/perftest.cc
+2
-2
krita/plugins/viewplugins/rotateimage/dlg_rotateimage.cc
krita/plugins/viewplugins/rotateimage/dlg_rotateimage.cc
+1
-1
krita/plugins/viewplugins/separate_channels/dlg_separate.cc
krita/plugins/viewplugins/separate_channels/dlg_separate.cc
+2
-2
krita/plugins/viewplugins/separate_channels/kis_channel_separator.cc
...ns/viewplugins/separate_channels/kis_channel_separator.cc
+5
-5
krita/plugins/viewplugins/variations/dlg_variations.cc
krita/plugins/viewplugins/variations/dlg_variations.cc
+2
-0
krita/ui/imageviewer.cc
krita/ui/imageviewer.cc
+4
-1
krita/ui/kcurve.cc
krita/ui/kcurve.cc
+10
-5
krita/ui/kis_autobrush.cc
krita/ui/kis_autobrush.cc
+3
-0
krita/ui/kis_birdeye_box.cc
krita/ui/kis_birdeye_box.cc
+5
-2
krita/ui/kis_brush_chooser.cc
krita/ui/kis_brush_chooser.cc
+5
-2
krita/ui/kis_canvas.cc
krita/ui/kis_canvas.cc
+11
-2
krita/ui/kis_canvas_painter.cc
krita/ui/kis_canvas_painter.cc
+23
-20
krita/ui/kis_clipboard.cc
krita/ui/kis_clipboard.cc
+7
-5
krita/ui/kis_color_cup.cc
krita/ui/kis_color_cup.cc
+7
-5
krita/ui/kis_controlframe.cc
krita/ui/kis_controlframe.cc
+12
-8
krita/ui/kis_custom_brush.cc
krita/ui/kis_custom_brush.cc
+6
-3
krita/ui/kis_custom_image_widget.cc
krita/ui/kis_custom_image_widget.cc
+3
-3
krita/ui/kis_custom_pattern.cc
krita/ui/kis_custom_pattern.cc
+3
-0
krita/ui/kis_dlg_adj_layer_props.cc
krita/ui/kis_dlg_adj_layer_props.cc
+7
-4
krita/ui/kis_dlg_adjustment_layer.cc
krita/ui/kis_dlg_adjustment_layer.cc
+7
-5
krita/ui/kis_dlg_apply_profile.cc
krita/ui/kis_dlg_apply_profile.cc
+3
-3
krita/ui/kis_dlg_image_properties.cc
krita/ui/kis_dlg_image_properties.cc
+6
-6
krita/ui/kis_dlg_layer_properties.cc
krita/ui/kis_dlg_layer_properties.cc
+2
-2
krita/ui/kis_dlg_new_layer.cc
krita/ui/kis_dlg_new_layer.cc
+3
-3
krita/ui/kis_dlg_preferences.cc
krita/ui/kis_dlg_preferences.cc
+10
-8
krita/ui/kis_doc.cc
krita/ui/kis_doc.cc
+7
-5
krita/ui/kis_double_widget.cc
krita/ui/kis_double_widget.cc
+4
-2
krita/ui/kis_filter_manager.cc
krita/ui/kis_filter_manager.cc
+4
-2
krita/ui/kis_filters_listview.cc
krita/ui/kis_filters_listview.cc
+6
-4
krita/ui/kis_gradient_chooser.cc
krita/ui/kis_gradient_chooser.cc
+3
-1
krita/ui/kis_gradient_slider_widget.cc
krita/ui/kis_gradient_slider_widget.cc
+11
-5
krita/ui/kis_histogram_view.cc
krita/ui/kis_histogram_view.cc
+11
-8
krita/ui/kis_icon_item.cc
krita/ui/kis_icon_item.cc
+2
-0
krita/ui/kis_iconwidget.cc
krita/ui/kis_iconwidget.cc
+3
-1
krita/ui/kis_input_device.cc
krita/ui/kis_input_device.cc
+2
-2
krita/ui/kis_int_spinbox.cc
krita/ui/kis_int_spinbox.cc
+6
-3
krita/ui/kis_itemchooser.cc
krita/ui/kis_itemchooser.cc
+2
-2
krita/ui/kis_label_cursor_pos.cc
krita/ui/kis_label_cursor_pos.cc
+1
-1
krita/ui/kis_label_progress.cc
krita/ui/kis_label_progress.cc
+7
-2
krita/ui/kis_layerbox.cc
krita/ui/kis_layerbox.cc
+12
-8
krita/ui/kis_layerlist.cc
krita/ui/kis_layerlist.cc
+5
-3
krita/ui/kis_multi_bool_filter_widget.cc
krita/ui/kis_multi_bool_filter_widget.cc
+3
-1
krita/ui/kis_multi_double_filter_widget.cc
krita/ui/kis_multi_double_filter_widget.cc
+3
-1
krita/ui/kis_multi_integer_filter_widget.cc
krita/ui/kis_multi_integer_filter_widget.cc
+3
-1
krita/ui/kis_opengl_canvas.cc
krita/ui/kis_opengl_canvas.cc
+9
-0
krita/ui/kis_opengl_canvas_painter.cc
krita/ui/kis_opengl_canvas_painter.cc
+14
-11
krita/ui/kis_paintop_box.cc
krita/ui/kis_paintop_box.cc
+10
-8
krita/ui/kis_palette_view.cc
krita/ui/kis_palette_view.cc
+3
-3
krita/ui/kis_palette_widget.cc
krita/ui/kis_palette_widget.cc
+4
-2
krita/ui/kis_part_layer.cc
krita/ui/kis_part_layer.cc
+4
-2
krita/ui/kis_part_layer_handler.cc
krita/ui/kis_part_layer_handler.cc
+2
-0
krita/ui/kis_pattern_chooser.cc
krita/ui/kis_pattern_chooser.cc
+3
-1
krita/ui/kis_previewdialog.cc
krita/ui/kis_previewdialog.cc
+5
-5
krita/ui/kis_previewwidget.cc
krita/ui/kis_previewwidget.cc
+4
-2
krita/ui/kis_qpaintdevice_canvas.cc
krita/ui/kis_qpaintdevice_canvas.cc
+9
-0
krita/ui/kis_qpaintdevice_canvas_painter.cc
krita/ui/kis_qpaintdevice_canvas_painter.cc
+13
-10
krita/ui/kis_resource_mediator.cc
krita/ui/kis_resource_mediator.cc
+4
-2
krita/ui/kis_resourceserver.cc
krita/ui/kis_resourceserver.cc
+4
-2
krita/ui/kis_ruler.cc
krita/ui/kis_ruler.cc
+5
-1
krita/ui/kis_selection_manager.cc
krita/ui/kis_selection_manager.cc
+3
-1
krita/ui/kis_selection_options.cc
krita/ui/kis_selection_options.cc
+3
-1
krita/ui/kis_text_brush.cc
krita/ui/kis_text_brush.cc
+2
-0
krita/ui/kis_tool_dummy.cc
krita/ui/kis_tool_dummy.cc
+1
-1
krita/ui/kis_tool_freehand.cc
krita/ui/kis_tool_freehand.cc
+2
-2
krita/ui/kis_tool_manager.cc
krita/ui/kis_tool_manager.cc
+1
-1
krita/ui/kis_tool_non_paint.cc
krita/ui/kis_tool_non_paint.cc
+3
-0
krita/ui/kis_tool_paint.cc
krita/ui/kis_tool_paint.cc
+11
-5
krita/ui/kis_tool_shape.cc
krita/ui/kis_tool_shape.cc
+3
-1
krita/ui/kis_view.cc
krita/ui/kis_view.cc
+32
-19
No files found.
krita/colorspaces/cmyk_u16/kis_cmyk_u16_colorspace.cc
View file @
00d7dded
...
...
@@ -69,10 +69,10 @@ void KisCmykU16ColorSpace::mixColors(const quint8 **colors, const quint8 *weight
quint32
alpha
=
pixel
->
alpha
;
quint32
alphaTimesWeight
=
UINT16_MULT
(
alpha
,
UINT8_TO_UINT16
(
*
weights
));
totalCyan
+=
UINT16_MULT
(
pixel
->
cyan
,
alphaTimesWeight
);
totalMagenta
+=
UINT16_MULT
(
pixel
->
magenta
,
alphaTimesWeight
);
totalYellow
+=
UINT16_MULT
(
pixel
->
yellow
,
alphaTimesWeight
);
totalBlack
+=
UINT16_MULT
(
pixel
->
black
,
alphaTimesWeight
);
totalCyan
+=
UINT16_MULT
(
pixel
->
Qt
::
cyan
,
alphaTimesWeight
);
totalMagenta
+=
UINT16_MULT
(
pixel
->
Qt
::
magenta
,
alphaTimesWeight
);
totalYellow
+=
UINT16_MULT
(
pixel
->
Qt
::
yellow
,
alphaTimesWeight
);
totalBlack
+=
UINT16_MULT
(
pixel
->
Qt
::
black
,
alphaTimesWeight
);
newAlpha
+=
alphaTimesWeight
;
weights
++
;
...
...
@@ -92,10 +92,10 @@ void KisCmykU16ColorSpace::mixColors(const quint8 **colors, const quint8 *weight
totalBlack
=
UINT16_DIVIDE
(
totalBlack
,
newAlpha
);
}
dstPixel
->
cyan
=
totalCyan
;
dstPixel
->
magenta
=
totalMagenta
;
dstPixel
->
yellow
=
totalYellow
;
dstPixel
->
black
=
totalBlack
;
dstPixel
->
Qt
::
cyan
=
totalCyan
;
dstPixel
->
Qt
::
magenta
=
totalMagenta
;
dstPixel
->
Qt
::
yellow
=
totalYellow
;
dstPixel
->
Qt
::
black
=
totalBlack
;
}
void
KisCmykU16ColorSpace
::
convolveColors
(
quint8
**
colors
,
qint32
*
kernelValues
,
KisChannelInfo
::
enumChannelFlags
channelFlags
,
quint8
*
dst
,
qint32
factor
,
qint32
offset
,
qint32
nColors
)
const
...
...
@@ -109,10 +109,10 @@ void KisCmykU16ColorSpace::convolveColors(quint8** colors, qint32* kernelValues,
qint32
weight
=
*
kernelValues
;
if
(
weight
!=
0
)
{
totalCyan
+=
pixel
->
cyan
*
weight
;
totalMagenta
+=
pixel
->
magenta
*
weight
;
totalYellow
+=
pixel
->
yellow
*
weight
;
totalK
+=
pixel
->
black
*
weight
;
totalCyan
+=
pixel
->
Qt
::
cyan
*
weight
;
totalMagenta
+=
pixel
->
Qt
::
magenta
*
weight
;
totalYellow
+=
pixel
->
Qt
::
yellow
*
weight
;
totalK
+=
pixel
->
Qt
::
black
*
weight
;
totalAlpha
+=
pixel
->
alpha
*
weight
;
}
colors
++
;
...
...
@@ -122,10 +122,10 @@ void KisCmykU16ColorSpace::convolveColors(quint8** colors, qint32* kernelValues,
Pixel
*
p
=
reinterpret_cast
<
Pixel
*>
(
dst
);
if
(
channelFlags
&
KisChannelInfo
::
FLAG_COLOR
)
{
p
->
cyan
=
CLAMP
(
(
totalCyan
/
factor
)
+
offset
,
0
,
quint16_MAX
);
p
->
magenta
=
CLAMP
(
(
totalMagenta
/
factor
)
+
offset
,
0
,
quint16_MAX
);
p
->
yellow
=
CLAMP
(
(
totalYellow
/
factor
)
+
offset
,
0
,
quint16_MAX
);
p
->
black
=
CLAMP
(
(
totalK
/
factor
)
+
offset
,
0
,
quint16_MAX
);
p
->
Qt
::
cyan
=
CLAMP
(
(
totalCyan
/
factor
)
+
offset
,
0
,
quint16_MAX
);
p
->
Qt
::
magenta
=
CLAMP
(
(
totalMagenta
/
factor
)
+
offset
,
0
,
quint16_MAX
);
p
->
Qt
::
yellow
=
CLAMP
(
(
totalYellow
/
factor
)
+
offset
,
0
,
quint16_MAX
);
p
->
Qt
::
black
=
CLAMP
(
(
totalK
/
factor
)
+
offset
,
0
,
quint16_MAX
);
}
if
(
channelFlags
&
KisChannelInfo
::
FLAG_ALPHA
)
{
p
->
alpha
=
CLAMP
((
totalAlpha
/
factor
)
+
offset
,
0
,
quint16_MAX
);
...
...
@@ -140,10 +140,10 @@ void KisCmykU16ColorSpace::invertColor(quint8 * src, qint32 nPixels)
while
(
nPixels
--
)
{
Pixel
*
p
=
reinterpret_cast
<
Pixel
*>
(
src
);
p
->
cyan
=
quint16_MAX
-
p
->
cyan
;
p
->
magenta
=
quint16_MAX
-
p
->
magenta
;
p
->
yellow
=
quint16_MAX
-
p
->
yellow
;
p
->
black
=
quint16_MAX
-
p
->
black
;
p
->
Qt
::
cyan
=
quint16_MAX
-
p
->
Qt
::
cyan
;
p
->
Qt
::
magenta
=
quint16_MAX
-
p
->
Qt
::
magenta
;
p
->
Qt
::
yellow
=
quint16_MAX
-
p
->
Qt
::
yellow
;
p
->
Qt
::
black
=
quint16_MAX
-
p
->
Qt
::
black
;
src
+=
psize
;
}
}
...
...
@@ -176,7 +176,7 @@ void KisCmykU16ColorSpace::applyAdjustment(const quint8 *src, quint8 *dst, KisCo
delete
[]
tmp
;
}
QValueVector
<
KisChannelInfo
*>
KisCmykU16ColorSpace
::
channels
()
const
Q
3
ValueVector
<
KisChannelInfo
*>
KisCmykU16ColorSpace
::
channels
()
const
{
return
m_channels
;
}
...
...
krita/colorspaces/cmyk_u8/kis_cmyk_colorspace.cc
View file @
00d7dded
...
...
@@ -174,7 +174,7 @@ void KisCmykColorSpace::applyAdjustment(const quint8 *src, quint8 *dst, KisColor
delete
[]
tmp
;
}
QValueVector
<
KisChannelInfo
*>
KisCmykColorSpace
::
channels
()
const
Q
3
ValueVector
<
KisChannelInfo
*>
KisCmykColorSpace
::
channels
()
const
{
return
m_channels
;
}
...
...
krita/colorspaces/gray_u16/kis_gray_u16_colorspace.cc
View file @
00d7dded
...
...
@@ -70,7 +70,7 @@ void KisGrayU16ColorSpace::mixColors(const quint8 **colors, const quint8 *weight
quint32
alpha
=
pixel
->
alpha
;
quint32
alphaTimesWeight
=
UINT16_MULT
(
alpha
,
UINT8_TO_UINT16
(
*
weights
));
totalGray
+=
UINT16_MULT
(
pixel
->
gray
,
alphaTimesWeight
);
totalGray
+=
UINT16_MULT
(
pixel
->
Qt
::
gray
,
alphaTimesWeight
);
newAlpha
+=
alphaTimesWeight
;
weights
++
;
...
...
@@ -87,7 +87,7 @@ void KisGrayU16ColorSpace::mixColors(const quint8 **colors, const quint8 *weight
totalGray
=
UINT16_DIVIDE
(
totalGray
,
newAlpha
);
}
dstPixel
->
gray
=
totalGray
;
dstPixel
->
Qt
::
gray
=
totalGray
;
}
void
KisGrayU16ColorSpace
::
convolveColors
(
quint8
**
colors
,
qint32
*
kernelValues
,
KisChannelInfo
::
enumChannelFlags
channelFlags
,
quint8
*
dst
,
...
...
@@ -102,7 +102,7 @@ void KisGrayU16ColorSpace::convolveColors(quint8** colors, qint32* kernelValues,
qint32
weight
=
*
kernelValues
;
if
(
weight
!=
0
)
{
totalGray
+=
pixel
->
gray
*
weight
;
totalGray
+=
pixel
->
Qt
::
gray
*
weight
;
totalAlpha
+=
pixel
->
alpha
*
weight
;
}
colors
++
;
...
...
@@ -112,7 +112,7 @@ void KisGrayU16ColorSpace::convolveColors(quint8** colors, qint32* kernelValues,
Pixel
*
p
=
reinterpret_cast
<
Pixel
*>
(
dst
);
if
(
channelFlags
&
KisChannelInfo
::
FLAG_COLOR
)
{
p
->
gray
=
CLAMP
(
(
totalGray
/
factor
)
+
offset
,
0
,
quint16_MAX
);
p
->
Qt
::
gray
=
CLAMP
(
(
totalGray
/
factor
)
+
offset
,
0
,
quint16_MAX
);
}
if
(
channelFlags
&
KisChannelInfo
::
FLAG_ALPHA
)
{
p
->
alpha
=
CLAMP
((
totalAlpha
/
factor
)
+
offset
,
0
,
quint16_MAX
);
...
...
@@ -127,7 +127,7 @@ void KisGrayU16ColorSpace::invertColor(quint8 * src, qint32 nPixels)
while
(
nPixels
--
)
{
Pixel
*
p
=
reinterpret_cast
<
Pixel
*>
(
src
);
p
->
gray
=
quint16_MAX
-
p
->
gray
;
p
->
Qt
::
gray
=
quint16_MAX
-
p
->
Qt
::
gray
;
src
+=
psize
;
}
}
...
...
@@ -137,11 +137,11 @@ void KisGrayU16ColorSpace::invertColor(quint8 * src, qint32 nPixels)
quint8
KisGrayU16ColorSpace
::
intensity8
(
const
quint8
*
src
)
const
{
const
Pixel
*
p
=
reinterpret_cast
<
const
Pixel
*>
(
src
);
return
UINT16_TO_UINT8
(
p
->
gray
);
return
UINT16_TO_UINT8
(
p
->
Qt
::
gray
);
}
QValueVector
<
KisChannelInfo
*>
KisGrayU16ColorSpace
::
channels
()
const
Q
3
ValueVector
<
KisChannelInfo
*>
KisGrayU16ColorSpace
::
channels
()
const
{
return
m_channels
;
}
...
...
krita/colorspaces/gray_u8/kis_gray_colorspace.cc
View file @
00d7dded
...
...
@@ -61,13 +61,13 @@ KisGrayColorSpace::~KisGrayColorSpace()
void
KisGrayColorSpace
::
setPixel
(
quint8
*
pixel
,
quint8
gray
,
quint8
alpha
)
const
{
pixel
[
PIXEL_GRAY
]
=
gray
;
pixel
[
PIXEL_GRAY
]
=
Qt
::
gray
;
pixel
[
PIXEL_GRAY_ALPHA
]
=
alpha
;
}
void
KisGrayColorSpace
::
getPixel
(
const
quint8
*
pixel
,
quint8
*
gray
,
quint8
*
alpha
)
const
{
*
gray
=
pixel
[
PIXEL_GRAY
];
*
Qt
::
gray
=
pixel
[
PIXEL_GRAY
];
*
alpha
=
pixel
[
PIXEL_GRAY_ALPHA
];
}
...
...
@@ -175,7 +175,7 @@ quint8 KisGrayColorSpace::intensity8(const quint8 * src) const
return
src
[
PIXEL_GRAY
];
}
QValueVector
<
KisChannelInfo
*>
KisGrayColorSpace
::
channels
()
const
Q
3
ValueVector
<
KisChannelInfo
*>
KisGrayColorSpace
::
channels
()
const
{
return
m_channels
;
}
...
...
krita/colorspaces/lms_f32/kis_lms_f32_colorspace.cc
View file @
00d7dded
...
...
@@ -87,18 +87,18 @@ void KisLmsF32ColorSpace::fromQColor(const QColor& c, quint8 *dstU8, KisProfile
{
Pixel
*
dst
=
reinterpret_cast
<
Pixel
*>
(
dstU8
);
dst
->
longWave
=
computeLong
(
c
.
red
(),
c
.
green
(),
c
.
blue
());
dst
->
middleWave
=
computeMiddle
(
c
.
red
(),
c
.
green
(),
c
.
blue
());
dst
->
shortWave
=
computeShort
(
c
.
red
(),
c
.
green
(),
c
.
blue
());
dst
->
longWave
=
computeLong
(
c
.
Qt
::
red
(),
c
.
Qt
::
green
(),
c
.
Qt
::
blue
());
dst
->
middleWave
=
computeMiddle
(
c
.
Qt
::
red
(),
c
.
Qt
::
green
(),
c
.
Qt
::
blue
());
dst
->
shortWave
=
computeShort
(
c
.
Qt
::
red
(),
c
.
Qt
::
green
(),
c
.
Qt
::
blue
());
}
void
KisLmsF32ColorSpace
::
fromQColor
(
const
QColor
&
c
,
quint8
opacity
,
quint8
*
dstU8
,
KisProfile
*
/*profile*/
)
{
Pixel
*
dst
=
reinterpret_cast
<
Pixel
*>
(
dstU8
);
dst
->
longWave
=
computeLong
(
c
.
red
(),
c
.
green
(),
c
.
blue
());
dst
->
middleWave
=
computeMiddle
(
c
.
red
(),
c
.
green
(),
c
.
blue
());
dst
->
shortWave
=
computeShort
(
c
.
red
(),
c
.
green
(),
c
.
blue
());
dst
->
longWave
=
computeLong
(
c
.
Qt
::
red
(),
c
.
Qt
::
green
(),
c
.
Qt
::
blue
());
dst
->
middleWave
=
computeMiddle
(
c
.
Qt
::
red
(),
c
.
Qt
::
green
(),
c
.
Qt
::
blue
());
dst
->
shortWave
=
computeShort
(
c
.
Qt
::
red
(),
c
.
Qt
::
green
(),
c
.
Qt
::
blue
());
dst
->
alpha
=
UINT8_TO_FLOAT
(
opacity
);
}
...
...
@@ -164,7 +164,7 @@ void KisLmsF32ColorSpace::mixColors(const quint8 **colors, const quint8 *weights
dstPixel
->
shortWave
=
totalShort
;
}
QValueVector
<
KisChannelInfo
*>
KisLmsF32ColorSpace
::
channels
()
const
Q
3
ValueVector
<
KisChannelInfo
*>
KisLmsF32ColorSpace
::
channels
()
const
{
return
m_channels
;
}
...
...
krita/colorspaces/rgb_f16half/kis_rgb_f16half_colorspace.cc
View file @
00d7dded
...
...
@@ -67,9 +67,9 @@ void KisRgbF16HalfColorSpace::setPixel(quint8 *dst, half red, half green, half b
{
Pixel
*
dstPixel
=
reinterpret_cast
<
Pixel
*>
(
dst
);
dstPixel
->
red
=
red
;
dstPixel
->
green
=
green
;
dstPixel
->
blue
=
blue
;
dstPixel
->
Qt
::
red
=
Qt
::
red
;
dstPixel
->
Qt
::
green
=
Qt
::
green
;
dstPixel
->
Qt
::
blue
=
Qt
::
blue
;
dstPixel
->
alpha
=
alpha
;
}
...
...
@@ -77,9 +77,9 @@ void KisRgbF16HalfColorSpace::getPixel(const quint8 *src, half *red, half *green
{
const
Pixel
*
srcPixel
=
reinterpret_cast
<
const
Pixel
*>
(
src
);
*
red
=
srcPixel
->
red
;
*
green
=
srcPixel
->
green
;
*
blue
=
srcPixel
->
blue
;
*
Qt
::
red
=
srcPixel
->
Qt
::
red
;
*
Qt
::
green
=
srcPixel
->
Qt
::
green
;
*
Qt
::
blue
=
srcPixel
->
Qt
::
blue
;
*
alpha
=
srcPixel
->
alpha
;
}
...
...
@@ -87,18 +87,18 @@ void KisRgbF16HalfColorSpace::fromQColor(const QColor& c, quint8 *dstU8, KisProf
{
Pixel
*
dst
=
reinterpret_cast
<
Pixel
*>
(
dstU8
);
dst
->
red
=
UINT8_TO_HALF
(
c
.
red
());
dst
->
green
=
UINT8_TO_HALF
(
c
.
green
());
dst
->
blue
=
UINT8_TO_HALF
(
c
.
blue
());
dst
->
Qt
::
red
=
UINT8_TO_HALF
(
c
.
Qt
::
red
());
dst
->
Qt
::
green
=
UINT8_TO_HALF
(
c
.
Qt
::
green
());
dst
->
Qt
::
blue
=
UINT8_TO_HALF
(
c
.
Qt
::
blue
());
}
void
KisRgbF16HalfColorSpace
::
fromQColor
(
const
QColor
&
c
,
quint8
opacity
,
quint8
*
dstU8
,
KisProfile
*
)
{
Pixel
*
dst
=
reinterpret_cast
<
Pixel
*>
(
dstU8
);
dst
->
red
=
UINT8_TO_HALF
(
c
.
red
());
dst
->
green
=
UINT8_TO_HALF
(
c
.
green
());
dst
->
blue
=
UINT8_TO_HALF
(
c
.
blue
());
dst
->
Qt
::
red
=
UINT8_TO_HALF
(
c
.
Qt
::
red
());
dst
->
Qt
::
green
=
UINT8_TO_HALF
(
c
.
Qt
::
green
());
dst
->
Qt
::
blue
=
UINT8_TO_HALF
(
c
.
Qt
::
blue
());
dst
->
alpha
=
UINT8_TO_HALF
(
opacity
);
}
...
...
@@ -106,14 +106,14 @@ void KisRgbF16HalfColorSpace::toQColor(const quint8 *srcU8, QColor *c, KisProfil
{
const
Pixel
*
src
=
reinterpret_cast
<
const
Pixel
*>
(
srcU8
);
c
->
setRgb
(
HALF_TO_UINT8
(
src
->
red
),
HALF_TO_UINT8
(
src
->
green
),
HALF_TO_UINT8
(
src
->
blue
));
c
->
setRgb
(
HALF_TO_UINT8
(
src
->
Qt
::
red
),
HALF_TO_UINT8
(
src
->
Qt
::
green
),
HALF_TO_UINT8
(
src
->
Qt
::
blue
));
}
void
KisRgbF16HalfColorSpace
::
toQColor
(
const
quint8
*
srcU8
,
QColor
*
c
,
quint8
*
opacity
,
KisProfile
*
)
{
const
Pixel
*
src
=
reinterpret_cast
<
const
Pixel
*>
(
srcU8
);
c
->
setRgb
(
HALF_TO_UINT8
(
src
->
red
),
HALF_TO_UINT8
(
src
->
green
),
HALF_TO_UINT8
(
src
->
blue
));
c
->
setRgb
(
HALF_TO_UINT8
(
src
->
Qt
::
red
),
HALF_TO_UINT8
(
src
->
Qt
::
green
),
HALF_TO_UINT8
(
src
->
Qt
::
blue
));
*
opacity
=
HALF_TO_UINT8
(
src
->
alpha
);
}
...
...
@@ -122,9 +122,9 @@ quint8 KisRgbF16HalfColorSpace::difference(const quint8 *src1U8, const quint8 *s
const
Pixel
*
src1
=
reinterpret_cast
<
const
Pixel
*>
(
src1U8
);
const
Pixel
*
src2
=
reinterpret_cast
<
const
Pixel
*>
(
src2U8
);
return
HALF_TO_UINT8
(
qMax
(
QABS
(
src2
->
red
-
src1
->
red
),
qMax
(
QABS
(
src2
->
green
-
src1
->
green
),
QABS
(
src2
->
blue
-
src1
->
blue
))));
return
HALF_TO_UINT8
(
qMax
(
QABS
(
src2
->
Qt
::
red
-
src1
->
Qt
::
red
),
qMax
(
QABS
(
src2
->
Qt
::
green
-
src1
->
Qt
::
green
),
QABS
(
src2
->
Qt
::
blue
-
src1
->
Qt
::
blue
))));
}
void
KisRgbF16HalfColorSpace
::
mixColors
(
const
quint8
**
colors
,
const
quint8
*
weights
,
quint32
nColors
,
quint8
*
dst
)
const
...
...
@@ -138,9 +138,9 @@ void KisRgbF16HalfColorSpace::mixColors(const quint8 **colors, const quint8 *wei
half
alpha
=
pixel
->
alpha
;
half
alphaTimesWeight
=
alpha
*
UINT8_TO_HALF
(
*
weights
);
totalRed
+=
pixel
->
red
*
alphaTimesWeight
;
totalGreen
+=
pixel
->
green
*
alphaTimesWeight
;
totalBlue
+=
pixel
->
blue
*
alphaTimesWeight
;
totalRed
+=
pixel
->
Qt
::
red
*
alphaTimesWeight
;
totalGreen
+=
pixel
->
Qt
::
green
*
alphaTimesWeight
;
totalBlue
+=
pixel
->
Qt
::
blue
*
alphaTimesWeight
;
newAlpha
+=
alphaTimesWeight
;
weights
++
;
...
...
@@ -159,9 +159,9 @@ void KisRgbF16HalfColorSpace::mixColors(const quint8 **colors, const quint8 *wei
totalBlue
=
totalBlue
/
newAlpha
;
}
dstPixel
->
red
=
totalRed
;
dstPixel
->
green
=
totalGreen
;
dstPixel
->
blue
=
totalBlue
;
dstPixel
->
Qt
::
red
=
totalRed
;
dstPixel
->
Qt
::
green
=
totalGreen
;
dstPixel
->
Qt
::
blue
=
totalBlue
;
}
void
KisRgbF16HalfColorSpace
::
convolveColors
(
quint8
**
colors
,
qint32
*
kernelValues
,
KisChannelInfo
::
enumChannelFlags
channelFlags
,
quint8
*
dst
,
qint32
factor
,
qint32
offset
,
qint32
nColors
)
const
...
...
@@ -175,9 +175,9 @@ void KisRgbF16HalfColorSpace::convolveColors(quint8** colors, qint32 * kernelVal
half
weight
=
*
kernelValues
;
if
(
weight
!=
0
)
{
totalRed
+=
pixel
->
red
*
UINT8_TO_HALF
(
weight
);
totalGreen
+=
pixel
->
green
*
UINT8_TO_HALF
(
weight
);
totalBlue
+=
pixel
->
blue
*
UINT8_TO_HALF
(
weight
);
totalRed
+=
pixel
->
Qt
::
red
*
UINT8_TO_HALF
(
weight
);
totalGreen
+=
pixel
->
Qt
::
green
*
UINT8_TO_HALF
(
weight
);
totalBlue
+=
pixel
->
Qt
::
blue
*
UINT8_TO_HALF
(
weight
);
totalAlpha
+=
pixel
->
alpha
*
UINT8_TO_HALF
(
weight
);
}
colors
++
;
...
...
@@ -187,9 +187,9 @@ void KisRgbF16HalfColorSpace::convolveColors(quint8** colors, qint32 * kernelVal
Pixel
*
p
=
reinterpret_cast
<
Pixel
*>
(
dst
);
if
(
channelFlags
&
KisChannelInfo
::
FLAG_COLOR
)
{
p
->
red
=
CLAMP
(
(
totalRed
/
factor
)
+
offset
,
0
,
HALF_MAX
);
p
->
green
=
CLAMP
(
(
totalGreen
/
factor
)
+
offset
,
0
,
HALF_MAX
);
p
->
blue
=
CLAMP
(
(
totalBlue
/
factor
)
+
offset
,
0
,
HALF_MAX
);
p
->
Qt
::
red
=
CLAMP
(
(
totalRed
/
factor
)
+
offset
,
0
,
HALF_MAX
);
p
->
Qt
::
green
=
CLAMP
(
(
totalGreen
/
factor
)
+
offset
,
0
,
HALF_MAX
);
p
->
Qt
::
blue
=
CLAMP
(
(
totalBlue
/
factor
)
+
offset
,
0
,
HALF_MAX
);
}
if
(
channelFlags
&
KisChannelInfo
::
FLAG_ALPHA
)
{
p
->
alpha
=
CLAMP
((
totalAlpha
/
factor
)
+
offset
,
0
,
HALF_MAX
);
...
...
@@ -204,9 +204,9 @@ void KisRgbF16HalfColorSpace::invertColor(quint8 * src, qint32 nPixels)
while
(
nPixels
--
)
{
Pixel
*
p
=
reinterpret_cast
<
Pixel
*>
(
src
);
p
->
red
=
1.0
-
p
->
red
;
p
->
green
=
1.0
-
p
->
green
;
p
->
blue
=
1.0
-
p
->
blue
;
p
->
Qt
::
red
=
1.0
-
p
->
Qt
::
red
;
p
->
Qt
::
green
=
1.0
-
p
->
Qt
::
green
;
p
->
Qt
::
blue
=
1.0
-
p
->
Qt
::
blue
;
src
+=
psize
;
}
...
...
@@ -217,11 +217,11 @@ quint8 KisRgbF16HalfColorSpace::intensity8(const quint8 * src) const
{
const
Pixel
*
p
=
reinterpret_cast
<
const
Pixel
*>
(
src
);
return
HALF_TO_UINT8
((
p
->
red
*
0.30
+
p
->
green
*
0.59
+
p
->
blue
*
0.11
)
+
0.5
);
return
HALF_TO_UINT8
((
p
->
Qt
::
red
*
0.30
+
p
->
Qt
::
green
*
0.59
+
p
->
Qt
::
blue
*
0.11
)
+
0.5
);
}
QValueVector
<
KisChannelInfo
*>
KisRgbF16HalfColorSpace
::
channels
()
const
Q
3
ValueVector
<
KisChannelInfo
*>
KisRgbF16HalfColorSpace
::
channels
()
const
{
return
m_channels
;
}
...
...
krita/colorspaces/rgb_f16half/tests/kis_rgb_f16half_colorspace_tester.cc
View file @
00d7dded
...
...
@@ -79,7 +79,7 @@ void KisRgbF16HalfColorSpaceTester::testBasics()
CHECK
(
cs
->
nColorChannels
(),
NUM_COLOUR_CHANNELS
);
CHECK
(
cs
->
pixelSize
(),
NUM_CHANNELS
*
CHANNEL_SIZE
);
QValueVector
<
KisChannelInfo
*>
channels
=
cs
->
channels
();
Q
3
ValueVector
<
KisChannelInfo
*>
channels
=
cs
->
channels
();
// Red
CHECK
(
channels
[
0
]
->
pos
(),
PIXEL_RED
*
CHANNEL_SIZE
);
...
...
krita/colorspaces/rgb_f32/kis_rgb_f32_colorspace.cc
View file @
00d7dded
...
...
@@ -66,9 +66,9 @@ void KisRgbF32ColorSpace::setPixel(quint8 *dst, float red, float green, float bl
{
Pixel
*
dstPixel
=
reinterpret_cast
<
Pixel
*>
(
dst
);
dstPixel
->
red
=
red
;
dstPixel
->
green
=
green
;
dstPixel
->
blue
=
blue
;
dstPixel
->
Qt
::
red
=
Qt
::
red
;
dstPixel
->
Qt
::
green
=
Qt
::
green
;
dstPixel
->
Qt
::
blue
=
Qt
::
blue
;
dstPixel
->
alpha
=
alpha
;
}
...
...
@@ -76,9 +76,9 @@ void KisRgbF32ColorSpace::getPixel(const quint8 *src, float *red, float *green,
{
const
Pixel
*
srcPixel
=
reinterpret_cast
<
const
Pixel
*>
(
src
);
*
red
=
srcPixel
->
red
;
*
green
=
srcPixel
->
green
;
*
blue
=
srcPixel
->
blue
;
*
Qt
::
red
=
srcPixel
->
Qt
::
red
;
*
Qt
::
green
=
srcPixel
->
Qt
::
green
;
*
Qt
::
blue
=
srcPixel
->
Qt
::
blue
;
*
alpha
=
srcPixel
->
alpha
;
}
...
...
@@ -86,18 +86,18 @@ void KisRgbF32ColorSpace::fromQColor(const QColor& c, quint8 *dstU8, KisProfile
{
Pixel
*
dst
=
reinterpret_cast
<
Pixel
*>
(
dstU8
);
dst
->
red
=
UINT8_TO_FLOAT
(
c
.
red
());
dst
->
green
=
UINT8_TO_FLOAT
(
c
.
green
());
dst
->
blue
=
UINT8_TO_FLOAT
(
c
.
blue
());
dst
->
Qt
::
red
=
UINT8_TO_FLOAT
(
c
.
Qt
::
red
());
dst
->
Qt
::
green
=
UINT8_TO_FLOAT
(
c
.
Qt
::
green
());
dst
->
Qt
::
blue
=
UINT8_TO_FLOAT
(
c
.
Qt
::
blue
());
}
void
KisRgbF32ColorSpace
::
fromQColor
(
const
QColor
&
c
,
quint8
opacity
,
quint8
*
dstU8
,
KisProfile
*
/*profile*/
)
{
Pixel
*
dst
=
reinterpret_cast
<
Pixel
*>
(
dstU8
);
dst
->
red
=
UINT8_TO_FLOAT
(
c
.
red
());
dst
->
green
=
UINT8_TO_FLOAT
(
c
.
green
());
dst
->
blue
=
UINT8_TO_FLOAT
(
c
.
blue
());
dst
->
Qt
::
red
=
UINT8_TO_FLOAT
(
c
.
Qt
::
red
());
dst
->
Qt
::
green
=
UINT8_TO_FLOAT
(
c
.
Qt
::
green
());
dst
->
Qt
::
blue
=
UINT8_TO_FLOAT
(
c
.
Qt
::
blue
());
dst
->
alpha
=
UINT8_TO_FLOAT
(
opacity
);
}
...
...
@@ -105,14 +105,14 @@ void KisRgbF32ColorSpace::toQColor(const quint8 *srcU8, QColor *c, KisProfile *
{
const
Pixel
*
src
=
reinterpret_cast
<
const
Pixel
*>
(
srcU8
);
c
->
setRgb
(
FLOAT_TO_UINT8
(
src
->
red
),
FLOAT_TO_UINT8
(
src
->
green
),
FLOAT_TO_UINT8
(
src
->
blue
));
c
->
setRgb
(
FLOAT_TO_UINT8
(
src
->
Qt
::
red
),
FLOAT_TO_UINT8
(
src
->
Qt
::
green
),
FLOAT_TO_UINT8
(
src
->
Qt
::
blue
));
}
void
KisRgbF32ColorSpace
::
toQColor
(
const
quint8
*
srcU8
,
QColor
*
c
,
quint8
*
opacity
,
KisProfile
*
/*profile*/
)
{
const
Pixel
*
src
=
reinterpret_cast
<
const
Pixel
*>
(
srcU8
);
c
->
setRgb
(
FLOAT_TO_UINT8
(
src
->
red
),
FLOAT_TO_UINT8
(
src
->
green
),
FLOAT_TO_UINT8
(
src
->
blue
));
c
->
setRgb
(
FLOAT_TO_UINT8
(
src
->
Qt
::
red
),
FLOAT_TO_UINT8
(
src
->
Qt
::
green
),
FLOAT_TO_UINT8
(
src
->
Qt
::
blue
));
*
opacity
=
FLOAT_TO_UINT8
(
src
->
alpha
);
}
...
...
@@ -121,9 +121,9 @@ quint8 KisRgbF32ColorSpace::difference(const quint8 *src1U8, const quint8 *src2U
const
Pixel
*
src1
=
reinterpret_cast
<
const
Pixel
*>
(
src1U8
);
const
Pixel
*
src2
=
reinterpret_cast
<
const
Pixel
*>
(
src2U8
);
return
FLOAT_TO_UINT8
(
qMax
(
QABS
(
src2
->
red
-
src1
->
red
),
qMax
(
QABS
(
src2
->
green
-
src1
->
green
),
QABS
(
src2
->
blue
-
src1
->
blue
))));
return
FLOAT_TO_UINT8
(
qMax
(
QABS
(
src2
->
Qt
::
red
-
src1
->
Qt
::
red
),
qMax
(
QABS
(
src2
->
Qt
::
green
-
src1
->
Qt
::
green
),
QABS
(
src2
->
Qt
::
blue
-
src1
->
Qt
::
blue
))));
}
void
KisRgbF32ColorSpace
::
mixColors
(
const
quint8
**
colors
,
const
quint8
*
weights
,
quint32
nColors
,
quint8
*
dst
)
const
...
...
@@ -137,9 +137,9 @@ void KisRgbF32ColorSpace::mixColors(const quint8 **colors, const quint8 *weights
float
alpha
=
pixel
->
alpha
;
float
alphaTimesWeight
=
alpha
*
UINT8_TO_FLOAT
(
*
weights
);
totalRed
+=
pixel
->
red
*
alphaTimesWeight
;
totalGreen
+=
pixel
->
green
*
alphaTimesWeight
;
totalBlue
+=
pixel
->
blue
*
alphaTimesWeight
;
totalRed
+=
pixel
->
Qt
::
red
*
alphaTimesWeight
;
totalGreen
+=
pixel
->
Qt
::
green
*
alphaTimesWeight
;
totalBlue
+=
pixel
->
Qt
::
blue
*
alphaTimesWeight
;
newAlpha
+=
alphaTimesWeight
;
weights
++
;
...
...
@@ -158,9 +158,9 @@ void KisRgbF32ColorSpace::mixColors(const quint8 **colors, const quint8 *weights
totalBlue
=
totalBlue
/
newAlpha
;
}
dstPixel
->
red
=
totalRed
;
dstPixel
->
green
=
totalGreen
;
dstPixel
->
blue
=
totalBlue
;
dstPixel
->
Qt
::
red
=
totalRed
;
dstPixel
->
Qt
::
green
=
totalGreen
;
dstPixel
->
Qt
::
blue
=
totalBlue
;
}
void
KisRgbF32ColorSpace
::
convolveColors
(
quint8
**
colors
,
qint32
*
kernelValues
,
KisChannelInfo
::
enumChannelFlags
channelFlags
,
quint8
*
dst
,
qint32
factor
,
qint32
offset
,
qint32
nColors
)
const
...
...
@@ -174,9 +174,9 @@ void KisRgbF32ColorSpace::convolveColors(quint8** colors, qint32 * kernelValues,
float
weight
=
*
kernelValues
;
if
(
weight
!=
0
)
{
totalRed
+=
pixel
->
red
*
weight
;
totalGreen
+=
pixel
->
green
*
weight
;
totalBlue
+=
pixel
->
blue
*
weight
;
totalRed
+=
pixel
->
Qt
::
red
*
weight
;
totalGreen
+=
pixel
->
Qt
::
green
*
weight
;
totalBlue
+=
pixel
->
Qt
::
blue
*
weight
;
totalAlpha
+=
pixel
->
alpha
*
weight
;
}
colors
++
;
...
...
@@ -186,9 +186,9 @@ void KisRgbF32ColorSpace::convolveColors(quint8** colors, qint32 * kernelValues,
Pixel
*
p
=
reinterpret_cast
<
Pixel
*>
(
dst
);
if
(
channelFlags
&
KisChannelInfo
::
FLAG_COLOR
)
{
p
->
red
=
CLAMP
(
(
totalRed
/
factor
)
+
offset
,
0
,
FLOAT_MAX
);
p
->
green
=
CLAMP
(
(
totalGreen
/
factor
)
+
offset
,
0
,
FLOAT_MAX
);
p
->
blue
=
CLAMP
(
(
totalBlue
/
factor
)
+
offset
,
0
,
FLOAT_MAX
);
p
->
Qt
::
red
=
CLAMP
(
(
totalRed
/
factor
)
+
offset
,
0
,
FLOAT_MAX
);
p
->
Qt
::
green
=
CLAMP
(
(
totalGreen
/
factor
)
+
offset
,
0
,
FLOAT_MAX
);
p
->
Qt
::
blue
=
CLAMP
(
(
totalBlue
/
factor
)
+
offset
,
0
,
FLOAT_MAX
);
}
if
(
channelFlags
&
KisChannelInfo
::
FLAG_ALPHA
)
{
p
->
alpha
=
CLAMP
((
totalAlpha
/
factor
)
+
offset
,
0
,
FLOAT_MAX
);
...
...
@@ -203,9 +203,9 @@ void KisRgbF32ColorSpace::invertColor(quint8 * src, qint32 nPixels)
while
(
nPixels
--
)
{
Pixel
*
p
=
reinterpret_cast
<
Pixel
*>
(
src
);
p
->
red
=
FLOAT_MAX
-
p
->
red
;
p
->
green
=
FLOAT_MAX
-
p
->
green
;
p
->
blue
=
FLOAT_MAX
-
p
->
blue
;
p
->
Qt
::
red
=
FLOAT_MAX
-
p
->
Qt
::
red
;
p
->
Qt
::
green
=
FLOAT_MAX
-
p
->
Qt
::
green
;
p
->
Qt
::
blue
=
FLOAT_MAX
-
p
->
Qt
::
blue
;
src
+=
psize
;
}