GNOME Bugzilla – Bug 137053
PDB entries for transform tools lack some options
Last modified: 2004-12-22 21:47:04 UTC
The PDB entries for the transform tools (rotate, scale, perspective, ...) do not expose all options of the underlying core tools. The following options are currently missing: - interpolation_type: in the PDB calls, there is only a boolean specifying if interpolation should be used or not, but the type is taken from the global config options. - supersample: this is currently hardcoded to TRUE or FALSE depending on the tool, as described in bug #136702. - clip_result: this is currently hardcoded to FALSE for all tools. It would be nice to change the PDB API or to provide an additional API that gives more control to the caller.
The rotation tool with it's "gimp-rotate" PDB entry misses the coordinates around which to operate the rotation. That renders this API entry almost useless. I'd say its priority could be "normal" rather than "low". At least this should be done before 2.2 final. As for a start to fix this bug, I think that all new PDB entries with the extra functionalities would be better than replacing the old ones. What could be a good name for the new functions? Something as gimp-rotate-new, or gimp-rotate-full ?
Is it necessary to have a new name at all? PDB functions can take varying arguments.
Finished coding the modifications for this. I am building it now to see if it works, and tomorrow I will attach the patches.
Created attachment 32357 [details] [review] creates gimp_flip_extended in core transform tools, allow some needed enums to be exported to pdbgen
Created attachment 32358 [details] Version of pdb file that implements optional parameters in PDB. untabifiying made a patch useless. File implements *_extended versions of all transform tools PDB which accept as extra parameters things taht were hardcoded in the older functions. The biggest change is the rotate, which allows one to choose the center, seconded by the one that allows one to pick the "interpolation type" straight, instead of reliyng on GIMP context.
Do I miss something here or does clip-result not make any sense for the flip tool? Why did you add it then? Also gimp_foo_extended() is a bad name for new procedures. I would suggest that we deprecate the old PDB calls and replace them with new ones that have proper names in a gimp_transform namespace. So we would have gimp_transform_flip, gimp_transform_rotate, gimp_transform_scale, ... These functions would best live in a separate file, transform.pdb.
I will do most of these changes in the morning. I tried to ask for the names before. :-) Do I need to change any of the meta-makefiles when creating a new file? As for the "gimp-transform-flip' instead of clipping result, I will let the flipping axis being one parameter - it is there internally - the axis x, or y coordinate. Maybe the clipping will have an effect them. Also, having the functions with fewer parameters is good for rapid *-fu development. Do the old ones really have to be deprecated?
Created attachment 32421 [details] [review] Changes needed to makefiles and enum files to implement gimp_transform_ pdb namespace
Created attachment 32422 [details] FIle implementing new API New file that re-implements all transform functions as gimp-drawable-transform-xxxx , at Mitchs request. Also, first attempt to implement a flip around an arbitrary axis - I have not tested it yet - need some sleep.
Created attachment 32470 [details] File implementing new API Fixed the flip procedure.
Your patch breaks indentation in all touched files and doesn't really follow the coding style.
Created attachment 32574 [details] File implementing new API I fixed the linebreak / indentation issues I could find. I am sorry if there are more of them remaining.
I forgot to mention here, latest implementation of *flip* includes a working flip around an arbitray axis, as asked in bug #133720.
2004-10-26 Sven Neumann <sven@gimp.org> Added new drawable transform API to the PDB. Largely based on patches from Joao S. O. Bueno. Fixes bug #137053. * app/core/gimpdrawable-transform.[ch]: added missing parameters to gimp_drawable_transform_flip(). * tools/pdbgen/pdb/transform_tools.pdb: changed accordinly. * app/base/base-enums.h * app/core/core-enums.h: removed pdp-skip for GimpInterpolationType and GimpTransformDirection enums. * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * tools/pdbgen/enums.pl * tools/pdbgen/groups.pl: regenerated. * tools/pdbgen/Makefile.am * tools/pdbgen/pdb/drawable_transform.pdb: added new file defining the new PDB calls. * app/pdb/Makefile.am * app/pdb/drawable_transform_cmds.c * app/pdb/internal_procs.c * app/pdb/transform_tools_cmds.c * libgimp/gimp_pdb.h * libgimp/gimpdrawabletransform_pdb.[ch]: regenerated.
Mitch and me found some issues with the new API and we think that it needs some review before 2.2. Mitch started to work on this already. Reopening so that this isn't forgotten.
K. Let me know if you think I can help. I was wondering|: are path transformations in already? Maybe they could get in still. They would have to be in another file, of course.
You can of course write that patch but I don't think we should accept more PDB API changes at this point. Such an API always needs some review and time is getting short. We can focus on a nice new vectors API for GIMP 2.4.
Mitch did a couple of changes to the transform APIs. Can this bug be closed now?
Yes, after this final cleanup: 2004-11-16 Michael Natterer <mitch@gimp.org> * tools/pdbgen/pdb/drawable_transform.pdb: renamed the new drawable_foo_defaults() functions to drawable_foo_default() to be consistent with paintbrush_default() and friends. * tools/pdbgen/pdb/transform_tools.pdb * libgimp/gimp.def: changed accordingly. * app/pdb/drawable_transform_cmds.c * app/pdb/transform_tools_cmds.c * libgimp/gimpdrawabletransform_pdb.[ch] * libgimp/gimptransformtools_pdb.c: regenerated. * plug-ins/script-fu/scripts/coolmetal-logo.scm * plug-ins/script-fu/scripts/image-structure.scm * plug-ins/script-fu/scripts/text-circle.scm: follow the API change.