Changeset View
Changeset View
Standalone View
Standalone View
commands/imagelib/effects/kpEffectReduceColorsCommand.cpp
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | |||||
44 | { | 44 | { | ||
45 | } | 45 | } | ||
46 | 46 | | |||
47 | //--------------------------------------------------------------------- | 47 | //--------------------------------------------------------------------- | ||
48 | 48 | | |||
49 | // public | 49 | // public | ||
50 | QString kpEffectReduceColorsCommand::commandName (int depth, int dither) const | 50 | QString kpEffectReduceColorsCommand::commandName (int depth, int dither) const | ||
51 | { | 51 | { | ||
52 | if (depth == 1) | 52 | switch (depth) { | ||
53 | { | 53 | case 1: if (dither) { | ||
54 | if (dither) | | |||
55 | return i18n ("Reduce to Monochrome (Dithered)"); | 54 | return i18n ("Reduce to Monochrome (Dithered)"); | ||
56 | else | | |||
57 | return i18n ("Reduce to Monochrome"); | | |||
58 | } | 55 | } | ||
59 | else if (depth == 8) | 56 | return i18n ("Reduce to Monochrome"); | ||
60 | { | 57 | | ||
61 | if (dither) | 58 | case 8: | ||
59 | if (dither) { | ||||
62 | return i18n ("Reduce to 256 Color (Dithered)"); | 60 | return i18n ("Reduce to 256 Color (Dithered)"); | ||
63 | else | | |||
64 | return i18n ("Reduce to 256 Color"); | | |||
65 | } | 61 | } | ||
66 | else | 62 | return i18n ("Reduce to 256 Color"); | ||
67 | { | 63 | | ||
68 | return QString(); | 64 | default: return QString(); | ||
69 | } | 65 | } | ||
70 | } | 66 | } | ||
71 | 67 | | |||
72 | //--------------------------------------------------------------------- | 68 | //--------------------------------------------------------------------- | ||
73 | 69 | | |||
74 | // | 70 | // | ||
75 | // kpEffectReduceColorsCommand implements kpEffectCommandBase interface | 71 | // kpEffectReduceColorsCommand implements kpEffectCommandBase interface | ||
76 | // | 72 | // | ||
77 | 73 | | |||
78 | // protected virtual [base kpEffectCommandBase] | 74 | // protected virtual [base kpEffectCommandBase] | ||
79 | kpImage kpEffectReduceColorsCommand::applyEffect (const kpImage &image) | 75 | kpImage kpEffectReduceColorsCommand::applyEffect (const kpImage &image) | ||
80 | { | 76 | { | ||
81 | return kpEffectReduceColors::applyEffect (image, m_depth, m_dither); | 77 | return kpEffectReduceColors::applyEffect (image, m_depth, m_dither); | ||
82 | } | 78 | } | ||
83 | 79 | | |||
84 | //--------------------------------------------------------------------- | 80 | //--------------------------------------------------------------------- |