~ubuntu-branches/ubuntu/maverick/gimp/maverick-updates

« back to all changes in this revision

Viewing changes to plug-ins/gfig/README

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-12-09 19:44:52 UTC
  • Revision ID: james.westby@ubuntu.com-20051209194452-yggpemjlofpjqyf4
Tags: upstream-2.2.9
ImportĀ upstreamĀ versionĀ 2.2.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Objects
 
2
+++++++
 
3
 
 
4
The plug-in allows you to draw the following shapes:-
 
5
 
 
6
Lines
 
7
Circles
 
8
Ellipses
 
9
n sided regular polygons (n >=3)
 
10
Curves (arcs)
 
11
Spirals
 
12
N pointed stars
 
13
Simple Beizer curves
 
14
 
 
15
An object is constructed as a number of control points and these are used 
 
16
to select the object on the drawing area once it has been created.
 
17
 
 
18
The drawing area preview is currently set to 
 
19
 
 
20
        MIN(650 x 650,img_width x img_height). 
 
21
 
 
22
You can change this altering the PREVIEW_SIZE item in the source code. 
 
23
 
 
24
Operations
 
25
++++++++++
 
26
 
 
27
The following operations can be performed on objects:-
 
28
 
 
29
The objects can either be moved independently around the drawing area or 
 
30
all together.
 
31
 
 
32
Each control point can be moved.
 
33
 
 
34
Objects can be copied.
 
35
 
 
36
Objects can be deleted.
 
37
 
 
38
N sided Polygons can be split into N line segments. This also works for N 
 
39
pointed stars.
 
40
 
 
41
The drawing area can be scaled.
 
42
 
 
43
Control points can be hidden.
 
44
 
 
45
To aid alignment of objects a "grid" can be placed on the drawing area.
 
46
This can be either a normal rectangular grid or a polar type grid centered 
 
47
in the drawing area. 
 
48
The spacings of the grid can be changed as well as the colours used to draw the
 
49
grid lines. When "Snap to grid" is checked then all operations will be 
 
50
constrained to fall on a grid intersection. (Fun when using the polar grid).
 
51
Additionally the third mouse button will constrain the point movement to be
 
52
on a horiz/vert (for rect grid) or radial/radius (for polar) only when 
 
53
"Snap to grid" is set.
 
54
 
 
55
The image that was selected when Gfig was started can also be shown (scaled) in
 
56
the drawing area. (Options tag).
 
57
 
 
58
Painting tab
 
59
++++++++++++
 
60
 
 
61
There are three possible mode when painting.
 
62
 
 
63
1) Brush
 
64
2) Selection
 
65
3) Selection+fill 
 
66
 
 
67
Brush
 
68
~~~~~
 
69
When the paint button is pressed each object will be rendered/drawn onto 
 
70
the image using the currently selected ink colour. The objects can be drawn 
 
71
onto the original layer or onto a new layer (either a single layer or 
 
72
multiple layers - latter is good for animations). When new layers are 
 
73
created the background can either be:-
 
74
        
 
75
Transparent.
 
76
Background (the current BG colour).
 
77
White.
 
78
Copy.
 
79
 
 
80
The last option means that the layer is duplicated from the previous layer 
 
81
before the draw operation is performed (re good for animations).
 
82
 
 
83
Lines can be drawn in reverse order. This means that reg polygons/curves/lines 
 
84
that are normally constructed of lines can be drawn starting at either "end". 
 
85
This is only noticeable when the current brush has fading turned on.
 
86
The "Approx Circles/Ellipses" toggle allows the same effects when drawing these
 
87
types of objects.
 
88
 
 
89
Note that in the current version any selections present in the image are first 
 
90
de-selected when Gfig starts up. This is because selections are used to 
 
91
draw circles and ellipses (unless the Approx. Circles & Ellipses toggle is set).
 
92
 
 
93
Selection
 
94
~~~~~~~~~
 
95
With this method closed selections are made of the objects. See selection
 
96
tab for more details.
 
97
 
 
98
Selections can only be made on the current layer.
 
99
 
 
100
Selection+Fill
 
101
~~~~~~~~~~~~~~
 
102
This method first selects the objects and then fills the selection area. The
 
103
selection tab gives more details on how the selections are filled.
 
104
 
 
105
 
 
106
Brush Tab
 
107
+++++++++
 
108
 
 
109
This tab now contains a preview of the selected brush in black ink. If the
 
