Commit 80682edc authored by Carl Olsson's avatar Carl Olsson

Add colourspace and alpha options.

parent abec7e36
set(kritapalettize_SOURCES palettize.cpp)
ki18n_wrap_ui(kritapalettize_SOURCES palettize.ui)
add_library(kritapalettize MODULE ${kritapalettize_SOURCES})
target_link_libraries(kritapalettize kritaui)
install(TARGETS kritapalettize DESTINATION ${KRITA_PLUGIN_INSTALL_DIR})
......@@ -5,5 +5,5 @@
"X-KDE-ServiceTypes": [
"Krita/Filter"
],
"X-Krita-Version": "30"
"X-Krita-Version": "28"
}
This diff is collapsed.
......@@ -21,6 +21,8 @@
#ifndef PALETTIZE_H
#define PALETTIZE_H
#include "ui_palettize.h"
#include <kis_filter.h>
#include <kis_config_widget.h>
#include <kis_filter_configuration.h>
......@@ -29,14 +31,7 @@
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/register/point.hpp>
class KoColorSet;
class KoResourceItemChooser;
class QGroupBox;
class KoPattern;
class QCheckBox;
class QLineEdit;
class QButtonGroup;
class KisDoubleWidget;
class Palettize : public QObject
{
......@@ -44,7 +39,7 @@ public:
Palettize(QObject *parent, const QVariantList &);
};
class KisPalettizeWidget : public KisConfigWidget
class KisPalettizeWidget : public KisConfigWidget, public Ui::Palettize
{
public:
KisPalettizeWidget(QWidget* parent = 0);
......@@ -52,21 +47,34 @@ public:
KisPropertiesConfigurationSP configuration() const override;
private:
KoResourceItemChooser* m_paletteWidget;
QGroupBox* m_ditherGroupBox;
QButtonGroup* m_ditherModeGroup;
KoResourceItemChooser* m_ditherPatternWidget;
QCheckBox* m_ditherPatternUseAlphaCheckBox;
QLineEdit* m_ditherNoiseSeedWidget;
KisDoubleWidget* m_ditherWeightWidget;
};
class KisFilterPalettize : public KisFilter
{
public:
enum DitherMode {
enum Colorspace {
Lab,
RGB
};
enum AlphaMode {
Clip,
Index,
UseDither
};
enum ThresholdMode {
Pattern,
Noise
};
enum PatternValueMode {
Auto,
Lightness,
Alpha
};
enum ColorMode {
PerChannelOffset,
NearestColors
};
KisFilterPalettize();
static inline KoID id() { return KoID("palettize", i18n("Palettize")); }
KisConfigWidget* createConfigurationWidget(QWidget* parent, const KisPaintDeviceSP dev, bool useForMasks) const override;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment