diff --git a/src/app/cli/app_options.cpp b/src/app/cli/app_options.cpp index 2dcbcdc88..153c6f017 100644 --- a/src/app/cli/app_options.cpp +++ b/src/app/cli/app_options.cpp @@ -34,7 +34,7 @@ AppOptions::AppOptions(int argc, const char* argv[]) , m_saveAs(m_po.add("save-as").requiresValue("").description("Save the last given sprite with other format")) , m_palette(m_po.add("palette").requiresValue("").description("Change the palette of the last given sprite")) , m_scale(m_po.add("scale").requiresValue("").description("Resize all previously opened sprites")) - , m_ditheringAlgorithm(m_po.add("dithering-algorithm").requiresValue("").description("Dithering algorithm used in --color-mode\nto convert images from RGB to Indexed\n none\n ordered\n old-ordered")) + , m_ditheringAlgorithm(m_po.add("dithering-algorithm").requiresValue("").description("Dithering algorithm used in --color-mode\nto convert images from RGB to Indexed\n none\n ordered\n old")) , m_ditheringMatrix(m_po.add("dithering-matrix").requiresValue("").description("Matrix used in ordered dithering algorithm\n bayer2x2\n bayer4x4\n bayer8x8\n filename.png")) , m_colorMode(m_po.add("color-mode").requiresValue("").description("Change color mode of all previously\nopened sprites:\n rgb\n grayscale\n indexed")) , m_shrinkTo(m_po.add("shrink-to").requiresValue("width,height").description("Shrink each sprite if it is\nlarger than width or height")) diff --git a/src/app/cli/cli_processor.cpp b/src/app/cli/cli_processor.cpp index 2eeb079b9..223e47620 100644 --- a/src/app/cli/cli_processor.cpp +++ b/src/app/cli/cli_processor.cpp @@ -349,14 +349,14 @@ void CliProcessor::process() else if (opt == &m_options.ditheringAlgorithm()) { if (value.value() == "none") ditheringAlgorithm = render::DitheringAlgorithm::None; - else if (value.value() == "old-ordered") - ditheringAlgorithm = render::DitheringAlgorithm::OldOrdered; else if (value.value() == "ordered") ditheringAlgorithm = render::DitheringAlgorithm::Ordered; + else if (value.value() == "old") + ditheringAlgorithm = render::DitheringAlgorithm::Old; else throw std::runtime_error("--dithering-algorithm needs a valid algorithm name\n" "Usage: --dithering-algorithm \n" - "Where can be none, old-ordered, or ordered"); + "Where can be none, ordered, or old"); } // --dithering-matrix else if (opt == &m_options.ditheringMatrix()) { @@ -378,12 +378,12 @@ void CliProcessor::process() case render::DitheringAlgorithm::None: params.set("dithering", "none"); break; - case render::DitheringAlgorithm::OldOrdered: - params.set("dithering", "old-ordered"); - break; case render::DitheringAlgorithm::Ordered: params.set("dithering", "ordered"); break; + case render::DitheringAlgorithm::Old: + params.set("dithering", "old"); + break; } if (ditheringAlgorithm != render::DitheringAlgorithm::None && diff --git a/src/app/commands/cmd_change_pixel_format.cpp b/src/app/commands/cmd_change_pixel_format.cpp index 7484ba46d..155768d3f 100644 --- a/src/app/commands/cmd_change_pixel_format.cpp +++ b/src/app/commands/cmd_change_pixel_format.cpp @@ -365,8 +365,8 @@ void ChangePixelFormatCommand::onLoadParams(const Params& params) std::string dithering = params.get("dithering"); if (dithering == "ordered") m_ditheringAlgorithm = render::DitheringAlgorithm::Ordered; - else if (dithering == "old-ordered") - m_ditheringAlgorithm = render::DitheringAlgorithm::OldOrdered; + else if (dithering == "old") + m_ditheringAlgorithm = render::DitheringAlgorithm::Old; else m_ditheringAlgorithm = render::DitheringAlgorithm::None; @@ -517,12 +517,12 @@ std::string ChangePixelFormatCommand::onGetFriendlyName() const switch (m_ditheringAlgorithm) { case render::DitheringAlgorithm::None: break; - case render::DitheringAlgorithm::OldOrdered: - text += " with Old Ordered Dithering"; - break; case render::DitheringAlgorithm::Ordered: text += " with Ordered Dithering"; break; + case render::DitheringAlgorithm::Old: + text += " with Old Dithering"; + break; } break; case IMAGE_GRAYSCALE: diff --git a/src/app/ui/dithering_selector.cpp b/src/app/ui/dithering_selector.cpp index 4389af8ae..a0c380f9c 100644 --- a/src/app/ui/dithering_selector.cpp +++ b/src/app/ui/dithering_selector.cpp @@ -124,11 +124,11 @@ DitheringSelector::DitheringSelector() render::BayerMatrix(4), "Ordered Dithering - Bayer Matrix 4x4")); addItem(new DitherItem(render::DitheringAlgorithm::Ordered, render::BayerMatrix(2), "Ordered Dithering - Bayer Matrix 2x2")); - addItem(new DitherItem(render::DitheringAlgorithm::OldOrdered, + addItem(new DitherItem(render::DitheringAlgorithm::Old, render::BayerMatrix(8), "Old Dithering - Bayer Matrix 8x8")); - addItem(new DitherItem(render::DitheringAlgorithm::OldOrdered, + addItem(new DitherItem(render::DitheringAlgorithm::Old, render::BayerMatrix(4), "Old Dithering - Bayer Matrix 4x4")); - addItem(new DitherItem(render::DitheringAlgorithm::OldOrdered, + addItem(new DitherItem(render::DitheringAlgorithm::Old, render::BayerMatrix(2), "Old Dithering - Bayer Matrix 2x2")); setSelectedItemIndex(0); diff --git a/src/render/dithering_algorithm.h b/src/render/dithering_algorithm.h index 65bd19014..12671363d 100644 --- a/src/render/dithering_algorithm.h +++ b/src/render/dithering_algorithm.h @@ -13,8 +13,8 @@ namespace render { // Dithering algorithms enum class DitheringAlgorithm { None, - OldOrdered, Ordered, + Old, }; } // namespace render diff --git a/src/render/quantization.cpp b/src/render/quantization.cpp index baab0546b..3569b4be4 100644 --- a/src/render/quantization.cpp +++ b/src/render/quantization.cpp @@ -99,12 +99,12 @@ Image* convert_pixel_format( ditheringAlgorithm != DitheringAlgorithm::None) { base::UniquePtr dither; switch (ditheringAlgorithm) { - case DitheringAlgorithm::OldOrdered: - dither.reset(new OrderedDither(is_background ? -1: new_mask_color)); - break; case DitheringAlgorithm::Ordered: dither.reset(new OrderedDither2(is_background ? -1: new_mask_color)); break; + case DitheringAlgorithm::Old: + dither.reset(new OrderedDither(is_background ? -1: new_mask_color)); + break; } if (dither) dither_rgb_image_to_indexed(