|
Krita Source Code Documentation
|
The KisSwatchGroup class stores a matrix of color swatches swatches can accessed using (x, y) coordinates. x is the column number from left to right and y is the row number from top to bottom. Both x and y start at 0 there could be empty entries, so the checkEntry(int, int) method must used whenever you want to get an entry from the matrix. More...
#include <KisSwatchGroup.h>
Classes | |
| struct | Private |
Public Member Functions | |
| bool | checkSwatchExists (int column, int row) const |
checkSwatch checks if position column and row has a valid entry both column and row start from 0 | |
| int | colorCount () const |
| KisSwatch | getSwatch (int column, int row) const |
getSwatch used to get the swatch entry at position (column, row) there is an assertion to make sure that this position isn't empty, so checkEntry(int, int) must be used before this method to ensure a valid entry can be found | |
| QList< SwatchInfo > | infoList () const |
| getColors | |
| KisSwatchGroup (const KisSwatchGroup &rhs) | |
| QString | name () const |
| KisSwatchGroup & | operator= (const KisSwatchGroup &rhs) |
| int | rowCount () const |
| void | setName (const QString &name) |
| void | setRowCount (int newRowCount) |
| int | slotCount () const |
| ~KisSwatchGroup () | |
Public Attributes | |
| : struct SwatchInfo { QString group | |
| int | column |
| int | row |
| KisSwatch | swatch |
Static Public Attributes | |
| static int | DEFAULT_COLUMN_COUNT = 16 |
| static int | DEFAULT_ROW_COUNT = 20 |
Private Member Functions | |
| QPair< int, int > | addSwatch (const KisSwatch &e) |
| addEntry adds the entry e to the right of the rightmost entry in the last row if the rightmost entry in the last row is in the right most column, add e to the leftmost column of a new row | |
| void | clear () |
| int | columnCount () const |
| KisSwatchGroup () | |
| bool | removeSwatch (int column, int row) |
removeSwatch removes the entry at position (column, row) | |
| void | setColumnCount (int columnCount) |
| void | setSwatch (const KisSwatch &e, int column, int row) |
setSwatch sets the entry at position (column, row) to be e | |
Private Attributes | |
| std::experimental::propagate_const< std::unique_ptr< Private > > | d |
Friends | |
| struct | AddGroupCommand |
| struct | AddSwatchCommand |
| struct | ClearCommand |
| class | KisPaletteEditor |
| class | KoColorSet |
| struct | RemoveGroupCommand |
| struct | RemoveSwatchCommand |
| struct | SetColumnCountCommand |
| class | TestKisSwatchGroup |
| class | TestKoColorSet |
The KisSwatchGroup class stores a matrix of color swatches swatches can accessed using (x, y) coordinates. x is the column number from left to right and y is the row number from top to bottom. Both x and y start at 0 there could be empty entries, so the checkEntry(int, int) method must used whenever you want to get an entry from the matrix.
Definition at line 31 of file KisSwatchGroup.h.
| KisSwatchGroup::~KisSwatchGroup | ( | ) |
Definition at line 29 of file KisSwatchGroup.cpp.
| KisSwatchGroup::KisSwatchGroup | ( | const KisSwatchGroup & | rhs | ) |
Definition at line 32 of file KisSwatchGroup.cpp.
|
private |
Definition at line 25 of file KisSwatchGroup.cpp.
|
private |
addEntry adds the entry e to the right of the rightmost entry in the last row if the rightmost entry in the last row is in the right most column, add e to the leftmost column of a new row
when column is set to 0, resize number of columns to default
| e |
Definition at line 156 of file KisSwatchGroup.cpp.
References checkSwatchExists(), KoColor::clearMetadata(), KisSwatch::color(), columnCount(), d, DEFAULT_COLUMN_COUNT, setColumnCount(), setSwatch(), and swatch.
| bool KisSwatchGroup::checkSwatchExists | ( | int | column, |
| int | row ) const |
checkSwatch checks if position column and row has a valid entry both column and row start from 0
| column | |
| row |
Definition at line 58 of file KisSwatchGroup.cpp.
|
private |
Definition at line 180 of file KisSwatchGroup.cpp.
References d.
| int KisSwatchGroup::colorCount | ( | ) | const |
Definition at line 203 of file KisSwatchGroup.cpp.
References d.
|
private |
Definition at line 140 of file KisSwatchGroup.cpp.
References d.
| KisSwatch KisSwatchGroup::getSwatch | ( | int | column, |
| int | row ) const |
getSwatch used to get the swatch entry at position (column, row) there is an assertion to make sure that this position isn't empty, so checkEntry(int, int) must be used before this method to ensure a valid entry can be found
| column | |
| row |
Definition at line 144 of file KisSwatchGroup.cpp.
References column, d, KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, row, and rowCount().
| QList< KisSwatchGroup::SwatchInfo > KisSwatchGroup::infoList | ( | ) | const |
getColors
Definition at line 213 of file KisSwatchGroup.cpp.
| QString KisSwatchGroup::name | ( | ) | const |
| KisSwatchGroup & KisSwatchGroup::operator= | ( | const KisSwatchGroup & | rhs | ) |
Definition at line 36 of file KisSwatchGroup.cpp.
References d.
|
private |
removeSwatch removes the entry at position (column, row)
| column | |
| row |
Definition at line 83 of file KisSwatchGroup.cpp.
| int KisSwatchGroup::rowCount | ( | ) | const |
|
private |
Definition at line 102 of file KisSwatchGroup.cpp.
References checkSwatchExists(), columnCount(), d, getSwatch(), KIS_SAFE_ASSERT_RECOVER_RETURN, and rowCount().
| void KisSwatchGroup::setName | ( | const QString & | name | ) |
Definition at line 228 of file KisSwatchGroup.cpp.
| void KisSwatchGroup::setRowCount | ( | int | newRowCount | ) |
Definition at line 185 of file KisSwatchGroup.cpp.
References d.
setSwatch sets the entry at position (column, row) to be e
| e | |
| column | |
| row |
Definition at line 45 of file KisSwatchGroup.cpp.
References checkSwatchExists(), column, d, row, and setRowCount().
| int KisSwatchGroup::slotCount | ( | ) | const |
Definition at line 208 of file KisSwatchGroup.cpp.
References columnCount(), and rowCount().
|
friend |
Definition at line 93 of file KisSwatchGroup.h.
|
friend |
Definition at line 90 of file KisSwatchGroup.h.
|
friend |
Definition at line 94 of file KisSwatchGroup.h.
|
friend |
Definition at line 102 of file KisSwatchGroup.h.
|
friend |
Definition at line 89 of file KisSwatchGroup.h.
|
friend |
Definition at line 91 of file KisSwatchGroup.h.
|
friend |
Definition at line 92 of file KisSwatchGroup.h.
|
friend |
Definition at line 95 of file KisSwatchGroup.h.
|
friend |
Definition at line 96 of file KisSwatchGroup.h.
|
friend |
Definition at line 97 of file KisSwatchGroup.h.
| KisSwatchGroup::__pad0__ |
Definition at line 153 of file KisSwatchGroup.h.
| int KisSwatchGroup::column |
Definition at line 38 of file KisSwatchGroup.h.
|
private |
Definition at line 144 of file KisSwatchGroup.h.
|
static |
Definition at line 43 of file KisSwatchGroup.h.
|
static |
Definition at line 44 of file KisSwatchGroup.h.
| int KisSwatchGroup::row |
Definition at line 37 of file KisSwatchGroup.h.
| KisSwatch KisSwatchGroup::swatch |
Definition at line 36 of file KisSwatchGroup.h.