diff --git a/libs/ui/CMakeLists.txt b/libs/ui/CMakeLists.txt index 8bb1a881a1..8c1f23f7d1 100644 --- a/libs/ui/CMakeLists.txt +++ b/libs/ui/CMakeLists.txt @@ -1,609 +1,608 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/qtlockedfile ) include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR} ${OCIO_INCLUDE_DIR} ) add_subdirectory( tests ) if (APPLE) find_library(FOUNDATION_LIBRARY Foundation) find_library(APPKIT_LIBRARY AppKit) endif () set(kritaui_LIB_SRCS canvas/kis_canvas_widget_base.cpp canvas/kis_canvas2.cpp canvas/kis_canvas_updates_compressor.cpp canvas/kis_canvas_controller.cpp canvas/kis_paintop_transformation_connector.cpp canvas/kis_display_color_converter.cpp canvas/kis_display_filter.cpp canvas/kis_exposure_gamma_correction_interface.cpp canvas/kis_tool_proxy.cpp canvas/kis_canvas_decoration.cc canvas/kis_coordinates_converter.cpp canvas/kis_grid_manager.cpp canvas/kis_grid_decoration.cpp canvas/kis_grid_config.cpp canvas/kis_prescaled_projection.cpp canvas/kis_qpainter_canvas.cpp canvas/kis_projection_backend.cpp canvas/kis_update_info.cpp canvas/kis_image_patch.cpp canvas/kis_image_pyramid.cpp canvas/kis_infinity_manager.cpp canvas/kis_change_guides_command.cpp canvas/kis_guides_decoration.cpp canvas/kis_guides_manager.cpp canvas/kis_guides_config.cpp canvas/kis_snap_config.cpp canvas/kis_snap_line_strategy.cpp canvas/KisSnapPointStrategy.cpp canvas/KisSnapPixelStrategy.cpp canvas/KisMirrorAxisConfig.cpp dialogs/kis_about_application.cpp dialogs/kis_dlg_adj_layer_props.cc dialogs/kis_dlg_adjustment_layer.cc dialogs/kis_dlg_filter.cpp dialogs/kis_dlg_generator_layer.cpp dialogs/kis_dlg_file_layer.cpp dialogs/kis_dlg_filter.cpp dialogs/kis_dlg_stroke_selection_properties.cpp dialogs/kis_dlg_image_properties.cc dialogs/kis_dlg_layer_properties.cc dialogs/kis_dlg_preferences.cc dialogs/slider_and_spin_box_sync.cpp dialogs/kis_dlg_blacklist_cleanup.cpp dialogs/kis_dlg_layer_style.cpp dialogs/kis_dlg_png_import.cpp dialogs/kis_dlg_import_image_sequence.cpp dialogs/kis_delayed_save_dialog.cpp dialogs/KisSessionManagerDialog.cpp dialogs/KisNewWindowLayoutDialog.cpp flake/kis_node_dummies_graph.cpp flake/kis_dummies_facade_base.cpp flake/kis_dummies_facade.cpp flake/kis_node_shapes_graph.cpp flake/kis_node_shape.cpp flake/kis_shape_controller.cpp flake/kis_shape_layer.cc flake/kis_shape_layer_canvas.cpp flake/kis_shape_selection.cpp flake/kis_shape_selection_canvas.cpp flake/kis_shape_selection_model.cpp flake/kis_take_all_shapes_command.cpp brushhud/kis_uniform_paintop_property_widget.cpp brushhud/kis_brush_hud.cpp brushhud/kis_round_hud_button.cpp brushhud/kis_dlg_brush_hud_config.cpp brushhud/kis_brush_hud_properties_list.cpp brushhud/kis_brush_hud_properties_config.cpp kis_aspect_ratio_locker.cpp kis_autogradient.cc kis_bookmarked_configurations_editor.cc kis_bookmarked_configurations_model.cc kis_bookmarked_filter_configurations_model.cc KisPaintopPropertiesBase.cpp kis_canvas_resource_provider.cpp kis_derived_resources.cpp kis_categories_mapper.cpp kis_categorized_list_model.cpp kis_categorized_item_delegate.cpp kis_clipboard.cc kis_config.cc KisOcioConfiguration.cpp kis_control_frame.cpp kis_composite_ops_model.cc kis_paint_ops_model.cpp kis_cursor.cc kis_cursor_cache.cpp kis_custom_pattern.cc kis_file_layer.cpp kis_change_file_layer_command.h kis_safe_document_loader.cpp kis_splash_screen.cpp kis_filter_manager.cc kis_filters_model.cc - kis_histogram_view.cc KisImageBarrierLockerWithFeedback.cpp kis_image_manager.cc kis_image_view_converter.cpp kis_import_catcher.cc kis_layer_manager.cc kis_mask_manager.cc kis_mimedata.cpp kis_node_commands_adapter.cpp kis_node_manager.cpp kis_node_juggler_compressed.cpp kis_node_selection_adapter.cpp kis_node_insertion_adapter.cpp KisNodeDisplayModeAdapter.cpp kis_node_model.cpp kis_node_filter_proxy_model.cpp kis_model_index_converter_base.cpp kis_model_index_converter.cpp kis_model_index_converter_show_all.cpp kis_painting_assistant.cc kis_painting_assistants_decoration.cpp KisDecorationsManager.cpp kis_paintop_box.cc kis_paintop_option.cpp kis_paintop_options_model.cpp kis_paintop_settings_widget.cpp kis_popup_palette.cpp kis_png_converter.cpp kis_preference_set_registry.cpp KisResourceServerProvider.cpp KisResourceBundleServerProvider.cpp KisSelectedShapesProxy.cpp kis_selection_decoration.cc kis_selection_manager.cc KisSelectionActionsAdapter.cpp kis_statusbar.cc kis_zoom_manager.cc kis_favorite_resource_manager.cpp kis_workspace_resource.cpp kis_action.cpp kis_action_manager.cpp KisActionPlugin.cpp kis_canvas_controls_manager.cpp kis_tooltip_manager.cpp kis_multinode_property.cpp kis_stopgradient_editor.cpp KisWelcomePageWidget.cpp kisexiv2/kis_exif_io.cpp kisexiv2/kis_exiv2.cpp kisexiv2/kis_iptc_io.cpp kisexiv2/kis_xmp_io.cpp opengl/kis_opengl.cpp opengl/kis_opengl_canvas2.cpp opengl/kis_opengl_canvas_debugger.cpp opengl/kis_opengl_image_textures.cpp opengl/kis_texture_tile.cpp opengl/kis_opengl_shader_loader.cpp opengl/kis_texture_tile_info_pool.cpp opengl/KisOpenGLUpdateInfoBuilder.cpp opengl/KisOpenGLModeProber.cpp opengl/KisScreenInformationAdapter.cpp kis_fps_decoration.cpp tool/KisToolChangesTracker.cpp tool/KisToolChangesTrackerData.cpp tool/kis_selection_tool_helper.cpp tool/kis_selection_tool_config_widget_helper.cpp tool/kis_rectangle_constraint_widget.cpp tool/kis_shape_tool_helper.cpp tool/kis_tool.cc tool/kis_delegated_tool_policies.cpp tool/kis_tool_freehand.cc tool/kis_speed_smoother.cpp tool/kis_painting_information_builder.cpp tool/kis_stabilized_events_sampler.cpp tool/kis_tool_freehand_helper.cpp tool/kis_tool_multihand_helper.cpp tool/kis_figure_painting_tool_helper.cpp tool/kis_tool_paint.cc tool/kis_tool_shape.cc tool/kis_tool_ellipse_base.cpp tool/kis_tool_rectangle_base.cpp tool/kis_tool_polyline_base.cpp tool/kis_tool_utils.cpp tool/kis_resources_snapshot.cpp tool/kis_smoothing_options.cpp tool/KisStabilizerDelayedPaintHelper.cpp tool/KisStrokeSpeedMonitor.cpp tool/strokes/freehand_stroke.cpp tool/strokes/KisStrokeEfficiencyMeasurer.cpp tool/strokes/kis_painter_based_stroke_strategy.cpp tool/strokes/kis_filter_stroke_strategy.cpp tool/strokes/kis_color_picker_stroke_strategy.cpp tool/strokes/KisFreehandStrokeInfo.cpp tool/strokes/KisMaskedFreehandStrokePainter.cpp tool/strokes/KisMaskingBrushRenderer.cpp tool/strokes/KisMaskingBrushCompositeOpFactory.cpp tool/strokes/move_stroke_strategy.cpp tool/KisSelectionToolFactoryBase.cpp tool/KisToolPaintFactoryBase.cpp widgets/kis_cmb_composite.cc widgets/kis_cmb_contour.cpp widgets/kis_cmb_gradient.cpp widgets/kis_paintop_list_widget.cpp widgets/kis_cmb_idlist.cc widgets/kis_color_space_selector.cc widgets/kis_advanced_color_space_selector.cc widgets/kis_cie_tongue_widget.cpp widgets/kis_tone_curve_widget.cpp widgets/kis_curve_widget.cpp widgets/kis_custom_image_widget.cc widgets/kis_image_from_clipboard_widget.cpp widgets/kis_double_widget.cc widgets/kis_filter_selector_widget.cc widgets/kis_gradient_chooser.cc widgets/kis_iconwidget.cc widgets/kis_mask_widgets.cpp widgets/kis_meta_data_merge_strategy_chooser_widget.cc widgets/kis_multi_bool_filter_widget.cc widgets/kis_multi_double_filter_widget.cc widgets/kis_multi_integer_filter_widget.cc widgets/kis_multipliers_double_slider_spinbox.cpp widgets/kis_paintop_presets_popup.cpp widgets/kis_tool_options_popup.cpp widgets/kis_paintop_presets_chooser_popup.cpp widgets/kis_paintop_presets_save.cpp widgets/kis_paintop_preset_icon_library.cpp widgets/kis_pattern_chooser.cc widgets/kis_preset_chooser.cpp widgets/kis_progress_widget.cpp widgets/kis_selection_options.cc widgets/kis_scratch_pad.cpp widgets/kis_scratch_pad_event_filter.cpp widgets/kis_preset_selector_strip.cpp widgets/kis_slider_spin_box.cpp widgets/KisSelectionPropertySlider.cpp widgets/kis_size_group.cpp widgets/kis_size_group_p.cpp widgets/kis_wdg_generator.cpp widgets/kis_workspace_chooser.cpp widgets/kis_categorized_list_view.cpp widgets/kis_widget_chooser.cpp widgets/kis_tool_button.cpp widgets/kis_floating_message.cpp widgets/kis_lod_availability_widget.cpp widgets/kis_color_label_selector_widget.cpp widgets/kis_color_filter_combo.cpp widgets/kis_elided_label.cpp widgets/kis_stopgradient_slider_widget.cpp widgets/kis_preset_live_preview_view.cpp widgets/KisScreenColorPicker.cpp widgets/KoDualColorButton.cpp widgets/KoStrokeConfigWidget.cpp widgets/KoFillConfigWidget.cpp widgets/KisLayerStyleAngleSelector.cpp widgets/KisMemoryReportButton.cpp KisPaletteEditor.cpp dialogs/KisDlgPaletteEditor.cpp widgets/KisNewsWidget.cpp widgets/KisGamutMaskToolbar.cpp utils/kis_document_aware_spin_box_unit_manager.cpp utils/KisSpinBoxSplineUnitConverter.cpp input/kis_input_manager.cpp input/kis_input_manager_p.cpp input/kis_extended_modifiers_mapper.cpp input/kis_abstract_input_action.cpp input/kis_tool_invocation_action.cpp input/kis_pan_action.cpp input/kis_alternate_invocation_action.cpp input/kis_rotate_canvas_action.cpp input/kis_zoom_action.cpp input/kis_change_frame_action.cpp input/kis_gamma_exposure_action.cpp input/kis_show_palette_action.cpp input/kis_change_primary_setting_action.cpp input/kis_abstract_shortcut.cpp input/kis_native_gesture_shortcut.cpp input/kis_single_action_shortcut.cpp input/kis_stroke_shortcut.cpp input/kis_shortcut_matcher.cpp input/kis_select_layer_action.cpp input/KisQtWidgetsTweaker.cpp input/KisInputActionGroup.cpp operations/kis_operation.cpp operations/kis_operation_configuration.cpp operations/kis_operation_registry.cpp operations/kis_operation_ui_factory.cpp operations/kis_operation_ui_widget.cpp operations/kis_filter_selection_operation.cpp actions/kis_selection_action_factories.cpp actions/KisPasteActionFactory.cpp actions/KisTransformToolActivationCommand.cpp input/kis_touch_shortcut.cpp kis_document_undo_store.cpp kis_gui_context_command.cpp kis_gui_context_command_p.cpp input/kis_tablet_debugger.cpp input/kis_input_profile_manager.cpp input/kis_input_profile.cpp input/kis_shortcut_configuration.cpp input/config/kis_input_configuration_page.cpp input/config/kis_edit_profiles_dialog.cpp input/config/kis_input_profile_model.cpp input/config/kis_input_configuration_page_item.cpp input/config/kis_action_shortcuts_model.cpp input/config/kis_input_type_delegate.cpp input/config/kis_input_mode_delegate.cpp input/config/kis_input_button.cpp input/config/kis_input_editor_delegate.cpp input/config/kis_mouse_input_editor.cpp input/config/kis_wheel_input_editor.cpp input/config/kis_key_input_editor.cpp processing/fill_processing_visitor.cpp kis_asl_layer_style_serializer.cpp kis_psd_layer_style_resource.cpp canvas/kis_mirror_axis.cpp kis_abstract_perspective_grid.cpp KisApplication.cpp KisAutoSaveRecoveryDialog.cpp KisDetailsPane.cpp KisDocument.cpp KisCloneDocumentStroke.cpp kis_node_view_color_scheme.cpp KisImportExportFilter.cpp KisFilterEntry.cpp KisImportExportManager.cpp KisImportExportUtils.cpp kis_async_action_feedback.cpp KisMainWindow.cpp KisOpenPane.cpp KisPart.cpp KisPrintJob.cpp KisTemplate.cpp KisTemplateCreateDia.cpp KisTemplateGroup.cpp KisTemplates.cpp KisTemplatesPane.cpp KisTemplateTree.cpp KisUndoActionsUpdateManager.cpp KisView.cpp KisImportExportErrorCode.cpp thememanager.cpp kis_mainwindow_observer.cpp KisViewManager.cpp kis_mirror_manager.cpp qtlockedfile/qtlockedfile.cpp qtsingleapplication/qtlocalpeer.cpp qtsingleapplication/qtsingleapplication.cpp KisResourceBundle.cpp KisResourceBundleManifest.cpp kis_md5_generator.cpp KisApplicationArguments.cpp KisNetworkAccessManager.cpp KisMultiFeedRSSModel.cpp KisRemoteFileFetcher.cpp KisSaveGroupVisitor.cpp KisWindowLayoutResource.cpp KisWindowLayoutManager.cpp KisSessionResource.cpp KisReferenceImagesDecoration.cpp KisReferenceImage.cpp flake/KisReferenceImagesLayer.cpp flake/KisReferenceImagesLayer.h ) if(WIN32) # Private headers are needed for: # * KisDlgCustomTabletResolution # * KisScreenInformationAdapter include_directories(SYSTEM ${Qt5Gui_PRIVATE_INCLUDE_DIRS}) set(kritaui_LIB_SRCS ${kritaui_LIB_SRCS} qtlockedfile/qtlockedfile_win.cpp ) if (NOT USE_QT_TABLET_WINDOWS) set(kritaui_LIB_SRCS ${kritaui_LIB_SRCS} input/wintab/kis_tablet_support_win.cpp input/wintab/kis_screen_size_choice_dialog.cpp input/wintab/kis_tablet_support_win8.cpp ) else() set(kritaui_LIB_SRCS ${kritaui_LIB_SRCS} dialogs/KisDlgCustomTabletResolution.cpp ) endif() endif() set(kritaui_LIB_SRCS ${kritaui_LIB_SRCS} kis_animation_frame_cache.cpp kis_animation_cache_populator.cpp KisAsyncAnimationRendererBase.cpp KisAsyncAnimationCacheRenderer.cpp KisAsyncAnimationFramesSavingRenderer.cpp dialogs/KisAsyncAnimationRenderDialogBase.cpp dialogs/KisAsyncAnimationCacheRenderDialog.cpp dialogs/KisAsyncAnimationFramesSaveDialog.cpp canvas/kis_animation_player.cpp kis_animation_importer.cpp KisSyncedAudioPlayback.cpp KisFrameDataSerializer.cpp KisFrameCacheStore.cpp KisFrameCacheSwapper.cpp KisAbstractFrameCacheSwapper.cpp KisInMemoryFrameCacheSwapper.cpp input/wintab/drawpile_tablettester/tablettester.cpp input/wintab/drawpile_tablettester/tablettest.cpp ) if (UNIX) set(kritaui_LIB_SRCS ${kritaui_LIB_SRCS} qtlockedfile/qtlockedfile_unix.cpp ) endif() if(APPLE) set(kritaui_LIB_SRCS ${kritaui_LIB_SRCS} osx.mm ) endif() ki18n_wrap_ui(kritaui_LIB_SRCS widgets/KoFillConfigWidget.ui widgets/KoStrokeConfigWidget.ui forms/wdgdlgpngimport.ui forms/wdgfullscreensettings.ui forms/wdgautogradient.ui forms/wdggeneralsettings.ui forms/wdgperformancesettings.ui forms/wdggenerators.ui forms/wdgbookmarkedconfigurationseditor.ui forms/wdgapplyprofile.ui forms/wdgcustompattern.ui forms/wdglayerproperties.ui forms/wdgcolorsettings.ui forms/wdgtabletsettings.ui forms/wdgcolorspaceselector.ui forms/wdgcolorspaceselectoradvanced.ui forms/wdgdisplaysettings.ui forms/kis_previewwidgetbase.ui forms/kis_matrix_widget.ui forms/wdgselectionoptions.ui forms/wdggeometryoptions.ui forms/wdgnewimage.ui forms/wdgimageproperties.ui forms/wdgmaskfromselection.ui forms/wdgmasksource.ui forms/wdgfilterdialog.ui forms/wdgmetadatamergestrategychooser.ui forms/wdgpaintoppresets.ui forms/wdgpaintopsettings.ui forms/wdgdlggeneratorlayer.ui forms/wdgdlgfilelayer.ui forms/wdgfilterselector.ui forms/wdgfilternodecreation.ui forms/wdgmultipliersdoublesliderspinbox.ui forms/wdgnodequerypatheditor.ui forms/wdgpresetselectorstrip.ui forms/wdgsavebrushpreset.ui forms/wdgpreseticonlibrary.ui forms/wdgdlgblacklistcleanup.ui forms/wdgrectangleconstraints.ui forms/wdgimportimagesequence.ui forms/wdgstrokeselectionproperties.ui forms/KisDetailsPaneBase.ui forms/KisOpenPaneBase.ui forms/wdgstopgradienteditor.ui forms/wdgsessionmanager.ui forms/wdgnewwindowlayout.ui forms/KisWelcomePage.ui forms/WdgDlgPaletteEditor.ui forms/KisNewsPage.ui forms/wdgGamutMaskToolbar.ui brushhud/kis_dlg_brush_hud_config.ui dialogs/kis_delayed_save_dialog.ui input/config/kis_input_configuration_page.ui input/config/kis_edit_profiles_dialog.ui input/config/kis_input_configuration_page_item.ui input/config/kis_mouse_input_editor.ui input/config/kis_wheel_input_editor.ui input/config/kis_key_input_editor.ui layerstyles/wdgBevelAndEmboss.ui layerstyles/wdgblendingoptions.ui layerstyles/WdgColorOverlay.ui layerstyles/wdgContour.ui layerstyles/wdgdropshadow.ui layerstyles/WdgGradientOverlay.ui layerstyles/wdgInnerGlow.ui layerstyles/wdglayerstyles.ui layerstyles/WdgPatternOverlay.ui layerstyles/WdgSatin.ui layerstyles/WdgStroke.ui layerstyles/wdgstylesselector.ui layerstyles/wdgTexture.ui layerstyles/wdgKisLayerStyleAngleSelector.ui wdgsplash.ui input/wintab/kis_screen_size_choice_dialog.ui input/wintab/drawpile_tablettester/tablettest.ui ) if(WIN32) if(USE_QT_TABLET_WINDOWS) ki18n_wrap_ui(kritaui_LIB_SRCS dialogs/KisDlgCustomTabletResolution.ui ) else() ki18n_wrap_ui(kritaui_LIB_SRCS input/wintab/kis_screen_size_choice_dialog.ui ) endif() endif() add_library(kritaui SHARED ${kritaui_HEADERS_MOC} ${kritaui_LIB_SRCS} ) generate_export_header(kritaui BASE_NAME kritaui) target_link_libraries(kritaui KF5::CoreAddons KF5::Completion KF5::I18n KF5::ItemViews Qt5::Network kritaimpex kritacolor kritaimage kritalibbrush kritawidgets kritawidgetutils ${PNG_LIBRARIES} LibExiv2::LibExiv2 ) if (HAVE_QT_MULTIMEDIA) target_link_libraries(kritaui Qt5::Multimedia) endif() if (NOT WIN32 AND NOT APPLE) target_link_libraries(kritaui ${X11_X11_LIB} ${X11_Xinput_LIB} ${XCB_LIBRARIES}) endif() if(APPLE) target_link_libraries(kritaui ${FOUNDATION_LIBRARY}) target_link_libraries(kritaui ${APPKIT_LIBRARY}) endif () target_link_libraries(kritaui ${OPENEXR_LIBRARIES}) # Add VSync disable workaround if(NOT WIN32 AND NOT APPLE) target_link_libraries(kritaui ${CMAKE_DL_LIBS} Qt5::X11Extras) endif() if(X11_FOUND) target_link_libraries(kritaui Qt5::X11Extras ${X11_LIBRARIES}) endif() target_include_directories(kritaui PUBLIC $ $ $ $ $ $ $ ) set_target_properties(kritaui PROPERTIES VERSION ${GENERIC_KRITA_LIB_VERSION} SOVERSION ${GENERIC_KRITA_LIB_SOVERSION} ) install(TARGETS kritaui ${INSTALL_TARGETS_DEFAULT_ARGS}) if (APPLE) install(FILES osx.stylesheet DESTINATION ${DATA_INSTALL_DIR}/krita) endif () diff --git a/libs/ui/kis_histogram_view.cc b/libs/ui/kis_histogram_view.cc deleted file mode 100644 index 8cd3b0c712..0000000000 --- a/libs/ui/kis_histogram_view.cc +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (c) 2005 Bart Coppens - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kis_histogram_view.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "KoChannelInfo.h" -#include "KoBasicHistogramProducers.h" -#include "KoColorSpace.h" - -#include "kis_global.h" -#include "kis_layer.h" -#include -#include "kis_paint_device.h" - -KisHistogramView::KisHistogramView(QWidget *parent, const char *name, Qt::WindowFlags f) - : QLabel(parent, f), - m_currentDev(nullptr), m_currentProducer(nullptr), - m_smoothHistogram(false),m_histogram_type(LINEAR) -{ - setObjectName(name); -} - -KisHistogramView::~KisHistogramView() -{ -} - - -KoHistogramProducer *KisHistogramView::currentProducer() -{ - return m_currentProducer; -} - -void KisHistogramView::startUpdateCanvasProjection() -{ - updateHistogramCalculation(); -} - -void KisHistogramView::setChannels(QList & channels) -{ - m_channels = channels; - updateHistogramCalculation(); -} - -void KisHistogramView::setProducer(KoHistogramProducer* producer) -{ - m_currentProducer = producer; - m_channels = m_currentProducer->channels(); - if( !m_histogram.isNull() ){ - m_histogram->setProducer( m_currentProducer ); - } - updateHistogramCalculation(); -} - -void KisHistogramView::setPaintDevice(KisPaintDeviceSP dev, KoHistogramProducer* producer, const QRect &bounds) -{ - m_currentProducer = producer; - m_channels = m_currentProducer->channels(); - m_currentDev = dev; - m_currentBounds = bounds; - m_histogram = new KisHistogram(m_currentDev, m_currentBounds, m_currentProducer, m_histogram_type); - - updateHistogramCalculation(); -} - -void KisHistogramView::setView(double from, double size) -{ - double m_from = from; - double m_width = size; - if (m_from + m_width > 1.0) - m_from = 1.0 - m_width; - m_histogram->producer()->setView(m_from, m_width); - updateHistogramCalculation(); -} - -bool KisHistogramView::hasColor() -{ - return m_color; -} - -void KisHistogramView::setColor(bool set) -{ - if (set != m_color) { - m_color = set; - } - update(); -} - -void KisHistogramView::setHistogramType(enumHistogramType type) -{ - m_histogram_type = type; - updateHistogramCalculation(); -} - -void KisHistogramView::updateHistogramCalculation() -{ - if (!m_currentProducer || m_currentDev.isNull() || m_histogram.isNull() ) { // Something's very wrong: not initialized - return; - } - m_histogram->updateHistogram(); - update(); -} - -void KisHistogramView::mousePressEvent(QMouseEvent * e) -{ - if (e->button() == Qt::RightButton) - emit rightClicked(e->globalPos()); - else - QLabel::mousePressEvent(e); -} - -void KisHistogramView::setSmoothHistogram(bool smoothHistogram) -{ - m_smoothHistogram = smoothHistogram; -} - - -void KisHistogramView::paintEvent(QPaintEvent *event) -{ - QLabel::paintEvent(event); - - if( this->height() > 0 && this->width()>0 && !m_histogram.isNull() ){ - qint32 height = this->height(); - int selFrom, selTo; // from - to in bins - - qint32 bins = m_histogram->producer()->numberOfBins(); - - QPainter painter(this); - painter.setPen(this->palette().light().color()); - - const int NGRID = 4; - for(int i=0; i<=NGRID; ++i){ - painter.drawLine(this->width()*i/NGRID,0.,this->width()*i/NGRID,this->height()); - painter.drawLine(0.,this->height()*i/NGRID,this->width(),this->height()*i/NGRID); - } - - - // Draw the box of the selection, if any - if (m_histogram->hasSelection()) { - double width = m_histogram->selectionTo() - m_histogram->selectionFrom(); - double factor = static_cast(bins) / m_histogram->producer()->viewWidth(); - selFrom = static_cast(m_histogram->selectionFrom() * factor); - selTo = selFrom + static_cast(width * factor); - painter.drawRect(selFrom, 0, selTo - selFrom, height); - } else { - // We don't want the drawing to think we're in a selected area - selFrom = -1; - selTo = 2; - } - - float highest = 0; - - if(m_channels.count()==0){ - m_channels=m_currentProducer->channels(); - } - int nChannels = m_channels.size(); - - // First we iterate once, so that we have the overall maximum. This is a bit inefficient, - // but not too much since the histogram caches the calculations - for (int chan = 0; chan < m_channels.size(); chan++) { - if( m_channels.at(chan)->channelType() != KoChannelInfo::ALPHA ){ - m_histogram->setChannel(chan); - if ((float)m_histogram->calculations().getHighest() > highest) - highest = (float)m_histogram->calculations().getHighest(); - } - } - highest = (m_histogram_type==LINEAR)? highest: std::log2(highest); - - painter.setWindow(QRect(-1,0,bins+1,highest)); - painter.setCompositionMode(QPainter::CompositionMode_Plus); - - for (int chan = 0; chan < nChannels; chan++) { - if( m_channels.at(chan)->channelType() != KoChannelInfo::ALPHA ){ - auto color = m_channels.at(chan)->color(); - auto fill_color = color; - fill_color.setAlphaF(.25); - painter.setBrush(fill_color); - auto pen = QPen(color); - pen.setWidth(0); - painter.setPen(pen); - - if (m_smoothHistogram){ - QPainterPath path; - - m_histogram->setChannel(chan); - path.moveTo(QPointF(-1,highest)); - for (qint32 i = 0; i < bins; ++i) { - float v = (m_histogram_type==LINEAR)? highest-m_histogram->getValue(i): highest-std::log2(m_histogram->getValue(i)); - path.lineTo(QPointF(i,v)); - - } - path.lineTo(QPointF(bins+1,highest)); - path.closeSubpath(); - painter.drawPath(path); - } - else { - pen.setWidth(1); - painter.setPen(pen); - m_histogram->setChannel(chan); - for (qint32 i = 0; i < bins; ++i) { - float v = (m_histogram_type==LINEAR)? highest-m_histogram->getValue(i): highest-std::log2(m_histogram->getValue(i)); - painter.drawLine(QPointF(i,highest),QPointF(i,v)); - } - } - } - } - } -} diff --git a/libs/ui/kis_histogram_view.h b/libs/ui/kis_histogram_view.h deleted file mode 100644 index 1c57c15c10..0000000000 --- a/libs/ui/kis_histogram_view.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2005 Bart Coppens - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef _KIS_HISTOGRAM_VIEW_ -#define _KIS_HISTOGRAM_VIEW_ - -#include -#include -#include -#include -#include -#include - -#include "kis_types.h" -#include "kis_histogram.h" - -#include - - -class KoChannelInfo; - -/** - * This class displays a histogram. It has a list of channels it can - * select. The easy way is to display channelStrings() to the user, - * and then use a setActiveChannel with the integer the same as the - * one the selected string in that stringlist has. If the selected one - * is a producer, the histogram will automatically display all its - * channels, and color them if that is possible. - * - * You can also set the channels manually, just don't forget that the - * displayed channels all need to belong to the same producer! If you - * set them manually, don't forget to set the (non)usage of color as - * well. - * - * You can either set this to use a specific layer, or use a specific - * histogram. With the latter, some functionality will disappear, like - * listProducers(). Setting a histogram will discard info on the - * layer, and setting a layer will discard info on the histogram. - * - **/ -class KRITAUI_EXPORT KisHistogramView : public QLabel -{ - Q_OBJECT - -public: - - KisHistogramView(QWidget *parent = 0, const char *name = 0, Qt::WindowFlags f = 0); - - ~KisHistogramView() override; - - void setPaintDevice(KisPaintDeviceSP dev, KoHistogramProducer *producer, const QRect &bounds); - - void setView(double from, double size); - - KoHistogramProducer *currentProducer(); - - bool hasColor(); - void setColor(bool set); - void setProducer(KoHistogramProducer* producer); - void setChannels(QList & channels); - void paintEvent(QPaintEvent* event) override; - virtual void updateHistogramCalculation(); - void setSmoothHistogram(bool smoothHistogram); - -public Q_SLOTS: - virtual void setHistogramType(enumHistogramType type); - virtual void startUpdateCanvasProjection(); - -Q_SIGNALS: - void rightClicked(const QPoint& pos); - -protected: - - void mousePressEvent(QMouseEvent * e) override; - -private: - - void setChannels(void); - - void addProducerChannels(KoHistogramProducer *producer); - KisHistogramSP m_histogram; - KisPaintDeviceSP m_currentDev; - QRect m_currentBounds; - KoHistogramProducer *m_currentProducer; - QList m_channels; - bool m_color; - bool m_smoothHistogram; - enumHistogramType m_histogram_type; -}; - -#endif // _KIS_HISTOGRAM_VIEW_ diff --git a/plugins/extensions/CMakeLists.txt b/plugins/extensions/CMakeLists.txt index 9ace76c315..65798e6f5f 100644 --- a/plugins/extensions/CMakeLists.txt +++ b/plugins/extensions/CMakeLists.txt @@ -1,20 +1,19 @@ add_subdirectory( imagesplit ) add_subdirectory( clonesarray ) add_subdirectory( colorrange ) add_subdirectory( colorspaceconversion ) -add_subdirectory( histogram ) add_subdirectory( imagesize ) add_subdirectory( metadataeditor ) add_subdirectory( modify_selection ) add_subdirectory( offsetimage ) add_subdirectory( rotateimage ) add_subdirectory( separate_channels ) add_subdirectory( shearimage ) add_subdirectory( layergroupswitcher ) add_subdirectory( resourcemanager ) add_subdirectory( layersplit ) add_subdirectory( animationrenderer ) add_subdirectory( waveletdecompose ) add_subdirectory( pykrita ) add_subdirectory( qmic ) add_subdirectory( buginfo ) diff --git a/plugins/extensions/histogram/CMakeLists.txt b/plugins/extensions/histogram/CMakeLists.txt deleted file mode 100644 index 9666edfd2d..0000000000 --- a/plugins/extensions/histogram/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -set(kritahistogram_SOURCES histogram.cc dlg_histogram.cc kis_histogram_widget.cc ) -ki18n_wrap_ui(kritahistogram_SOURCES wdghistogram.ui ) -add_library(kritahistogram MODULE ${kritahistogram_SOURCES}) -target_link_libraries(kritahistogram kritaui) -install(TARGETS kritahistogram DESTINATION ${KRITA_PLUGIN_INSTALL_DIR}) -install( FILES histogram.xmlgui DESTINATION ${DATA_INSTALL_DIR}/kritaplugins) diff --git a/plugins/extensions/histogram/dlg_histogram.cc b/plugins/extensions/histogram/dlg_histogram.cc deleted file mode 100644 index b78d5c64d0..0000000000 --- a/plugins/extensions/histogram/dlg_histogram.cc +++ /dev/null @@ -1,61 +0,0 @@ -/* - * dlg_histogram.cc - part of KimageShop^WKrayon^WKrita - * - * Copyright (c) 2004 Boudewijn Rempt - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "dlg_histogram.h" - -#include -#include - -#include "kis_types.h" -#include "kis_paint_device.h" -#include "kis_histogram_widget.h" - - -DlgHistogram::DlgHistogram(QWidget * parent, const char * name) - : KoDialog(parent) -{ - setCaption(i18n("Histogram")); - setButtons(Ok | Cancel); - setDefaultButton(Ok); - setObjectName(name); - m_page = new KisHistogramWidget(this, "histogram"); - - Q_CHECK_PTR(m_page); - - setCaption(i18n("Histogram")); - setMainWidget(m_page); - resize(m_page->sizeHint()); -} - -DlgHistogram::~DlgHistogram() -{ - delete m_page; -} - -void DlgHistogram::setPaintDevice(KisPaintDeviceSP dev, const QRect &bounds) -{ - m_page->setPaintDevice(dev, bounds); -} - -void DlgHistogram::okClicked() -{ - accept(); -} - diff --git a/plugins/extensions/histogram/dlg_histogram.h b/plugins/extensions/histogram/dlg_histogram.h deleted file mode 100644 index 9ac59133e7..0000000000 --- a/plugins/extensions/histogram/dlg_histogram.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * dlg_histogram.h -- part of KimageShop^WKrayon^WKrita - * - * Copyright (c) 2004 Boudewijn Rempt - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#ifndef DLG_HISTOGRAM -#define DLG_HISTOGRAM - -#include - -#include "kis_types.h" - -class KisHistogramWidget; - -/** - * This dialog shows the histogram for the (selected) portion - * of the current layer. - * - * XXX: Also for complete image? - */ -class DlgHistogram: public KoDialog -{ - Q_OBJECT - -public: - - DlgHistogram(QWidget * parent = 0, - const char* name = 0); - ~DlgHistogram() override; - - void setPaintDevice(KisPaintDeviceSP dev, const QRect &bounds); - -private Q_SLOTS: - void okClicked(); - -private: - - KisHistogramWidget * m_page; -}; - -#endif // DLG_HISTOGRAM diff --git a/plugins/extensions/histogram/histogram.cc b/plugins/extensions/histogram/histogram.cc deleted file mode 100644 index 2a6036ae84..0000000000 --- a/plugins/extensions/histogram/histogram.cc +++ /dev/null @@ -1,70 +0,0 @@ -/* - * histogram.h -- Part of Krita - * - * Copyright (c) 2004 Boudewijn Rempt (boud@valdyas.org) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "histogram.h" - -#include -#include -#include - -#include -#include -#include -#include - -#include "dlg_histogram.h" -#include "kis_node_manager.h" -#include - -K_PLUGIN_FACTORY_WITH_JSON(HistogramFactory, "kritahistogram.json", registerPlugin();) - -Histogram::Histogram(QObject *parent, const QVariantList &) - : KisActionPlugin(parent) -{ - KisAction* action = createAction("histogram"); - connect(action, SIGNAL(triggered()), this, SLOT(slotActivated())); -} - -Histogram::~Histogram() -{ -} - -void Histogram::slotActivated() -{ - DlgHistogram * dlgHistogram = new DlgHistogram(viewManager()->mainWindow(), "Histogram"); - - Q_CHECK_PTR(dlgHistogram); - - KisLayerSP layer = viewManager()->nodeManager()->activeLayer(); - if (layer) { - KisPaintDeviceSP dev = layer->paintDevice(); - - if (dev) { - dlgHistogram->setPaintDevice(dev, layer->image()->bounds()); - } - if (dlgHistogram->exec() == QDialog::Accepted) { - // Do nothing; this is an informational dialog - } - } - delete dlgHistogram; -} - -#include "histogram.moc" - diff --git a/plugins/extensions/histogram/histogram.h b/plugins/extensions/histogram/histogram.h deleted file mode 100644 index cfe286ffc3..0000000000 --- a/plugins/extensions/histogram/histogram.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * histogram.h -- Part of Krita - * - * Copyright (c) 2004 Boudewijn Rempt (boud@valdyas.org) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef HISTOGRAM_H -#define HISTOGRAM_H - -#include - -#include - -class Histogram : public KisActionPlugin -{ - Q_OBJECT -public: - Histogram(QObject *parent, const QVariantList &); - ~Histogram() override; - -private Q_SLOTS: - void slotActivated(); -}; - -#endif // HISTOGRAM_H diff --git a/plugins/extensions/histogram/histogram.xmlgui b/plugins/extensions/histogram/histogram.xmlgui deleted file mode 100644 index 9a009a73a0..0000000000 --- a/plugins/extensions/histogram/histogram.xmlgui +++ /dev/null @@ -1,8 +0,0 @@ - - - - &Layer - - - - diff --git a/plugins/extensions/histogram/kis_histogram_widget.cc b/plugins/extensions/histogram/kis_histogram_widget.cc deleted file mode 100644 index 393b5b2b5d..0000000000 --- a/plugins/extensions/histogram/kis_histogram_widget.cc +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright (c) 2004 Boudewijn Rempt - * (c) 2005 Bart Coppens - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "kis_histogram_widget.h" - -#include -#include -#include -#include -#include - -#include - -#include "KoChannelInfo.h" -#include "KoBasicHistogramProducers.h" -#include "kis_histogram_view.h" - -#include "kis_histogram.h" -#include "kis_global.h" -#include "kis_types.h" -#include "kis_layer.h" -#include "kis_paint_device.h" - - -KisHistogramWidget::KisHistogramWidget(QWidget *parent, const char *name) - : WdgHistogram(parent) -{ - setObjectName(name); - m_from = 0.0; - m_width = 0.0; -} - -KisHistogramWidget::~KisHistogramWidget() -{ -} - -QList KisHistogramWidget::producers() -{ - if (m_cs) - return KoHistogramProducerFactoryRegistry::instance()->keysCompatibleWith(m_cs,true); - return QList(); -} - - -void KisHistogramWidget::setChannels(void) -{ - m_comboInfo.clear(); - m_channelStrings.clear(); - m_channels.clear(); - m_channelToOffset.clear(); - - QList list = KoHistogramProducerFactoryRegistry::instance()->keysCompatibleWith(m_cs,false); - - if (list.count() == 0) { - // XXX: No native histogram for this colorspace. Using converted RGB. We should have a warning - KoGenericRGBHistogramProducerFactory f; - addProducerChannels(f.generate()); - } else { - Q_FOREACH (const QString &id, list) { - KoHistogramProducer *producer = KoHistogramProducerFactoryRegistry::instance()->value(id)->generate(); - if (producer) { - addProducerChannels(producer); - } - } - } - - m_currentProducer = m_comboInfo.at(0).producer; - m_color = false; - // The currently displayed channel and its offset - m_channels.append(m_comboInfo.at(1).channel); - m_channelToOffset.append(0); -} - -void KisHistogramWidget::setCurrentChannels(const KoID& producerID, QList channels) -{ - setCurrentChannels( - KoHistogramProducerFactoryRegistry::instance()->value(producerID.id())->generate(), - channels); -} - -void KisHistogramWidget::setCurrentChannels(KoHistogramProducer *producer, QList channels) -{ - m_currentProducer = producer; - m_currentProducer->setView(m_from, m_width); - m_histogramView->setProducer(m_currentProducer); - //m_histogram->setChannel(0); // Set a default channel, just being nice - - m_channels.clear(); - m_channelToOffset.clear(); - - if (channels.count() == 0) { - return; - } - - QList producerChannels = m_currentProducer->channels(); - - for (int i = 0; i < channels.count(); i++) { - // Also makes sure the channel is actually in the producer's list - for (int j = 0; j < producerChannels.count(); j++) { - if (channels.at(i)->name() == producerChannels.at(j)->name()) { - m_channelToOffset.append(m_channels.count()); // The first we append maps to 0 - m_channels.append(channels.at(i)); - } - } - } - m_histogramView->setChannels(m_channels); -} - -void KisHistogramWidget::addProducerChannels(KoHistogramProducer *producer) -{ - if (!producer) return; - - ComboboxInfo info; - info.isProducer = true; - info.producer = producer; - m_comboInfo.append(info); - m_channelStrings.append(producer->id().name()); -} - -void KisHistogramWidget::setActiveChannel(int channel) -{ - ComboboxInfo info = m_comboInfo.at(channel); - if (info.producer != m_currentProducer) { - m_currentProducer = info.producer; - m_currentProducer->setView(m_from, m_width); - m_histogramView->setProducer(m_currentProducer); - } - - m_channels.clear(); - m_channelToOffset.clear(); - - if (info.isProducer) { - m_color = true; - m_channels = m_currentProducer->channels(); - for (int i = 0; i < m_channels.count(); i++) - m_channelToOffset.append(i); - //setChannel(0); // Set a default channel, just being nice - } else { - m_color = false; - QList channels = m_currentProducer->channels(); - for (int i = 0; i < channels.count(); i++) { - KoChannelInfo* channel = channels.at(i); - if (channel->name() == info.channel->name()) { - m_channels.append(channel); - m_channelToOffset.append(i); - break; - } - } - } - updateEnabled(); -} - -QStringList KisHistogramWidget::channelStrings() -{ - return m_channelStrings; -} - -void KisHistogramWidget::setPaintDevice(KisPaintDeviceSP dev, const QRect &bounds) -{ - radioLinear->disconnect(this); - radioLog->disconnect(this); - cmbChannel->disconnect(this); - - m_cs = dev->colorSpace(); - - setChannels(); // Sets m_currentProducer to the first in the list - m_histogramView->setPaintDevice(dev, m_currentProducer, bounds); - setActiveChannel(0); // So we have the colored one if there are colors - - // The channels - cmbChannel->clear(); - cmbChannel->addItems(this->channelStrings()); - cmbChannel->setCurrentIndex(0); - - // View display - currentView->setMinimum(0); - currentView->setMaximum(100); - - updateEnabled(); - - m_from = m_histogramView->currentProducer()->viewFrom(); - m_width = m_histogramView->currentProducer()->viewWidth(); - - connect(radioLinear,SIGNAL(clicked()), this, SLOT(slotTypeSwitched())); - connect(radioLog,SIGNAL(clicked()), this, SLOT(slotTypeSwitched())); - connect(cmbChannel, SIGNAL(activated(int)), this, SLOT(setActiveChannel(int))); - connect(zoomIn, SIGNAL(clicked()), this, SLOT(slotZoomIn())); - connect(zoomOut, SIGNAL(clicked()), this, SLOT(slotZoomOut())); - connect(currentView, SIGNAL(valueChanged(int)), this, SLOT(slide(int))); -} - - -void KisHistogramWidget::slotTypeSwitched(void) -{ - m_histogramView->setHistogramType( radioLinear->isChecked()?LINEAR:LOGARITHMIC ); -} - -void KisHistogramWidget::setView(double from, double size) -{ - m_from = from; - m_width = size; - if (m_from + m_width > 1.0) - m_from = 1.0 - m_width; - m_histogramView->setView(m_from, m_width); - updateEnabled(); -} - -void KisHistogramWidget::slotZoomIn() -{ - if ((m_width / 2) >= m_histogramView->currentProducer()->maximalZoom()) { - setView(m_from, m_width / 2); - } -} - -void KisHistogramWidget::slotZoomOut() -{ - if (m_width * 2 <= 1.0) { - setView(m_from, m_width * 2); - } -} - -void KisHistogramWidget::slide(int val) -{ - // Beware: at the END (e.g. 100), we want to still view m_width: - setView((static_cast(val) / 100.0) *(1.0 - m_width), m_width); -} - -void KisHistogramWidget::updateEnabled() -{ - if (m_histogramView->currentProducer()->maximalZoom() < 1.0) { - if ((m_width / 2) >= m_histogramView->currentProducer()->maximalZoom()) { - zoomIn->setEnabled(true); - } else { - zoomIn->setEnabled(false); - } - if (m_width * 2 <= 1.0) { - zoomOut->setEnabled(true); - } else { - zoomOut->setEnabled(false); - } - if (m_width < 1.0) - currentView->setEnabled(true); - else - currentView->setEnabled(false); - } else { - zoomIn->setEnabled(false); - zoomOut->setEnabled(false); - currentView->setEnabled(false); - } -} - - diff --git a/plugins/extensions/histogram/kis_histogram_widget.h b/plugins/extensions/histogram/kis_histogram_widget.h deleted file mode 100644 index 6cb9f4faf7..0000000000 --- a/plugins/extensions/histogram/kis_histogram_widget.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2004 Boudewijn Rempt - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#ifndef KIS_HISTOGRAM_WIDGET_ -#define KIS_HISTOGRAM_WIDGET_ - -#include "kis_types.h" -#include "ui_wdghistogram.h" -#include "KoHistogramProducer.h" - -class WdgHistogram : public QWidget, public Ui::WdgHistogram -{ - Q_OBJECT - -public: - WdgHistogram(QWidget *parent) : QWidget(parent) { - setupUi(this); - } -}; - -/** - * The histogram widget takes a paint device or an image and - * draws a histogram for the given KisHistogram. - */ -class KisHistogramWidget : public WdgHistogram -{ - - Q_OBJECT - -public: - KisHistogramWidget(QWidget *parent, const char *name); - ~KisHistogramWidget() override; - - void setPaintDevice(KisPaintDeviceSP dev, const QRect &bounds); - - /** Sets the currently displayed channels to channels of the producer with producerID as ID*/ - void setCurrentChannels(const KoID& producerID, QList channels); - - /** Be careful, producer will be modified */ - void setCurrentChannels(KoHistogramProducer *producer, QList channels); - -private Q_SLOTS: - void setActiveChannel(int channel); - void slotTypeSwitched(void); - void slotZoomIn(); - void slotZoomOut(); - void slide(int val); - -private: - void setChannels(void); - void addProducerChannels(KoHistogramProducer *producer); - - typedef struct { - bool isProducer; - KoHistogramProducer *producer; - KoChannelInfo * channel; - } ComboboxInfo; - - QVector m_comboInfo; - // Maps the channels in m_channels to a real channel offset in the producer->channels() - QVector m_channelToOffset; - QStringList m_channelStrings; - QList m_channels; - const KoColorSpace* m_cs; - - QStringList channelStrings(); - /** Lists all producers currently available */ - QList producers(); - - void setView(double from, double size); - void updateEnabled(); - double m_from, m_width; - KoHistogramProducer* m_currentProducer; - bool m_color; -}; - - -#endif // KIS_HISTOGRAM_WIDGET_ diff --git a/plugins/extensions/histogram/kritahistogram.json b/plugins/extensions/histogram/kritahistogram.json deleted file mode 100644 index 45e40e5cd8..0000000000 --- a/plugins/extensions/histogram/kritahistogram.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Id": "Histogram Plugin", - "Type": "Service", - "X-KDE-Library": "kritahistogram", - "X-KDE-ServiceTypes": [ - "Krita/ViewPlugin" - ], - "X-Krita-Version": "28" -} diff --git a/plugins/extensions/histogram/wdghistogram.ui b/plugins/extensions/histogram/wdghistogram.ui deleted file mode 100644 index 8f42d66375..0000000000 --- a/plugins/extensions/histogram/wdghistogram.ui +++ /dev/null @@ -1,179 +0,0 @@ - - - WdgHistogram - - - - 0 - 0 - 450 - 380 - - - - - - - Histogram Options - - - - - - - - &Channel: - - - cmbChannel - - - - - - - - 0 - 0 - - - - - - - - &Linear - - - true - - - - - - - Qt::Vertical - - - QSizePolicy::Preferred - - - - 20 - 21 - - - - - - - - Qt::Vertical - - - QSizePolicy::Preferred - - - - 20 - 20 - - - - - - - - &Logarithmic - - - - - - - - - - - - - 0 - 0 - - - - - 256 - 150 - - - - - - - - 0 - - - - - View: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - + - - - - - - - - 0 - 0 - - - - - - - - - - - - - 0 - 0 - - - - Qt::Horizontal - - - - - - - - - - KisHistogramView - -
kis_histogram_view.h
-
-
- - -