diff --git a/README.md b/README.md index da84fa2..43bfb99 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,26 @@ -# Fix-CA +# GIMP3-Fix-CA ## Overview -Fix-CA is a [GIMP](http://www.gimp.org/) plug-in to correct Chromatic Aberration -(CA). For a general explanation about Chromatic Aberration, you can find -information from -[Wikipedia](http://en.wikipedia.org/wiki/Chromatic_aberration). -Fix-CA is able to fix Lateral CA colored fringing caused by light travelling -through lenses, and Directional CA caused by light travelling through dense -material such as glass and water. +GIMP3-Fix-CA is a [GIMP](http://www.gimp.org/) plug-in to correct Chromatic Aberration +(CA). For a general explanation about Chromatic Aberration, you can find information +from [Wikipedia](http://en.wikipedia.org/wiki/Chromatic_aberration). +GIMP3-Fix-CA can fix Lateral CA colored fringing caused by light travelling through +lenses, and Directional CA caused by light travelling through dense material such as +glass or water. -This plug-in was written by Kriang Lerdsuwanakij lerdsuwa@users.sourceforge.net -and is distributed under [GNU General Public License Version 3](COPYING) (GPLv3). -Several patches and improvements were later added in 2023,2024 by Jose Da Silva. +GIMP2-Fix-CA was written by Kriang Lerdsuwanakij lerdsuwa@users.sourceforge.net, and +several patches and improvements were later added in 2023,2024 by Jose Da Silva. +GIMP3-Fix-CA uses a lot of the same code with modifications to run for GIMP3. +Fix-CA is distributed under [GNU General Public License Version 3](COPYING) (GPLv3). -## Using Fix-CA +## Using GIMP3-Fix-CA Fix-CA plug-in can be accessed via the menu 'Filters->Colors->Chromatic Aberration' -There are two different types of Chromatic Aberration that can be corrected by Fix-CA: -Lateral and Directional. +There are two types of Chromatic Aberration that can be corrected by GIMP3-Fix-CA: +Lateral and Directional. ### Lateral CA @@ -45,12 +45,13 @@ Below is the image used to demonstrate Fix-CA plug-in capability This is a photo of Wat Pathum Wanaram, a buddhist temple next to Siam Paragon, a major shopping mall in Bangkok. The areas of interest are marked with green -rectangles. Note that the reduced size here is only for display purposes. -The actual processing is done on the full sized image (with green rectangles -left "as-is" on a different layer, unaffected by the plug-in). +rectangles. Note that the reduced size here is only for display purposes here. -Below are 200% zoom of the four areas. The chromatic aberration (CA) is -visible on the images as red and blue lines around bright area. +The actual processing is done on the full sized image (with green pixels left in +same positions "as-is", and the blue or red pixels are moved outwards or inwards. + +Below are 200% zoom of the four areas before processing. The Chromatic Aberration +(CA) is visible on these images as red and blue lines around bright areas. ![](img-fix-ca/ex-zoom.jpg) @@ -59,19 +60,34 @@ but can be quite visible when the image is cropped to a smaller area and then expanded. Invoking Fix-CA plug-in using the menu 'Filters->Colors->Chromatic Aberration' -With the settings shown below image (for version 2.1.0), much of the CA can be -eliminated (for version 3.0.0 blue and red settings are moved into group 'Lateral'). +with the 'Lateral' settings shown below can help improve or this image. ![](img-fix-ca/fix-ca-dialog.png) +When you are going to correct for Lateral CA, you should look around the edges. + +The corners tend to have the worst Lateral CA, and you begin correcting there. +If you correct one corner, the rest of the picture should look okay too, therefore +check the other corners and edges using preview ON/OFF as you look around. +If the image center is not the lens center, or some alignment is off, then you +will want to move the lens center around a little bit a little bit off center, +and then check the corners and edges again until it looks okay to you. +The poor man's zoom of the branches (shown below) is an example you can try where +the lens center is off-center, and the lens alignment may be a little skewed too. + In the dialog box, setting red to -1.5 will shift the red channel inward to the maximum of 1.5 pixels. Here the positive number means moving outward, while the negative number means inward. Since the orientation of this photo -is portrait, the red channel of top and bottom border will moved by 1.5 pixels. +is portrait, the red channel of top and bottom border will move by 1.5 pixels. Pixels at the inner part the red channel will be moved less while the pixels at the center of image will not be moved at all. (For a landscape image, the left and right border will be moved by 1.5 pixels instead). +The LensX=1296/LensY=1944 is the image center, which is also the assumed optical +lens center. The lens center point can be moved around if you find one side needs +more correcting than the other side. Setting LensX=-1/LensY=-1 is also the same +as choosing the image center. + The interpolation parameter controls how the plug-in deals with fractional pixels, for example, if the plug-in decides to move an image pixel by 0.8 pixel, 'Linear' and 'Cubic' settings will try to get a value by averaging @@ -79,7 +95,7 @@ the surrounding pixels while 'None' will pick the nearest pixel (for this example by moving 1 full pixel). The 'Preview saturation' setting changes the saturation for the preview image. -This may help you spot CA problems. The setting does not have any effect on the +This helps you spot CA problems. This setting does not have any effect on the final image produced by this filter. Below is the 200% zoom for the resulting change using the above corrections. @@ -88,29 +104,45 @@ Below is the 200% zoom for the resulting change using the above corrections. In this example above we need to trade off between bottom right area (which suffers from less CA) and the left area (the most CA). -If the image used is cropped, you can concentrate on fixing in the part of the -image that is actually used and ignore the rest. Just remember, a better result -can be expected if you correct CA before cropping. + +Now that we know one side has more CA than the other, we can improve this image +further by moving the lens center towards the direction of less CA... + +If we move the lens center right to approx LensX=1406, and increase Red=-2.0 +due to the added distance on the left, this seems to resolve both left and right +sides. If you look at the bottom left corner, you will see some blue beginning +to appear, so if you change Blue=+0.6 this seems to fix that too....but we also +seem to have negative changes happening towards the wall near the roof.... + +...let's try again.... reset LensX=1296/LensY=1944 (or use LensX=-1/LensY=-1). + +Before we start moving LensX/LensY, let us change saturation=100%, and let us +also try changing Red=-1.5 to Red=+1.5 instead, this is actually looking better. +...and seeing some blue let us also change Blue=-1.2, and we see better results +everywhere... and we also did not have to change LensX/LensY from image center. For the majority of your pictures and images, you can assume the lens center is -also at the image center (unless you're working with a cropped image). If you want -to fix the [full sized original here](img-fix-ca/full-Wat_Pathum_Wanaram.jpg) -image further, then Fix-CA (version 4.0) now adds the ability to also move the -lens centerpoint (default is center of image). -Below you will see added variables LensX, LensY, allowing you to move the lens centerpoint to another location on the image. +also at the image center (unless you notice more left/right or up/down CA), or +if you are working with a cropped picture which may have the center elsewhere. -![](img-fix-ca/fix-ca-center.jpg) +Today's digital self-contained cameras are unlikely to have lateral problems +since they likely have built in software to correct for lateral problems, but you +can probably expect some amount of lateral CA for older analog type cameras. Below is an example image using a poor man's zoom attached to a smartphone. Even though a smartphone can correct an image for it's own lens, the poor man's zoom attachment adds Lateral CA as well as having the lens center off to one side. -You may notice the pixel corrections seem like large values like 6.0, but this -applies to the (black) corners, and reduces down to about 3.0 around the edges of -where the lens image begins, eventually 0 pixel shift at lens center (658,1280). ![](img-fix-ca/ex-bran.jpg) ![](img-fix-ca/poorman-zoom.jpg) +To correct this, you may notice the pixel corrections seem like large values +like 6.0, but this applies to the (black) corners, and reduces down to about +3.0 around the edges of where the lens image begins, eventually a zero pixel +shift what seems to be a lens center of LensX=658/LensY=1280. + +![](img-fix-ca/fix-ca-center.jpg) + Below is a Preview (off) of the leaves (showing blue). This can be corrected using the Lateral CA settings shown above (can be seen with Preview on). @@ -124,9 +156,7 @@ The [full sized original is here](img-fix-ca/full-branches.jpg). In Directional Chromatic Aberration, the amount of CA is assumed to be the same throughout the image. This happen, for example, when photographing fish in an aquarium. Light travels through dense water and glass and bends -differently depending on the color and angle from the glass. This CA correction -mode was introduced in Fix-CA version 3.0.0. You can specify the amount of shift -for blue and red along both X and Y axis. +differently depending on the color and angle from the glass. This example is a complete photo of a sleeping sea turtle. @@ -150,35 +180,37 @@ The picture below shows (50% zoom) corrected image of the interested region. ![](img-fix-ca/Sea_turtle-fixed.jpg) -## Download and building Fix-CA +## Download and building GIMP3-Fix-CA Fortunately, everything is in just one file. Just get the C source file. To compile and install the plug-in, you need the development library for Gimp. Usually it's in gimp-devel package in your distribution. Use the command ```sh - gimptool-2.0 --install fix-ca.c + gimptool-3.0 --install fix-ca.c ``` will automatically compile and install into the local plug-in directory -of your account. For Windows users, if you wish to make the plug-in +of your home account. For Windows users, if you wish to make the plug-in available to all users of the machine, use ```sh - gimptool-2.0 --install-admin fix-ca.c + gimptool-3.0 --install-admin fix-ca.c ``` instead. (use the Installation method below for other OSes). Type ```sh - gimptool-2.0 --help + gimptool-3.0 --help ``` for further help. If Gimp is already running in your system, exit and restart Gimp for the new -plug-in to be detected. The following displays Fix-CA version 2.1.0 information -from the GIMP menu. +plug-in to be detected. The following displays GIMP3-Fix-CA information from +the GIMP menu. + ![](plug-in-browser.png) ## Installation method Developers and Distro installers will be more interested in this install method. +This method also includes local language support (for included languages). Installing from Git master requires 2 preparatory steps: @@ -222,6 +254,11 @@ make install ## Version History +GIMP3-Fix-CA +- 0.0 (May 15, 2024) First version. + +GIMP2-Fix-CA +- 4.0 (February 29, 2024) Upgraded code to use GIMP-2.10 API. Now Gimp-Fix-CA works with RGB/RGBA with precisions of 8bit, 16bit, 32bit, or double for each color of R,G,B,A. Also added Lens X/Y center and a lens centerline in the preview window. Local Language support now included for the installable Gimp-Fix-CA. This version is bumped to 4.0 since it requires GIMP-2.10.xx, and also because non-interactive scripting also requires Lateral Lens X/Y positions (default=-1,-1) - 3.0.4 (December 2, 2023) mostly edits around make system. Minimal mods to fix-ca.c code (which needs updating). - 3.0.3 (October 8, 2022) autoconf/automake/configure/make added for building fix.ca - 3.0.2 (December 22, 2007) Add the missing tile cache that speed up preview. @@ -232,4 +269,6 @@ make install - 1.0.0 (November 30, 2006) First version. -Note: The Original Web page content and pictures are copyrighted (c) 2006, 2007 by Kriang Lerdsuwanakij. +Note: The Original Web page content and pictures are copyrighted (c) 2006, 2007 +by Kriang Lerdsuwanakij. New Added images and web page content added 2022..2024 +by Jose Da Silva are under the same license as this GPL3+ project. diff --git a/configure.ac b/configure.ac index df97ec9..cd8f53d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # -*- Autoconf -*- dnl Process this file with "autoreconf -i;automake" to produce a configure script. -# Copyright (C) 2022 by Joe Da Silva +# Copyright (C) 2024 by Joe Da Silva AC_PREREQ([2.68]) #-------------------------------------------------------------------------- @@ -19,15 +19,13 @@ AC_PREREQ([2.68]) # fix_ca_major_version += 1; # fix_ca_minor_version = 0; # -m4_define([fix_ca_name], [gimp-fix-ca]) -#m4_define([fix_ca_major_version], [3.0]) -#m4_define([fix_ca_minor_version], [4]) +m4_define([fix_ca_name], [gimp3-fix-ca]) m4_define([fix_ca_major_version], [0]) m4_define([fix_ca_minor_version], [0]) m4_define([fix_ca_version],[fix_ca_major_version.fix_ca_minor_version]) -m4_define([fix_ca_package_name], [gimp-fix-ca]) -m4_define([fix_ca_package_home], [https://github.com/JoesCat/gimp-fix-ca]) -m4_define([fix_ca_package_email], [https://github.com/JoesCat/gimp-fix-ca/issues]) +m4_define([fix_ca_package_name], [gimp3-fix-ca]) +m4_define([fix_ca_package_home], [https://github.com/JoesCat/gimp3-fix-ca]) +m4_define([fix_ca_package_email], [https://github.com/JoesCat/gimp3-fix-ca/issues]) #-------------------------------------------------------------------------- AC_INIT([fix_ca_name],[fix_ca_version],[fix_ca_package_email], [fix_ca_package_name],[fix_ca_package_home]) @@ -54,7 +52,6 @@ AC_PROG_SED AC_PROG_LN_S AC_PROG_MKDIR_P AC_PATH_PROG([STRIP],[strip],[:]) -#AC_PATH_PROG([GIMPTOOL],[gimptool-2.0],[:]) AC_PATH_PROG([GIMPTOOL],[gimptool-3.0],[:]) AC_PATH_PROG([MSGFMT],[msgfmt],[:]) AC_PATH_PROG([MSGINIT],[msginit],[:]) @@ -138,7 +135,6 @@ if test x"${have_gettext}" = xno; then AC_SEARCH_LIBS([intl],[have_gettext=yes],[ AC_MSG_ERROR([ERROR: gettext() required! Please install libintl or GETTEXT Packages.])]) fi -#GETTEXT_PACKAGE=gimp20-fix-ca GETTEXT_PACKAGE=gimp30-fix-ca AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The gettext translation domain.]) @@ -159,20 +155,14 @@ AC_SUBST([ACLOCAL],["${ACLOCAL}"]) GIMP_CFLAGS= GIMP_LIBS= have_libgimp=no -#PKG_CHECK_MODULES([GIMP],[gimp-2.0 >= 2.10.0 gimpui-2.0 >= 2.10.0],[have_libgimp=yes]) -PKG_CHECK_MODULES([GIMP],[gimp-3.0],[have_libgimp=yes]) +PKG_CHECK_MODULES([GIMP],[gimp-3.0 gimpui-3.0],[have_libgimp=yes]) if test x"${have_libgimp}" != xyes; then - #AC_MSG_FAILURE([ERROR: Please install the developer version of libgimp2.],[1]) AC_MSG_FAILURE([ERROR: Please install the developer version of libgimp3.],[1]) fi AC_SUBST(GIMP_CFLAGS) -#GIMP_LIBS="${GIMP_LIBS} -lgimpui-3.0" -#GIMP_LIBS="${GIMP_LIBS} -lgimpwidgets-3.0" AC_SUBST(GIMP_LIBS) -#GIMP_LIBDIR=`${PKG_CONFIG} --variable=gimplibdir gimp-2.0` GIMP_LIBDIR=`${PKG_CONFIG} --variable=gimplibdir gimp-3.0` AC_SUBST(GIMP_LIBDIR) -#GIMP_DATADIR=`${PKG_CONFIG} --variable=gimpdatadir gimp-2.0` GIMP_DATADIR=`${PKG_CONFIG} --variable=gimpdatadir gimp-3.0` AC_SUBST(GIMP_DATADIR) @@ -181,10 +171,8 @@ AM_CONDITIONAL([HAVEGIMPTOOL],[test "${GIMPTOOL}"x != x]) GTK_CFLAGS= GTK_LIBS= have_libgtk=no -#PKG_CHECK_MODULES([GTK],[gtk+-2.0],[have_libgtk=yes]) PKG_CHECK_MODULES([GTK],[gtk+-3.0],[have_libgtk=yes]) if test x"${have_libgtk}" != xyes; then - #AC_MSG_FAILURE([ERROR: Please install the developer version of libgtk+2.],[1]) AC_MSG_FAILURE([ERROR: Please install the developer version of libgtk+3.],[1]) fi AC_SUBST(GTK_CFLAGS) @@ -222,7 +210,6 @@ SNIPPET1=' ifeq ($(shell id -u),0) bindir = $(GIMP_LIBDIR)/plug-ins/fix-ca else - #bindir = $(libdir)/gimp/2.0/plug-ins/fix-ca bindir = $(libdir)/gimp/2.99/plug-ins/fix-ca endif ' @@ -253,7 +240,7 @@ AH_BOTTOM([ AC_CONFIG_FILES([ Makefile po/Makefile -rpm/gimp-fix-ca.spec +rpm/gimp3-fix-ca.spec ]) AC_OUTPUT AC_MSG_NOTICE([ @@ -264,7 +251,7 @@ Configuration: Build code location ${builddir} docs root dir ${datarootdir} bin plug-in dir ${GIMP_LIBDIR}/plug-ins/fix-ca - GIMP locale dir ${LOCALEDIR} + GIMP3 locale dir ${LOCALEDIR} Use locale languages ${have_gettext} Compiler ${CC} CPPFLAGS ${CPPFLAGS} diff --git a/fix-ca.c b/fix-ca.c index 6d30309..eb6606b 100644 --- a/fix-ca.c +++ b/fix-ca.c @@ -1,7 +1,7 @@ /* - * fix-ca.c - Gimp Plug-In Fix Chromatic Aberration + * fix-ca.c - gimp3-plugin-fix-ca - Fix Chromatic Aberration * Copyright (c) 2006, 2007 Kriang Lerdsuwanakij - (original author) - * Copyright (c) 2023, 2024 Jose Da Silva (updates and improvements) + * Copyright (c) 2023, 2024 Jose Da Silva (gimp3, updates, improvements) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,7 +36,7 @@ #include #endif -#ifdef xxHAVE_GETTEXT +#ifdef HAVE_GETTEXT #include #define _(String) gettext (String) #ifdef gettext_noop @@ -57,20 +57,15 @@ #define PLUG_IN_PROC "plug-in-fix-ca" #define PLUG_IN_ROLE "gimp-fix-ca" -#define PLUG_IN_BINARY "fix-ga" -//-------#define SPIN_BUTTON_WIDTH 8 -//-------#define COLOR_BUTTON_WIDTH 55 +#define PLUG_IN_BINARY "fix-ca" #define PROCEDURE_NAME "Fix-CA" #define DATA_KEY_VALS "fix_ca" -/* Size controls in Fix CA dialog box */ -#define SCALE_WIDTH 150 -#define ENTRY_WIDTH 4 - -/* For row buffer management */ +/* For fixca() row buffer management */ #define SOURCE_ROWS 120 #define INPUT_MAX SOURCE_ROWS/4 +#define INPUT_MXF SOURCE_ROWS/4.0 #define ROW_INVALID -100 #define ITER_INITIAL -100 @@ -87,31 +82,25 @@ struct _FixCaClass { /* Storage type */ typedef struct { - gdouble blue; - gdouble red; - gdouble lens_x; - gdouble lens_y; - gboolean update_preview; + gdouble blueL; + gdouble redL; + gdouble lensX; + gdouble lensY; GimpInterpolationType interpolation; - gdouble saturation; - gdouble x_blue; - gdouble x_red; - gdouble y_blue; - gdouble y_red; - gboolean reset_values; - /* private, internal use */ + gdouble blueX; + gdouble redX; + gdouble blueY; + gdouble redY; + /* local image use */ GimpDrawable *drawable; - gint Xsize; - gint Ysize; - gint bpp; - gint bpc; - guchar *srcImg; - guchar *destImg; - guchar *prevImg; - GimpPreview *preview; - GtkWidget *previewarea; - gint XPsize; - gint YPsize; + guchar *srcImg; + guchar *destImg; + gint Xsize; + gint Ysize; + gint bpp; + gint bpc; + gdouble saturation; + gboolean reset_values; } FixCaParams; /* Declare local functions. */ @@ -133,7 +122,7 @@ static GimpValueArray * fixca_run (GimpProcedure *procedure, gpointer run_data); static gboolean fixca_dialog (GimpProcedure *procedure, - GimpProcedureConfig *proc_config, + GObject *config, FixCaParams *params); static void fixca_region (FixCaParams *params, @@ -146,15 +135,11 @@ static void fixca_region (FixCaParams *params, static void fixca_help (const gchar *help_id, gpointer help_data); -static void preview_update (GimpPreview *preview, -//static void preview_update (GtkWidget *preview, - FixCaParams *params); +static void preview_update (GtkWidget *widget, + GObject *config); static void set_default_settings (FixCaParams *params); -static gboolean get_from_config (GimpProcedureConfig *proc_config, - FixCaParams *params); - G_DEFINE_TYPE (FixCa, fixca, GIMP_TYPE_PLUG_IN) @@ -183,14 +168,13 @@ fixca_query_procedures (GimpPlugIn *plug_in) } static GimpProcedure * -fixca_create_procedure (GimpPlugIn *plug_in, const gchar *name) +fixca_create_procedure (GimpPlugIn *plug_in, + const gchar *name) { GimpProcedure *procedure = NULL; if (!strcmp (name, PLUG_IN_PROC)) { - gegl_init (NULL, NULL); - procedure = gimp_image_procedure_new (plug_in, name, GIMP_PDB_PROC_TYPE_PLUGIN, fixca_run, NULL, NULL); @@ -199,80 +183,71 @@ fixca_create_procedure (GimpPlugIn *plug_in, const gchar *name) gimp_procedure_set_sensitivity_mask (procedure, GIMP_PROCEDURE_SENSITIVE_DRAWABLE); -#ifdef xxHAVE_GETTEXT +#ifdef HAVE_GETTEXT /* Initialize i18n support */ - //setlocale (LC_ALL, ""); + setlocale (LC_ALL, ""); bindtextdomain (GETTEXT_PACKAGE, gimp_locale_directory ()); #ifdef HAVE_BIND_TEXTDOMAIN_CODESET bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); #endif - //textdomain (GETTEXT_PACKAGE); + textdomain (GETTEXT_PACKAGE); #endif gimp_procedure_set_menu_label (procedure, _("Chromatic Aberration...")); gimp_procedure_add_menu_path (procedure, _("/Filters/Colors")); gimp_procedure_set_documentation (procedure, - _("Fix chromatic aberration"), - _("Fix chromatic aberration caused by " - "imperfect lens. It works by shifting " - "red and blue components of image pixels " - "in the specified amounts."), - PLUG_IN_PROC); + /* menu entry tooltip blurb */ _("Fix Chromatic Aberration"), + /* help for script developers */ _("Fix Chromatic Aberration caused by " + "optical lens (eg: analog cameras, adapters)." + "This plugin works by shifting red and blue" "pixels in the specified amounts."), + /* help ID */ PLUG_IN_PROC); gimp_procedure_set_attribution (procedure, - "Kriang Lerdsuwanakij", - "Kriang Lerdsuwanakij 2006,2007, Jose Da Silva 2022..2024", - "2006 - 2024"); - - GIMP_PROC_ARG_DOUBLE (procedure, "blue", - _("_Blue"), _("Blue amount (lateral)"), - -INPUT_MAX, INPUT_MAX, 0.0, G_PARAM_READWRITE); - GIMP_PROC_ARG_DOUBLE (procedure, "red", - _("_Red"), _("Red amount (lateral)"), - -INPUT_MAX, INPUT_MAX, 0.0, G_PARAM_READWRITE); - GIMP_PROC_ARG_INT (procedure, "lens_x", - _("lens_X"), _("Lens center X (lateral)"), - 0, GIMP_MAX_IMAGE_SIZE-1, 0, G_PARAM_READWRITE); - GIMP_PROC_ARG_INT (procedure, "lens_y", - _("lens_Y"), _("Lens center Y (lateral)"), - 0, GIMP_MAX_IMAGE_SIZE-1, 0, G_PARAM_READWRITE); + /* author(s) original, GIMP3 */ "Kriang Lerdsuwanakij, Jose Da Silva", + /* copyright */ "GPL3+", + /* date made */ "2024"); + + GIMP_PROC_ARG_DOUBLE (procedure, "bluel", + _("_Blue-L"), _("Blue amount (lateral)"), + -INPUT_MXF, INPUT_MXF, 0.0, G_PARAM_READWRITE); + GIMP_PROC_ARG_DOUBLE (procedure, "redl", + _("_Red-L"), _("Red amount (lateral)"), + -INPUT_MXF, INPUT_MXF, 0.0, G_PARAM_READWRITE); + GIMP_PROC_ARG_INT (procedure, "lensx", + _("Lens_X"), _("Lens center X (lateral)"), + -1, GIMP_MAX_IMAGE_SIZE-1, -1, G_PARAM_READWRITE); + GIMP_PROC_ARG_INT (procedure, "lensy", + _("Lens_Y"), _("Lens center Y (lateral)"), + -1, GIMP_MAX_IMAGE_SIZE-1, -1, G_PARAM_READWRITE); GIMP_PROC_ARG_INT (procedure, "interpolation", _("_Interpolation"), _("Interpolation 0=None/1=Linear/2=Cubic"), 0, 2, 1, G_PARAM_READWRITE); - GIMP_PROC_ARG_DOUBLE (procedure, "x_blue", - _("X B_lue"), _("Blue amount, X axis (directional)"), + GIMP_PROC_ARG_DOUBLE (procedure, "bluex", + _("B_lue-X"), _("Blue amount, X axis (directional)"), -INPUT_MAX, INPUT_MAX, 0.0, G_PARAM_READWRITE); - GIMP_PROC_ARG_DOUBLE (procedure, "x_red", - _("X R_ed"), _("Red amount, X axis (directional)"), + GIMP_PROC_ARG_DOUBLE (procedure, "redx", + _("R_ed-X"), _("Red amount, X axis (directional)"), -INPUT_MAX, INPUT_MAX, 0.0, G_PARAM_READWRITE); - GIMP_PROC_ARG_DOUBLE (procedure, "y_blue", - _("Y Bl_ue"), _("Blue amount, Y axis (directional)"), + GIMP_PROC_ARG_DOUBLE (procedure, "bluey", + _("Bl_ue-Y"), _("Blue amount, Y axis (directional)"), -INPUT_MAX, INPUT_MAX, 0.0, G_PARAM_READWRITE); - GIMP_PROC_ARG_DOUBLE (procedure, "y_red", - _("Y Re_d"), _("Red amount, Y axis (directional)"), + GIMP_PROC_ARG_DOUBLE (procedure, "redy", + _("Re_d-Y"), _("Red amount, Y axis (directional)"), -INPUT_MAX, INPUT_MAX, 0.0, G_PARAM_READWRITE); - GIMP_PROC_ARG_BOOLEAN (procedure, "reset_values", - _("_Reset all values to default"), - _("Reset all values to default"), - FALSE, - G_PARAM_READWRITE); - /* GUI-only arguments */ -// GIMP_PROC_AUX_ARG_DOUBLE (procedure, "saturation", -// _("Preview _saturation"), -// _("Saturate colors to help you see overlaps"), -// -100.0, 100.0, 0.0, G_PARAM_READWRITE); } return procedure; } -static GimpValueArray *fixca_run(GimpProcedure *procedure, - GimpRunMode run_mode, - GimpImage *image, - gint n_drawables, - GimpDrawable **drawables, - GimpProcedureConfig *proc_config, - gpointer run_data) { +static GimpValueArray * +fixca_run (GimpProcedure *procedure, + GimpRunMode run_mode, + GimpImage *image, + gint n_drawables, + GimpDrawable **drawables, + GimpProcedureConfig *proc_config, + gpointer run_data) +{ const Babl *format; GeglBuffer *srcBuf; GeglBuffer *shadow; @@ -282,14 +257,14 @@ static GimpValueArray *fixca_run(GimpProcedure *procedure, GError *error = NULL; gint x, y, width, height, sizeImg; -#ifdef xxHAVE_GETTEXT +#ifdef HAVE_GETTEXT /* Initialize i18n support */ - //setlocale(LC_ALL, ""); + setlocale(LC_ALL, ""); bindtextdomain(GETTEXT_PACKAGE, gimp_locale_directory()); #ifdef HAVE_BIND_TEXTDOMAIN_CODESET bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); #endif - //textdomain(GETTEXT_PACKAGE); + textdomain(GETTEXT_PACKAGE); #endif if (n_drawables != 1) { @@ -313,11 +288,53 @@ static GimpValueArray *fixca_run(GimpProcedure *procedure, error); } + /* init, and fetch variables */ fix_ca_params.Xsize = gimp_drawable_get_width (drawable); fix_ca_params.Ysize = gimp_drawable_get_height (drawable); fix_ca_params.bpp = gimp_drawable_get_bpp (drawable); - fix_ca_params.srcImg = fix_ca_params.destImg = fix_ca_params.prevImg = NULL; + fix_ca_params.srcImg = fix_ca_params.destImg = NULL; set_default_settings (&fix_ca_params); + g_object_get (proc_config, + "interpolation", &fix_ca_params.interpolation, + "bluel", &fix_ca_params.blueL, + "redl", &fix_ca_params.redL, + "lensx", &fix_ca_params.lensX, + "lensy", &fix_ca_params.lensY, + "bluex", &fix_ca_params.blueX, + "redx", &fix_ca_params.redX, + "bluey", &fix_ca_params.blueY, + "redy", &fix_ca_params.redY, + NULL); + if (fix_ca_params.blueL < -INPUT_MAX) + fix_ca_params.blueL = -INPUT_MAX; + if (fix_ca_params.blueL > INPUT_MAX) + fix_ca_params.blueL = INPUT_MAX; + if (fix_ca_params.redL < -INPUT_MAX) + fix_ca_params.redL = -INPUT_MAX; + if (fix_ca_params.redL > INPUT_MAX) + fix_ca_params.redL = INPUT_MAX; + if (fix_ca_params.lensX < -1.0 || fix_ca_params.lensX >= fix_ca_params.Xsize) + fix_ca_params.lensX = -1.0; + if (fix_ca_params.lensY < -1.0 || fix_ca_params.lensY >= fix_ca_params.Ysize) + fix_ca_params.lensY = -1.0; + if (fix_ca_params.interpolation < 0 || fix_ca_params.interpolation > 2) + fix_ca_params.interpolation = 0; + if (fix_ca_params.blueX < -INPUT_MAX) + fix_ca_params.blueX = -INPUT_MAX; + if (fix_ca_params.blueX > INPUT_MAX) + fix_ca_params.blueX = INPUT_MAX; + if (fix_ca_params.redX < -INPUT_MAX) + fix_ca_params.redX = -INPUT_MAX; + if (fix_ca_params.redX > INPUT_MAX) + fix_ca_params.redX = INPUT_MAX; + if (fix_ca_params.blueY < -INPUT_MAX) + fix_ca_params.blueY = -INPUT_MAX; + if (fix_ca_params.blueY > INPUT_MAX) + fix_ca_params.blueY = INPUT_MAX; + if (fix_ca_params.redY < -INPUT_MAX) + fix_ca_params.redY = -INPUT_MAX; + if (fix_ca_params.redY > INPUT_MAX) + fix_ca_params.redY = INPUT_MAX; /* figure-out bytes per color precision */ switch (gimp_image_get_precision (image)) { @@ -370,7 +387,7 @@ static GimpValueArray *fixca_run(GimpProcedure *procedure, fix_ca_params.bpp, fix_ca_params.bpc); #endif - /* prepare to draw or preview, fetch values and image */ + /* prepare to draw, or preview, fetch values and image */ sizeImg = fix_ca_params.Xsize * fix_ca_params.Ysize * fix_ca_params.bpp; fix_ca_params.srcImg = g_new (guchar, sizeImg); fix_ca_params.destImg = g_new (guchar, sizeImg); @@ -386,80 +403,65 @@ static GimpValueArray *fixca_run(GimpProcedure *procedure, error); } -// if (!get_from_config (&proc_config, &fix_ca_params)) { -// g_set_error (&error, GIMP_PLUG_IN_ERROR, 0, _("Parameter out of range!")); -// status = GIMP_PDB_CALLING_ERROR; -// } - format = gimp_drawable_get_format (drawable); - //gegl_init (NULL, NULL); + gegl_init (NULL, NULL); srcBuf = gimp_drawable_get_buffer (drawable); gegl_buffer_get (srcBuf, GEGL_RECTANGLE (0, 0, fix_ca_params.Xsize, fix_ca_params.Ysize), 1.0, format, fix_ca_params.srcImg, GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE); - /* In interactive mode, display a dialog to advertise the exercise. */ - if (run_mode == GIMP_RUN_INTERACTIVE) { - if (!fixca_dialog (procedure, &proc_config, &fix_ca_params)) { - status = GIMP_PDB_CANCEL; - } + /* In interactive mode, display dialog to get 'config' variables. */ + if (run_mode == GIMP_RUN_INTERACTIVE && \ + ! fixca_dialog (procedure, G_OBJECT (proc_config), &fix_ca_params)) { + status = GIMP_PDB_CANCEL; } -#ifdef DEBUG_TIME - printf("Xsize=%d Ysize=%d, ", - fix_ca_params.Xsize, fix_ca_params.Ysize); - printf("bytes per pixel=%d, bytes per color=%d\n", - fix_ca_params.bpp, fix_ca_params.bpc); -#endif -#ifdef DEBUG_TIME - printf("done fixca_dialog\n"); -#endif - -// if (status == GIMP_PDB_SUCCESS && !get_from_config (&proc_config, &fix_ca_params)) { -// g_set_error(&error, GIMP_PLUG_IN_ERROR, 0, _("Parameter out of range!")); -// status = GIMP_PDB_CALLING_ERROR; -// } /* Modify image according to input params */ if (status == GIMP_PDB_SUCCESS && gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height)) { #ifdef DEBUG_TIME - double sec; - struct timeval tv1, tv2; - gettimeofday (&tv1, NULL); + double sec; + struct timeval tv1, tv2; + gettimeofday (&tv1, NULL); - printf ("Start fixca(), x=%d y=%d width=%d height=%d\n", - x, y, width, height); + printf ("Start fixca(), x=%d y=%d width=%d height=%d\n", x, y, width, height); #endif - shadow = gimp_drawable_get_shadow_buffer(drawable); + shadow = gimp_drawable_get_shadow_buffer(drawable); + + /* adjust pixel regions from srcImg to destImg, according to params */ + fixca_region (&fix_ca_params, x, (x+width), y, (y+height), TRUE); - /* adjust pixel regions from srcImg to destImg, according to params */ - fixca_region (&fix_ca_params, x, (x+width), y, (y+height), TRUE); #ifdef DEBUG_TIME - printf ("finished doing fixca_region\n"); - printf ("blue=%g red=%g lens_x=%g lens_y=%g Xsize=%d/%d Ysize=%d/%d", - fix_ca_params.blue, fix_ca_params.red, fix_ca_params.lens_x, fix_ca_params.lens_y, fix_ca_params.Xsize, width, fix_ca_params.Ysize, height); - printf ("x_blue=%g x_red=%g x_blue=%g x_red=%g\n", - fix_ca_params.x_blue, fix_ca_params.x_red, fix_ca_params.y_blue, fix_ca_params.y_red); - printf ("interpolation=%d saturation=%g reset values=%d\n", - fix_ca_params.interpolation, fix_ca_params.saturation, fix_ca_params.reset_values); + printf ("finished doing fixca_region\n"); + printf ("..blue=%g red=%g lens_x=%g lens_y=%g\n", + fix_ca_params.blueL, fix_ca_params.redL, fix_ca_params.lensX, + fix_ca_params.lensY); + printf ("..Xsize=%d/%d Ysize=%d/%d", + fix_ca_params.Xsize, width, fix_ca_params.Ysize, height); + printf ("..x_blue=%g x_red=%g x_blue=%g x_red=%g\n", + fix_ca_params.blueX, fix_ca_params.redX, fix_ca_params.blueY, + fix_ca_params.redY); + printf ("..interpolation=%d saturation=%g reset values=%d\n", + fix_ca_params.interpolation, fix_ca_params.saturation, + fix_ca_params.reset_values); #endif - gegl_buffer_set (shadow, GEGL_RECTANGLE(x, y, width, height), - 0, format, fix_ca_params.destImg, GEGL_AUTO_ROWSTRIDE); + gegl_buffer_set (shadow, GEGL_RECTANGLE(x, y, width, height), + 0, format, fix_ca_params.destImg, GEGL_AUTO_ROWSTRIDE); - gegl_buffer_flush (shadow); - gimp_drawable_merge_shadow (drawable, TRUE); - gimp_drawable_update (drawable, x, y, width, height); - g_object_unref (shadow); + gegl_buffer_flush (shadow); + gimp_drawable_merge_shadow (drawable, TRUE); + gimp_drawable_update (drawable, x, y, width, height); + g_object_unref (shadow); #ifdef DEBUG_TIME - gettimeofday (&tv2, NULL); + gettimeofday (&tv2, NULL); - sec = tv2.tv_sec - tv1.tv_sec + (tv2.tv_usec - tv1.tv_usec)/1000000.0; - printf ("End fixca(), Elapsed time: %.2f\n", sec); + sec = tv2.tv_sec - tv1.tv_sec + (tv2.tv_usec - tv1.tv_usec)/1000000.0; + printf ("End fixca(), Elapsed time: %.2f\n", sec); #endif } @@ -479,76 +481,16 @@ static GimpValueArray *fixca_run(GimpProcedure *procedure, static void set_default_settings (FixCaParams *params) { - params->blue = 0.0; - params->red = 0.0; - params->lens_x = round (params->Xsize/2); - params->lens_y = round (params->Ysize/2); - params->update_preview = TRUE; + params->blueL = params->redL = 0.0; + params->lensX = round (params->Xsize/2); + params->lensY = round (params->Ysize/2); params->interpolation = GIMP_INTERPOLATION_NONE; params->saturation = 0.0; - params->x_blue = 0.0; - params->x_red = 0.0; - params->y_blue = 0.0; - params->y_red = 0.0; + params->blueX = params->redX = 0.0; + params->blueY = params->redY = 0.0; params->reset_values = FALSE; } -static gboolean -get_from_config (GimpProcedureConfig *proc_config, FixCaParams *params) -{ -#ifdef DEBUG_TIME - printf("start get_from_config\n"); -#endif - - g_object_get (proc_config, - "blue", ¶ms->blue, - "red", ¶ms->red, - "lens_x", ¶ms->lens_x, - "lens_y", ¶ms->lens_y, - "interpolation", ¶ms->interpolation, - "x_blue", ¶ms->x_blue, - "x_red", ¶ms->x_red, - "y_blue", ¶ms->y_blue, - "y_red", ¶ms->y_red, - "reset_values", ¶ms->reset_values, - NULL); - -#ifdef DEBUG_TIME - printf("loaded config\n"); - printf("blue=%g red=%g lens_x=%g lens_y=%g ", - params->blue, params->red, params->lens_x, params->lens_y); - printf("x_blue=%g x_red=%g x_blue=%g x_red=%g\n", - params->x_blue, params->x_red, params->y_blue, params->y_red); - printf("interpolation=%d saturation=%g reset values=%d\n", - params->interpolation, params->saturation, params->reset_values); -#endif - - if (params->reset_values) - set_default_settings (¶ms); - - if (params->blue < -INPUT_MAX || \ - params->blue > INPUT_MAX || \ - params->red < -INPUT_MAX || \ - params->red > INPUT_MAX || \ - params->lens_x < 0 || \ - params->lens_x >= params->Xsize || \ - params->lens_y < 0 || \ - params->lens_y >= params->Ysize || \ - params->interpolation < 0 || \ - params->interpolation > 2 || \ - params->x_blue < -INPUT_MAX || \ - params->x_blue > INPUT_MAX || \ - params->x_red < -INPUT_MAX || \ - params->x_red > INPUT_MAX || \ - params->y_blue < -INPUT_MAX || \ - params->y_blue > INPUT_MAX || \ - params->y_red < -INPUT_MAX || \ - params->y_red > INPUT_MAX) - return FALSE; - - return TRUE; -} - static gdouble get_pixel (guchar *ptr, gint bpc) { @@ -637,43 +579,53 @@ absolute (gint i) return -i; } -void -preview_update (GimpPreview *preview, FixCaParams *params) -//preview_update (GtkWidget *preview, FixCaParams *params) +static void +preview_update (GtkWidget *widget, GObject *config) { - gint b, i, j, x, y, width, height; - gdouble d; + GimpPreview *preview; + FixCaParams *params; + guchar *buffer; + gint b, i, j, x, y, width, height; + gdouble d; + + preview = GIMP_PREVIEW (widget); + params = g_object_get_data (config, "fixcaparams"); gimp_preview_get_position (preview, &x, &y); gimp_preview_get_size (preview, &width, &height); + #ifdef DEBUG_TIME printf ("preview_update(), x=%d y=%d w=%d h=%d bpp=%d bcp=%d\n", x, y, width, height, params->bpp, params->bpc); + printf ("..blue=%g red=%g lensX=%g lensY=%g\n", + params->blueL, params->redL, params->lensX, params->lensY); + printf ("..interpolation=%d, blueX=%g redX=%g, blueY=%g redY=%g\n", + params->interpolation, params->blueX, params->redX, + params->blueY, params->redY); #endif fixca_region (params, 0, params->Xsize, y, (y + height), FALSE); -#ifdef DEBUG_TIME - printf ("..continue update_preview\n"); -#endif + buffer = g_new (guchar, width * height * params->bpp); b = absolute (params->bpc); for (i = 0; i < height; i++) { if (b == 1) { - memcpy (¶ms->prevImg[width * i * params->bpp], + memcpy (&buffer[width * i * params->bpp], ¶ms->destImg[(params->Xsize * (y + i) + x) * params->bpp], width * params->bpp); } else { for (j = 0; j < width*params->bpp/b; j++) { d = get_pixel (¶ms->destImg[(params->Xsize*(y+i)+x)*params->bpp+j*b], params->bpc); - set_pixel (¶ms->prevImg[width*i*params->bpp/b+j], d, 1); + set_pixel (&buffer[width*i*params->bpp/b+j], d, 1); } } } - gimp_preview_draw_buffer (preview, params->prevImg, width * params->bpp/b); - //gtk_widget_queue_draw (params->previewarea); + gimp_preview_draw_buffer (preview, buffer, width * params->bpp/b); + g_free (buffer); + #ifdef DEBUG_TIME - printf ("done update_preview\n"); + printf ("..done preview_update\n"); #endif } @@ -693,23 +645,118 @@ gfix_combo_entry_update (GtkWidget *widget, static gboolean fixca_dialog (GimpProcedure *procedure, - GimpProcedureConfig *config, + GObject *config, FixCaParams *params) { +#if 0 + // NOTE: F1 help missing in gimp_procedure_dialog_new. + // TODO: preview window not updated, config values are unused. + GtkWidget *dialog; + GtkListStore *store; + GtkWidget *preview; + GtkWidget *adj; + gboolean run; + gint x, y, width, height; + + //g_object_set_data (config, "saturation", params->saturation); + + gimp_ui_init (PLUG_IN_BINARY); + + dialog = gimp_procedure_dialog_new (procedure, + GIMP_PROCEDURE_CONFIG (config), + _("Chromatic Aberration")); + + gimp_dialog_set_alternative_button_order (GTK_DIALOG (dialog), + GTK_RESPONSE_OK, + GTK_RESPONSE_CANCEL, + -1); + + gimp_window_set_transient (GTK_WINDOW (dialog)); + + /* frame for primitive radio buttons */ + store = gimp_int_store_new (_("None (Fastest)"), GIMP_INTERPOLATION_NONE, + _("Linear"), GIMP_INTERPOLATION_LINEAR, + _("Cubic (Best)"), GIMP_INTERPOLATION_CUBIC, + NULL); + frame = gimp_procedure_dialog_get_int_radio (GIMP_PROCEDURE_DIALOG (dialog), + "interpolation", + GIMP_INT_STORE (store)); + gtk_widget_set_margin_bottom (frame, 12); + + /* Lateral */ + adj = gimp_procedure_dialog_get_scale_entry (GIMP_PROCEDURE_DIALOG (dialog), + "bluel", 0.1); + adj = gimp_procedure_dialog_get_scale_entry (GIMP_PROCEDURE_DIALOG (dialog), + "redl", 0.1); + adj = gimp_procedure_dialog_get_scale_entry (GIMP_PROCEDURE_DIALOG (dialog), + "lensx", 1.0); + adj = gimp_procedure_dialog_get_scale_entry (GIMP_PROCEDURE_DIALOG (dialog), + "lensy", 1.0); + gtk_widget_set_margin_bottom (adj, 12); + gimp_procedure_dialog_get_label (GIMP_PROCEDURE_DIALOG (dialog), + "lateral-label", _("Lateral"), + FALSE, FALSE); + gimp_procedure_dialog_fill_box (GIMP_PROCEDURE_DIALOG (dialog), + "lateral-vbox", "bluel", "redl", + "lensx", "lensy", NULL); + gimp_procedure_dialog_fill_frame (GIMP_PROCEDURE_DIALOG (dialog), + "lateral-frame", "lateral-label", + FALSE, "lateral-vbox"); + + /* Directional */ + adj = gimp_procedure_dialog_get_scale_entry (GIMP_PROCEDURE_DIALOG (dialog), + "bluex", 0.1); + adj = gimp_procedure_dialog_get_scale_entry (GIMP_PROCEDURE_DIALOG (dialog), + "redx", 0.1); + adj = gimp_procedure_dialog_get_scale_entry (GIMP_PROCEDURE_DIALOG (dialog), + "bluey", 0.1); + adj = gimp_procedure_dialog_get_scale_entry (GIMP_PROCEDURE_DIALOG (dialog), + "redy", 0.1); + gtk_widget_set_margin_bottom (adj, 12); + gimp_procedure_dialog_get_label (GIMP_PROCEDURE_DIALOG (dialog), + "directional-label", _("Directional"), + FALSE, FALSE); + gimp_procedure_dialog_fill_box (GIMP_PROCEDURE_DIALOG (dialog), + "directional-vbox", "bluex", "redx", + "bluey", "redy", NULL); + gimp_procedure_dialog_fill_frame (GIMP_PROCEDURE_DIALOG (dialog), + "directional-frame", "directional-label", + FALSE, "directional-vbox"); + + gimp_procedure_dialog_fill_box (GIMP_PROCEDURE_DIALOG (dialog), + "fixca-vbox", "interpolation", "lateral-frame", + "directional-frame", NULL); + + preview = gimp_procedure_dialog_get_drawable_preview (GIMP_PROCEDURE_DIALOG (dialog), + "preview", params->drawable); + g_object_set_data (config, "fixcaparams", params); + g_signal_connect (preview, "invalidated", G_CALLBACK (preview_update), config); + + g_signal_connect_swapped (config, "notify", + G_CALLBACK (gimp_preview_invalidate), + preview); + + gimp_procedure_dialog_fill (GIMP_PROCEDURE_DIALOG (dialog), + "preview", "fixca-vbox", NULL); + + gtk_widget_show (dialog); + run = gimp_procedure_dialog_run (GIMP_PROCEDURE_DIALOG (dialog)); + gtk_widget_destroy (dialog); + + //g_object_unref (saturation); + //g_object_unref (fixcaparams); + +#else GtkWidget *dialog; GtkWidget *main_vbox; GtkWidget *combo; GtkWidget *preview; - GtkWidget *grid; GtkWidget *frame; GtkWidget *adj; - GtkWidget *button; - gboolean run; gchar *title; - gint x, y, width, height; + gboolean run; gimp_ui_init (PLUG_IN_BINARY); - title = g_strdup_printf (_("Chromatic Aberration")); dialog = gimp_dialog_new (title, "fix_ca", NULL, (GtkDialogFlags) 0, @@ -718,6 +765,7 @@ fixca_dialog (GimpProcedure *procedure, _("_OK"), GTK_RESPONSE_OK, NULL); g_free (title); + g_object_set_data (config, "fixcaparams", params); main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12); @@ -725,36 +773,17 @@ fixca_dialog (GimpProcedure *procedure, main_vbox, TRUE, TRUE, 0); gtk_widget_show (main_vbox); -/*** - preview = gimp_drawable_preview_new_from_drawable(params->drawable); + preview = gimp_drawable_preview_new_from_drawable (params->drawable); gtk_box_pack_start (GTK_BOX (main_vbox), preview, TRUE, TRUE, 0); gtk_widget_show (preview); - gimp_preview_get_position(preview, &x, &y); - gimp_preview_get_size(preview, &width, &height); - params->prevImg = g_new(guchar, width * height * params->bpp); -/** - preview = gimp_drawable_preview_new_from_drawable(params->drawable); - gtk_box_pack_start (GTK_BOX (main_vbox), preview, TRUE, TRUE, 0); - gtk_widget_show (preview); - params->previewarea = preview; - - gimp_preview_get_position(preview, &x, &y); - gimp_preview_get_size(preview, &width, &height); - params->prevImg = g_new(guchar, width * height * params->bpp); - - g_signal_connect(preview, "invalidated", - G_CALLBACK(preview_update), - params); -/***/ -// grid = gtk_grid_new (); -// gtk_grid_set_row_spacing (GTK_GRID (grid), 6); -// gtk_grid_set_column_spacing (GTK_GRID (grid), 6); - //gtk_container_set_border_width (GTK_CONTAINER (grid), 12); -// gtk_widget_show (grid); + g_signal_connect (preview, "invalidated", G_CALLBACK (preview_update), config); + g_signal_connect_swapped (config, "notify", + G_CALLBACK (gimp_preview_invalidate), + preview); adj = gimp_scale_entry_new (_("_Saturation:"), - params->saturation, -100.0, 100.0, 0); + params->saturation, -100.0, 100.0, 0); gimp_label_spin_set_increments (GIMP_LABEL_SPIN(adj), 1, 10); gimp_help_set_help_data (adj, _("Saturate colors in preview window to help you see overlaps"), @@ -763,15 +792,15 @@ fixca_dialog (GimpProcedure *procedure, g_signal_connect (adj, "value_changed", G_CALLBACK (gfix_scale_entry_update), &(params->saturation)); -// g_signal_connect_swapped(adj, "value_changed", -// G_CALLBACK(gimp_preview_invalidate), -// preview); + g_signal_connect_swapped (adj, "value_changed", + G_CALLBACK(gimp_preview_invalidate), + preview); gtk_box_pack_start (GTK_BOX (main_vbox), adj, FALSE, FALSE, 0); gtk_widget_show (adj); - combo = gimp_int_combo_box_new (_("None (Fastest)"), GIMP_INTERPOLATION_NONE, - _("Linear"), GIMP_INTERPOLATION_LINEAR, - _("Cubic (Best)"), GIMP_INTERPOLATION_CUBIC, + combo = gimp_int_combo_box_new (_("_None (Fastest)"), GIMP_INTERPOLATION_NONE, + _("L_inear"), GIMP_INTERPOLATION_LINEAR, + _("_Cubic (Best)"), GIMP_INTERPOLATION_CUBIC, NULL); gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo), params->interpolation); gimp_help_set_help_data (combo, @@ -790,71 +819,53 @@ fixca_dialog (GimpProcedure *procedure, gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); - adj = gimp_scale_entry_new (_("_Blue:"), params->blue, -INPUT_MAX, INPUT_MAX, 1); + adj = gimp_scale_entry_new (_("_Blue:"), params->blueL, -INPUT_MAX, INPUT_MAX, 1); gimp_label_spin_set_increments (GIMP_LABEL_SPIN (adj), 0.1, 0.5); gtk_box_pack_start (GTK_BOX (main_vbox), adj, FALSE, FALSE, 0); gtk_widget_show (adj); g_signal_connect (adj, "value_changed", G_CALLBACK (gfix_scale_entry_update), - &(params->blue)); -// g_signal_connect_swapped(adj, "value_changed", -// G_CALLBACK(gimp_preview_invalidate), -// preview); + &(params->blueL)); + g_signal_connect_swapped (adj, "value_changed", + G_CALLBACK(gimp_preview_invalidate), + preview); - adj = gimp_scale_entry_new (_("_Red:"), params->red, -INPUT_MAX, INPUT_MAX, 1); + adj = gimp_scale_entry_new (_("_Red:"), params->redL, -INPUT_MAX, INPUT_MAX, 1); gimp_label_spin_set_increments (GIMP_LABEL_SPIN (adj), 0.1, 0.5); gtk_box_pack_start (GTK_BOX (main_vbox), adj, FALSE, FALSE, 0); gtk_widget_show (adj); g_signal_connect (adj, "value_changed", G_CALLBACK (gfix_scale_entry_update), - &(params->red)); -// g_signal_connect_swapped(adj, "value_changed", -// G_CALLBACK(gimp_preview_invalidate), -// preview); + &(params->redL)); + g_signal_connect_swapped (adj, "value_changed", + G_CALLBACK(gimp_preview_invalidate), + preview); - adj = gimp_scale_entry_new (_("Lens_X:"), params->lens_x, 0, params->Xsize-1, 0); + adj = gimp_scale_entry_new (_("Lens_X:"), params->lensX, -1, params->Xsize-1, 0); gimp_label_spin_set_increments (GIMP_LABEL_SPIN (adj), 10, 100); gtk_box_pack_start (GTK_BOX (main_vbox), adj, FALSE, FALSE, 0); gtk_widget_show (adj); g_signal_connect (adj, "value_changed", G_CALLBACK (gfix_scale_entry_update), - &(params->lens_x)); -// g_signal_connect_swapped(adj, "value_changed", -// G_CALLBACK(gimp_preview_invalidate), -// preview); + &(params->lensX)); + g_signal_connect_swapped (adj, "value_changed", + G_CALLBACK(gimp_preview_invalidate), + preview); - adj = gimp_scale_entry_new (_("Lens_Y:"), params->lens_y, 0, params->Ysize-1, 0); + adj = gimp_scale_entry_new (_("Lens_Y:"), params->lensY, -1, params->Ysize-1, 0); gimp_label_spin_set_increments (GIMP_LABEL_SPIN (adj), 10, 100); gtk_box_pack_start (GTK_BOX (main_vbox), adj, FALSE, FALSE, 0); gtk_widget_show (adj); g_signal_connect (adj, "value_changed", G_CALLBACK (gfix_scale_entry_update), - &(params->lens_y)); -// g_signal_connect_swapped(adj, "value_changed", -// G_CALLBACK(gimp_preview_invalidate), -// preview); - - //button = gtk_check_button_new_with_mnemonic(_("Reset Lens Center")); - //gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), - // data->use_full_page); - //gtk_box_pack_start(GTK_BOX(main_vbox), button, FALSE, FALSE, 0); - //g_signal_connect(button, "toggled", - // G_CALLBACK(print_size_info_use_full_page_toggled), - // NULL); - //gtk_widget_show(button); - - //button = gtk_check_button_new_with_mnemonic(_("_Draw Crop Marks")); - //gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (button), - // data->draw_crop_marks); - //gtk_box_pack_start(GTK_BOX(main_vbox), button, FALSE, FALSE, 0); - //g_signal_connect(button, "toggled", - // G_CALLBACK(print_draw_crop_marks_toggled), - // NULL); - //gtk_widget_show(button); + &(params->lensY)); + g_signal_connect_swapped (adj, "value_changed", + G_CALLBACK(gimp_preview_invalidate), + preview); frame = gimp_frame_new (_("Directional, X axis")); gimp_help_set_help_data (frame, @@ -863,29 +874,29 @@ fixca_dialog (GimpProcedure *procedure, gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); - adj = gimp_scale_entry_new (_("B_lue:"), params->x_blue, -INPUT_MAX, INPUT_MAX, 1); + adj = gimp_scale_entry_new (_("B_lue:"), params->blueX, -INPUT_MAX, INPUT_MAX, 1); gimp_label_spin_set_increments (GIMP_LABEL_SPIN (adj), 0.1, 0.5); gtk_box_pack_start (GTK_BOX (main_vbox), adj, FALSE, FALSE, 0); gtk_widget_show (adj); g_signal_connect (adj, "value_changed", G_CALLBACK (gfix_scale_entry_update), - &(params->x_blue)); -// g_signal_connect_swapped(adj, "value_changed", -// G_CALLBACK(gimp_preview_invalidate), -// preview); + &(params->blueX)); + g_signal_connect_swapped (adj, "value_changed", + G_CALLBACK(gimp_preview_invalidate), + preview); - adj = gimp_scale_entry_new (_("R_ed:"), params->x_red, -INPUT_MAX, INPUT_MAX, 1); + adj = gimp_scale_entry_new (_("R_ed:"), params->redX, -INPUT_MAX, INPUT_MAX, 1); gimp_label_spin_set_increments (GIMP_LABEL_SPIN (adj), 0.1, 0.5); gtk_box_pack_start (GTK_BOX (main_vbox), adj, FALSE, FALSE, 0); gtk_widget_show (adj); g_signal_connect (adj, "value_changed", G_CALLBACK (gfix_scale_entry_update), - &(params->x_red)); -// g_signal_connect_swapped(adj, "value_changed", -// G_CALLBACK(gimp_preview_invalidate), -// preview); + &(params->redX)); + g_signal_connect_swapped(adj, "value_changed", + G_CALLBACK(gimp_preview_invalidate), + preview); frame = gimp_frame_new (_("Directional, Y axis")); gimp_help_set_help_data (frame, @@ -894,70 +905,49 @@ fixca_dialog (GimpProcedure *procedure, gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); - adj = gimp_scale_entry_new (_("Bl_ue:"), params->y_blue, -INPUT_MAX, INPUT_MAX, 1); + adj = gimp_scale_entry_new (_("Bl_ue:"), params->blueY, -INPUT_MAX, INPUT_MAX, 1); gimp_label_spin_set_increments (GIMP_LABEL_SPIN (adj), 0.1, 0.5); gtk_box_pack_start (GTK_BOX (main_vbox), adj, FALSE, FALSE, 0); gtk_widget_show (adj); g_signal_connect (adj, "value_changed", G_CALLBACK (gfix_scale_entry_update), - &(params->y_blue)); -// g_signal_connect_swapped(adj, "value_changed", -// G_CALLBACK (gimp_preview_invalidate), -// preview); -/***/ - adj = gimp_scale_entry_new (_("Re_d:"), params->y_red, -INPUT_MAX, INPUT_MAX, 1); + &(params->blueY)); + g_signal_connect_swapped (adj, "value_changed", + G_CALLBACK(gimp_preview_invalidate), + preview); + + adj = gimp_scale_entry_new (_("Re_d:"), params->redY, -INPUT_MAX, INPUT_MAX, 1); gimp_label_spin_set_increments (GIMP_LABEL_SPIN (adj), 0.1, 0.5); gtk_box_pack_start (GTK_BOX (main_vbox), adj, FALSE, FALSE, 0); gtk_widget_show (adj); - g_signal_connect (GIMP_LABEL_SPIN (adj), "value_changed", - G_CALLBACK (gfix_scale_entry_update), - &(params->y_red)); -// g_signal_connect_swapped(adj, "value_changed", -// G_CALLBACK(gimp_preview_invalidate), -// preview); + g_signal_connect (adj, "value_changed", + G_CALLBACK (gfix_scale_entry_update), + &(params->redY)); + g_signal_connect_swapped (adj, "value_changed", + G_CALLBACK(gimp_preview_invalidate), + preview); gtk_widget_show (dialog); run = (gimp_dialog_run (GIMP_DIALOG(dialog)) == GTK_RESPONSE_OK); - gtk_widget_destroy (dialog); - -// g_free (params->prevImg); - -/*** - dialog = gimp_procedure_dialog_new (procedure, - GIMP_PROCEDURE_CONFIG (config), - _("Chromatic Aberration")); - gimp_dialog_set_alternative_button_order (GTK_DIALOG (dialog), - GTK_RESPONSE_OK, - GTK_RESPONSE_CANCEL, - -1); - gimp_window_set_transient (GTK_WINDOW (dialog)); - gimp_procedure_dialog_get_scale_entry (GIMP_PROCEDURE_DIALOG (dialog), - "blue", 0.1); - gimp_procedure_dialog_get_scale_entry (GIMP_PROCEDURE_DIALOG (dialog), - "red", 0.1); - gimp_procedure_dialog_get_scale_entry (GIMP_PROCEDURE_DIALOG (dialog), - "lens_x", 0.1); - gimp_procedure_dialog_get_scale_entry (GIMP_PROCEDURE_DIALOG (dialog), - "lens_y", 0.1); - gimp_procedure_dialog_get_scale_entry (GIMP_PROCEDURE_DIALOG (dialog), - "interpolation", 1); - gimp_procedure_dialog_get_scale_entry (GIMP_PROCEDURE_DIALOG (dialog), - "x_blue", 0.1); - gimp_procedure_dialog_get_scale_entry (GIMP_PROCEDURE_DIALOG (dialog), - "x_red", 0.1); - gimp_procedure_dialog_get_scale_entry (GIMP_PROCEDURE_DIALOG (dialog), - "y_blue", 0.1); - gimp_procedure_dialog_get_scale_entry (GIMP_PROCEDURE_DIALOG (dialog), - "y_red", 0.1); - - gimp_procedure_dialog_fill (GIMP_PROCEDURE_DIALOG (dialog), NULL); - gtk_widget_show(dialog); - run = gimp_procedure_dialog_run (GIMP_PROCEDURE_DIALOG (dialog)); + if (run) { + /* set config for future in case we use these settings again */ + g_object_set (config, + "interpolation", ¶ms->interpolation, + "bluel", ¶ms->blueL, + "redl", ¶ms->redL, + "lensx", ¶ms->lensX, + "lensy", ¶ms->lensY, + "bluex", ¶ms->blueX, + "redx", ¶ms->redX, + "bluey", ¶ms->blueY, + "redy", ¶ms->redY, + NULL); + } gtk_widget_destroy (dialog); -***/ +#endif return run; } @@ -1187,7 +1177,7 @@ fixca_region (FixCaParams *params, #ifdef DEBUG_TIME double sec; struct timeval tv1, tv2; - gettimeofday(&tv1, NULL); + gettimeofday (&tv1, NULL); #endif if (show_progress) @@ -1201,8 +1191,8 @@ fixca_region (FixCaParams *params, } dest = g_new (guchar, (x2-x1) * bytes); - x_center = params->lens_x; - y_center = params->lens_y; + x_center = params->lensX; + y_center = params->lensY; /* Scale to get source */ if (x_center >= y_center) max_dim = x_center; @@ -1212,8 +1202,8 @@ fixca_region (FixCaParams *params, max_dim = orig_width - x_center; if (orig_height - y_center > max_dim) max_dim = orig_height - y_center; - scale_blue = max_dim / (max_dim + params->blue); - scale_red = max_dim / (max_dim + params->red); + scale_blue = max_dim / (max_dim + params->blueL); + scale_red = max_dim / (max_dim + params->redL); /* Optimize by loading only parts of a row */ if (scale_blue > scale_red) @@ -1221,18 +1211,18 @@ fixca_region (FixCaParams *params, else scale_max = scale_red; - if (params->x_blue > params->x_red) { - x_shift_min = params->x_red; - x_shift_max = params->x_blue; + if (params->blueX > params->redX) { + x_shift_min = params->redX; + x_shift_max = params->blueX; } else { - x_shift_min = params->x_blue; - x_shift_max = params->x_red; + x_shift_min = params->blueX; + x_shift_max = params->redX; } /* Horizontal band to load for each row */ - band_1 = scale(x1, x_center, orig_width, scale_max, x_shift_max); - band_2 = scale(x2-1, x_center, orig_width, scale_max, x_shift_min); - if (band_1 > x1) /* Make sure green is also covered */ + band_1 = scale (x1, x_center, orig_width, scale_max, x_shift_max); + band_2 = scale (x2-1, x_center, orig_width, scale_max, x_shift_min); + if (band_1 > x1) /* Make sure green is also covered */ band_1 = x1; if (band_2 < x2-1) band_2 = x2-1; @@ -1262,31 +1252,31 @@ fixca_region (FixCaParams *params, for (y = y1; y < y2; ++y) { /* Get current row, for green channel */ guchar *ptr; - ptr = load_data(orig_width, bytes, srcPTR, src, src_row, src_iter, - band_adj, band_1, band_2, y, y); + ptr = load_data (orig_width, bytes, srcPTR, src, src_row, src_iter, + band_adj, band_1, band_2, y, y); /* Collect Green and Alpha channels all at once */ - memcpy(dest, &ptr[x1], (x2-x1)*bytes); + memcpy (dest, &ptr[x1], (x2-x1)*bytes); if (params->interpolation == GIMP_INTERPOLATION_NONE) { guchar *ptr_blue, *ptr_red; gint y_blue, y_red, x_blue, x_red; /* Get blue and red row */ - y_blue = scale(y, y_center, orig_height, scale_blue, params->y_blue); - y_red = scale(y, y_center, orig_height, scale_red, params->y_red); - ptr_blue = load_data(orig_width, bytes, srcPTR, src, src_row, src_iter, - band_adj, band_1, band_2, y_blue, y); - ptr_red = load_data(orig_width, bytes, srcPTR, src, src_row, src_iter, - band_adj, band_1, band_2, y_red, y); + y_blue = scale (y, y_center, orig_height, scale_blue, params->blueY); + y_red = scale (y, y_center, orig_height, scale_red, params->redY); + ptr_blue = load_data (orig_width, bytes, srcPTR, src, src_row, src_iter, + band_adj, band_1, band_2, y_blue, y); + ptr_red = load_data (orig_width, bytes, srcPTR, src, src_row, src_iter, + band_adj, band_1, band_2, y_red, y); for (x = x1; x < x2; ++x) { - /* Blue and red channel */ - x_blue = scale(x, x_center, orig_width, scale_blue, params->x_blue); - x_red = scale(x, x_center, orig_width, scale_red, params->x_red); + /* Blue and red channel */ + x_blue = scale (x, x_center, orig_width, scale_blue, params->blueX); + x_red = scale (x, x_center, orig_width, scale_red, params->redX); - memcpy(&dest[(x-x1)*bytes + 2*b], &ptr_blue[x_blue*bytes + 2*b], b); - memcpy(&dest[(x-x1)*bytes], &ptr_red[x_red*bytes], b); + memcpy (&dest[(x-x1)*bytes + 2*b], &ptr_blue[x_blue*bytes + 2*b], b); + memcpy (&dest[(x-x1)*bytes], &ptr_red[x_red*bytes], b); } } else if (params->interpolation == GIMP_INTERPOLATION_LINEAR) { /* Pointer to pixel data rows y, y+1 */ @@ -1301,8 +1291,8 @@ fixca_region (FixCaParams *params, gint x_blue_1, x_red_1, x_blue_2, x_red_2; /* Get blue and red row */ - y_blue_d = scale_d(y, y_center, orig_height, scale_blue, params->y_blue); - y_red_d = scale_d(y, y_center, orig_height, scale_red, params->y_red); + y_blue_d = scale_d (y, y_center, orig_height, scale_blue, params->blueY); + y_red_d = scale_d (y, y_center, orig_height, scale_red, params->redY); /* Integer and fractional row */ y_blue_1 = floor (y_blue_d); @@ -1311,47 +1301,47 @@ fixca_region (FixCaParams *params, d_y_red = y_red_d - y_red_1; /* Load pixel data */ - ptr_blue_1 = load_data(orig_width, bytes, srcPTR, src, src_row, src_iter, - band_adj, band_1, band_2, y_blue_1, y); - ptr_red_1 = load_data(orig_width, bytes, srcPTR, src, src_row, src_iter, - band_adj, band_1, band_2, y_red_1, y); + ptr_blue_1 = load_data (orig_width, bytes, srcPTR, src, src_row, src_iter, + band_adj, band_1, band_2, y_blue_1, y); + ptr_red_1 = load_data (orig_width, bytes, srcPTR, src, src_row, src_iter, + band_adj, band_1, band_2, y_red_1, y); if (y_blue_1 == orig_height-1) - ptr_blue_2 = ptr_blue_1; + ptr_blue_2 = ptr_blue_1; else - ptr_blue_2 = load_data(orig_width, bytes, srcPTR, src, src_row, src_iter, - band_adj, band_1, band_2, y_blue_1+1, y); + ptr_blue_2 = load_data (orig_width, bytes, srcPTR, src, src_row, src_iter, + band_adj, band_1, band_2, y_blue_1+1, y); if (y_red_1 == orig_height-1) - ptr_red_2 = ptr_red_1; + ptr_red_2 = ptr_red_1; else - ptr_red_2 = load_data(orig_width, bytes, srcPTR, src, src_row, src_iter, - band_adj, band_1, band_2, y_red_1+1, y); + ptr_red_2 = load_data (orig_width, bytes, srcPTR, src, src_row, src_iter, + band_adj, band_1, band_2, y_red_1+1, y); for (x = x1; x < x2; ++x) { - /* Blue and red channel */ - x_blue_d = scale_d(x, x_center, orig_width, scale_blue, params->x_blue); - x_red_d = scale_d(x, x_center, orig_width, scale_red, params->x_red); - - /* Integer and fractional column */ - x_blue_1 = floor (x_blue_d); - x_red_1 = floor (x_red_d); - d_x_blue = x_blue_d - x_blue_1; - d_x_red = x_red_d - x_red_1; - if (x_blue_1 == orig_width-1) - x_blue_2 = x_blue_1; - else - x_blue_2 = x_blue_1 + 1; - if (x_red_1 == orig_width-1) - x_red_2 = x_red_1; - else - x_red_2 = x_red_1 + 1; - - /* Interpolation */ - bilinear((dest+((x-x1)*bytes+2*b)), - (ptr_blue_1+2*b), (ptr_blue_2+2*b), x_blue_1, x_blue_2, - bytes, bpc, d_x_blue, d_y_blue); - bilinear((dest+((x-x1)*bytes)), - ptr_red_1, ptr_red_2, x_red_1, x_red_2, - bytes, bpc, d_x_red, d_y_red); + /* Blue and red channel */ + x_blue_d = scale_d (x, x_center, orig_width, scale_blue, params->blueX); + x_red_d = scale_d (x, x_center, orig_width, scale_red, params->redX); + + /* Integer and fractional column */ + x_blue_1 = floor (x_blue_d); + x_red_1 = floor (x_red_d); + d_x_blue = x_blue_d - x_blue_1; + d_x_red = x_red_d - x_red_1; + if (x_blue_1 == orig_width-1) + x_blue_2 = x_blue_1; + else + x_blue_2 = x_blue_1 + 1; + if (x_red_1 == orig_width-1) + x_red_2 = x_red_1; + else + x_red_2 = x_red_1 + 1; + + /* Interpolation */ + bilinear ((dest+((x-x1)*bytes+2*b)), + (ptr_blue_1+2*b), (ptr_blue_2+2*b), x_blue_1, x_blue_2, + bytes, bpc, d_x_blue, d_y_blue); + bilinear ((dest+((x-x1)*bytes)), + ptr_red_1, ptr_red_2, x_red_1, x_red_2, + bytes, bpc, d_x_red, d_y_red); } } else if (params->interpolation == GIMP_INTERPOLATION_CUBIC) { /* Pointer to pixel data rows y-1, y */ @@ -1370,8 +1360,8 @@ fixca_region (FixCaParams *params, gint x_blue_3, x_red_3, x_blue_4, x_red_4; /* Get blue and red row */ - y_blue_d = scale_d(y, y_center, orig_height, scale_blue, params->y_blue); - y_red_d = scale_d(y, y_center, orig_height, scale_red, params->y_red); + y_blue_d = scale_d (y, y_center, orig_height, scale_blue, params->blueY); + y_red_d = scale_d (y, y_center, orig_height, scale_red, params->redY); y_blue_2 = floor (y_blue_d); y_red_2 = floor (y_red_d); @@ -1379,112 +1369,112 @@ fixca_region (FixCaParams *params, d_y_red = y_red_d - y_red_2; /* Row */ - ptr_blue_2 = load_data(orig_width, bytes, srcPTR, src, src_row, src_iter, - band_adj, band_1, band_2, y_blue_2, y); - ptr_red_2 = load_data(orig_width, bytes, srcPTR, src, src_row, src_iter, - band_adj, band_1, band_2, y_red_2, y); + ptr_blue_2 = load_data (orig_width, bytes, srcPTR, src, src_row, src_iter, + band_adj, band_1, band_2, y_blue_2, y); + ptr_red_2 = load_data (orig_width, bytes, srcPTR, src, src_row, src_iter, + band_adj, band_1, band_2, y_red_2, y); /* Row - 1 */ if (y_blue_2 == 0) - ptr_blue_1 = ptr_blue_2; + ptr_blue_1 = ptr_blue_2; else - ptr_blue_1 = load_data(orig_width, bytes, srcPTR, src, src_row, src_iter, - band_adj, band_1, band_2, y_blue_2-1, y); + ptr_blue_1 = load_data (orig_width, bytes, srcPTR, src, src_row, src_iter, + band_adj, band_1, band_2, y_blue_2-1, y); if (y_red_2 == 0) - ptr_red_1 = ptr_red_2; + ptr_red_1 = ptr_red_2; else - ptr_red_1 = load_data(orig_width, bytes, srcPTR, src, src_row, src_iter, - band_adj, band_1, band_2, y_red_2-1, y); + ptr_red_1 = load_data (orig_width, bytes, srcPTR, src, src_row, src_iter, + band_adj, band_1, band_2, y_red_2-1, y); /* Row + 1 */ if (y_blue_2 == orig_height-1) - ptr_blue_3 = ptr_blue_2; + ptr_blue_3 = ptr_blue_2; else - ptr_blue_3 = load_data(orig_width, bytes, srcPTR, src, src_row, src_iter, - band_adj, band_1, band_2, y_blue_2+1, y); + ptr_blue_3 = load_data (orig_width, bytes, srcPTR, src, src_row, src_iter, + band_adj, band_1, band_2, y_blue_2+1, y); if (y_red_2 == orig_height-1) - ptr_red_3 = ptr_red_2; + ptr_red_3 = ptr_red_2; else - ptr_red_3 = load_data(orig_width, bytes, srcPTR, src, src_row, src_iter, - band_adj, band_1, band_2, y_red_2+1, y); + ptr_red_3 = load_data (orig_width, bytes, srcPTR, src, src_row, src_iter, + band_adj, band_1, band_2, y_red_2+1, y); /* Row + 2 */ if (y_blue_2 == orig_height-1) - ptr_blue_4 = ptr_blue_2; + ptr_blue_4 = ptr_blue_2; else if (y_blue_2 == orig_height-2) - ptr_blue_4 = ptr_blue_3; + ptr_blue_4 = ptr_blue_3; else - ptr_blue_4 = load_data(orig_width, bytes, srcPTR, src, src_row, src_iter, - band_adj, band_1, band_2, y_blue_2+2, y); + ptr_blue_4 = load_data (orig_width, bytes, srcPTR, src, src_row, src_iter, + band_adj, band_1, band_2, y_blue_2+2, y); if (y_red_2 == orig_height-1) - ptr_red_4 = ptr_red_2; + ptr_red_4 = ptr_red_2; else if (y_red_2 == orig_height-2) - ptr_red_4 = ptr_red_3; + ptr_red_4 = ptr_red_3; else - ptr_red_4 = load_data(orig_width, bytes, srcPTR, src, src_row, src_iter, - band_adj, band_1, band_2, y_red_2+2, y); + ptr_red_4 = load_data (orig_width, bytes, srcPTR, src, src_row, src_iter, + band_adj, band_1, band_2, y_red_2+2, y); for (x = x1; x < x2; ++x) { - double y1, y2, y3, y4; - - /* Blue and red channel */ - x_blue_d = scale_d(x, x_center, orig_width, scale_blue, params->x_blue); - x_red_d = scale_d(x, x_center, orig_width, scale_red, params->x_red); - - x_blue_2 = floor (x_blue_d); - x_red_2 = floor (x_red_d); - d_x_blue = x_blue_d - x_blue_2; - d_x_red = x_red_d - x_red_2; - - /* Column - 1 */ - if (x_blue_2 == 0) - x_blue_1 = x_blue_2; - else - x_blue_1 = x_blue_2 - 1; - if (x_red_2 == 0) - x_red_1 = x_red_2; - else - x_red_1 = x_red_2 - 1; - - /* Column + 1 */ - if (x_blue_2 == orig_width-1) - x_blue_3 = x_blue_2; - else - x_blue_3 = x_blue_2 + 1; - if (x_red_2 == orig_width-1) - x_red_3 = x_red_2; - else - x_red_3 = x_red_2 + 1; - - /* Column + 2 */ - if (x_blue_3 == orig_width-1) - x_blue_4 = x_blue_3; - else - x_blue_4 = x_blue_3 + 1; - if (x_red_3 == orig_width-1) - x_red_4 = x_red_3; - else - x_red_4 = x_red_3 + 1; - - y1 = cubicY(ptr_blue_1+2*b, bytes, bpc, d_x_blue, - x_blue_1, x_blue_2, x_blue_3, x_blue_4); - y2 = cubicY(ptr_blue_2+2*b, bytes, bpc, d_x_blue, - x_blue_1, x_blue_2, x_blue_3, x_blue_4); - y3 = cubicY(ptr_blue_3+2*b, bytes, bpc, d_x_blue, - x_blue_1, x_blue_2, x_blue_3, x_blue_4); - y4 = cubicY(ptr_blue_4+2*b, bytes, bpc, d_x_blue, - x_blue_1, x_blue_2, x_blue_3, x_blue_4); - cubicX((dest+(x-x1)*bytes+2*b), bytes, bpc, d_y_blue, y1, y2, y3, y4); - - y1 = cubicY(ptr_red_1, bytes, bpc, d_x_red, - x_red_1, x_red_2, x_red_3, x_red_4); - y2 = cubicY(ptr_red_2, bytes, bpc, d_x_red, - x_red_1, x_red_2, x_red_3, x_red_4); - y3 = cubicY(ptr_red_3, bytes, bpc, d_x_red, - x_red_1, x_red_2, x_red_3, x_red_4); - y4 = cubicY(ptr_red_4, bytes, bpc, d_x_red, - x_red_1, x_red_2, x_red_3, x_red_4); - cubicX((dest+(x-x1)*bytes), bytes, bpc, d_y_red, y1, y2, y3, y4); + double y1, y2, y3, y4; + + /* Blue and red channel */ + x_blue_d = scale_d (x, x_center, orig_width, scale_blue, params->blueX); + x_red_d = scale_d (x, x_center, orig_width, scale_red, params->redX); + + x_blue_2 = floor (x_blue_d); + x_red_2 = floor (x_red_d); + d_x_blue = x_blue_d - x_blue_2; + d_x_red = x_red_d - x_red_2; + + /* Column - 1 */ + if (x_blue_2 == 0) + x_blue_1 = x_blue_2; + else + x_blue_1 = x_blue_2 - 1; + if (x_red_2 == 0) + x_red_1 = x_red_2; + else + x_red_1 = x_red_2 - 1; + + /* Column + 1 */ + if (x_blue_2 == orig_width-1) + x_blue_3 = x_blue_2; + else + x_blue_3 = x_blue_2 + 1; + if (x_red_2 == orig_width-1) + x_red_3 = x_red_2; + else + x_red_3 = x_red_2 + 1; + + /* Column + 2 */ + if (x_blue_3 == orig_width-1) + x_blue_4 = x_blue_3; + else + x_blue_4 = x_blue_3 + 1; + if (x_red_3 == orig_width-1) + x_red_4 = x_red_3; + else + x_red_4 = x_red_3 + 1; + + y1 = cubicY (ptr_blue_1+2*b, bytes, bpc, d_x_blue, + x_blue_1, x_blue_2, x_blue_3, x_blue_4); + y2 = cubicY (ptr_blue_2+2*b, bytes, bpc, d_x_blue, + x_blue_1, x_blue_2, x_blue_3, x_blue_4); + y3 = cubicY (ptr_blue_3+2*b, bytes, bpc, d_x_blue, + x_blue_1, x_blue_2, x_blue_3, x_blue_4); + y4 = cubicY (ptr_blue_4+2*b, bytes, bpc, d_x_blue, + x_blue_1, x_blue_2, x_blue_3, x_blue_4); + cubicX ((dest+(x-x1)*bytes+2*b), bytes, bpc, d_y_blue, y1, y2, y3, y4); + + y1 = cubicY (ptr_red_1, bytes, bpc, d_x_red, + x_red_1, x_red_2, x_red_3, x_red_4); + y2 = cubicY (ptr_red_2, bytes, bpc, d_x_red, + x_red_1, x_red_2, x_red_3, x_red_4); + y3 = cubicY (ptr_red_3, bytes, bpc, d_x_red, + x_red_1, x_red_2, x_red_3, x_red_4); + y4 = cubicY (ptr_red_4, bytes, bpc, d_x_red, + x_red_1, x_red_2, x_red_3, x_red_4); + cubicX ((dest+(x-x1)*bytes), bytes, bpc, d_y_red, y1, y2, y3, y4); } } @@ -1498,7 +1488,7 @@ fixca_region (FixCaParams *params, set_data (dest, params, x1, y, (x2-x1)); if (show_progress && ((y-y1) % 8 == 0)) - gimp_progress_update((gdouble) (y-y1)/(y2-y1)); + gimp_progress_update ((gdouble) (y-y1)/(y2-y1)); } if (show_progress) @@ -1520,16 +1510,18 @@ static void fixca_help (const gchar *help_id, gpointer help_data) { gimp_message(_("The image to modify is in RGB format. Color precision " - "can be float, double, 8, 16, 32, 64. The green pixels " - "are kept stationary, and you can shift the red and blue " - "colors within a range of {-10..+10} pixels.\n\n" + "can be double, 8, 16, 32 or 64. The green pixels are " + "kept stationary, and you can shift red and blue colors " + "within a range of {-30..+30} pixels.\n\n" "Lateral Chromatic Aberration is due to camera lens(es) " "with no aberration at the lens center, and increasing " - "gradually toward the edges of the image.\n\n" + "gradually toward the edges of the image. Digital cameras " + "may correct for this in software, analog cameras, or " + "adapters may show this in resulting photos or images.\n\n" "Directional X and Y axis aberrations are a flat amount " "of aberration due to image seen through something like " "glass, water, or another medium of different density. " - "You can shift pixels up/left {-10..+10} down/right.\n\n" + "You can shift pixels up/left {-30..+30} down/right.\n\n" "Lateral aberration correction is applied first, since " "the lens(es) are closest to the film or image sensor, " "and directional corrections applied last since this is " diff --git a/org.gimp.extension.fix-ca.metainfo.xml b/org.gimp.extension.fix3-ca.metainfo.xml similarity index 80% rename from org.gimp.extension.fix-ca.metainfo.xml rename to org.gimp.extension.fix3-ca.metainfo.xml index 68cf2d6..19d496d 100644 --- a/org.gimp.extension.fix-ca.metainfo.xml +++ b/org.gimp.extension.fix3-ca.metainfo.xml @@ -1,7 +1,7 @@ - + - org.gimp.extension.fix-ca + org.gimp.extension.fix3-ca org.gimp.GIMP Fix Chromatic Aberration [plug-in to correct Lateral or Directional Chromatic Aberration (CA)] @@ -32,17 +32,16 @@ imagem devido a luz viajando através de materiais densos, como vidro ou água.

- https://github.com/JoesCat/gimp-fix-ca - https://github.com/JoesCat/gimp-fix-ca#readme - https://github.com/JoesCat/gimp-fix-ca/issues + https://github.com/JoesCat/gimp3-fix-ca + https://github.com/JoesCat/gimp3-fix-ca#readme + https://github.com/JoesCat/gimp3-fix-ca/issues CC0-1.0 GPL-3.0+ - - + - org.gimp.GIMP + org.gimp.GIMP fix-ca diff --git a/po/Makefile.am b/po/Makefile.am index 28edee5..3445967 100644 --- a/po/Makefile.am +++ b/po/Makefile.am @@ -1,7 +1,8 @@ LANGUAGES = es fr pt PO_FILES = es.po fr.po pt.po -# Information to help translators +# Information to help translators: +# # To create a new pot file, you need to cd into this po directory first: # cd po; del gimp30-fix-ca.pot; make update-pot # diff --git a/po/es.po b/po/es.po index 416583e..e648592 100644 --- a/po/es.po +++ b/po/es.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: gimp-fix-ca\n" -"Report-Msgid-Bugs-To: https://github.com/JoesCat/gimp-fix-ca/issues\n" -"POT-Creation-Date: 2024-02-17 17:24-0800\n" +"Report-Msgid-Bugs-To: https://github.com/JoesCat/gimp3-fix-ca/issues\n" +"POT-Creation-Date: 2024-05-12 16:27-0700\n" "PO-Revision-Date: 2024-02-19 23:10-0800\n" "Last-Translator: Jose Da Silva \n" "Language-Team: \n" @@ -17,114 +17,265 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../fix-ca.c:159 +#: ../fix-ca.c:198 +#, fuzzy +msgid "Chromatic Aberration..." +msgstr "Aberración Cromática..." + +#: ../fix-ca.c:199 +msgid "/Filters/Colors" +msgstr "/Filters/Colores" + +#: ../fix-ca.c:201 +#, fuzzy +msgid "Fix Chromatic Aberration" +msgstr "Aberración Cromática" + +#: ../fix-ca.c:202 +#, fuzzy msgid "" -"Fix chromatic aberration caused by imperfect lens. It works by shifting red " -"and blue components of image pixels in the specified amounts." +"Fix Chromatic Aberration caused by optical lens (eg: analog cameras, " +"adapters).This plugin works by shifting red and bluepixels in the specified " +"amounts." msgstr "" -"Corrija la aberración cromática causada por lentes imperfectas. Funciona " "desplazando los componentes rojo y azul de los píxeles de la imagen en las " "cantidades especificadas." +"Corrija la aberración cromática causada por lentes imperfectas. Funciona " +"desplazando los componentes rojo y azul de los píxeles de la imagen en las " +"cantidades especificadas." -#: ../fix-ca.c:166 ../fix-ca.c:372 -msgid "Chromatic Aberration" -msgstr "Aberración Cromática" +#: ../fix-ca.c:212 +#, fuzzy +msgid "_Blue-L" +msgstr "_Azul-L" -#: ../fix-ca.c:178 -msgid "/Filters/Colors" -msgstr "/Filters/Colores" +#: ../fix-ca.c:212 +msgid "Blue amount (lateral)" +msgstr "Movimiento azul (lateral)" + +#: ../fix-ca.c:215 +#, fuzzy +msgid "_Red-L" +msgstr "_Rojo-L" + +#: ../fix-ca.c:215 +msgid "Red amount (lateral)" +msgstr "Movimiento rojo (lateral)" + +#: ../fix-ca.c:218 +#, fuzzy +msgid "Lens_X" +msgstr "Lente_X" + +#: ../fix-ca.c:218 +msgid "Lens center X (lateral)" +msgstr "Centro de la lente X (lateral)" + +#: ../fix-ca.c:221 +#, fuzzy +msgid "Lens_Y" +msgstr "Lente_Y" + +#: ../fix-ca.c:221 +msgid "Lens center Y (lateral)" +msgstr "Centro de la lente Y (lateral)" + +#: ../fix-ca.c:224 +#, fuzzy +msgid "_Interpolation" +msgstr "_Interpolación" + +#: ../fix-ca.c:225 +msgid "Interpolation 0=None/1=Linear/2=Cubic" +msgstr "Interpolación 0=Ninguna/1=Lineal/2=Cúbica" + +#: ../fix-ca.c:228 +msgid "B_lue-X" +msgstr "A_zul-X" -#: ../fix-ca.c:314 -msgid "Invalid color type!" -msgstr "¡Tipo de color no válido!:" +#: ../fix-ca.c:228 +msgid "Blue amount, X axis (directional)" +msgstr "Azul mover eje X (direccional)" -#: ../fix-ca.c:406 -msgid "Preview _saturation:" -msgstr "Vista previa _saturación:" +#: ../fix-ca.c:231 +msgid "R_ed-X" +msgstr "R_ojo-X" -#: ../fix-ca.c:418 -msgid "None (Fastest)" -msgstr "Ninguno (Más rápido)" +#: ../fix-ca.c:231 +msgid "Red amount, X axis (directional)" +msgstr "Rojo mover eje X (direccional)" -#: ../fix-ca.c:419 -msgid "Linear" -msgstr "Lineales" +#: ../fix-ca.c:234 +msgid "Bl_ue-Y" +msgstr "Az_ul-Y" -#: ../fix-ca.c:420 -msgid "Cubic (Best)" -msgstr "Cúbica (Mejor)" +#: ../fix-ca.c:234 +msgid "Blue amount, Y axis (directional)" +msgstr "Azul mover eje Y (direccional)" -#: ../fix-ca.c:428 -msgid "_Interpolation:" -msgstr "_Interpolación:" +#: ../fix-ca.c:237 +msgid "Re_d-Y" +msgstr "Ro_jo-Y" -#: ../fix-ca.c:435 +#: ../fix-ca.c:237 +msgid "Red amount, Y axis (directional)" +msgstr "Azul mover eje Y (direccional)" + +#: ../fix-ca.c:274 +#, c-format +msgid "Procedure '%s' only works with one drawable." +msgstr "Procedimiento '%s' solo funciona con un elemento dibujable." + +#: ../fix-ca.c:285 +#, c-format +msgid "Procedure '%s' only works with RGB or RGBA." +msgstr "Procedimiento '%s' solo funciona con RGB o RGBA." + +#: ../fix-ca.c:378 +#, c-format +msgid "Procedure '%s' cannot use this color precision." +msgstr "Procedimiento '%s' no puede utilizar esta precisión de color." + +#: ../fix-ca.c:401 +#, c-format +msgid "Procedure '%s', not enough RAM." +msgstr "Procedimiento '%s', no hay suficiente RAM." + +#: ../fix-ca.c:669 ../fix-ca.c:762 +msgid "Chromatic Aberration" +msgstr "Aberración Cromática" + +#: ../fix-ca.c:679 ../fix-ca.c:803 +msgid "_None (Fastest)" +msgstr "_Ninguno (Más rápido)" + +#: ../fix-ca.c:680 ../fix-ca.c:804 +msgid "L_inear" +msgstr "L_ineales" + +#: ../fix-ca.c:681 ../fix-ca.c:805 +msgid "_Cubic (Best)" +msgstr "Cú_bica (Mejor)" + +#: ../fix-ca.c:699 ../fix-ca.c:817 msgid "Lateral" msgstr "Lateral" -#: ../fix-ca.c:446 +#: ../fix-ca.c:719 +#, fuzzy +msgid "Directional" +msgstr "Direccional" + +#: ../fix-ca.c:766 +msgid "_Cancel" +msgstr "_Cancelar" + +#: ../fix-ca.c:767 +msgid "_OK" +msgstr "_OK" + +#: ../fix-ca.c:787 +#, fuzzy +msgid "_Saturation:" +msgstr "_Saturación:" + +#: ../fix-ca.c:791 +msgid "Saturate colors in preview window to help you see overlaps" +msgstr "Saturar colores en vista previa para ayudarle a ver superposiciones" + +#: ../fix-ca.c:809 +msgid "Method of how to move Blue and Red Pixels" +msgstr "Método de cómo mover píxeles azules y rojos" + +#: ../fix-ca.c:819 +msgid "Do corrections for lens affected chromatic aberration" +msgstr "Hacer correcciones para la aberración cromática afectada por la lente." + +#: ../fix-ca.c:824 msgid "_Blue:" msgstr "_Azul:" -#: ../fix-ca.c:459 +#: ../fix-ca.c:836 msgid "_Red:" msgstr "_Rojo:" -#: ../fix-ca.c:472 +#: ../fix-ca.c:848 msgid "Lens_X:" msgstr "Lente_X:" -#: ../fix-ca.c:485 +#: ../fix-ca.c:860 msgid "Lens_Y:" msgstr "Lente_Y:" -#: ../fix-ca.c:498 +#: ../fix-ca.c:872 msgid "Directional, X axis" msgstr "Direccional, eje X" -#: ../fix-ca.c:509 ../fix-ca.c:545 -msgid "Blue:" -msgstr "Azul:" +#: ../fix-ca.c:874 +msgid "Do flat directional corrections along the X axis" +msgstr "Hacer correcciones direccionales planas en el eje X" -#: ../fix-ca.c:522 ../fix-ca.c:558 -msgid "Red:" -msgstr "Rojo:" +#: ../fix-ca.c:879 +#, fuzzy +msgid "B_lue:" +msgstr "A_zul:" + +#: ../fix-ca.c:891 +msgid "R_ed:" +msgstr "R_ojo:" -#: ../fix-ca.c:534 +#: ../fix-ca.c:903 msgid "Directional, Y axis" msgstr "Direccional, eje Y" -#: ../fix-ca.c:981 +#: ../fix-ca.c:905 +msgid "Do flat directional corrections along the Y axis" +msgstr "Hacer correcciones direccionales planas en el eje Y" + +#: ../fix-ca.c:910 +msgid "Bl_ue:" +msgstr "Az_ul:" + +#: ../fix-ca.c:922 +msgid "Re_d:" +msgstr "Ro_jo:" + +#: ../fix-ca.c:1186 msgid "Shifting pixel components..." msgstr "Moviendo píxeles..." -#: ../fix-ca.c:1310 +#: ../fix-ca.c:1514 +#, fuzzy msgid "" -"The image to modify is in RGB format. Color precision can be float, double, " -"8, 16, 32, 64. The green pixels are kept stationary, and you can shift the " -"red and blue colors within a range of {-10..+10} pixels.\n" +"The image to modify is in RGB format. Color precision can be double, 8, 16, " +"32 or 64. The green pixels are kept stationary, and you can shift red and " +"blue colors within a range of {-30..+30} pixels.\n" "\n" "Lateral Chromatic Aberration is due to camera lens(es) with no aberration at " -"the lens center, and increasing gradually toward the edges of the image.\n" +"the lens center, and increasing gradually toward the edges of the image. " +"Digital cameras may correct for this in software, analog cameras, or " +"adapters may show this in resulting photos or images.\n" "\n" "Directional X and Y axis aberrations are a flat amount of aberration due to " "image seen through something like glass, water, or another medium of " -"different density. You can shift pixels up/left {-10..+10} down/right.\n" +"different density. You can shift pixels up/left {-30..+30} down/right.\n" "\n" "Lateral aberration correction is applied first, since the lens(es) are " "closest to the film or image sensor, and directional corrections applied " "last since this is the furthest away from the camera." msgstr "" "La imagen a modificar está en formato RGB. La precisión del color puede ser " -"flotante, doble, 8, 16, 32, 64. Los píxeles verdes se mantienen estacionarios y" -"puede cambiar los colores rojo y azul dentro de un rango de {-10..+10} píxeles.\n" +"doble, 8, 16, 32, 64. Los píxeles verdes se mantienen " +"estacionarios ypuede cambiar los colores rojo y azul dentro de un rango de " +"{-30..+30} píxeles.\n" "\n" "La aberración cromática lateral se debe a lentes de cámara sin aberración " "en el centro de la lente y que aumenta gradualmente hacia los bordes de la " -"imagen.\n" +"imagen. Las cámaras digitales pueden corregir esto en el software, las cámaras " +"analógicas o los adaptadores pueden mostrar esto en las fotografías o imágenes " "resultantes.\n" "\n" "Las aberraciones direccionales de los ejes X e Y son una cantidad fija de " "aberración debida a la imagen vista a través de algo como vidrio, agua u " -"otro medio de diferente densidad. Puede desplazar los píxeles hacia " -"arriba/izquierda {-10..+10} abajo/derecha.\n" +"otro medio de diferente densidad. Puede desplazar los píxeles hacia arriba/" +"izquierda {-30..+30} abajo/derecha.\n" "\n" "La corrección de la aberración lateral se aplica primero, ya que las lentes " "están más cercanas a la película o al sensor de imagen, y las correcciones " diff --git a/po/fr.po b/po/fr.po index 33e09d7..a96b360 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: gimp-fix-ca\n" -"Report-Msgid-Bugs-To: https://github.com/JoesCat/gimp-fix-ca/issues\n" -"POT-Creation-Date: 2024-02-17 17:24-0800\n" +"Report-Msgid-Bugs-To: https://github.com/JoesCat/gimp3-fix-ca/issues\n" +"POT-Creation-Date: 2024-05-12 16:27-0700\n" "PO-Revision-Date: 2024-02-19 21:00-0800\n" "Last-Translator: Jose Da Silva \n" "Language-Team: \n" @@ -17,99 +17,246 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../fix-ca.c:159 +#: ../fix-ca.c:198 +#, fuzzy +msgid "Chromatic Aberration..." +msgstr "Aberration Chromatique..." + +#: ../fix-ca.c:199 +msgid "/Filters/Colors" +msgstr "/Filters/Couleur" + +#: ../fix-ca.c:201 +#, fuzzy +msgid "Fix Chromatic Aberration" +msgstr "Aberration Chromatique" + +#: ../fix-ca.c:202 +#, fuzzy msgid "" -"Fix chromatic aberration caused by imperfect lens. It works by shifting red " -"and blue components of image pixels in the specified amounts." +"Fix Chromatic Aberration caused by optical lens (eg: analog cameras, " +"adapters).This plugin works by shifting red and bluepixels in the specified " +"amounts." msgstr "" "Corrige l'aberration chromatique causée par un objectif imparfait. Il " "fonctionne en décalant les composants rouges et bleus des pixels de l'image " "dans les quantités spécifiées." -#: ../fix-ca.c:166 ../fix-ca.c:372 -msgid "Chromatic Aberration" -msgstr "Aberration Chromatique" +#: ../fix-ca.c:212 +#, fuzzy +msgid "_Blue-L" +msgstr "_Bleue-L" -#: ../fix-ca.c:178 -msgid "/Filters/Colors" -msgstr "/Filters/Couleur" +#: ../fix-ca.c:212 +msgid "Blue amount (lateral)" +msgstr "Mouvement bleue (latéral)" + +#: ../fix-ca.c:215 +#, fuzzy +msgid "_Red-L" +msgstr "_Rouge-L" + +#: ../fix-ca.c:215 +msgid "Red amount (lateral)" +msgstr "Mouvement rouge (latéral)" + +#: ../fix-ca.c:218 +#, fuzzy +msgid "Lens_X" +msgstr "Lentille_X" + +#: ../fix-ca.c:218 +msgid "Lens center X (lateral)" +msgstr "Centre de la lentille X (latéral)" + +#: ../fix-ca.c:221 +#, fuzzy +msgid "Lens_Y" +msgstr "Lentille_Y" + +#: ../fix-ca.c:221 +msgid "Lens center Y (lateral)" +msgstr "Centre de la lentille Y (latéral)" + +#: ../fix-ca.c:224 +#, fuzzy +msgid "_Interpolation" +msgstr "_Interpolation" + +#: ../fix-ca.c:225 +msgid "Interpolation 0=None/1=Linear/2=Cubic" +msgstr "Interpolation 0=Aucune/1=Linéaire/2=Cubique" + +#: ../fix-ca.c:228 +msgid "B_lue-X" +msgstr "B_leue-X" + +#: ../fix-ca.c:228 +msgid "Blue amount, X axis (directional)" +msgstr "Quantité de bleue, axe X (directionnel)" -#: ../fix-ca.c:314 -msgid "Invalid color type!" -msgstr "Type de couleur invalide!" +#: ../fix-ca.c:231 +msgid "R_ed-X" +msgstr "R_ouge-X" -#: ../fix-ca.c:406 -msgid "Preview _saturation:" -msgstr "Aperçu _saturation:" +#: ../fix-ca.c:231 +msgid "Red amount, X axis (directional)" +msgstr "Quantité de rouge, axe X (directionnel)" -#: ../fix-ca.c:418 -msgid "None (Fastest)" -msgstr "Aucun (Rapide)" +#: ../fix-ca.c:234 +msgid "Bl_ue-Y" +msgstr "Bl_eue-Y" -#: ../fix-ca.c:419 -msgid "Linear" -msgstr "Linéaire" +#: ../fix-ca.c:234 +msgid "Blue amount, Y axis (directional)" +msgstr "Quantité de bleue, axe Y (directionnel)" -#: ../fix-ca.c:420 -msgid "Cubic (Best)" -msgstr "Cubiques (Meilleur)" +#: ../fix-ca.c:237 +msgid "Re_d-Y" +msgstr "Ro_uge-Y" -#: ../fix-ca.c:428 -msgid "_Interpolation:" -msgstr "_Interpolation:" +#: ../fix-ca.c:237 +msgid "Red amount, Y axis (directional)" +msgstr "Quantité de rouge, axe Y (directionnel)" -#: ../fix-ca.c:435 +#: ../fix-ca.c:274 +#, c-format +msgid "Procedure '%s' only works with one drawable." +msgstr "Procédure '%s' ne fonctionne qu'avec RGB ou RGBA." + +#: ../fix-ca.c:285 +#, c-format +msgid "Procedure '%s' only works with RGB or RGBA." +msgstr "" + +#: ../fix-ca.c:378 +#, c-format +msgid "Procedure '%s' cannot use this color precision." +msgstr "Procédure '%s' ne peut pas utiliser cette précision de couleur." + +#: ../fix-ca.c:401 +#, c-format +msgid "Procedure '%s', not enough RAM." +msgstr "Procédure '%s', pas assez de RAM." + +#: ../fix-ca.c:669 ../fix-ca.c:762 +msgid "Chromatic Aberration" +msgstr "Aberration Chromatique" + +#: ../fix-ca.c:679 ../fix-ca.c:803 +msgid "_None (Fastest)" +msgstr "Aucu_n (Rapide)" + +#: ../fix-ca.c:680 ../fix-ca.c:804 +msgid "L_inear" +msgstr "L_inéaire" + +#: ../fix-ca.c:681 ../fix-ca.c:805 +msgid "_Cubic (Best)" +msgstr "_Cubiques (Meilleur)" + +#: ../fix-ca.c:699 ../fix-ca.c:817 msgid "Lateral" msgstr "Latérale" -#: ../fix-ca.c:446 +#: ../fix-ca.c:719 +#, fuzzy +msgid "Directional" +msgstr "Directionnel" + +#: ../fix-ca.c:766 +msgid "_Cancel" +msgstr "_Fermer" + +#: ../fix-ca.c:767 +msgid "_OK" +msgstr "_OK" + +#: ../fix-ca.c:787 +#, fuzzy +msgid "_Saturation:" +msgstr "Sa_turation:" + +#: ../fix-ca.c:791 +msgid "Saturate colors in preview window to help you see overlaps" +msgstr "Saturez les couleurs pour aider à voir les bords" + +#: ../fix-ca.c:809 +msgid "Method of how to move Blue and Red Pixels" +msgstr "Méthode de déplacement des pixels bleus et rouges" + +#: ../fix-ca.c:819 +msgid "Do corrections for lens affected chromatic aberration" +msgstr "Effectuer des corrections pour l'aberration chromatique affectée par la lentille optique" + +#: ../fix-ca.c:824 msgid "_Blue:" msgstr "_Bleue:" -#: ../fix-ca.c:459 +#: ../fix-ca.c:836 msgid "_Red:" msgstr "_Rouge:" -#: ../fix-ca.c:472 +#: ../fix-ca.c:848 msgid "Lens_X:" msgstr "Lentille_X:" -#: ../fix-ca.c:485 +#: ../fix-ca.c:860 msgid "Lens_Y:" msgstr "Lentille_Y:" -#: ../fix-ca.c:498 +#: ../fix-ca.c:872 msgid "Directional, X axis" msgstr "Directionnel, axe X" -#: ../fix-ca.c:509 ../fix-ca.c:545 -msgid "Blue:" -msgstr "Bleue:" +#: ../fix-ca.c:874 +msgid "Do flat directional corrections along the X axis" +msgstr "Effectuer des corrections sur l'axe X" -#: ../fix-ca.c:522 ../fix-ca.c:558 -msgid "Red:" -msgstr "Rouge:" +#: ../fix-ca.c:879 +#, fuzzy +msgid "B_lue:" +msgstr "B_leue:" -#: ../fix-ca.c:534 +#: ../fix-ca.c:891 +msgid "R_ed:" +msgstr "R_ouge:" + +#: ../fix-ca.c:903 msgid "Directional, Y axis" msgstr "Directionnel, axe Y" -#: ../fix-ca.c:981 +#: ../fix-ca.c:905 +msgid "Do flat directional corrections along the Y axis" +msgstr "Effectuer des corrections sur l'axe Y" + +#: ../fix-ca.c:910 +msgid "Bl_ue:" +msgstr "Bl_eue:" + +#: ../fix-ca.c:922 +msgid "Re_d:" +msgstr "Ro_uge:" + +#: ../fix-ca.c:1186 msgid "Shifting pixel components..." msgstr "Déplacement des pixels..." -#: ../fix-ca.c:1310 +#: ../fix-ca.c:1514 +#, fuzzy msgid "" -"The image to modify is in RGB format. Color precision can be float, double, " -"8, 16, 32, 64. The green pixels are kept stationary, and you can shift the " -"red and blue colors within a range of {-10..+10} pixels.\n" +"The image to modify is in RGB format. Color precision can be double, 8, 16, " +"32 or 64. The green pixels are kept stationary, and you can shift red and " +"blue colors within a range of {-30..+30} pixels.\n" "\n" "Lateral Chromatic Aberration is due to camera lens(es) with no aberration at " -"the lens center, and increasing gradually toward the edges of the image.\n" +"the lens center, and increasing gradually toward the edges of the image. " +"Digital cameras may correct for this in software, analog cameras, or " +"adapters may show this in resulting photos or images.\n" "\n" "Directional X and Y axis aberrations are a flat amount of aberration due to " "image seen through something like glass, water, or another medium of " -"different density. You can shift pixels up/left {-10..+10} down/right.\n" +"different density. You can shift pixels up/left {-30..+30} down/right.\n" "\n" "Lateral aberration correction is applied first, since the lens(es) are " "closest to the film or image sensor, and directional corrections applied " @@ -117,19 +264,21 @@ msgid "" msgstr "" "L'image à modifier est au format RVB. La précision des couleurs peut être " "flottante, double, 8, 16, 32, 64. Les pixels verts restent stationnaires et " -"vous pouvez décaler les couleurs rouge et bleue dans une plage de {-10..+10} " "pixels.\n" +"vous pouvez décaler les couleurs rouge et bleue dans une plage de {-30..+30} " +"pixels.\n" "\n" "L'aberration chromatique latérale est due aux objectifs de l'appareil photo " "sans aberration au centre de l'objectif et augmentant progressivement vers " -"les bords de l'image.\n" +"les bords de l'image. Les appareils photo numériques peuvent corriger cela " +"dans un logiciel, les appareils photo analogiques ou les adaptateurs peuvent " +"l'afficher dans les photos ou images résultantes.\n" "\n" "Les aberrations directionnelles des axes X et Y sont une quantité plate " "d'aberration due à une image vue à travers quelque chose comme le verre, " "l'eau ou un autre milieu de densité différente. Vous pouvez déplacer les " -"pixels vers le haut/gauche {-10..+10} vers le bas/droite.\n" +"pixels vers le haut/gauche {-30..+30} vers le bas/droite.\n" "\n" -"La correction des aberrations latérales est appliquée en premier, puisque " -"le ou les objectif(s) sont les plus proches du film ou du capteur d'image, " -"et les corrections directionnelles sont appliquées en dernier puisque " -"celui-ci est le plus éloigné de l'appareil photo." - +"La correction des aberrations latérales est appliquée en premier, puisque le " +"ou les objectif(s) sont les plus proches du film ou du capteur d'image, et " +"les corrections directionnelles sont appliquées en dernier puisque celui-ci " +"est le plus éloigné de l'appareil photo." diff --git a/po/gimp20-fix-ca.pot b/po/gimp20-fix-ca.pot deleted file mode 100644 index a662fb6..0000000 --- a/po/gimp20-fix-ca.pot +++ /dev/null @@ -1,114 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: https://github.com/JoesCat/gimp-fix-ca/issues\n" -"POT-Creation-Date: 2024-02-17 17:24-0800\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../fix-ca.c:159 -msgid "" -"Fix chromatic aberration caused by imperfect lens. It works by shifting red " -"and blue components of image pixels in the specified amounts." -msgstr "" - -#: ../fix-ca.c:166 ../fix-ca.c:372 -msgid "Chromatic Aberration" -msgstr "" - -#: ../fix-ca.c:178 -msgid "/Filters/Colors" -msgstr "" - -#: ../fix-ca.c:314 -msgid "Invalid color type!" -msgstr "" - -#: ../fix-ca.c:406 -msgid "Preview _saturation:" -msgstr "" - -#: ../fix-ca.c:418 -msgid "None (Fastest)" -msgstr "" - -#: ../fix-ca.c:419 -msgid "Linear" -msgstr "" - -#: ../fix-ca.c:420 -msgid "Cubic (Best)" -msgstr "" - -#: ../fix-ca.c:428 -msgid "_Interpolation:" -msgstr "" - -#: ../fix-ca.c:435 -msgid "Lateral" -msgstr "" - -#: ../fix-ca.c:446 -msgid "_Blue:" -msgstr "" - -#: ../fix-ca.c:459 -msgid "_Red:" -msgstr "" - -#: ../fix-ca.c:472 -msgid "Lens_X:" -msgstr "" - -#: ../fix-ca.c:485 -msgid "Lens_Y:" -msgstr "" - -#: ../fix-ca.c:498 -msgid "Directional, X axis" -msgstr "" - -#: ../fix-ca.c:509 ../fix-ca.c:545 -msgid "Blue:" -msgstr "" - -#: ../fix-ca.c:522 ../fix-ca.c:558 -msgid "Red:" -msgstr "" - -#: ../fix-ca.c:534 -msgid "Directional, Y axis" -msgstr "" - -#: ../fix-ca.c:981 -msgid "Shifting pixel components..." -msgstr "" - -#: ../fix-ca.c:1310 -msgid "" -"The image to modify is in RGB format. Color precision can be float, double, " -"8, 16, 32, 64. The green pixels are kept stationary, and you can shift the " -"red and blue colors within a range of {-10..+10} pixels.\n" -"\n" -"Lateral Chromatic Aberration is due to camera lens(es) with no aberration at " -"the lens center, and increasing gradually toward the edges of the image.\n" -"\n" -"Directional X and Y axis aberrations are a flat amount of aberration due to " -"image seen through something like glass, water, or another medium of " -"different density. You can shift pixels up/left {-10..+10} down/right.\n" -"\n" -"Lateral aberration correction is applied first, since the lens(es) are " -"closest to the film or image sensor, and directional corrections applied " -"last since this is the furthest away from the camera." -msgstr "" diff --git a/po/gimp30-fix-ca.pot b/po/gimp30-fix-ca.pot new file mode 100644 index 0000000..c06f464 --- /dev/null +++ b/po/gimp30-fix-ca.pot @@ -0,0 +1,249 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: https://github.com/JoesCat/gimp3-fix-ca/issues\n" +"POT-Creation-Date: 2024-05-13 15:46-0700\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../fix-ca.c:198 +msgid "Chromatic Aberration..." +msgstr "" + +#: ../fix-ca.c:199 +msgid "/Filters/Colors" +msgstr "" + +#: ../fix-ca.c:201 +msgid "Fix Chromatic Aberration" +msgstr "" + +#: ../fix-ca.c:202 +msgid "" +"Fix Chromatic Aberration caused by optical lens (eg: analog cameras, " +"adapters).This plugin works by shifting red and bluepixels in the specified " +"amounts." +msgstr "" + +#: ../fix-ca.c:212 +msgid "_Blue" +msgstr "" + +#: ../fix-ca.c:212 +msgid "Blue amount (lateral)" +msgstr "" + +#: ../fix-ca.c:215 +msgid "_Red" +msgstr "" + +#: ../fix-ca.c:215 +msgid "Red amount (lateral)" +msgstr "" + +#: ../fix-ca.c:218 +msgid "lens_X" +msgstr "" + +#: ../fix-ca.c:218 +msgid "Lens center X (lateral)" +msgstr "" + +#: ../fix-ca.c:221 +msgid "lens_Y" +msgstr "" + +#: ../fix-ca.c:221 +msgid "Lens center Y (lateral)" +msgstr "" + +#: ../fix-ca.c:224 +msgid "_Interpolation" +msgstr "" + +#: ../fix-ca.c:225 +msgid "Interpolation 0=None/1=Linear/2=Cubic" +msgstr "" + +#: ../fix-ca.c:228 +msgid "X B_lue" +msgstr "" + +#: ../fix-ca.c:228 +msgid "Blue amount, X axis (directional)" +msgstr "" + +#: ../fix-ca.c:231 +msgid "X R_ed" +msgstr "" + +#: ../fix-ca.c:231 +msgid "Red amount, X axis (directional)" +msgstr "" + +#: ../fix-ca.c:234 +msgid "Y Bl_ue" +msgstr "" + +#: ../fix-ca.c:234 +msgid "Blue amount, Y axis (directional)" +msgstr "" + +#: ../fix-ca.c:237 +msgid "Y Re_d" +msgstr "" + +#: ../fix-ca.c:237 +msgid "Red amount, Y axis (directional)" +msgstr "" + +#: ../fix-ca.c:274 +#, c-format +msgid "Procedure '%s' only works with one drawable." +msgstr "" + +#: ../fix-ca.c:285 +#, c-format +msgid "Procedure '%s' only works with RGB or RGBA." +msgstr "" + +#: ../fix-ca.c:378 +#, c-format +msgid "Procedure '%s' cannot use this color precision." +msgstr "" + +#: ../fix-ca.c:401 +#, c-format +msgid "Procedure '%s', not enough RAM." +msgstr "" + +#: ../fix-ca.c:669 ../fix-ca.c:762 +msgid "Chromatic Aberration" +msgstr "" + +#: ../fix-ca.c:679 ../fix-ca.c:803 +msgid "None (Fastest)" +msgstr "" + +#: ../fix-ca.c:680 ../fix-ca.c:804 +msgid "Linear" +msgstr "" + +#: ../fix-ca.c:681 ../fix-ca.c:805 +msgid "Cubic (Best)" +msgstr "" + +#: ../fix-ca.c:699 ../fix-ca.c:817 +msgid "Lateral" +msgstr "" + +#: ../fix-ca.c:719 +msgid "Directional" +msgstr "" + +#: ../fix-ca.c:766 +msgid "_Cancel" +msgstr "" + +#: ../fix-ca.c:767 +msgid "_OK" +msgstr "" + +#: ../fix-ca.c:787 +msgid "_Saturation:" +msgstr "" + +#: ../fix-ca.c:791 +msgid "Saturate colors in preview window to help you see overlaps" +msgstr "" + +#: ../fix-ca.c:809 +msgid "Method of how to move Blue and Red Pixels" +msgstr "" + +#: ../fix-ca.c:819 +msgid "Do corrections for lens affected chromatic aberration" +msgstr "" + +#: ../fix-ca.c:824 +msgid "_Blue:" +msgstr "" + +#: ../fix-ca.c:836 +msgid "_Red:" +msgstr "" + +#: ../fix-ca.c:848 +msgid "Lens_X:" +msgstr "" + +#: ../fix-ca.c:860 +msgid "Lens_Y:" +msgstr "" + +#: ../fix-ca.c:872 +msgid "Directional, X axis" +msgstr "" + +#: ../fix-ca.c:874 +msgid "Do flat directional corrections along the X axis" +msgstr "" + +#: ../fix-ca.c:879 +msgid "B_lue:" +msgstr "" + +#: ../fix-ca.c:891 +msgid "R_ed:" +msgstr "" + +#: ../fix-ca.c:903 +msgid "Directional, Y axis" +msgstr "" + +#: ../fix-ca.c:905 +msgid "Do flat directional corrections along the Y axis" +msgstr "" + +#: ../fix-ca.c:910 +msgid "Bl_ue:" +msgstr "" + +#: ../fix-ca.c:922 +msgid "Re_d:" +msgstr "" + +#: ../fix-ca.c:1186 +msgid "Shifting pixel components..." +msgstr "" + +#: ../fix-ca.c:1514 +msgid "" +"The image to modify is in RGB format. Color precision can be double, 8, 16, " +"32 or 64. The green pixels are kept stationary, and you can shift red and " +"blue colors within a range of {-30..+30} pixels.\n" +"\n" +"Lateral Chromatic Aberration is due to camera lens(es) with no aberration at " +"the lens center, and increasing gradually toward the edges of the image. " +"Digital cameras may correct for this in software, analog cameras, or " +"adapters may show this in resulting photos or images.\n" +"\n" +"Directional X and Y axis aberrations are a flat amount of aberration due to " +"image seen through something like glass, water, or another medium of " +"different density. You can shift pixels up/left {-30..+30} down/right.\n" +"\n" +"Lateral aberration correction is applied first, since the lens(es) are " +"closest to the film or image sensor, and directional corrections applied " +"last since this is the furthest away from the camera." +msgstr "" diff --git a/po/pt.po b/po/pt.po index 87651dd..0dd5f43 100644 --- a/po/pt.po +++ b/po/pt.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: gimp-fix-ca\n" -"Report-Msgid-Bugs-To: https://github.com/JoesCat/gimp-fix-ca/issues\n" -"POT-Creation-Date: 2024-02-17 17:24-0800\n" +"Report-Msgid-Bugs-To: https://github.com/JoesCat/gimp3-fix-ca/issues\n" +"POT-Creation-Date: 2024-05-12 16:27-0700\n" "PO-Revision-Date: 2024-02-17 17:24-0800\n" "Last-Translator: Jose Da Silva \n" "Language-Team: \n" @@ -17,116 +17,265 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../fix-ca.c:159 +#: ../fix-ca.c:198 +#, fuzzy +msgid "Chromatic Aberration..." +msgstr "Aberração Cromática..." + +#: ../fix-ca.c:199 +msgid "/Filters/Colors" +msgstr "/Filters/Cors" + +#: ../fix-ca.c:201 +#, fuzzy +msgid "Fix Chromatic Aberration" +msgstr "Aberração Cromática" + +#: ../fix-ca.c:202 +#, fuzzy msgid "" -"Fix chromatic aberration caused by imperfect lens. It works by shifting red " -"and blue components of image pixels in the specified amounts." +"Fix Chromatic Aberration caused by optical lens (eg: analog cameras, " +"adapters).This plugin works by shifting red and bluepixels in the specified " +"amounts." msgstr "" "Corrija a aberração cromática causada por lentes imperfeitas. Funciona " "movendo pixels vermelhos e azuis na imagem." -#: ../fix-ca.c:166 ../fix-ca.c:372 -msgid "Chromatic Aberration" -msgstr "Aberração Cromática" +#: ../fix-ca.c:212 +#, fuzzy +msgid "_Blue-L" +msgstr "_Azul-L" -#: ../fix-ca.c:178 -msgid "/Filters/Colors" -msgstr "/Filters/Cors" +#: ../fix-ca.c:212 +msgid "Blue amount (lateral)" +msgstr "Movimento azul (lateral)" + +#: ../fix-ca.c:215 +#, fuzzy +msgid "_Red-L" +msgstr "_Vermelho-L" + +#: ../fix-ca.c:215 +msgid "Red amount (lateral)" +msgstr "Movimento vermelho (lateral)" + +#: ../fix-ca.c:218 +#, fuzzy +msgid "Lens_X" +msgstr "Lente_X" + +#: ../fix-ca.c:218 +msgid "Lens center X (lateral)" +msgstr "Centro da lente X (lateral)" + +#: ../fix-ca.c:221 +#, fuzzy +msgid "Lens_Y" +msgstr "Lente_Y" + +#: ../fix-ca.c:221 +msgid "Lens center Y (lateral)" +msgstr "Centro da lente Y (lateral)" + +#: ../fix-ca.c:224 +#, fuzzy +msgid "_Interpolation" +msgstr "_Interpolação" + +#: ../fix-ca.c:225 +msgid "Interpolation 0=None/1=Linear/2=Cubic" +msgstr "Interpolação 0=Nenhum/1=Linear/2=Cúbico" + +#: ../fix-ca.c:228 +msgid "B_lue-X" +msgstr "A_zul-X" -#: ../fix-ca.c:314 -msgid "Invalid color type!" -msgstr "Tipo de cor inválido!" +#: ../fix-ca.c:228 +msgid "Blue amount, X axis (directional)" +msgstr "Quantidade de azul, eixo X (direcional)" -#: ../fix-ca.c:406 -msgid "Preview _saturation:" -msgstr "Visualizar _saturação:" +#: ../fix-ca.c:231 +msgid "R_ed-X" +msgstr "V_ermelho-X" -#: ../fix-ca.c:418 -msgid "None (Fastest)" -msgstr "Nenhum (Rápido)" +#: ../fix-ca.c:231 +msgid "Red amount, X axis (directional)" +msgstr "Quantidade de vermelho, eixo X (direcional)" -#: ../fix-ca.c:419 -msgid "Linear" -msgstr "Linear" +#: ../fix-ca.c:234 +msgid "Bl_ue-Y" +msgstr "Az_ul-Y" -#: ../fix-ca.c:420 -msgid "Cubic (Best)" -msgstr "Cúbico (Melhor)" +#: ../fix-ca.c:234 +msgid "Blue amount, Y axis (directional)" +msgstr "Quantidade de azul, eixo Y (direcional)" -#: ../fix-ca.c:428 -msgid "_Interpolation:" -msgstr "_Interpolação:" +#: ../fix-ca.c:237 +msgid "Re_d-Y" +msgstr "Ve_rmelho-Y" -#: ../fix-ca.c:435 +#: ../fix-ca.c:237 +msgid "Red amount, Y axis (directional)" +msgstr "Quantidade de vermelho, eixo Y (direcional)" + +#: ../fix-ca.c:274 +#, c-format +msgid "Procedure '%s' only works with one drawable." +msgstr "Procedimento '%s' só funciona com um drawable." + +#: ../fix-ca.c:285 +#, c-format +msgid "Procedure '%s' only works with RGB or RGBA." +msgstr "Procedimento '%s' só funciona com RGB ou RGBA." + +#: ../fix-ca.c:378 +#, c-format +msgid "Procedure '%s' cannot use this color precision." +msgstr "Procedimento '%s' não pode usar esta precisão de cor." + +#: ../fix-ca.c:401 +#, c-format +msgid "Procedure '%s', not enough RAM." +msgstr "Procedimento '%s', RAM insuficiente." + +#: ../fix-ca.c:669 ../fix-ca.c:762 +msgid "Chromatic Aberration" +msgstr "Aberração Cromática" + +#: ../fix-ca.c:679 ../fix-ca.c:803 +msgid "_None (Fastest)" +msgstr "_Nenhum (Rápido)" + +#: ../fix-ca.c:680 ../fix-ca.c:804 +msgid "L_inear" +msgstr "L_inear" + +#: ../fix-ca.c:681 ../fix-ca.c:805 +msgid "_Cubic (Best)" +msgstr "_Cúbico (Melhor)" + +#: ../fix-ca.c:699 ../fix-ca.c:817 msgid "Lateral" msgstr "Lateral" -#: ../fix-ca.c:446 +#: ../fix-ca.c:719 +#, fuzzy +msgid "Directional" +msgstr "Direcional" + +#: ../fix-ca.c:766 +msgid "_Cancel" +msgstr "_Fechar" + +#: ../fix-ca.c:767 +msgid "_OK" +msgstr "_OK" + +#: ../fix-ca.c:787 +#, fuzzy +msgid "_Saturation:" +msgstr "_Saturação:" + +#: ../fix-ca.c:791 +msgid "Saturate colors in preview window to help you see overlaps" +msgstr "Sature as cores para ajudá-lo a ver as bordas" + +#: ../fix-ca.c:809 +msgid "Method of how to move Blue and Red Pixels" +msgstr "Método de mover pixels azuis e vermelhos" + +#: ../fix-ca.c:819 +msgid "Do corrections for lens affected chromatic aberration" +msgstr "Faça correções para a aberração cromática afetada pela lente" + +#: ../fix-ca.c:824 msgid "_Blue:" msgstr "_Azul:" -#: ../fix-ca.c:459 +#: ../fix-ca.c:836 msgid "_Red:" -msgstr "_Vermelha:" +msgstr "_Vermelho:" -#: ../fix-ca.c:472 +#: ../fix-ca.c:848 msgid "Lens_X:" msgstr "Lente_X:" -#: ../fix-ca.c:485 +#: ../fix-ca.c:860 msgid "Lens_Y:" msgstr "Lente_Y:" -#: ../fix-ca.c:498 +#: ../fix-ca.c:872 msgid "Directional, X axis" msgstr "Direcional, eixo X" -#: ../fix-ca.c:509 ../fix-ca.c:545 -msgid "Blue:" -msgstr "Azul:" +#: ../fix-ca.c:874 +msgid "Do flat directional corrections along the X axis" +msgstr "Faça correções direcionais no eixo X" -#: ../fix-ca.c:522 ../fix-ca.c:558 -msgid "Red:" -msgstr "Vermelha:" +#: ../fix-ca.c:879 +#, fuzzy +msgid "B_lue:" +msgstr "A_zul:" -#: ../fix-ca.c:534 +#: ../fix-ca.c:891 +msgid "R_ed:" +msgstr "V_ermelho:" + +#: ../fix-ca.c:903 msgid "Directional, Y axis" msgstr "Direcional, eixo Y" -#: ../fix-ca.c:981 +#: ../fix-ca.c:905 +msgid "Do flat directional corrections along the Y axis" +msgstr "Faça correções direcionais no eixo Y" + +#: ../fix-ca.c:910 +msgid "Bl_ue:" +msgstr "Az_ul:" + +#: ../fix-ca.c:922 +msgid "Re_d:" +msgstr "Ve_rmelho:" + +#: ../fix-ca.c:1186 msgid "Shifting pixel components..." msgstr "Mudando pixels de cor..." -#: ../fix-ca.c:1310 +#: ../fix-ca.c:1514 +#, fuzzy msgid "" -"The image to modify is in RGB format. Color precision can be float, double, " -"8, 16, 32, 64. The green pixels are kept stationary, and you can shift the " -"red and blue colors within a range of {-10..+10} pixels.\n" +"The image to modify is in RGB format. Color precision can be double, 8, 16, " +"32 or 64. The green pixels are kept stationary, and you can shift red and " +"blue colors within a range of {-30..+30} pixels.\n" "\n" "Lateral Chromatic Aberration is due to camera lens(es) with no aberration at " -"the lens center, and increasing gradually toward the edges of the image.\n" +"the lens center, and increasing gradually toward the edges of the image. " +"Digital cameras may correct for this in software, analog cameras, or " +"adapters may show this in resulting photos or images.\n" "\n" "Directional X and Y axis aberrations are a flat amount of aberration due to " "image seen through something like glass, water, or another medium of " -"different density. You can shift pixels up/left {-10..+10} down/right.\n" +"different density. You can shift pixels up/left {-30..+30} down/right.\n" "\n" "Lateral aberration correction is applied first, since the lens(es) are " "closest to the film or image sensor, and directional corrections applied " "last since this is the furthest away from the camera." msgstr "" -"A imagem a modificar está no formato RGB. A precisão da cor pode ser flutuante, " -"dupla, 8, 16, 32, 64. Os pixels verdes são mantidos estacionários e você pode " -"mudar as cores vermelha e azul dentro de um intervalo de {-10..+10} pixels.\n" +"A imagem a modificar está no formato RGB. A precisão da cor pode ser " +"dupla, 8, 16, 32, 64. Os pixels verdes são mantidos estacionários " +"e você pode mudar as cores vermelha e azul dentro de um intervalo de {-30.." +"+30} pixels.\n" "\n" -"A aberração cromática lateral ocorre devido às lentes da câmera sem aberração " -"no centro da lente e aumentando gradualmente em direção às bordas da imagem.\n" +"A Aberração Cromática Lateral é devida a lentes de câmera sem aberração no " +"centro da lente e aumentando gradualmente em direção às bordas da imagem. " +"As câmeras digitais podem corrigir isso no software, as câmeras analógicas " +"ou os adaptadores podem mostrar isso nas fotos ou imagens resultantes.\n" "\n" "As aberrações direcionais dos eixos X e Y são uma quantidade fixa de " "aberração devido à imagem vista através de algo como vidro, água ou outro " "meio de densidade diferente. Você pode deslocar pixels para cima/esquerda " -"{-10..+10} para baixo/direita.\n" +"{-30..+30} para baixo/direita.\n" "\n" "A correção da aberração lateral é aplicada primeiro, pois a lente está mais " -"próxima do filme ou sensor de imagem, e as correções direcionais são aplicadas " -"por último, pois está mais distante da câmera." - +"próxima do filme ou sensor de imagem, e as correções direcionais são " +"aplicadas por último, pois está mais distante da câmera." diff --git a/rpm/gimp-fix-ca.spec.in b/rpm/gimp3-fix-ca.spec.in similarity index 50% rename from rpm/gimp-fix-ca.spec.in rename to rpm/gimp3-fix-ca.spec.in index a144512..45584d8 100644 --- a/rpm/gimp-fix-ca.spec.in +++ b/rpm/gimp3-fix-ca.spec.in @@ -1,31 +1,30 @@ # -# spec file for package gimp plugin fix-ca +# spec file for package gimp3-fix-ca plugin # -%define moname gimp20-fix-ca -%define plugindir %{_libdir}/gimp/2.0/plug-ins/fix-ca +%define moname gimp30-fix-ca +%define plugindir %{_libdir}/gimp/3.0/plug-ins/fix-ca Name: @FIX_CA_PACKAGE_NAME@ Version: @FIX_CA_VERSION@ Release: 0 -Summary: A Gimp2 plugin for correcting Chromatic Aberration (CA) +Summary: A Gimp3 plugin for correcting Chromatic Aberration (CA) License: GPLv3+ Group: Graphics/Editors and Converters -URL: https://github.com/JoesCat/gimp-fix-ca -Source0: https://github.com/JoesCat/gimp-fix-ca/releases/download/%{version}/%{name}-%{version}.tar.gz +URL: https://github.com/JoesCat/gimp3-fix-ca +Source0: https://github.com/JoesCat/gimp3-fix-ca/releases/download/%{version}/%{name}-%{version}.tar.gz BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc BuildRequires: make BuildRequires: gettext-devel -BuildRequires: gtk+2-devel -BuildRequires: pkgconfig(gimp-2.0) -Requires: gimp >= 2.10.0 +BuildRequires: gtk+3-devel +BuildRequires: pkgconfig(gimp-3.0) %description -A Gimp2 plug-in to correct Chromatic Aberration (CA). -Fix-CA can fix Lateral CA caused due to light travelling through lenses, +A Gimp3 plug-in to correct Chromatic Aberration (CA). +GIMP3-Fix-CA can fix Lateral CA caused due to light travelling through lenses, and fix Directional CA due to light travelling through dense material such as glass or water. @@ -49,6 +48,6 @@ automake --add-missing %files -f %{moname}.lang %license COPYING %{plugindir}/fix-ca -%{_datarootdir}/metainfo/org.gimp.extension.fix-ca.metainfo.xml +%{_datarootdir}/metainfo/org.gimp.extension.fix3-ca.metainfo.xml %changelog