Commit 1d2da173 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Merge branch 'colsson/krita-palettize'

parents 9b2dd2e8 549c6633
......@@ -5,4 +5,6 @@ Ilya Portnov:MyPaint shade selector
Martin Renold:MyPaint shade selector
Saisho Kazuki:Japanese Animation template
Pasquale D'Antuono:Donor
David Gowers:Dither patterns
......@@ -82,5 +82,36 @@ fractal_pattern.pat
generic_paper1.pat
generic_paper2.pat
hexacolBW__2.pat
DITH_0202_CLUS.pat
DITH_0202_GEN_.pat
DITH_0202_HORZ.pat
DITH_0202_VERT.pat
DITH_0404_ALT_.pat
DITH_0404_BL22.pat
DITH_0404_CLUS.pat
DITH_0404_CURL.pat
DITH_0404_DIAG.pat
DITH_0404_ELL2.pat
DITH_0404_ELL3.pat
DITH_0404_ELLS.pat
DITH_0404_GEN_.pat
DITH_0404_HORZ.pat
DITH_0404_SHUR.pat
DITH_0404_SLIC.pat
DITH_0404_VERT.pat
DITH_0404_WAV2.pat
DITH_0404_WAVE.pat
DITH_0404_ZORO.pat
DITH_0808_BL22.pat
DITH_0808_BL22_v.pat
DITH_0808_BUBL.pat
DITH_0808_CIRC.pat
DITH_0808_CLUS.pat
DITH_0808_DIAM.pat
DITH_0808_PANL.pat
DITH_0808_SPOT.pat
DITH_0808_SWRL.pat
DITH_0808_WAVE.pat
DITH_3232_CSTR.pat
DESTINATION ${DATA_INSTALL_DIR}/krita/patterns)
This diff is collapsed.
......@@ -259,7 +259,7 @@ void KoColorSet::setPaletteType(PaletteType paletteType)
quint32 KoColorSet::colorCount() const
{
int colorCount = d->groups[GLOBAL_GROUP_NAME].colorCount();
int colorCount = 0;
for (KisSwatchGroup &g : d->groups.values()) {
colorCount += g.colorCount();
}
......
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})
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