110
brush is too large to fit in the preview use the mouse button to "move" it
 
111
around (as with the brush dialog in the main GIMP - until that brush 
 
112
patch went in!).
 
113
 
 
114
Four types of brush can be used:-
 
115
 
 
116
Normal brush
 
117
~~~~~~~~~~~~
 
118
Simply paints with the current brush - honors fading if any
 
119
The Fade option allows the "brush fading" to be selected. I am sure that some
 
120
nifty anims can be created with this option. 
 
121
 
 
122
Pencil brush
 
123
~~~~~~~~~~~~
 
124
Same as the GIMPS pencil. 
 
125
 
 
126
Airbrush
 
127
~~~~~~~~
 
128
As GIMPS airbrush. The "pressure" can be specified and this is reflected in the
 
129
preview window.
 
130
 
 
131
Pattern
 
132
~~~~~~~
 
133
The lines are drawn with the currently selected pattern. The preview will
 
134
show this pattern.
 
135
 
 
136
Note a patch to enable a couple of "hidden" paintbrush features was recently
 
137
posted to the GIMP developers list. The patch only allowed these features
 
138
to be called via the UI and not the PDB so they cannot be used by Gfig. If they were exported via the PDB then they would have probably broken a number of 
 
139
scripts and Gfig itself (number of args changes on the PDB call).
 
140
 
 
141
Select tab
 
142
++++++++++
 
143
 
 
144
This is enabled when using either Selection or Selection+fill types when
 
145
painting objects.
 
146
 
 
147
The anti aliasing and feather toggles apply to the selection made when 
 
148
"painting" the objects. The feather radius can be changed.
 
149
 
 
150
The default selection mode is to add to the current selection so each object
 
151
add to the overall selection. The other selection modes are also possible
 
152
but you must bear in mind the following:-
 
153
 
 
154
Subtraction/Intersection will not produce any selection if no selection is 
 
155
elect the area in the target window (AFTER starting Gfig up) and then paint 
 
156
using this method.
 
157
 
 
158
Replace will leave only the last object selection.
 
159
 
 
160
When the paint type is selection+fill then the objects will be selected 
 
161
and then filled. The opacity of the fill can be chosen. By default a fill
 
162
is performed after each section. If filling onto a single layer
 
163
then the fill will accumulate on the first objects painted. This will be 
 
164
noticeable when opacity != 100. To get around this then use replace mode
 
165
OR use a new layer for each selection/fill. (Paint tab). Additionally you can
 
166
set the fill to be performed after ALL objects have been selected (useful
 
167
for intersection type selections).
 
168
 
 
169
Selection of non-closed objects
 
170
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
171
For objects that are not closed the first & last points will be joined 
 
172
together to form the closed selection. For arcs you can either fill
 
173
as segments or sectors. Note straight lines will not cause any selection to be
 
174
made. This can be a little confusing when filling since the whole canvas will
 
175
be filled if any straight lines are present on it.
 
176
 
 
177
 
 
178
Scaling
 
179
+++++++
 
180
 
 
181
When Gfig first comes up the selected group of objects are automatically scaled 
 
182
upwards to the image size. (If the source image is < 256*256 then no automatic 
 
183
scaling is performed - change PREVIEW_SIZE in source to alter this values).
 
184
By toggling the scale button the objects can then be scaled in the drawing 
 
185
area. This scaling will be reflected when the objects are drawn.
 
186
To reposition the objects on the drawing area use SHIFT + MOVE_OBJ operation.
 
187
 
 
188
 
 
189
Other ops
 
190
+++++++++
 
191
 
 
192
Double click on reg polygon object selection to get dialog with slider to 
 
193
selected the number of sides to draw.
 
194
 
 
195
Double click on star object selection to get dialog with slider to 
 
196
selected the number of points the star will have.
 
197
 
 
198
Double click on spiral object selection to get dialog with slider to 
 
199
selected the number of turns the spiral will have and it direction.
 
200
 
 
201
Double click on bezier object selection to get dialog which allows you to
 
202
control how the curve is displayed and if it is closed.
 
203
 
 
204
SHIFT + MOVE_PNT will break a reg polygon or star into a number of 
 
205
connected lines.
 
206
 
 
207
When drawing lines if the SHIFT modifier is used then connected lines 
 
208
can be drawn.
 
