~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to devel-docs/ggr.txt

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
    The .ggr file format.
2
2
 
3
3
GGR files are used to store GIMP gradients.  A gradient consists of a
4
 
series of consecutive *segments* spanning the range from 0 to 1.  Each
 
4
series of consecutive *segments* spanning the range from 0.0 to 1.0.  Each
5
5
segment has the following attributes:
6
6
 
7
7
Left Endpoint coordinate: (double)
9
9
Right Endpoint coordinate (double)
10
10
Right Endpoint color (RGBA color)
11
11
Midpoint coordinate (double)
12
 
Blend function (enum; values are 0 = "linear", 1 = "curved",
13
 
                2 = "sinusoidal", 3 = "spherical (increasing)", 
14
 
                4 = "spherical (decreasing)")
15
 
Color type (enum; values are 0 = "RGB", 1 = "HSV CCW", 2 = "HSV CW")
 
12
Blending function (enum; values are:
 
13
                   0 = "linear"
 
14
                   1 = "curved"
 
15
                   2 = "sinusoidal"
 
16
                   3 = "spherical (increasing)"
 
17
                   4 = "spherical (decreasing)")
 
18
Coloring type (enum; values are:
 
19
               0 = "RGB"
 
20
               1 = "HSV CCW"
 
21
               2 = "HSV CW")
 
22
Left and right Endpoint Color type (enum; values are:
 
23
                                    0 = "fixed"
 
24
                                    1 = "foreground",
 
25
                                    2 = "foreground transparent"
 
26
                                    3 = "background",
 
27
                                    4 = "background transparent")
16
28
 
17
29
 
18
30
A GGR file is an ASCII file structured as follows:
22
34
Line 3: the number of segments 
23
35
 
24
36
The remaining lines consist of segment specifications.  There must be
25
 
one line for each segment.  Each line contains 13 numbers -- the first
26
 
11 are floats, the remaining 2 are ints.  Here is what each field
 
37
one line for each segment.  Each line contains 15 numbers -- the first
 
38
11 are floats, the remaining 4 are ints.  Here is what each field
27
39
encodes:
28
40
 
29
41
Field      Meaning
38
50
  8          Right endpoint G
39
51
  9          Right endpoint B
40
52
 10          Right endpoint A
41
 
 11          Blend function type
42
 
 12          Color type
 
53
 11          Blending function type
 
54
 12          Coloring type
 
55
 13          Left endpoint color type
 
56
 14          Right endpoint color type
43
57
 
44
58
The left endpoint coordinate of each segment must equal the right
45
59
endpoint coordinate of the preceding segment.
47
61
Note 1: This is a description of the *new* gradient file format.  In
48
62
earlier versions of GIMP a different format was used.
49
63
 
50
 
Note 2: A few of the gradients at the top of the list in the Gradients
51
 
Dialog are special ones, for which shades of gray are replaced with
52
 
proportionate blends of the current foreground and background colors.
53
 
These special gradients are not represented by .ggr files in the
54
 
"gradients" directory, and there is currently no way to get this
55
 
behavior for a custom gradient.
 
64
Note 2: In GIMP versions prior to 2.3.11 the file format didn't contain
 
65
the color types of the endpoints, thus it was impossible to get the
 
66
behavior of the special "FG to BG" etc. gradients in custom gradients.
56
67
 
57
 
Note 3: Starting with version 2.1, Gimp now has the ability to load
 
68
Note 3: Starting with version 2.1, GIMP now has the ability to load
58
69
gradients in SVG gradient format, if the file is placed in the user's
59
70
personal "gradients" directory, or some other location in the
60
71
gradients search path.