Glimmer: Python extension for Mediascript
From CSWiki
[edit]
Pick a Pythonesque representation for colors
- You could use integers, like we do in MediaScheme
- You could use objects, like they may do in PyGimp
- You could use something else
[edit]
Figure out a nice way to translate colors between GIMP and Python
- Jordan knows a bit about GIMP color representations
- libs/mediascript/mesc-rgb.c presents our simple RGB representation
-
gimp_rgb_to_rgbin libs/mpltg/mpltg.c provides an example
- why is there a python representation for a RGB color too? (/Glimmer/DrFu/share/mediascript/python/mgimp.py)
- This stuff was written by Sam recently and it seems that it does a lot of the implementation
[edit]
Get some simple GIMP callbacks working
By callbacks, I mean procedures that you call in Python that affect the GIMP.
Some suggestions
-
image_set_pixel(image,x,y,color) -
image_get_pixel(image,x,y) -
context_get_fgcolor()
[edit]
Write the generic "call PDB procedure" function
- Start with a simple procedure that, given the name of a PDB procedure, extracts and prints out information about the procedure
- Write a procedure that, given a PDB type and C value, returns the corresponding Python value (corresponding to
pdb_to_scheme_valinmpltg.c)- You may want to start with only one or two types of values, such as integers or colors
- Write a procedure that, given a PDB type and Python value, returns the corresponding C/GIMP value (corresponding to
scheme_to_pdb_valinmpltg.c)- Again, you may want to start with only one or two types of values, such as integers or colors
- See how PyGimp does PDB calls
- See how MediaScript does PDB calls (
mpltg_cfun_gimp_pdb_callin mpltg.c) - Write something similar for your Python
[edit]
Write code that registers each PDB procedure as a call to your generic "call PDB procedure" function
- PyGimp and MediaScript should present appropriate examples
[edit]
Work on equivalents to some of the MediaScheme-specific higher order procedures
-
image_computeis a nice one to start with -
image_transformis another nice one
[edit]
User Interface Stuff
I expect these kinds of things will go better with me here, but you may want to explore any or all of these if you get fed up with the other stuff.
- Color coding of output/error/results
- Click on an error and go to the appropriate place in the definitions pane
- Automatic indenting in definitions pane
- Syntax highlighting