209
 
 
210
SHIFT + MOVE_OBJ will move all objects. Note if "snap to grid" is selected then
 
211
the new point will be constrained to fall on a grid intersection.
 
212
 
 
213
Mouse button 3 + "snap to grid" will constrain the point to fall on one of the
 
214
two gridlines it was originally on.
 
215
 
 
216
The ">" and "<" buttons allow you to selective move through each of the 
 
217
objects in the collection. The "==" returns the display to normal. If the
 
218
"paint" button is pressed then only the single object displayed will be 
 
219
drawn into the target window. Also when in this mode pressing the shift button
 
220
will temporarily show all the objects in the collection.
 
221
 
 
222
The the options tab there is now a toggle that allows you to turn the 
 
223
position display on and off.
 
224
 
 
225
Gfig objects
 
226
++++++++++++
 
227
 
 
228
The upper right part of gfig contains a scroll region when different 
 
229
collection of objects can be found. When button 1 is pressed on an entry 
 
230
the small preview window will be updated with the objects contained in 
 
231
the selected figure. These objects can then be loaded into the main window 
 
232
by using the "Edit" button or the "Merge" button. In the former case 
 
233
the objects area will first be cleared before the new objects
 
234
are added. In the latter case the objects will be merged into the drawing area.
 
235
 
 
236
When a collection of objects is altered to small image of a floppy disc 
 
237
will be placed next to the entry signifying that this collection needs to be 
 
238
saved. If a red cross appears here then the file associated with the 
 
239
entry is read only and cannot be saved to (it can be copied however).
 
240
 
 
241
Button 3 brings up a popup menu that allows collections to be saved away to 
 
242
different files. (Accel. keys also exist for some functions).
 
243
 
 
244
The buttons on the right of the list area allow the following operations:-
 
245
 
 
246
Rescan:-
 
247
This popus up a window which allows you to add directories to the internal 
 
248
gfig-path.  A (re)scan of these directories can the performed. Note any 
 
249
modification to the gfig-path will NOT be mirrored in your ~/.gimp/gimprc file.
 
250
 
 
251
Load:-
 
252
Allows you to load a single collection of objects.
 
253
 
 
254
New:-
 
255
Create a new collection. Note that until this is saved away to a file then no
 
256
filename will be associated with it. (See status area).
 
257
 
 
258
Delete:-
 
259
Popups a dialog asking if you wish to delete the entry selected in the list 
 
260
box as well as on disc.
 
261
 
 
262
Additionally button 3 over the list area allows the following:-
 
263
 
 
264
Save as...:-
 
265
Save collection to new filename. The collections filename is also 
 
266
changed to this new name. The original name is NOT deleted from the disc 
 
267
but it is effectively removed from the list selection area (actually it 
 
268
is overwritten internally).
 
269
 
 
270
Save:-
 
271
Save the currently selected entry to disc.
 
272
 
 
273
Copy:-
 
274
Make a copy of the collection.
 
275
 
 
276
Edit:-
 
277
Same as the "Edit button".
 
278
 
 
279
Double click on entry with Button 1 popups up a dialog that allows you to 
 
280
modify the nme of an entry (similar to other list areas in the GIMP).
 
281
 
 
282
Bezier
 
283
~~~~~~
 
284
 
 
285
OK my maths is a little rusty. The bezier stuff is only very simple. However...
 
286
I have tried to abstract as much as possible the bezier calculations from
 
287
the drawing of the control points / painting on the screen and in the target
 
288
window. 
 
289
 
 
290
The bezier function is defined as:-
 
291
 
 
292
void
 
293
DrawBezier (gdouble (*points)[2], gint np, gdouble mid, gint depth)
 
294
{
 
295
...
 
296
}
 
297
 
 
298
Points an array of pairs of doubles that define the control points
 
299
np is the number of points. Mid is always starts as 0.5 - and depth
 
300
defines how deep the recursion should go when calculating the line points.
 
301
 
 
302
The function should call fp_pnt_add() when a point on the curve has been
 
303
calculated. 
 
304
 
 
305
If anyone would like to produce a better/faster function then you
 
306
should be able to replace the DrawBezier function. (Only the first two args
 
307
are really needed). 
 
308
 
 
309
The algorithm the current code is based on was obtained by looking 
 
310
at the many many examples out on the web.
 
311
(Bezier drawing seems to be topic of the year for computer degrees 
 
312
and people learning java!!!)
 
313