From 411ceda0e72af0f0f945ecf96c4bb76d0870f6ef Mon Sep 17 00:00:00 2001 From: David Capello Date: Sat, 19 Jul 2014 22:01:39 -0300 Subject: [PATCH] Add options to save GIF files (how to quantize palettes mainly) * Added "context" parameter to save/load routines so we can test them. --- data/widgets/gif_options.xml | 30 +++ src/app/app.cpp | 2 +- src/app/commands/cmd_open_file.cpp | 2 +- src/app/commands/cmd_palette_editor.cpp | 3 +- src/app/commands/cmd_save_file.cpp | 8 +- src/app/context.cpp | 10 + src/app/context.h | 13 +- src/app/document.h | 1 + src/app/document_api.cpp | 2 +- src/app/document_exporter.cpp | 3 +- src/app/file/file.cpp | 33 +-- src/app/file/file.h | 10 +- src/app/file/file_tests.cpp | 6 +- src/app/file/gif_format.cpp | 235 +++++++++++++----- src/app/file/gif_options.h | 58 +++++ src/app/file/gif_tests.cpp | 312 ++++++++++++++++++++++++ src/app/file/jpeg_format.cpp | 18 +- src/app/thumbnail_generator.cpp | 10 +- src/app/util/clipboard.cpp | 2 +- src/raster/color.h | 8 + src/raster/palette.cpp | 4 +- src/raster/quantization.cpp | 111 ++++++--- src/raster/quantization.h | 26 +- src/raster/rgbmap.cpp | 87 ++----- src/raster/rgbmap.h | 9 +- src/raster/sprite.cpp | 7 +- 26 files changed, 788 insertions(+), 222 deletions(-) create mode 100644 data/widgets/gif_options.xml create mode 100644 src/app/file/gif_options.h create mode 100644 src/app/file/gif_tests.cpp diff --git a/data/widgets/gif_options.xml b/data/widgets/gif_options.xml new file mode 100644 index 000000000..3c901c05e --- /dev/null +++ b/data/widgets/gif_options.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + +