author | Claus Gittinger <cg@exept.de> |
Sat, 20 Mar 1999 02:28:24 +0100 | |
changeset 1070 | 1735e40c6825 |
parent 1057 | 36f9d47e1249 |
child 1075 | 74795d3e647d |
permissions | -rw-r--r-- |
400 | 1 |
" |
767 | 2 |
COPYRIGHT (c) 1997-1998 by eXept Software AG |
400 | 3 |
All Rights Reserved |
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
405 | 7 |
inclusion of the above copyright notice. This software may not |
400 | 8 |
be provided or otherwise made available to, or used by, any |
405 | 9 |
other person. No title to or ownership of the software is |
400 | 10 |
hereby transferred. |
11 |
" |
|
12 |
||
13 |
ToolApplicationModel subclass:#ImageEditor |
|
975 | 14 |
instanceVariableNames:'imageEditView colorMapMode editMode mouseKeyColorMode |
15 |
selectedColorIndex postOpenAction' |
|
929 | 16 |
classVariableNames:'' |
17 |
poolDictionaries:'' |
|
18 |
category:'Interface-UIPainter' |
|
400 | 19 |
! |
20 |
||
21 |
!ImageEditor class methodsFor:'documentation'! |
|
22 |
||
23 |
copyright |
|
24 |
" |
|
767 | 25 |
COPYRIGHT (c) 1997-1998 by eXept Software AG |
400 | 26 |
All Rights Reserved |
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
405 | 30 |
inclusion of the above copyright notice. This software may not |
400 | 31 |
be provided or otherwise made available to, or used by, any |
405 | 32 |
other person. No title to or ownership of the software is |
400 | 33 |
hereby transferred. |
34 |
" |
|
35 |
! |
|
36 |
||
37 |
documentation |
|
38 |
" |
|
737 | 39 |
Image Editor allows you to create, design, modify or just inspect images. |
400 | 40 |
|
41 |
[start with:] |
|
42 |
ImageEditor open |
|
941 | 43 |
ImageEditor openOnClass:Icon andSelector:#startIcon |
400 | 44 |
|
45 |
[see also:] |
|
46 |
ImageEditView Image |
|
47 |
||
48 |
[author:] |
|
544 | 49 |
Thomas Zwick, eXept Software AG |
400 | 50 |
" |
51 |
! ! |
|
52 |
||
53 |
!ImageEditor class methodsFor:'instance creation'! |
|
54 |
||
55 |
openModalOnClass: aClass andSelector: aSelector |
|
900 | 56 |
"opens modal a Image Editor on aClass and aSelector" |
767 | 57 |
" |
58 |
self openModalOnClass: self andSelector: #leftMouseKeyIcon |
|
59 |
" |
|
400 | 60 |
|
767 | 61 |
|imageEditor imageEditView className resourceClassName resourceSelector| |
62 |
||
400 | 63 |
imageEditor := self new. |
767 | 64 |
|
900 | 65 |
aClass isClass ifTrue: [className := aClass name]. |
66 |
aClass isString ifTrue: [className := aClass]. |
|
903 | 67 |
aClass isNil ifTrue: [className := '']. |
400 | 68 |
|
688 | 69 |
imageEditor postOpenAction: [imageEditView := imageEditor imageEditView. imageEditor loadFromOrPrepareForMessage: className, ' ', aSelector]. |
400 | 70 |
imageEditor openModal. |
71 |
||
688 | 72 |
resourceClassName := imageEditView resourceClass. |
767 | 73 |
resourceSelector := imageEditView resourceSelector. |
415 | 74 |
|
815 | 75 |
((className asString ~= resourceClassName) |
76 |
or:[aSelector asString ~= resourceSelector]) |
|
415 | 77 |
ifTrue: [^resourceClassName, ' ', resourceSelector] |
78 |
ifFalse:[^nil] |
|
400 | 79 |
! |
80 |
||
81 |
openOnClass: aClass andSelector: aSelector |
|
900 | 82 |
"opens a Image Editor on aClass and aSelector" |
767 | 83 |
" |
84 |
self openOnClass: self andSelector: #leftMouseKeyIcon |
|
85 |
" |
|
400 | 86 |
|
1057 | 87 |
|editor| |
88 |
||
89 |
editor := self new. |
|
90 |
editor allButOpen. |
|
91 |
editor loadFromMessage: aClass name, ' ', aSelector. |
|
92 |
editor openWindow |
|
93 |
||
94 |
"Modified: / 16.3.1999 / 21:33:49 / cg" |
|
400 | 95 |
! |
96 |
||
767 | 97 |
openOnFile: aFileName |
900 | 98 |
"opens a Image Editor on aFileName" |
767 | 99 |
" |
100 |
self openOnFile: 'bitmaps/SmalltalkX.xbm' |
|
101 |
" |
|
400 | 102 |
|
1057 | 103 |
|editor| |
104 |
||
105 |
editor := self new. |
|
106 |
editor allButOpen. |
|
107 |
editor loadFromFile: aFileName. |
|
108 |
editor openWindow |
|
109 |
||
110 |
"Modified: / 16.3.1999 / 21:33:25 / cg" |
|
400 | 111 |
! |
112 |
||
767 | 113 |
openOnImage: anImage |
900 | 114 |
"opens a Image Editor on anImage" |
767 | 115 |
" |
895 | 116 |
self openOnImage: Icon startIcon |
767 | 117 |
" |
400 | 118 |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
119 |
|editor| |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
120 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
121 |
editor := self new. |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
122 |
editor allButOpen. |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
123 |
editor loadFromImage: anImage. |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
124 |
editor openWindow |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
125 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
126 |
"Modified: / 11.3.1999 / 16:18:33 / cg" |
400 | 127 |
! ! |
128 |
||
129 |
!ImageEditor class methodsFor:'accessing'! |
|
130 |
||
131 |
listOfColorMaps |
|
767 | 132 |
"returns the list of default color maps for a new image" |
400 | 133 |
|
134 |
|colorMap| |
|
898 | 135 |
|
400 | 136 |
(colorMap := OrderedCollection new) |
137 |
add: Color black; |
|
138 |
add: Color white; |
|
139 |
add: Color red; |
|
140 |
add: Color green; |
|
141 |
add: Color blue; |
|
142 |
add: Color cyan; |
|
143 |
add: Color yellow; |
|
144 |
add: Color magenta; |
|
898 | 145 |
add: (Color redByte: 127 greenByte: 0 blueByte: 0); |
146 |
add: (Color redByte: 0 greenByte: 127 blueByte: 0); |
|
147 |
add: (Color redByte: 0 greenByte: 0 blueByte: 127); |
|
148 |
add: (Color redByte: 0 greenByte: 127 blueByte: 127); |
|
149 |
add: (Color redByte: 127 greenByte: 127 blueByte: 0); |
|
150 |
add: (Color redByte: 127 greenByte: 0 blueByte: 127); |
|
151 |
add: (Color redByte: 127 greenByte: 127 blueByte: 127); |
|
152 |
add: (Color redByte: 170 greenByte: 170 blueByte: 170). |
|
153 |
||
400 | 154 |
0 to: 5 do: |
155 |
[:r| |
|
156 |
0 to: 5 do: |
|
157 |
[:g| |
|
158 |
0 to: 5 do: |
|
159 |
[:b| |
|
898 | 160 |
colorMap add: (Color redByte: (r*255//5) ceiling greenByte: (g*255//5) ceiling blueByte: (b*255//5) ceiling) |
400 | 161 |
] |
162 |
] |
|
163 |
]. |
|
164 |
||
165 |
1 to: 25 do: |
|
166 |
[:g| |
|
898 | 167 |
colorMap add: (Color redByte: (g*255//26) ceiling greenByte: (g*255//26) ceiling blueByte: (g*255//26) ceiling) |
400 | 168 |
]. |
169 |
||
170 |
^Dictionary new |
|
171 |
at: '8-plane' put: colorMap; |
|
172 |
at: '8-plane + mask' put: colorMap; |
|
173 |
at: '4-plane' put: (colorMap copyFrom: 1 to: 16); |
|
174 |
at: '4-plane + mask' put: (colorMap copyFrom: 1 to: 16); |
|
175 |
at: '2-plane' put: (colorMap copyFrom: 1 to: 4); |
|
176 |
at: '2-plane + mask' put: (colorMap copyFrom: 1 to: 4); |
|
177 |
at: '1-plane' put: (colorMap copyFrom: 1 to: 2); |
|
178 |
at: '1-plane + mask' put: (colorMap copyFrom: 1 to: 2); |
|
179 |
yourself |
|
180 |
! |
|
181 |
||
182 |
listOfDefaultSizes |
|
767 | 183 |
"returns the list of default sizes for a new image" |
400 | 184 |
|
932
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
185 |
^#('8x8' '16x16' '22x22' '32x32' '48x48' '64x64') |
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
186 |
|
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
187 |
"Modified: / 31.7.1998 / 01:57:34 / cg" |
400 | 188 |
! ! |
189 |
||
460 | 190 |
!ImageEditor class methodsFor:'help specs'! |
191 |
||
192 |
helpSpec |
|
737 | 193 |
"This resource specification was automatically generated |
194 |
by the UIHelpTool of ST/X." |
|
195 |
||
196 |
"Do not manually edit this!! If it is corrupted, |
|
197 |
the UIHelpTool may not be able to read the specification." |
|
460 | 198 |
|
199 |
" |
|
737 | 200 |
UIHelpTool openOnClass:ImageEditor |
460 | 201 |
" |
202 |
||
737 | 203 |
<resource: #help> |
204 |
||
205 |
^super helpSpec addPairsFrom:#( |
|
460 | 206 |
|
207 |
#colorMap |
|
929 | 208 |
'ColorMap functions.' |
209 |
||
210 |
#colorMap1 |
|
211 |
'Convert to depth-1 image.' |
|
212 |
||
986 | 213 |
#colorMap1M |
214 |
'Convert to depth-1 image plus mask.' |
|
215 |
||
929 | 216 |
#colorMap2 |
217 |
'Convert to depth-2 image.' |
|
218 |
||
986 | 219 |
#colorMap2M |
220 |
'Convert to depth-2 image plus mask.' |
|
221 |
||
929 | 222 |
#colorMap4 |
223 |
'Convert to depth-4 image.' |
|
224 |
||
986 | 225 |
#colorMap4M |
226 |
'Convert to depth-4 image plus mask.' |
|
227 |
||
929 | 228 |
#colorMap8 |
229 |
'Convert to depth-8 image.' |
|
230 |
||
231 |
#colorMap8M |
|
232 |
'Convert to depth-8 image plus mask.' |
|
233 |
||
986 | 234 |
#colorMapTable |
235 |
'Shows a list of used colors of the image.' |
|
236 |
||
929 | 237 |
#compressColormap |
238 |
'Remove unneeded entries from the colorMap.' |
|
460 | 239 |
|
1045 | 240 |
#cropAll |
986 | 241 |
'Find and remove all borders.' |
242 |
||
1045 | 243 |
#cropBottom |
986 | 244 |
'Find and remove bottom border.' |
245 |
||
1045 | 246 |
#cropLeft |
986 | 247 |
'Find and remove left border.' |
248 |
||
1045 | 249 |
#cropManual |
986 | 250 |
'Specify border(s) to remove.' |
251 |
||
1045 | 252 |
#cropRight |
986 | 253 |
'Find and remove right border.' |
254 |
||
1045 | 255 |
#cropTop |
986 | 256 |
'Find and remove top border.' |
487 | 257 |
|
460 | 258 |
#drawModeBox |
914 | 259 |
'Switches to box-drawing mode.' |
460 | 260 |
|
261 |
#drawModeCopy |
|
914 | 262 |
'Switches to area-copy mode.' |
460 | 263 |
|
264 |
#drawModeFill |
|
914 | 265 |
'Switches to flood-fill mode.' |
460 | 266 |
|
267 |
#drawModeFilledBox |
|
914 | 268 |
'Switches to filled-box drawing mode.' |
460 | 269 |
|
270 |
#drawModePaste |
|
914 | 271 |
'Switches to paste mode.' |
272 |
||
273 |
#drawModePasteUnder |
|
274 |
'Switches to paste under mode.' |
|
460 | 275 |
|
276 |
#drawModePoint |
|
914 | 277 |
'Switches to point-drawing mode.' |
460 | 278 |
|
279 |
#editFlipHorizontal |
|
914 | 280 |
'Flips the image horizontally.' |
460 | 281 |
|
282 |
#editFlipVertical |
|
914 | 283 |
'Flips the image vertically.' |
460 | 284 |
|
285 |
#editMagnifyImage |
|
914 | 286 |
'Magnify the image.' |
460 | 287 |
|
288 |
#editNegate |
|
914 | 289 |
'Invert the images colors.' |
460 | 290 |
|
291 |
#editResize |
|
914 | 292 |
'Resize the image (preserving the old image).' |
460 | 293 |
|
294 |
#editRotate |
|
914 | 295 |
'Rotate the image.' |
460 | 296 |
|
929 | 297 |
#fileGrabImage |
298 |
'Pick an image from the screen.' |
|
299 |
||
460 | 300 |
#fileLoadFromClass |
929 | 301 |
'Select and load an image from a resource method.' |
460 | 302 |
|
303 |
#fileLoadFromFile |
|
929 | 304 |
'Select and load an image from a file.' |
460 | 305 |
|
306 |
#fileNewImage |
|
914 | 307 |
'Create a new image' |
460 | 308 |
|
309 |
#filePrint |
|
310 |
'Print the image on a postscript printer.' |
|
311 |
||
312 |
#fileSaveAs |
|
914 | 313 |
'Save the image to a file.' |
460 | 314 |
|
315 |
#fileSaveMaskAs |
|
914 | 316 |
'Save the mask of the image to a file.' |
460 | 317 |
|
318 |
#fileSaveMethod |
|
914 | 319 |
'Save the image as resource method in the current class and selector.' |
460 | 320 |
|
321 |
#fileSaveMethodAs |
|
914 | 322 |
'Save the image as resource method in a class.' |
460 | 323 |
|
487 | 324 |
#magnificationNumber |
914 | 325 |
'Shows the current magnification.' |
487 | 326 |
|
327 |
#magnifyImageDown |
|
914 | 328 |
'Decrease magnification.' |
487 | 329 |
|
330 |
#magnifyImageUp |
|
914 | 331 |
'Increase magnification.' |
487 | 332 |
|
333 |
#mouseKeyColorMode |
|
914 | 334 |
'Toggles between left and right mouse button color.' |
487 | 335 |
|
336 |
#previewView |
|
914 | 337 |
'Shows a preview of the image.' |
487 | 338 |
|
905 | 339 |
#settingsGridMagnification |
914 | 340 |
'Change the grid magnification of the edit view.' |
905 | 341 |
|
460 | 342 |
) |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
343 |
|
986 | 344 |
"Modified: / 7.9.1998 / 18:20:26 / cg" |
460 | 345 |
! ! |
346 |
||
737 | 347 |
!ImageEditor class methodsFor:'image specs'! |
348 |
||
349 |
leftMouseKeyIcon |
|
350 |
"This resource specification was automatically generated |
|
351 |
by the ImageEditor of ST/X." |
|
352 |
||
353 |
"Do not manually edit this!! If it is corrupted, |
|
354 |
the ImageEditor may not be able to read the specification." |
|
355 |
||
356 |
" |
|
357 |
ImageEditor openOnClass:self andSelector:#leftMouseKeyIcon |
|
358 |
" |
|
359 |
||
360 |
<resource: #image> |
|
361 |
||
362 |
^Icon |
|
363 |
constantNamed:#'ImageEditor leftMouseKeyIcon' |
|
364 |
ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@JEE@@B!!QP@@(TT@@@@@@@AUUP@@UUT@@EUU@@AUUP@@UUT@@EUU@@@UU@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255 255 0 0 0 255 0]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@?0G? _>A?8G? _>A?8G? _>A?8G? O<@_ @@@b') ; yourself); yourself]! |
|
365 |
||
366 |
rightMouseKeyIcon |
|
367 |
"This resource specification was automatically generated |
|
368 |
by the ImageEditor of ST/X." |
|
369 |
||
370 |
"Do not manually edit this!! If it is corrupted, |
|
371 |
the ImageEditor may not be able to read the specification." |
|
372 |
||
373 |
" |
|
374 |
ImageEditor openOnClass:self andSelector:#rightMouseKeyIcon |
|
375 |
" |
|
376 |
||
377 |
<resource: #image> |
|
378 |
||
379 |
^Icon |
|
380 |
constantNamed:#'ImageEditor rightMouseKeyIcon' |
|
381 |
ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@EEJ@@AQR @@TT(@@@@@@@AUUP@@UUT@@EUU@@AUUP@@UUT@@EUU@@@UU@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255 255 0 0 0 255 0]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@?0G? _>A?8G? _>A?8G? _>A?8G? O<@_ @@@b') ; yourself); yourself]! ! |
|
382 |
||
400 | 383 |
!ImageEditor class methodsFor:'interface specs'! |
384 |
||
767 | 385 |
dialogSpecForNewImage |
737 | 386 |
"This resource specification was automatically generated |
387 |
by the UIPainter of ST/X." |
|
519 | 388 |
|
737 | 389 |
"Do not manually edit this!! If it is corrupted, |
390 |
the UIPainter may not be able to read the specification." |
|
519 | 391 |
|
392 |
" |
|
767 | 393 |
UIPainter new openOnClass:ImageEditor andSelector:#dialogSpecForNewImage |
394 |
ImageEditor new openInterface:#dialogSpecForNewImage |
|
519 | 395 |
" |
396 |
||
397 |
<resource: #canvas> |
|
398 |
||
399 |
^ |
|
400 |
||
401 |
#(#FullSpec |
|
672 | 402 |
#window: |
519 | 403 |
#(#WindowSpec |
672 | 404 |
#name: 'New Image' |
975 | 405 |
#layout: #(#LayoutFrame 81 0 288 0 381 0 406 0) |
672 | 406 |
#label: 'New Image' |
407 |
#min: #(#Point 10 10) |
|
408 |
#max: #(#Point 1152 900) |
|
975 | 409 |
#bounds: #(#Rectangle 81 288 382 407) |
672 | 410 |
#usePreferredExtent: false |
519 | 411 |
) |
672 | 412 |
#component: |
519 | 413 |
#(#SpecCollection |
672 | 414 |
#collection: |
519 | 415 |
#( |
416 |
#(#ViewSpec |
|
672 | 417 |
#name: 'View' |
737 | 418 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -35 1.0) |
672 | 419 |
#component: |
519 | 420 |
#(#SpecCollection |
672 | 421 |
#collection: |
519 | 422 |
#( |
423 |
#(#FramedBoxSpec |
|
672 | 424 |
#name: 'framedBox1' |
932
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
425 |
#layout: #(#LayoutFrame 1 0.0 7 0.0 0 0.4 76 0) |
672 | 426 |
#component: |
519 | 427 |
#(#SpecCollection |
672 | 428 |
#collection: |
519 | 429 |
#( |
430 |
#(#ComboBoxSpec |
|
672 | 431 |
#name: 'defaultSizesComboBox' |
975 | 432 |
#layout: #(#LayoutFrame 0 0.0 10 0.0 0 1 35 0.0) |
672 | 433 |
#model: #selectionOfSize |
434 |
#type: #string |
|
435 |
#comboList: #listOfDefaultSizes |
|
519 | 436 |
) |
437 |
) |
|
438 |
) |
|
672 | 439 |
#label: 'Size' |
440 |
#labelPosition: #topLeft |
|
441 |
#style: #(#FontDescription #helvetica #medium #roman 12) |
|
519 | 442 |
) |
443 |
#(#FramedBoxSpec |
|
672 | 444 |
#name: 'framedBox2' |
932
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
445 |
#layout: #(#LayoutFrame 0 0.4 7 0.0 -1 1.0 76 0) |
672 | 446 |
#component: |
519 | 447 |
#(#SpecCollection |
672 | 448 |
#collection: |
519 | 449 |
#( |
450 |
#(#ComboListSpec |
|
672 | 451 |
#name: 'colorMapComboBox' |
975 | 452 |
#layout: #(#LayoutFrame 0 0.0 10 0.0 0 1 35 0.0) |
672 | 453 |
#model: #selectionOfColorMap |
454 |
#comboList: #listOfColorMaps |
|
455 |
#useIndex: false |
|
519 | 456 |
) |
457 |
) |
|
458 |
) |
|
672 | 459 |
#label: 'Color Map' |
460 |
#labelPosition: #topLeft |
|
461 |
#style: #(#FontDescription #helvetica #medium #roman 12) |
|
519 | 462 |
) |
463 |
) |
|
464 |
) |
|
672 | 465 |
#level: 1 |
519 | 466 |
) |
672 | 467 |
#(#UISubSpecification |
975 | 468 |
#name: 'windowSpecForCommitWithoutChannels' |
737 | 469 |
#layout: #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1.0) |
672 | 470 |
#minorKey: #windowSpecForCommitWithoutChannels |
519 | 471 |
) |
472 |
) |
|
473 |
) |
|
474 |
) |
|
767 | 475 |
! |
476 |
||
1045 | 477 |
gropDialogSpec |
986 | 478 |
"This resource specification was automatically generated |
479 |
by the UIPainter of ST/X." |
|
480 |
||
481 |
"Do not manually edit this!! If it is corrupted, |
|
482 |
the UIPainter may not be able to read the specification." |
|
483 |
||
484 |
" |
|
485 |
UIPainter new openOnClass:ImageEditor andSelector:#grobDialogSpec |
|
486 |
ImageEditor new openInterface:#grobDialogSpec |
|
487 |
" |
|
488 |
||
489 |
<resource: #canvas> |
|
490 |
||
491 |
^ |
|
492 |
||
493 |
#(#FullSpec |
|
494 |
#window: |
|
495 |
#(#WindowSpec |
|
1045 | 496 |
#name: 'Crop Borders' |
986 | 497 |
#layout: #(#LayoutFrame 22 0 233 0 266 0 415 0) |
1045 | 498 |
#label: 'Crop Borders' |
986 | 499 |
#min: #(#Point 10 10) |
500 |
#max: #(#Point 800 478) |
|
501 |
#bounds: #(#Rectangle 22 233 267 416) |
|
502 |
#usePreferredExtent: false |
|
503 |
) |
|
504 |
#component: |
|
505 |
#(#SpecCollection |
|
506 |
#collection: |
|
507 |
#( |
|
508 |
#(#LabelSpec |
|
509 |
#name: 'Label1' |
|
510 |
#layout: #(#LayoutFrame 14 0 21 0 90 0 43 0) |
|
511 |
#label: 'Left:' |
|
512 |
#translateLabel: true |
|
513 |
#adjust: #right |
|
514 |
) |
|
515 |
#(#InputFieldSpec |
|
516 |
#name: 'EntryField1' |
|
517 |
#layout: #(#LayoutFrame 95 0 21 0 132 0 43 0) |
|
518 |
#model: #left |
|
519 |
#type: #number |
|
520 |
) |
|
521 |
#(#LabelSpec |
|
522 |
#name: 'Label2' |
|
523 |
#layout: #(#LayoutFrame 14 0 51 0 90 0 73 0) |
|
524 |
#label: 'Right:' |
|
525 |
#translateLabel: true |
|
526 |
#adjust: #right |
|
527 |
) |
|
528 |
#(#InputFieldSpec |
|
529 |
#name: 'EntryField2' |
|
530 |
#layout: #(#LayoutFrame 95 0 51 0 132 0 73 0) |
|
531 |
#model: #right |
|
532 |
#type: #number |
|
533 |
) |
|
534 |
#(#LabelSpec |
|
535 |
#name: 'Label3' |
|
536 |
#layout: #(#LayoutFrame 14 0 81 0 90 0 103 0) |
|
537 |
#label: 'Top:' |
|
538 |
#translateLabel: true |
|
539 |
#adjust: #right |
|
540 |
) |
|
541 |
#(#InputFieldSpec |
|
542 |
#name: 'EntryField3' |
|
543 |
#layout: #(#LayoutFrame 95 0 81 0 132 0 103 0) |
|
544 |
#model: #top |
|
545 |
#type: #number |
|
546 |
) |
|
547 |
#(#LabelSpec |
|
548 |
#name: 'Label4' |
|
549 |
#layout: #(#LayoutFrame 14 0 111 0 90 0 133 0) |
|
550 |
#label: 'Bottom:' |
|
551 |
#translateLabel: true |
|
552 |
#adjust: #right |
|
553 |
) |
|
554 |
#(#InputFieldSpec |
|
555 |
#name: 'EntryField4' |
|
556 |
#layout: #(#LayoutFrame 95 0 111 0 132 0 133 0) |
|
557 |
#model: #bottom |
|
558 |
#type: #number |
|
559 |
) |
|
560 |
#(#HorizontalPanelViewSpec |
|
561 |
#name: 'HorizontalPanel1' |
|
562 |
#layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1) |
|
563 |
#component: |
|
564 |
#(#SpecCollection |
|
565 |
#collection: |
|
566 |
#( |
|
567 |
#(#ActionButtonSpec |
|
568 |
#name: 'Button1' |
|
569 |
#label: 'Cancel' |
|
570 |
#translateLabel: true |
|
571 |
#model: #cancel |
|
572 |
#extent: #(#Point 118 22) |
|
573 |
) |
|
574 |
#(#ActionButtonSpec |
|
575 |
#name: 'Button2' |
|
576 |
#label: 'OK' |
|
577 |
#translateLabel: true |
|
578 |
#model: #accept |
|
579 |
#extent: #(#Point 118 22) |
|
580 |
) |
|
581 |
) |
|
582 |
) |
|
583 |
#horizontalLayout: #fitSpace |
|
584 |
#verticalLayout: #center |
|
585 |
#horizontalSpace: 3 |
|
586 |
#verticalSpace: 3 |
|
587 |
) |
|
588 |
) |
|
589 |
) |
|
590 |
) |
|
591 |
||
592 |
"Modified: / 7.9.1998 / 18:29:34 / cg" |
|
593 |
! |
|
594 |
||
767 | 595 |
windowSpec |
596 |
"This resource specification was automatically generated |
|
597 |
by the UIPainter of ST/X." |
|
598 |
||
599 |
"Do not manually edit this!! If it is corrupted, |
|
600 |
the UIPainter may not be able to read the specification." |
|
601 |
||
602 |
" |
|
603 |
UIPainter new openOnClass:ImageEditor andSelector:#windowSpec |
|
604 |
ImageEditor new openInterface:#windowSpec |
|
605 |
ImageEditor open |
|
606 |
" |
|
607 |
||
608 |
<resource: #canvas> |
|
609 |
||
610 |
^ |
|
611 |
||
612 |
#(#FullSpec |
|
613 |
#window: |
|
614 |
#(#WindowSpec |
|
615 |
#name: 'Image Editor' |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
616 |
#layout: #(#LayoutFrame 507 0 28 0 1004 0 371 0) |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
617 |
#level: 0 |
767 | 618 |
#label: 'Image Editor' |
619 |
#min: #(#Point 400 320) |
|
620 |
#max: #(#Point 1152 900) |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
621 |
#bounds: #(#Rectangle 507 28 1005 372) |
767 | 622 |
#menu: #menu |
623 |
#usePreferredExtent: false |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
624 |
#returnIsOKInDialog: true |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
625 |
#escapeIsCancelInDialog: true |
767 | 626 |
) |
627 |
#component: |
|
628 |
#(#SpecCollection |
|
629 |
#collection: |
|
630 |
#( |
|
631 |
#(#MenuPanelSpec |
|
632 |
#name: 'menuToolbarView' |
|
633 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
634 |
#menu: #menuToolbar |
|
635 |
#style: #(#FontDescription #helvetica #medium #roman 10) |
|
636 |
#showSeparatingLines: true |
|
637 |
) |
|
638 |
#(#VariableHorizontalPanelSpec |
|
639 |
#name: 'variableHorizontalPanel1' |
|
640 |
#layout: #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0) |
|
641 |
#component: |
|
642 |
#(#SpecCollection |
|
643 |
#collection: |
|
644 |
#( |
|
645 |
#(#ViewSpec |
|
646 |
#name: 'view1' |
|
647 |
#component: |
|
648 |
#(#SpecCollection |
|
649 |
#collection: |
|
650 |
#( |
|
651 |
#(#VariableVerticalPanelSpec |
|
652 |
#name: 'VariableVerticalPanel1' |
|
653 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
654 |
#component: |
|
655 |
#(#SpecCollection |
|
656 |
#collection: |
|
657 |
#( |
|
658 |
#(#ViewSpec |
|
659 |
#name: 'View1' |
|
660 |
#component: |
|
661 |
#(#SpecCollection |
|
662 |
#collection: |
|
663 |
#( |
|
664 |
#(#MenuPanelSpec |
|
665 |
#name: 'MouseButtonColorToolBar' |
|
666 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 24 0) |
|
667 |
#menu: #menuMouseButtonColors |
|
668 |
) |
|
669 |
#(#DataSetSpec |
|
670 |
#name: 'colorDataSetView' |
|
671 |
#layout: #(#LayoutFrame 0 0.0 26 0.0 0 1.0 0 1.0) |
|
672 |
#activeHelpKey: #colorMapTable |
|
673 |
#model: #selectionOfColor |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
674 |
#menu: #colorMapMenu |
767 | 675 |
#style: #(#FontDescription #helvetica #medium #roman 10) |
676 |
#hasHorizontalScrollBar: true |
|
677 |
#hasVerticalScrollBar: true |
|
678 |
#miniScrollerHorizontal: true |
|
679 |
#miniScrollerVertical: true |
|
680 |
#dataList: #listOfColors |
|
681 |
#has3Dsepartors: true |
|
905 | 682 |
#has3Dseparators: true |
767 | 683 |
#verticalSpacing: 1 |
684 |
#columns: |
|
685 |
#( |
|
686 |
#(#DataSetColumnSpec |
|
687 |
#rendererType: #rowSelector |
|
688 |
#backgroundSelector: #yourself |
|
689 |
) |
|
690 |
#(#DataSetColumnSpec |
|
691 |
#label: 'R' |
|
692 |
#labelAlignment: #left |
|
942 | 693 |
#columnAlignment: #right |
694 |
#editorType: #InputField |
|
695 |
#type: #number |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
696 |
#model: #redFromColor: |
942 | 697 |
#writeSelector: #redAtColor:put: |
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
698 |
#selectSelector: #canSelectRedInColor: |
767 | 699 |
) |
700 |
#(#DataSetColumnSpec |
|
701 |
#label: 'G' |
|
702 |
#labelAlignment: #left |
|
942 | 703 |
#columnAlignment: #right |
704 |
#editorType: #InputField |
|
705 |
#type: #number |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
706 |
#model: #greenFromColor: |
942 | 707 |
#writeSelector: #greenAtColor:put: |
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
708 |
#selectSelector: #canSelectGreenInColor: |
767 | 709 |
) |
710 |
#(#DataSetColumnSpec |
|
711 |
#label: 'B' |
|
712 |
#labelAlignment: #left |
|
942 | 713 |
#columnAlignment: #right |
714 |
#editorType: #InputField |
|
715 |
#type: #number |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
716 |
#model: #blueFromColor: |
942 | 717 |
#writeSelector: #blueAtColor:put: |
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
718 |
#selectSelector: #canSelectBlueInColor: |
767 | 719 |
) |
720 |
) |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
721 |
#columnAdaptor: #colorColumnAdaptor |
767 | 722 |
) |
723 |
) |
|
724 |
) |
|
725 |
) |
|
726 |
#(#ArbitraryComponentSpec |
|
727 |
#name: 'imagePreView' |
|
728 |
#activeHelpKey: #previewView |
|
729 |
#hasHorizontalScrollBar: true |
|
730 |
#hasVerticalScrollBar: true |
|
731 |
#miniScrollerHorizontal: true |
|
732 |
#miniScrollerVertical: true |
|
733 |
#component: #ImageView |
|
734 |
#hasBorder: false |
|
735 |
) |
|
736 |
) |
|
737 |
) |
|
738 |
#handles: #(#Any 0.723776 1.0) |
|
739 |
) |
|
740 |
) |
|
741 |
) |
|
742 |
) |
|
743 |
#(#ViewSpec |
|
744 |
#name: 'view2' |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
745 |
#level: -1 |
767 | 746 |
#component: |
747 |
#(#SpecCollection |
|
748 |
#collection: |
|
749 |
#( |
|
750 |
#(#ArbitraryComponentSpec |
|
751 |
#name: 'imageEditView' |
|
752 |
#layout: #(#LayoutFrame 2 0.0 2 0.0 -2 1.0 -24 1.0) |
|
753 |
#hasHorizontalScrollBar: true |
|
754 |
#hasVerticalScrollBar: true |
|
755 |
#component: #ImageEditView |
|
756 |
#hasBorder: false |
|
757 |
) |
|
758 |
#(#LabelSpec |
|
759 |
#name: 'coordLabel' |
|
760 |
#layout: #(#LayoutFrame 2 0.0 -22 1 -83 1.0 0 1.0) |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
761 |
#level: -1 |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
762 |
#labelChannel: #imageInfoHolder |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
763 |
#resizeForLabel: false |
767 | 764 |
#adjust: #left |
765 |
) |
|
766 |
#(#ArrowButtonSpec |
|
767 |
#name: 'magnifyDownButton' |
|
768 |
#layout: #(#LayoutFrame -80 1 -22 1 -58 1 0 1) |
|
769 |
#activeHelpKey: #magnifyImageDown |
|
770 |
#model: #doMagnifyDown |
|
771 |
#enableChannel: #imageIsLoaded |
|
772 |
#isTriggerOnDown: true |
|
773 |
#direction: #left |
|
774 |
) |
|
775 |
#(#ArrowButtonSpec |
|
776 |
#name: 'magnifyUpButton' |
|
777 |
#layout: #(#LayoutFrame -24 1 -22 1 -2 1 0 1) |
|
778 |
#activeHelpKey: #magnifyImageUp |
|
779 |
#model: #doMagnifyUp |
|
780 |
#enableChannel: #imageIsLoaded |
|
781 |
#isTriggerOnDown: true |
|
782 |
#direction: #right |
|
783 |
) |
|
784 |
#(#InputFieldSpec |
|
785 |
#name: 'magnificationInputField' |
|
786 |
#layout: #(#LayoutFrame -57 1 -22 1 -26 1 0 1) |
|
787 |
#activeHelpKey: #magnificationNumber |
|
788 |
#enableChannel: #imageIsLoaded |
|
789 |
#model: #valueOfMagnification |
|
905 | 790 |
#type: #numberInRange |
767 | 791 |
#acceptOnReturn: false |
792 |
#acceptOnTab: false |
|
793 |
#numChars: 2 |
|
905 | 794 |
#minValue: 1 |
795 |
#maxValue: 99 |
|
767 | 796 |
) |
797 |
) |
|
798 |
) |
|
799 |
) |
|
800 |
) |
|
801 |
) |
|
802 |
#handles: #(#Any 0.276 1.0) |
|
803 |
) |
|
804 |
#(#UISubSpecification |
|
805 |
#name: 'infoBarSubSpec' |
|
806 |
#layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0) |
|
807 |
#majorKey: #ToolApplicationModel |
|
808 |
#minorKey: #windowSpecForInfoBar |
|
809 |
) |
|
810 |
) |
|
811 |
) |
|
812 |
) |
|
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
813 |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
814 |
"Modified: / 12.3.1999 / 00:15:05 / cg" |
519 | 815 |
! ! |
816 |
||
817 |
!ImageEditor class methodsFor:'menu specs'! |
|
818 |
||
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
819 |
colorMapMenu |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
820 |
"This resource specification was automatically generated |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
821 |
by the MenuEditor of ST/X." |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
822 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
823 |
"Do not manually edit this!! If it is corrupted, |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
824 |
the MenuEditor may not be able to read the specification." |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
825 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
826 |
" |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
827 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuSpec |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
828 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuSpec)) startUp |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
829 |
" |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
830 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
831 |
<resource: #menu> |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
832 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
833 |
^ |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
834 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
835 |
#(#Menu |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
836 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
837 |
#( |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
838 |
#(#MenuItem |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
839 |
#label: 'Add Color' |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
840 |
#translateLabel: true |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
841 |
#value: #addColorToColormap |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
842 |
) |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
843 |
) nil |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
844 |
nil |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
845 |
) |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
846 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
847 |
"Created: / 12.3.1999 / 00:19:00 / cg" |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
848 |
! |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
849 |
|
400 | 850 |
menu |
737 | 851 |
"This resource specification was automatically generated |
852 |
by the MenuEditor of ST/X." |
|
400 | 853 |
|
737 | 854 |
"Do not manually edit this!! If it is corrupted, |
855 |
the MenuEditor may not be able to read the specification." |
|
400 | 856 |
|
857 |
" |
|
858 |
MenuEditor new openOnClass:ImageEditor andSelector:#menu |
|
859 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menu)) startUp |
|
860 |
" |
|
861 |
||
862 |
<resource: #menu> |
|
863 |
||
864 |
^ |
|
865 |
||
866 |
#(#Menu |
|
867 |
||
868 |
#( |
|
869 |
#(#MenuItem |
|
672 | 870 |
#label: 'About' |
843 | 871 |
#translateLabel: true |
672 | 872 |
#activeHelpKey: #about |
873 |
#labelImage: #(#ResourceRetriever nil #menuIcon) |
|
874 |
#submenuChannel: #menuAbout |
|
400 | 875 |
) |
876 |
#(#MenuItem |
|
672 | 877 |
#label: 'File' |
878 |
#translateLabel: true |
|
879 |
#activeHelpKey: #file |
|
880 |
#submenu: |
|
400 | 881 |
#(#Menu |
882 |
||
883 |
#( |
|
884 |
#(#MenuItem |
|
672 | 885 |
#label: 'New...' |
843 | 886 |
#translateLabel: true |
767 | 887 |
#value: #doNewImage |
672 | 888 |
#activeHelpKey: #fileNewImage |
400 | 889 |
) |
890 |
#(#MenuItem |
|
672 | 891 |
#label: '-' |
400 | 892 |
) |
893 |
#(#MenuItem |
|
672 | 894 |
#label: 'Load...' |
843 | 895 |
#translateLabel: true |
767 | 896 |
#value: #doLoadFromClass |
672 | 897 |
#activeHelpKey: #fileLoadFromClass |
400 | 898 |
) |
899 |
#(#MenuItem |
|
672 | 900 |
#label: 'Load From File...' |
843 | 901 |
#translateLabel: true |
767 | 902 |
#value: #doLoadFromFile |
672 | 903 |
#activeHelpKey: #fileLoadFromFile |
400 | 904 |
) |
905 |
#(#MenuItem |
|
929 | 906 |
#label: 'Grab From Screen' |
907 |
#translateLabel: true |
|
908 |
#value: #grabScreenImage |
|
909 |
#activeHelpKey: #fileGrabImage |
|
910 |
) |
|
911 |
#(#MenuItem |
|
672 | 912 |
#label: '-' |
400 | 913 |
) |
914 |
#(#MenuItem |
|
672 | 915 |
#label: 'Save' |
843 | 916 |
#translateLabel: true |
767 | 917 |
#value: #doSaveMethod |
672 | 918 |
#activeHelpKey: #fileSaveMethod |
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
919 |
#enabled: #imageIsLoadedAndClassDefined |
400 | 920 |
) |
921 |
#(#MenuItem |
|
672 | 922 |
#label: 'Save As...' |
843 | 923 |
#translateLabel: true |
767 | 924 |
#value: #doSaveMethodAs |
672 | 925 |
#activeHelpKey: #fileSaveMethodAs |
926 |
#enabled: #imageIsLoaded |
|
927 |
) |
|
928 |
#(#MenuItem |
|
929 |
#label: '-' |
|
400 | 930 |
) |
931 |
#(#MenuItem |
|
672 | 932 |
#label: 'Save To File...' |
843 | 933 |
#translateLabel: true |
767 | 934 |
#value: #doSaveImageFileAs |
672 | 935 |
#activeHelpKey: #fileSaveAs |
936 |
#enabled: #imageIsLoaded |
|
400 | 937 |
) |
938 |
#(#MenuItem |
|
672 | 939 |
#label: 'Save Mask To File...' |
843 | 940 |
#translateLabel: true |
767 | 941 |
#value: #doSaveImageMaskFileAs |
672 | 942 |
#activeHelpKey: #fileSaveMaskAs |
943 |
#enabled: #imageIsLoaded |
|
400 | 944 |
) |
945 |
#(#MenuItem |
|
672 | 946 |
#label: '-' |
400 | 947 |
) |
948 |
#(#MenuItem |
|
672 | 949 |
#label: 'Print' |
843 | 950 |
#translateLabel: true |
767 | 951 |
#value: #doPrint |
672 | 952 |
#activeHelpKey: #filePrint |
953 |
#enabled: #imageIsLoaded |
|
400 | 954 |
) |
955 |
#(#MenuItem |
|
672 | 956 |
#label: '-' |
400 | 957 |
) |
958 |
#(#MenuItem |
|
672 | 959 |
#label: 'Browse Class' |
843 | 960 |
#translateLabel: true |
767 | 961 |
#value: #doBrowseClass |
672 | 962 |
#activeHelpKey: #fileBrowseClass |
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
963 |
#enabled: #hasClassDefined |
400 | 964 |
) |
965 |
#(#MenuItem |
|
672 | 966 |
#label: '-' |
400 | 967 |
) |
968 |
#(#MenuItem |
|
672 | 969 |
#label: 'Exit' |
970 |
#translateLabel: true |
|
971 |
#value: #closeRequest |
|
972 |
#activeHelpKey: #fileExit |
|
400 | 973 |
) |
974 |
) nil |
|
975 |
nil |
|
976 |
) |
|
977 |
) |
|
978 |
#(#MenuItem |
|
672 | 979 |
#label: 'Edit' |
843 | 980 |
#translateLabel: true |
672 | 981 |
#activeHelpKey: #edit |
982 |
#enabled: #imageIsLoaded |
|
983 |
#submenu: |
|
400 | 984 |
#(#Menu |
985 |
||
986 |
#( |
|
987 |
#(#MenuItem |
|
672 | 988 |
#label: 'Undo' |
843 | 989 |
#translateLabel: true |
767 | 990 |
#value: #doUndo |
672 | 991 |
#activeHelpKey: #editUndo |
992 |
#enabled: #valueOfCanUndo |
|
400 | 993 |
) |
994 |
#(#MenuItem |
|
672 | 995 |
#label: '-' |
400 | 996 |
) |
997 |
#(#MenuItem |
|
672 | 998 |
#label: 'Flip - Vertical' |
843 | 999 |
#translateLabel: true |
767 | 1000 |
#value: #doFlipVertical |
672 | 1001 |
#activeHelpKey: #editFlipVertical |
400 | 1002 |
) |
1003 |
#(#MenuItem |
|
672 | 1004 |
#label: 'Flip - Horizontal' |
843 | 1005 |
#translateLabel: true |
767 | 1006 |
#value: #doFlipHorizontal |
672 | 1007 |
#activeHelpKey: #editFlipHorizontal |
400 | 1008 |
) |
1009 |
#(#MenuItem |
|
672 | 1010 |
#label: '-' |
400 | 1011 |
) |
1012 |
#(#MenuItem |
|
672 | 1013 |
#label: 'Resize...' |
843 | 1014 |
#translateLabel: true |
767 | 1015 |
#value: #doResizeImage |
672 | 1016 |
#activeHelpKey: #editResize |
400 | 1017 |
) |
1018 |
#(#MenuItem |
|
672 | 1019 |
#label: 'Magnify...' |
843 | 1020 |
#translateLabel: true |
767 | 1021 |
#value: #doMagnifyImage |
672 | 1022 |
#activeHelpKey: #editMagnifyImage |
400 | 1023 |
) |
1024 |
#(#MenuItem |
|
672 | 1025 |
#label: 'Rotate...' |
843 | 1026 |
#translateLabel: true |
767 | 1027 |
#value: #doRotateImage |
672 | 1028 |
#activeHelpKey: #editRotate |
400 | 1029 |
) |
986 | 1030 |
#(#MenuItem |
1031 |
#label: '-' |
|
1032 |
) |
|
1033 |
#(#MenuItem |
|
1047 | 1034 |
#label: 'Crop' |
986 | 1035 |
#translateLabel: true |
1036 |
#submenu: |
|
1037 |
#(#Menu |
|
1038 |
||
1039 |
#( |
|
1040 |
#(#MenuItem |
|
1041 |
#label: 'All' |
|
1042 |
#translateLabel: true |
|
1047 | 1043 |
#value: #doCropAll |
1045 | 1044 |
#activeHelpKey: #cropAll |
986 | 1045 |
) |
1046 |
#(#MenuItem |
|
1047 |
#label: '-' |
|
1048 |
) |
|
1049 |
#(#MenuItem |
|
1050 |
#label: 'Left' |
|
1051 |
#translateLabel: true |
|
1047 | 1052 |
#value: #doCropLeft |
1045 | 1053 |
#activeHelpKey: #cropLeft |
986 | 1054 |
) |
1055 |
#(#MenuItem |
|
1056 |
#label: 'Right' |
|
1057 |
#translateLabel: true |
|
1047 | 1058 |
#value: #doCropRight |
1045 | 1059 |
#activeHelpKey: #cropRight |
986 | 1060 |
) |
1061 |
#(#MenuItem |
|
1062 |
#label: 'Top' |
|
1063 |
#translateLabel: true |
|
1047 | 1064 |
#value: #doCropTop |
1045 | 1065 |
#activeHelpKey: #cropTop |
986 | 1066 |
) |
1067 |
#(#MenuItem |
|
1068 |
#label: 'Bottom' |
|
1069 |
#translateLabel: true |
|
1047 | 1070 |
#value: #doCropBottom |
1045 | 1071 |
#activeHelpKey: #cropBottom |
986 | 1072 |
) |
1073 |
#(#MenuItem |
|
1074 |
#label: '-' |
|
1075 |
) |
|
1076 |
#(#MenuItem |
|
1077 |
#label: 'Manual...' |
|
1078 |
#translateLabel: true |
|
1047 | 1079 |
#value: #doCropManual |
1045 | 1080 |
#activeHelpKey: #cropManual |
986 | 1081 |
) |
1082 |
) nil |
|
1083 |
nil |
|
1084 |
) |
|
1085 |
) |
|
400 | 1086 |
) nil |
1087 |
nil |
|
1088 |
) |
|
1089 |
) |
|
1090 |
#(#MenuItem |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
1091 |
#label: 'ColorMap' |
843 | 1092 |
#translateLabel: true |
672 | 1093 |
#activeHelpKey: #colorMap |
1094 |
#enabled: #imageIsLoaded |
|
1095 |
#submenu: |
|
400 | 1096 |
#(#Menu |
1097 |
||
1098 |
#( |
|
1099 |
#(#MenuItem |
|
672 | 1100 |
#label: '8-Plane' |
843 | 1101 |
#translateLabel: true |
975 | 1102 |
#value: #colorMapMode: |
929 | 1103 |
#activeHelpKey: #colorMap8 |
672 | 1104 |
#argument: '8-plane' |
975 | 1105 |
#choice: #colorMapMode |
1106 |
#choiceValue: '8-plane' |
|
672 | 1107 |
) |
1108 |
#(#MenuItem |
|
1109 |
#label: '4-Plane' |
|
843 | 1110 |
#translateLabel: true |
975 | 1111 |
#value: #colorMapMode: |
929 | 1112 |
#activeHelpKey: #colorMap4 |
672 | 1113 |
#argument: '4-plane' |
975 | 1114 |
#choice: #colorMapMode |
1115 |
#choiceValue: '4-plane' |
|
400 | 1116 |
) |
1117 |
#(#MenuItem |
|
672 | 1118 |
#label: '2-Plane' |
843 | 1119 |
#translateLabel: true |
975 | 1120 |
#value: #colorMapMode: |
929 | 1121 |
#activeHelpKey: #colorMap2 |
672 | 1122 |
#argument: '2-plane' |
975 | 1123 |
#choice: #colorMapMode |
1124 |
#choiceValue: '2-plane' |
|
400 | 1125 |
) |
1126 |
#(#MenuItem |
|
672 | 1127 |
#label: '1-Plane' |
843 | 1128 |
#translateLabel: true |
975 | 1129 |
#value: #colorMapMode: |
929 | 1130 |
#activeHelpKey: #colorMap1 |
672 | 1131 |
#argument: '1-plane' |
975 | 1132 |
#choice: #colorMapMode |
1133 |
#choiceValue: '1-plane' |
|
400 | 1134 |
) |
1135 |
#(#MenuItem |
|
672 | 1136 |
#label: '-' |
1137 |
) |
|
1138 |
#(#MenuItem |
|
1139 |
#label: '8-Plane + Mask' |
|
843 | 1140 |
#translateLabel: true |
975 | 1141 |
#value: #colorMapMode: |
929 | 1142 |
#activeHelpKey: #colorMap8M |
672 | 1143 |
#argument: '8-plane + mask' |
975 | 1144 |
#choice: #colorMapMode |
1145 |
#choiceValue: '8-plane + mask' |
|
400 | 1146 |
) |
1147 |
#(#MenuItem |
|
672 | 1148 |
#label: '4-Plane + Mask' |
843 | 1149 |
#translateLabel: true |
975 | 1150 |
#value: #colorMapMode: |
929 | 1151 |
#activeHelpKey: #colorMap4M |
672 | 1152 |
#argument: '4-plane + mask' |
975 | 1153 |
#choice: #colorMapMode |
1154 |
#choiceValue: '4-plane + mask' |
|
400 | 1155 |
) |
1156 |
#(#MenuItem |
|
672 | 1157 |
#label: '2-Plane + Mask' |
843 | 1158 |
#translateLabel: true |
975 | 1159 |
#value: #colorMapMode: |
929 | 1160 |
#activeHelpKey: #colorMap2M |
672 | 1161 |
#argument: '2-plane + mask' |
975 | 1162 |
#choice: #colorMapMode |
1163 |
#choiceValue: '2-plane + mask' |
|
672 | 1164 |
) |
1165 |
#(#MenuItem |
|
1166 |
#label: '1-Plane + Mask' |
|
843 | 1167 |
#translateLabel: true |
975 | 1168 |
#value: #colorMapMode: |
929 | 1169 |
#activeHelpKey: #colorMap1M |
672 | 1170 |
#argument: '1-plane + mask' |
975 | 1171 |
#choice: #colorMapMode |
1172 |
#choiceValue: '1-plane + mask' |
|
400 | 1173 |
) |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
1174 |
#(#MenuItem |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
1175 |
#label: '-' |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
1176 |
) |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
1177 |
#(#MenuItem |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
1178 |
#label: 'Compress colormap' |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
1179 |
#translateLabel: true |
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1180 |
#value: #compressColorMap |
929 | 1181 |
#activeHelpKey: #compressColormap |
1008 | 1182 |
#enabled: #hasColormap |
1183 |
) |
|
1184 |
#(#MenuItem |
|
1185 |
#label: 'Sort colormap' |
|
1186 |
#translateLabel: true |
|
1187 |
#value: #sortColorMap |
|
1188 |
#enabled: #hasColormap |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
1189 |
) |
400 | 1190 |
) nil |
1191 |
nil |
|
1192 |
) |
|
1193 |
) |
|
1194 |
#(#MenuItem |
|
737 | 1195 |
#label: 'Settings' |
843 | 1196 |
#translateLabel: true |
737 | 1197 |
#submenu: |
1198 |
#(#Menu |
|
1199 |
||
1200 |
#( |
|
1201 |
#(#MenuItem |
|
905 | 1202 |
#label: 'Grid Magnification...' |
1203 |
#translateLabel: true |
|
1204 |
#value: #doChangeGridMagnification |
|
1205 |
#activeHelpKey: #settingsGridMagnification |
|
1206 |
) |
|
1033
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1008
diff
changeset
|
1207 |
"/ #(#MenuItem |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1008
diff
changeset
|
1208 |
"/ #label: '-' |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1008
diff
changeset
|
1209 |
"/ ) |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1008
diff
changeset
|
1210 |
"/ #(#MenuItem |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1008
diff
changeset
|
1211 |
"/ #label: 'Fonts' |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1008
diff
changeset
|
1212 |
"/ #translateLabel: true |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1008
diff
changeset
|
1213 |
"/ #submenuChannel: #menuFont |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1008
diff
changeset
|
1214 |
"/ ) |
737 | 1215 |
) nil |
1216 |
nil |
|
1217 |
) |
|
1218 |
) |
|
1219 |
#(#MenuItem |
|
756 | 1220 |
#label: 'History' |
843 | 1221 |
#translateLabel: true |
756 | 1222 |
#activeHelpKey: #history |
1223 |
#submenuChannel: #menuHistory |
|
1224 |
) |
|
1225 |
#(#MenuItem |
|
672 | 1226 |
#label: 'Help' |
843 | 1227 |
#translateLabel: true |
672 | 1228 |
#startGroup: #right |
1229 |
#activeHelpKey: #help |
|
1230 |
#submenuChannel: #menuHelp |
|
400 | 1231 |
) |
1232 |
) nil |
|
1233 |
nil |
|
1234 |
) |
|
986 | 1235 |
|
1008 | 1236 |
"Modified: / 30.9.1998 / 23:53:12 / cg" |
400 | 1237 |
! |
1238 |
||
679 | 1239 |
menuMouseButtonColors |
737 | 1240 |
"This resource specification was automatically generated |
1241 |
by the MenuEditor of ST/X." |
|
679 | 1242 |
|
737 | 1243 |
"Do not manually edit this!! If it is corrupted, |
1244 |
the MenuEditor may not be able to read the specification." |
|
679 | 1245 |
|
1246 |
" |
|
1247 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuMouseButtonColors |
|
1248 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuMouseButtonColors)) startUp |
|
1249 |
" |
|
1250 |
||
1251 |
<resource: #menu> |
|
1252 |
||
1253 |
^ |
|
1254 |
||
1255 |
#(#Menu |
|
1256 |
||
1257 |
#( |
|
1258 |
#(#MenuItem |
|
1259 |
#label: 'Left Mouse Button' |
|
1260 |
#nameKey: #leftMouseKeyButton |
|
1261 |
#activeHelpKey: #mouseKeyColorMode |
|
975 | 1262 |
#enabled: #imageIsLoaded |
679 | 1263 |
#labelImage: #(#ResourceRetriever nil #leftMouseKeyIcon) |
975 | 1264 |
#choice: #mouseKeyColorMode |
1265 |
#choiceValue: 1 |
|
679 | 1266 |
) |
1267 |
#(#MenuItem |
|
1268 |
#label: 'Right Mouse Button' |
|
1269 |
#nameKey: #rightMouseKeyButton |
|
1270 |
#activeHelpKey: #mouseKeyColorMode |
|
975 | 1271 |
#enabled: #imageIsLoaded |
679 | 1272 |
#labelImage: #(#ResourceRetriever nil #rightMouseKeyIcon) |
975 | 1273 |
#choice: #mouseKeyColorMode |
1274 |
#choiceValue: 2 |
|
679 | 1275 |
) |
1276 |
) nil |
|
1277 |
nil |
|
1278 |
) |
|
1279 |
! |
|
1280 |
||
400 | 1281 |
menuToolbar |
737 | 1282 |
"This resource specification was automatically generated |
1283 |
by the MenuEditor of ST/X." |
|
400 | 1284 |
|
737 | 1285 |
"Do not manually edit this!! If it is corrupted, |
1286 |
the MenuEditor may not be able to read the specification." |
|
400 | 1287 |
|
1288 |
" |
|
1289 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuToolbar |
|
1290 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuToolbar)) startUp |
|
1291 |
" |
|
1292 |
||
1293 |
<resource: #menu> |
|
1294 |
||
1295 |
^ |
|
1296 |
||
1297 |
#(#Menu |
|
1298 |
||
1299 |
#( |
|
1300 |
#(#MenuItem |
|
672 | 1301 |
#label: 'newImage' |
1302 |
#isButton: true |
|
767 | 1303 |
#value: #doNewImage |
672 | 1304 |
#activeHelpKey: #fileNewImage |
880 | 1305 |
#labelImage: #(#ResourceRetriever #Icon #newIcon) |
400 | 1306 |
) |
1307 |
#(#MenuItem |
|
672 | 1308 |
#label: 'loadFromClass' |
1309 |
#isButton: true |
|
767 | 1310 |
#value: #doLoadFromClass |
672 | 1311 |
#activeHelpKey: #fileLoadFromClass |
880 | 1312 |
#labelImage: #(#ResourceRetriever #Icon #loadIcon) |
672 | 1313 |
) |
1314 |
#(#MenuItem |
|
1315 |
#label: 'saveMethod' |
|
1316 |
#isButton: true |
|
767 | 1317 |
#value: #doSaveMethod |
672 | 1318 |
#activeHelpKey: #fileSaveMethod |
1319 |
#enabled: #imageIsLoaded |
|
880 | 1320 |
#labelImage: #(#ResourceRetriever #Icon #saveIcon) |
400 | 1321 |
) |
1322 |
#(#MenuItem |
|
672 | 1323 |
#label: '' |
400 | 1324 |
) |
1325 |
#(#MenuItem |
|
672 | 1326 |
#label: '' |
1327 |
) |
|
1328 |
#(#MenuItem |
|
1329 |
#label: '' |
|
1330 |
) |
|
1331 |
#(#MenuItem |
|
1332 |
#label: '' |
|
400 | 1333 |
) |
1334 |
#(#MenuItem |
|
672 | 1335 |
#label: 'Point' |
1336 |
#activeHelpKey: #drawModePoint |
|
1337 |
#enabled: #imageIsLoaded |
|
975 | 1338 |
#choice: #editMode |
1339 |
#choiceValue: #point |
|
400 | 1340 |
) |
1341 |
#(#MenuItem |
|
672 | 1342 |
#label: 'Box' |
1343 |
#activeHelpKey: #drawModeBox |
|
1344 |
#enabled: #imageIsLoaded |
|
975 | 1345 |
#choice: #editMode |
1346 |
#choiceValue: #box |
|
400 | 1347 |
) |
1348 |
#(#MenuItem |
|
672 | 1349 |
#label: 'Filled Box' |
1350 |
#activeHelpKey: #drawModeFilledBox |
|
1351 |
#enabled: #imageIsLoaded |
|
975 | 1352 |
#choice: #editMode |
1353 |
#choiceValue: #filledBox |
|
400 | 1354 |
) |
1355 |
#(#MenuItem |
|
672 | 1356 |
#label: 'Fill' |
1357 |
#activeHelpKey: #drawModeFill |
|
1358 |
#enabled: #imageIsLoaded |
|
975 | 1359 |
#choice: #editMode |
1360 |
#choiceValue: #fill |
|
400 | 1361 |
) |
1362 |
#(#MenuItem |
|
672 | 1363 |
#label: 'Copy' |
1364 |
#activeHelpKey: #drawModeCopy |
|
1365 |
#enabled: #imageIsLoaded |
|
975 | 1366 |
#choice: #editMode |
1367 |
#choiceValue: #copy |
|
400 | 1368 |
) |
1369 |
#(#MenuItem |
|
672 | 1370 |
#label: 'Paste' |
1371 |
#activeHelpKey: #drawModePaste |
|
1372 |
#enabled: #imageIsLoaded |
|
975 | 1373 |
#choice: #editMode |
1374 |
#choiceValue: #paste |
|
400 | 1375 |
) |
914 | 1376 |
#(#MenuItem |
1377 |
#label: 'Paste Under' |
|
1378 |
#activeHelpKey: #drawModePasteUnder |
|
1379 |
#enabled: #imageIsLoaded |
|
975 | 1380 |
#choice: #editMode |
1381 |
#choiceValue: #pasteUnder |
|
914 | 1382 |
) |
400 | 1383 |
) nil |
1384 |
nil |
|
1385 |
) |
|
1386 |
! ! |
|
1387 |
||
1388 |
!ImageEditor methodsFor:'accessing'! |
|
1389 |
||
1390 |
image |
|
767 | 1391 |
"returns the current editing image" |
400 | 1392 |
|
911 | 1393 |
^imageEditView image |
400 | 1394 |
! |
1395 |
||
1396 |
postOpenAction: anAction |
|
767 | 1397 |
"sets an action which is evaluated after opening" |
400 | 1398 |
|
1399 |
postOpenAction := anAction |
|
1400 |
! ! |
|
1401 |
||
1402 |
!ImageEditor methodsFor:'accessing - views'! |
|
1403 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1404 |
colorDataSetView |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1405 |
"returns the view of the colormap" |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1406 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1407 |
^(builder componentAt: #colorDataSetView) |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1408 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1409 |
"Created: / 26.7.1998 / 12:02:14 / cg" |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1410 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1411 |
|
487 | 1412 |
coordLabel |
767 | 1413 |
"returns the view the coord label" |
487 | 1414 |
|
1415 |
^builder componentAt: #coordLabel |
|
1416 |
! |
|
1417 |
||
400 | 1418 |
imageEditView |
911 | 1419 |
"returns the view of the image" |
400 | 1420 |
|
911 | 1421 |
^imageEditView := (builder componentAt: #imageEditView) subViews first |
400 | 1422 |
! |
1423 |
||
1424 |
imagePreView |
|
767 | 1425 |
"returns the preview of the image" |
400 | 1426 |
|
1427 |
^(builder componentAt: #imagePreView) subViews first |
|
475 | 1428 |
! ! |
1429 |
||
400 | 1430 |
!ImageEditor methodsFor:'aspects'! |
1431 |
||
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1432 |
activityInfoHolder |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1433 |
^ self valueOfInfoLabel |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1434 |
|
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1435 |
"Modified: / 29.7.1998 / 18:49:03 / cg" |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1436 |
! |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1437 |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1438 |
colorColumnAdaptor |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1439 |
^ self |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1440 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1441 |
"Created: / 26.7.1998 / 12:17:03 / cg" |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1442 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1443 |
|
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1444 |
hasClassAndSelectorDefined |
1054 | 1445 |
^ [ |
1446 |
|clsName| |
|
1447 |
||
1448 |
(clsName := imageEditView resourceClass) size > 0 |
|
1449 |
and:[(Smalltalk at:clsName ifAbsent:nil) notNil |
|
1450 |
and:[imageEditView resourceSelector notNil]] |
|
1451 |
] |
|
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1452 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1453 |
"Created: / 31.7.1998 / 02:02:54 / cg" |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1454 |
! |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1455 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1456 |
hasClassDefined |
1054 | 1457 |
^ [ |
1458 |
|clsName| |
|
1459 |
||
1460 |
(clsName := imageEditView resourceClass) > 0 |
|
1461 |
and:[(Smalltalk at:clsName ifAbsent:nil) notNil] |
|
1462 |
] |
|
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1463 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1464 |
"Created: / 31.7.1998 / 02:02:22 / cg" |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1465 |
! |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1466 |
|
1008 | 1467 |
hasColormap |
1468 |
^ [self image notNil and:[self image colorMap notNil]] |
|
1469 |
||
1470 |
"Created: / 30.9.1998 / 23:53:55 / cg" |
|
1471 |
! |
|
1472 |
||
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1473 |
imageInfoHolder |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1474 |
|holder| |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1475 |
(holder := builder bindingAt:#imageInfoHolder) isNil ifTrue:[ |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1476 |
builder aspectAt:#imageInfoHolder put:(holder := '' asValue). |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1477 |
]. |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1478 |
^ holder |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1479 |
|
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1480 |
"Modified: / 29.7.1998 / 18:32:08 / cg" |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1481 |
! |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1482 |
|
400 | 1483 |
imageIsLoaded |
767 | 1484 |
"returns whether an image is loaded as value holder" |
400 | 1485 |
|
1486 |
|holder| |
|
1487 |
(holder := builder bindingAt:#imageIsLoaded) isNil ifTrue:[ |
|
1488 |
builder aspectAt:#imageIsLoaded put:(holder := false asValue). |
|
1489 |
]. |
|
1490 |
^ holder |
|
1491 |
! |
|
1492 |
||
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1493 |
imageIsLoadedAndClassDefined |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1494 |
"returns whether an image is loaded as value holder" |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1495 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1496 |
^ [self hasClassAndSelectorDefined value |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1497 |
and:[self imageIsLoaded value]] |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1498 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1499 |
"Created: / 31.7.1998 / 02:04:18 / cg" |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1500 |
! |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
1501 |
|
400 | 1502 |
listOfColors |
767 | 1503 |
"returns the list of colors in a List" |
400 | 1504 |
|
1505 |
|holder| |
|
1506 |
(holder := builder bindingAt:#listOfColors) isNil ifTrue:[ |
|
1507 |
builder aspectAt:#listOfColors put:(holder := List new). |
|
942 | 1508 |
holder addDependent:self. |
400 | 1509 |
]. |
1510 |
^ holder |
|
1511 |
! |
|
1512 |
||
1513 |
selectionOfColor |
|
767 | 1514 |
"returns current selection of the edit color as an AspectAdaptor" |
400 | 1515 |
|
1516 |
|holder| |
|
1517 |
(holder := builder bindingAt:#selectionOfColor) isNil ifTrue:[ |
|
1518 |
builder aspectAt:#selectionOfColor put:( |
|
1519 |
holder := AspectAdaptor new subject:self; forAspect:#selectedColorIndex). |
|
1520 |
]. |
|
1521 |
^ holder |
|
1522 |
! |
|
1523 |
||
1524 |
valueOfMagnification |
|
767 | 1525 |
"returns current magnification of the image as an AspectAdaptor" |
400 | 1526 |
|
1527 |
|holder| |
|
1528 |
(holder := builder bindingAt:#valueOfMagnification) isNil ifTrue:[ |
|
1529 |
builder aspectAt:#valueOfMagnification put:( |
|
1530 |
holder := AspectAdaptor new subject:self; forAspect:#magnification) |
|
1531 |
]. |
|
1532 |
^ holder |
|
1533 |
! ! |
|
1534 |
||
767 | 1535 |
!ImageEditor methodsFor:'change & update'! |
1536 |
||
1537 |
findColorMapMode |
|
899 | 1538 |
"finds the colorMapMode for a new image" |
767 | 1539 |
|
1054 | 1540 |
|image listOfColors| |
1541 |
||
1542 |
image := self image. |
|
1543 |
image depth > 8 ifTrue: [ |
|
1544 |
colorMapMode value: ''. |
|
1545 |
self listOfColors removeAll. |
|
1546 |
^ nil |
|
1547 |
]. |
|
1548 |
||
1549 |
colorMapMode value:(image depth printString, '-plane'). |
|
1550 |
||
1551 |
(listOfColors := self listOfColors) isEmpty ifTrue:[ |
|
1552 |
self colorMapMode: colorMapMode value. |
|
1553 |
listOfColors := self listOfColors. |
|
1554 |
image := self image. |
|
767 | 1555 |
]. |
1054 | 1556 |
imageEditView selectColors: (Array |
1557 |
with: (listOfColors at:1) |
|
1558 |
with: (listOfColors at:2 ifAbsent:[listOfColors at:1])). |
|
1559 |
||
1560 |
image mask notNil ifTrue: [ |
|
1561 |
colorMapMode value:(colorMapMode value, ' + mask'). |
|
1562 |
||
1563 |
(listOfColors detect: [:clr| clr = (Color basicNew setColorId:0)] ifNone: nil) isNil |
|
1564 |
ifTrue:[ |
|
1565 |
listOfColors addFirst: (Color basicNew setColorId:0). |
|
1566 |
imageEditView selectColors: (Array |
|
1567 |
with:(listOfColors at:2 ifAbsent:[listOfColors at: 1]) |
|
1568 |
with: (listOfColors at: 1)). |
|
898 | 1569 |
] |
767 | 1570 |
]. |
1054 | 1571 |
self selectionOfColor |
1572 |
value: 0; |
|
1573 |
value: (self listOfColors indexOf: imageEditView selectedColor). |
|
767 | 1574 |
! |
1575 |
||
942 | 1576 |
update:something with:aParameter from:changedObject |
960 | 1577 |
|clrIndex| |
1578 |
||
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1579 |
changedObject == self listOfColors ifTrue:[ |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1580 |
something == #at: ifTrue:[ |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1581 |
"/ colormap entry changed at aParameter |
960 | 1582 |
|
1583 |
clrIndex := aParameter. |
|
1584 |
(self hasMask) ifTrue:[ |
|
1585 |
clrIndex := clrIndex - 1. |
|
1586 |
]. |
|
1587 |
||
1588 |
self image colorMap at:clrIndex put:(changedObject at:aParameter). |
|
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1589 |
self colorMapChanged. |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1590 |
^ self |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1591 |
]. |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1592 |
]. |
942 | 1593 |
super update:something with:aParameter from:changedObject |
1594 |
||
960 | 1595 |
"Modified: / 18.8.1998 / 17:18:42 / cg" |
942 | 1596 |
! |
1597 |
||
1054 | 1598 |
updateForNoImage |
767 | 1599 |
"updates channels and view, if image is loaded" |
1600 |
||
1601 |
self imageIsLoaded value: false. |
|
1602 |
self listOfColors removeAll. |
|
1603 |
self imagePreView image: nil |
|
1604 |
||
1605 |
||
1606 |
||
1607 |
||
1608 |
! |
|
1609 |
||
1610 |
updateLabelsAndHistory |
|
1611 |
"updates labels and history, if something has changed" |
|
1612 |
||
1613 |
self imageIsLoaded value: self image notNil. |
|
1614 |
||
1615 |
self image isNil ifTrue: [^nil]. |
|
1616 |
||
1617 |
self updateInfoLabel. |
|
1618 |
||
911 | 1619 |
imageEditView resourceMessage asCollectionOfWords size = 2 |
1620 |
ifTrue: [self addToHistory: imageEditView resourceMessage -> #loadFromMessage:]. |
|
767 | 1621 |
|
1622 |
self image fileName notNil |
|
1623 |
ifTrue: [self addToHistory: self image fileName -> #loadFromFile:]. |
|
1624 |
||
1625 |
||
1626 |
||
1627 |
! ! |
|
1628 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1629 |
!ImageEditor methodsFor:'data access'! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1630 |
|
942 | 1631 |
blueAtColor:aColor put:newBlue |
1632 |
"helper used to return a new row element, when blue is changed" |
|
1633 |
||
1634 |
|byte| |
|
1635 |
||
1636 |
aColor isNil ifTrue:[^ aColor]. "/ mask cannot be changed |
|
1637 |
byte := newBlue clampBetween:0 and:255. |
|
960 | 1638 |
byte = aColor blueByte ifTrue:[^ aColor]. |
942 | 1639 |
^ Color redByte:(aColor redByte) greenByte:(aColor greenByte) blueByte:byte |
960 | 1640 |
|
1641 |
"Modified: / 18.8.1998 / 17:00:12 / cg" |
|
942 | 1642 |
! |
1643 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1644 |
blueFromColor:aColor |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1645 |
"helper used to access a color as a row in the dataSet view" |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1646 |
|
930 | 1647 |
aColor isNil ifTrue:[^ 'none']. |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1648 |
^ aColor blueByte ? 'mask' |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1649 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1650 |
"Created: / 26.7.1998 / 12:30:35 / cg" |
930 | 1651 |
"Modified: / 31.7.1998 / 01:11:18 / cg" |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1652 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1653 |
|
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1654 |
canSelectBlueInColor:aColor |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1655 |
^ aColor blueByte notNil |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1656 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1657 |
"Created: / 7.8.1998 / 22:50:34 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1658 |
"Modified: / 7.8.1998 / 22:52:57 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1659 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1660 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1661 |
canSelectGreenInColor:aColor |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1662 |
^ aColor greenByte notNil |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1663 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1664 |
"Created: / 7.8.1998 / 22:50:22 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1665 |
"Modified: / 7.8.1998 / 22:52:46 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1666 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1667 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1668 |
canSelectRedInColor:aColor |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1669 |
^ aColor redByte notNil |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1670 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1671 |
"Created: / 7.8.1998 / 22:50:00 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1672 |
"Modified: / 7.8.1998 / 22:51:03 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1673 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
1674 |
|
942 | 1675 |
greenAtColor:aColor put:newGreen |
1676 |
"helper used to return a new row element, when green is changed" |
|
1677 |
||
1678 |
|byte| |
|
1679 |
||
1680 |
aColor isNil ifTrue:[^ aColor]. "/ mask cannot be changed |
|
1681 |
byte := newGreen clampBetween:0 and:255. |
|
960 | 1682 |
byte = aColor greenByte ifTrue:[^ aColor]. |
942 | 1683 |
^ Color redByte:(aColor redByte) greenByte:byte blueByte:(aColor blueByte) |
960 | 1684 |
|
1685 |
"Modified: / 18.8.1998 / 17:00:38 / cg" |
|
942 | 1686 |
! |
1687 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1688 |
greenFromColor:aColor |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1689 |
"helper used to access a color as a row in the dataSet view" |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1690 |
|
930 | 1691 |
aColor isNil ifTrue:[^ 'none']. |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1692 |
^ aColor greenByte ? 'mask' |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1693 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1694 |
"Created: / 26.7.1998 / 12:30:29 / cg" |
930 | 1695 |
"Modified: / 31.7.1998 / 01:11:31 / cg" |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1696 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1697 |
|
942 | 1698 |
redAtColor:aColor put:newRed |
1699 |
"helper used to return a new row element, when red is changed" |
|
1700 |
||
1701 |
|byte| |
|
1702 |
||
1703 |
aColor isNil ifTrue:[^ aColor]. "/ mask cannot be changed |
|
1704 |
byte := newRed clampBetween:0 and:255. |
|
960 | 1705 |
byte = aColor redByte ifTrue:[^ aColor]. |
942 | 1706 |
^ Color redByte:byte greenByte:(aColor greenByte) blueByte:(aColor blueByte) |
960 | 1707 |
|
1708 |
"Modified: / 18.8.1998 / 17:00:49 / cg" |
|
942 | 1709 |
! |
1710 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1711 |
redFromColor:aColor |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1712 |
"helper used to access a color as a row in the dataSet view" |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1713 |
|
930 | 1714 |
aColor isNil ifTrue:[^ 'none']. |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1715 |
^ aColor redByte ? 'mask' |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1716 |
|
930 | 1717 |
"Modified: / 31.7.1998 / 01:11:35 / cg" |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1718 |
! ! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1719 |
|
672 | 1720 |
!ImageEditor methodsFor:'help'! |
1721 |
||
1722 |
defaultInfoLabel |
|
767 | 1723 |
"returns the default info label" |
672 | 1724 |
|
911 | 1725 |
(imageEditView resourceClass isSymbol and: [(Smalltalk at: imageEditView resourceClass) isClass]) |
672 | 1726 |
ifTrue: |
1727 |
[ |
|
911 | 1728 |
^imageEditView resourceClass, ' >> ', imageEditView resourceSelector |
672 | 1729 |
]. |
767 | 1730 |
^'No class and selector defined.' |
674 | 1731 |
! |
1732 |
||
702 | 1733 |
openDocumentation |
767 | 1734 |
"opens the documentation file of the Image Editor" |
674 | 1735 |
|
763 | 1736 |
self openHTMLDocument: 'tools/uipainter/ImageEditor.html' |
1737 |
||
672 | 1738 |
! ! |
1739 |
||
767 | 1740 |
!ImageEditor methodsFor:'loading'! |
1741 |
||
1742 |
loadFromFile: aFileName |
|
1743 |
"loads an image from aFileName and sets up color map list and other info labels" |
|
1744 |
||
960 | 1745 |
|img| |
1746 |
||
980
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
1747 |
self withCursor:Cursor wait do:[ |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
1748 |
(imageEditView loadFromFile: aFileName) notNil ifTrue:[ |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
1749 |
(img := self image) notNil ifTrue:[ |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
1750 |
img colorMap notNil ifTrue:[ |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
1751 |
self listOfColors contents:(img usedColors asSet asOrderedCollection). |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
1752 |
] ifFalse:[ |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
1753 |
self listOfColors removeAll. |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
1754 |
]. |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
1755 |
self findColorMapMode. |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
1756 |
self updateLabelsAndHistory. |
1057 | 1757 |
imageEditView image:img. |
960 | 1758 |
] ifFalse:[ |
1054 | 1759 |
self updateForNoImage |
1057 | 1760 |
]. |
1761 |
self imagePreView image:img. |
|
767 | 1762 |
] |
1763 |
] |
|
960 | 1764 |
|
1057 | 1765 |
"Modified: / 16.3.1999 / 21:44:26 / cg" |
767 | 1766 |
! |
1767 |
||
960 | 1768 |
loadFromImage:anImage |
767 | 1769 |
"loads an image from anImage and sets up color map list and other info labels" |
1770 |
||
960 | 1771 |
imageEditView image:anImage. |
1057 | 1772 |
self imagePreView image: anImage. |
1773 |
anImage notNil ifTrue:[ |
|
1774 |
anImage colorMap notNil ifTrue:[ |
|
1775 |
self listOfColors contents:(anImage usedColors asSet asOrderedCollection). |
|
960 | 1776 |
] ifFalse:[ |
767 | 1777 |
self listOfColors removeAll. |
1778 |
]. |
|
1779 |
self findColorMapMode. |
|
1780 |
self updateLabelsAndHistory. |
|
960 | 1781 |
] ifFalse:[ |
1054 | 1782 |
self updateForNoImage |
767 | 1783 |
] |
960 | 1784 |
|
1057 | 1785 |
"Modified: / 16.3.1999 / 21:43:56 / cg" |
767 | 1786 |
! |
1787 |
||
1788 |
loadFromMessage: aMessage |
|
1789 |
"loads an image by evaluating aMessage and sets up color map list and other info labels" |
|
1790 |
||
960 | 1791 |
|img| |
1792 |
||
1793 |
(imageEditView loadFromMessage: aMessage) notNil ifTrue:[ |
|
1794 |
(img := self image) notNil ifTrue:[ |
|
1795 |
self listOfColors contents:(img usedColors asSet asOrderedCollection). |
|
767 | 1796 |
self findColorMapMode. |
1797 |
self updateLabelsAndHistory. |
|
1057 | 1798 |
imageEditView image:img. |
1799 |
self imagePreView image:img. |
|
960 | 1800 |
] ifFalse:[ |
1054 | 1801 |
self updateForNoImage |
767 | 1802 |
] |
1803 |
] |
|
960 | 1804 |
|
1057 | 1805 |
"Modified: / 16.3.1999 / 21:44:41 / cg" |
767 | 1806 |
! |
1807 |
||
1808 |
loadFromOrPrepareForMessage: aMessage |
|
1809 |
"loads an image by evaluating aMessage; |
|
1810 |
if no image could extract from aMessage; do set the class and the selector from |
|
1811 |
the aMessage for a saving at the end of editing" |
|
1812 |
||
911 | 1813 |
(imageEditView loadFromMessage: aMessage) notNil |
767 | 1814 |
ifTrue: |
1815 |
[ |
|
1816 |
self listOfColors contents: self image usedColors asSet asOrderedCollection. |
|
1817 |
self findColorMapMode. |
|
1818 |
] |
|
1819 |
ifFalse: |
|
1820 |
[ |
|
911 | 1821 |
imageEditView resourceMessage: aMessage. |
767 | 1822 |
]. |
1823 |
self updateLabelsAndHistory. |
|
1057 | 1824 |
self imagePreView image:(self image). |
1825 |
||
1826 |
"Modified: / 16.3.1999 / 21:45:07 / cg" |
|
767 | 1827 |
! ! |
1828 |
||
400 | 1829 |
!ImageEditor methodsFor:'menu modes'! |
1830 |
||
975 | 1831 |
colorMapMode |
1832 |
"returns colorMapMode" |
|
400 | 1833 |
|
975 | 1834 |
colorMapMode isNil ifTrue: [colorMapMode := '' asValue]. |
400 | 1835 |
|
975 | 1836 |
^colorMapMode |
400 | 1837 |
! |
1838 |
||
975 | 1839 |
editMode |
1840 |
"returns editMode" |
|
400 | 1841 |
|
1054 | 1842 |
editMode isNil ifTrue: [ |
975 | 1843 |
editMode := #point asValue. |
1054 | 1844 |
editMode onChangeSend:#value to:[imageEditView editMode:(editMode value)] |
975 | 1845 |
]. |
1846 |
||
1847 |
^editMode |
|
400 | 1848 |
! |
1849 |
||
975 | 1850 |
mouseKeyColorMode |
1851 |
"returns mouseKeyColorMode" |
|
400 | 1852 |
|
975 | 1853 |
mouseKeyColorMode isNil |
1854 |
ifTrue: |
|
1855 |
[ |
|
1856 |
mouseKeyColorMode := 1 asValue. |
|
1857 |
mouseKeyColorMode onChangeSend: #value to: [imageEditView mouseKeyColorMode: mouseKeyColorMode value. self selectionOfColor value: (self listOfColors indexOf: imageEditView selectedColor).] |
|
956 | 1858 |
]. |
400 | 1859 |
|
975 | 1860 |
^mouseKeyColorMode |
400 | 1861 |
! ! |
1862 |
||
535 | 1863 |
!ImageEditor methodsFor:'queries'! |
1864 |
||
960 | 1865 |
hasMask |
975 | 1866 |
^ colorMapMode notNil and:[colorMapMode value endsWith:'mask'] |
960 | 1867 |
|
1868 |
"Created: / 18.8.1998 / 17:17:38 / cg" |
|
1869 |
! |
|
1870 |
||
535 | 1871 |
preferredExtent |
767 | 1872 |
"returns the preferred extent" |
535 | 1873 |
|
1874 |
^super preferredExtent max: (Screen current width//3)@(Screen current height//3.5) |
|
1875 |
||
1876 |
||
1877 |
! ! |
|
1878 |
||
400 | 1879 |
!ImageEditor methodsFor:'selection'! |
1880 |
||
1881 |
magnification |
|
767 | 1882 |
"returns the magnification of the image" |
400 | 1883 |
|
911 | 1884 |
self imageEditView isNil ifTrue: [^1]. |
1885 |
^imageEditView magnification x |
|
400 | 1886 |
! |
1887 |
||
1888 |
magnification: aValue |
|
767 | 1889 |
"sets the magnification of the image" |
400 | 1890 |
|
905 | 1891 |
|magnification| |
1892 |
magnification := (aValue ? 1) asPoint. |
|
911 | 1893 |
(magnification = imageEditView magnification or: [magnification = (0@0)]) ifTrue: [^nil]. |
1894 |
imageEditView magnification: magnification |
|
400 | 1895 |
! |
1896 |
||
1897 |
selectedColorIndex |
|
767 | 1898 |
"returns the index of the selected color" |
400 | 1899 |
|
1900 |
^selectedColorIndex |
|
1901 |
! |
|
1902 |
||
1903 |
selectedColorIndex: anIndex |
|
767 | 1904 |
"sets the index of the selected color" |
400 | 1905 |
|
1054 | 1906 |
|clr pixel| |
1907 |
||
1908 |
selectedColorIndex := anIndex. |
|
1909 |
clr := self listOfColors at:anIndex ifAbsent:nil. |
|
1910 |
clr isNil ifTrue:[^ self]. |
|
1911 |
||
1912 |
(self listOfColors at:1) = Color noColor ifTrue:[ |
|
1913 |
anIndex == 1 ifTrue:[ |
|
1914 |
pixel := nil. "/ mask |
|
1915 |
] ifFalse:[ |
|
1916 |
pixel := anIndex - 2 |
|
1917 |
] |
|
1918 |
] ifFalse:[ |
|
1919 |
pixel := anIndex - 1 |
|
1920 |
]. |
|
1921 |
imageEditView selectedColorIndex:pixel. |
|
1922 |
imageEditView selectedColor:clr. |
|
400 | 1923 |
|
1924 |
! ! |
|
1925 |
||
1926 |
!ImageEditor methodsFor:'startup / release'! |
|
1927 |
||
1928 |
closeRequest |
|
767 | 1929 |
"close request" |
400 | 1930 |
|
911 | 1931 |
imageEditView checkModified ifTrue:[super closeRequest] |
400 | 1932 |
|
1933 |
! |
|
1934 |
||
1935 |
open |
|
767 | 1936 |
"after opening, sets the masterApplication of the imageEditView to self" |
400 | 1937 |
|
1938 |
super open. |
|
444 | 1939 |
|
911 | 1940 |
imageEditView := (builder componentAt: #imageEditView) subViews first. |
975 | 1941 |
imageEditView masterApplication: self. |
1942 |
||
400 | 1943 |
! |
1944 |
||
1945 |
postOpenWith:aBuilder |
|
767 | 1946 |
"after opening, sets the masterApplication of the imageEditView to self; |
1947 |
evaluate the postOpenAction" |
|
400 | 1948 |
|
911 | 1949 |
imageEditView masterApplication: self. |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1950 |
imageEditView imageInfoHolder:(self imageInfoHolder). |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1951 |
imageEditView activityInfoHolder:(self activityInfoHolder). |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1952 |
|
400 | 1953 |
postOpenAction notNil ifTrue: [postOpenAction value]. |
1954 |
||
767 | 1955 |
super postOpenWith:aBuilder |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
1956 |
|
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
1957 |
"Modified: / 29.7.1998 / 18:49:20 / cg" |
400 | 1958 |
! ! |
1959 |
||
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
1960 |
!ImageEditor methodsFor:'user actions - colormap'! |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
1961 |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1962 |
addColorToColormap |
1057 | 1963 |
|depth img cMap newColorMap newImage oldCListSize newMode| |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1964 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1965 |
img := self image. |
1054 | 1966 |
depth := img depth. |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1967 |
cMap := img colorMap. |
1054 | 1968 |
cMap isNil ifTrue:[ |
1969 |
self warn:'Image has no colormap\change colorMap mode first.' withCRs. |
|
1970 |
^ self |
|
1971 |
]. |
|
1972 |
||
1973 |
((depth == 1) |
|
1974 |
or:[cMap size == (1 bitShift:depth)]) ifTrue:[ |
|
1975 |
depth >= 8 ifTrue:[ |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1976 |
self warn:'No space for more colors in colormap.'. |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1977 |
^ self |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1978 |
]. |
1054 | 1979 |
(self confirm:'No space for more colors in colormap.\Change depth first.' withCRs) |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1980 |
ifFalse:[ |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1981 |
^ self |
1057 | 1982 |
]. |
1983 |
||
1984 |
imageEditView makeUndo. |
|
1985 |
newMode := (depth*2) printString , (colorMapMode value copyFrom:2). |
|
1986 |
self colorMapMode:newMode. |
|
1987 |
] ifFalse:[ |
|
1988 |
imageEditView makeUndo. |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1989 |
]. |
1054 | 1990 |
|
1057 | 1991 |
self halt. |
1054 | 1992 |
cMap := cMap asArray. |
1993 |
oldCListSize := self listOfColors size. |
|
1994 |
||
1995 |
"/ (colorMapMode value asString endsWith:'mask') ifTrue:[ |
|
1996 |
"/ cMap last = Color noColor ifTrue:[ |
|
1997 |
"/ cMap := cMap copyWithoutLast:1 |
|
1998 |
"/ ] ifFalse:[ |
|
1999 |
"/ cMap first = Color noColor ifTrue:[ |
|
2000 |
"/ cMap := cMap copyFrom:2 |
|
2001 |
"/ ] |
|
2002 |
"/ ]. |
|
2003 |
"/ ]. |
|
2004 |
"/ |
|
2005 |
||
2006 |
newColorMap := cMap copyWith:(Color black). |
|
2007 |
||
2008 |
newImage := img species new |
|
2009 |
width:img width |
|
2010 |
height:img height |
|
2011 |
depth:depth |
|
2012 |
fromArray:img bits. |
|
2013 |
||
2014 |
newImage colorMap:newColorMap. |
|
2015 |
newImage fileName:img fileName. |
|
2016 |
newImage mask:(img mask copy). |
|
2017 |
||
2018 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
2019 |
self listOfColors contents: newImage colorMap. |
|
2020 |
self findColorMapMode. |
|
2021 |
"/ mhmh - somehow, we get two colors added ... (sigh findColorMapMode adds another one ...) |
|
2022 |
self listOfColors size > (oldCListSize + 1) ifTrue:[ |
|
2023 |
self listOfColors removeLast |
|
2024 |
]. |
|
2025 |
self selectionOfColor value:(self listOfColors size). |
|
2026 |
self updateLabelsAndHistory. |
|
2027 |
] |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2028 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2029 |
"Created: / 12.3.1999 / 00:20:28 / cg" |
1057 | 2030 |
"Modified: / 16.3.1999 / 21:57:26 / cg" |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2031 |
! |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2032 |
|
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2033 |
colorMapChanged |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2034 |
|img| |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2035 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2036 |
img := self image. |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2037 |
img release. |
960 | 2038 |
imageEditView invalidate. |
2039 |
self imagePreView invalidate. |
|
2040 |
||
2041 |
"/ (imageEditView image:img) notNil ifTrue:[ |
|
2042 |
"/ self updateLabelsAndHistory. |
|
2043 |
"/ self imagePreView image:img |
|
2044 |
"/ ] |
|
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2045 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2046 |
"Created: / 7.8.1998 / 22:26:10 / cg" |
960 | 2047 |
"Modified: / 18.8.1998 / 17:08:55 / cg" |
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2048 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2049 |
|
975 | 2050 |
colorMapMode:aMode |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2051 |
"calculates a new color map for the image from aMode" |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2052 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2053 |
|depth numColors newColorMap newImage |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2054 |
oldImage image newColors realColorMap oldFileName |
1008 | 2055 |
usedColors useNearest usageCounts tmpBits tmpMap quest |
2056 |
prevMode maskThreshold maskImage| |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2057 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2058 |
self withExecuteCursorDo:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2059 |
oldImage := self image. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2060 |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2061 |
prevMode := colorMapMode value. |
1008 | 2062 |
oldImage depth > 8 ifTrue:[ |
2063 |
prevMode := nil |
|
2064 |
]. |
|
2065 |
||
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2066 |
newColorMap := self class listOfColorMaps at:aMode. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2067 |
depth := (newColorMap size log: 2) asInteger. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2068 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2069 |
useNearest := false. |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2070 |
depth == 1 ifTrue:[ |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2071 |
quest := 'Keep colormap (or use standard B&W)' |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2072 |
] ifFalse:[ |
1008 | 2073 |
prevMode isNil ifTrue:[ |
2074 |
quest := 'Compute colormap (or use standard)' |
|
2075 |
] ifFalse:[ |
|
2076 |
quest := 'Keep colormap (or use standard)' |
|
2077 |
] |
|
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2078 |
]. |
1008 | 2079 |
((prevMode = aMode) |
1057 | 2080 |
or:[depth > oldImage depth |
2081 |
or:[self confirm:(resources string:quest)]]) ifTrue:[ |
|
1008 | 2082 |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2083 |
"/ keep the colormap |
1008 | 2084 |
newColorMap atAllPut:Color black. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2085 |
depth > oldImage depth ifTrue:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2086 |
"/ easy - simply copy the part |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2087 |
numColors := 1 bitShift:oldImage depth. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2088 |
0 to:numColors-1 do:[:pixel | |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2089 |
newColorMap at:(pixel+1) put:(oldImage colorFromValue:pixel) |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2090 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2091 |
] ifFalse:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2092 |
"/ see if all used color fit the new colormap |
986 | 2093 |
usedColors := oldImage usedColorsMax:(1 bitShift:depth). |
2094 |
(usedColors notNil and:[usedColors size <= (1 bitShift:depth)]) ifTrue:[ |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2095 |
"/ yea - just install them |
986 | 2096 |
usedColors asArray keysAndValuesDo:[:idx :clr | |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2097 |
newColorMap at:idx put:clr |
1008 | 2098 |
]. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2099 |
] ifFalse:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2100 |
"/ copy over those that are most often used. |
986 | 2101 |
oldImage depth < 8 ifTrue:[ |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2102 |
tmpBits := ByteArray uninitializedNew:(oldImage width*oldImage height). |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2103 |
oldImage bits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2104 |
expandPixels:(oldImage depth) |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2105 |
width:oldImage width |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2106 |
height:oldImage height |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2107 |
into:tmpBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2108 |
mapping:nil. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2109 |
] ifFalse:[ |
986 | 2110 |
oldImage depth == 8 ifTrue:[ |
2111 |
tmpBits := oldImage bits |
|
2112 |
] ifFalse:[ |
|
2113 |
self warn:'Too many colors in image.'. |
|
2114 |
^ self |
|
2115 |
] |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2116 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2117 |
usageCounts := tmpBits usageCounts. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2118 |
tmpMap := Array new:usageCounts size. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2119 |
oldImage colorMap asArray keysAndValuesDo:[:i :clr | |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2120 |
tmpMap at:i put:clr |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2121 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2122 |
usageCounts sort:[:a :b | a > b] with:tmpMap. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2123 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2124 |
1 to:(1 bitShift:depth) do:[:idx | |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2125 |
newColorMap at:idx put:(tmpMap at:idx) |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2126 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2127 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2128 |
useNearest := Dialog |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2129 |
confirmWithCancel:(resources |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2130 |
string:'Image requires %1 colors.\ColorMap has only space for %2\\Use nearest (or map to first color) ?' |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2131 |
with:usedColors size |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2132 |
with:(1 bitShift:depth)) withCRs |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2133 |
labels:(resources array:#('cancel' 'first' 'nearest')). |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2134 |
useNearest isNil ifTrue:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2135 |
^ self "/ cancel |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2136 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2137 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2138 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2139 |
] ifFalse:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2140 |
"/ standard colormap |
921
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
2141 |
usedColors := oldImage usedColors. |
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
2142 |
(usedColors conform:[:clr | newColorMap includes:clr]) ifFalse:[ |
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
2143 |
useNearest := Dialog |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2144 |
confirmWithCancel:(resources |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2145 |
string:'Not all colors are present in the new colormap.\\Map missing ones to nearest (or map to first color) ?' |
921
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
2146 |
) withCRs |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2147 |
labels:(resources string:#('cancel' 'first' 'nearest')). |
921
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
2148 |
useNearest isNil ifTrue:[ |
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
2149 |
^ self "/ cancel |
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
2150 |
]. |
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
2151 |
]. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2152 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2153 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2154 |
imageEditView makeUndo. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2155 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2156 |
newImage := (Image implementorForDepth: depth) new. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2157 |
oldFileName := oldImage fileName. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2158 |
|
1008 | 2159 |
Image imageErrorSignal handle:[:ex| |
2160 |
Color colorErrorSignal handle:[:ex| |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2161 |
imageEditView undo. |
1008 | 2162 |
^ self warn:(resources string:'Conversion failed !!') |
2163 |
] do:[ |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2164 |
newImage := (Image implementorForDepth: depth) new. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2165 |
newImage width:oldImage width height:oldImage height depth:depth. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2166 |
newImage colorMap:newColorMap. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2167 |
newImage photometric:#palette. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2168 |
newImage bits:(ByteArray new:(newImage bytesPerRow * newImage height)). |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2169 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2170 |
oldImage colorsFromX:0 y:0 toX:(oldImage width-1) y:(oldImage height-1) do: |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2171 |
[:x :y :clr | |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2172 |
|newColor| |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2173 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2174 |
(newColorMap includes:clr) |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2175 |
ifTrue: [newColor := clr] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2176 |
ifFalse: [ |
1008 | 2177 |
newColor := clr nearestIn:newColorMap. |
2178 |
useNearest ifFalse:[ |
|
2179 |
(newColor deltaFrom:clr) > 0.5 ifTrue:[ |
|
2180 |
newColor := oldImage colorFromValue:0 |
|
2181 |
] |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2182 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2183 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2184 |
newImage colorAtX:x y:y put:newColor. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2185 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2186 |
image := newImage |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2187 |
]. |
1008 | 2188 |
] do:[ |
2189 |
image := newImage fromImage:oldImage |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2190 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2191 |
|
1008 | 2192 |
(aMode asString endsWith:'mask') ifTrue:[ |
2193 |
image mask isNil ifTrue:[ |
|
2194 |
(self confirm:'Generate mask from black ?') ifTrue:[ |
|
2195 |
maskThreshold := 0.1. |
|
2196 |
maskImage := Depth1Image fromImage:(image asThresholdMonochromeImage:maskThreshold). |
|
2197 |
] ifFalse:[ |
|
2198 |
maskImage := Depth1Image extent:image extent. |
|
2199 |
maskImage data:(ByteArray |
|
2200 |
new:(maskImage bytesPerRow * maskImage height) |
|
2201 |
withAll:16rFF). |
|
2202 |
||
2203 |
"/ maskImage fillRectangle:(image bounds) withColor:(Color colorId:1). |
|
2204 |
]. |
|
2205 |
image mask:maskImage. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2206 |
]. |
1008 | 2207 |
] ifFalse:[ |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2208 |
image mask: nil. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2209 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2210 |
realColorMap := OrderedCollection new. |
1054 | 2211 |
image realColorMap do:[:clr| |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2212 |
(realColorMap includes: clr) ifFalse: [realColorMap add: clr] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2213 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2214 |
newColors := realColorMap copyFrom: 1 to: (newColorMap size min: realColorMap size). |
1054 | 2215 |
newColorMap do:[:clr| |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2216 |
((newColors size < newColorMap size) and: [(newColors includes: clr) not]) |
1054 | 2217 |
ifTrue:[ |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2218 |
newColors add: clr |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2219 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2220 |
]. |
975 | 2221 |
image colorMap: newColors. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2222 |
|
1054 | 2223 |
(imageEditView image: image) notNil ifTrue:[ |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2224 |
image fileName: oldFileName. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2225 |
self listOfColors contents: image colorMap. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2226 |
self findColorMapMode. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2227 |
self updateLabelsAndHistory. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2228 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2229 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2230 |
|
1057 | 2231 |
"Modified: / 16.3.1999 / 21:55:39 / cg" |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2232 |
! |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2233 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2234 |
compressColorMap |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2235 |
"calculates a new color map for the image, using only used colors" |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2236 |
|
927 | 2237 |
|depth newColorMap newImage oldImage usedColors oldToNew oldBits newBits tmpBits| |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2238 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2239 |
oldImage := self image. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2240 |
depth := oldImage depth. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2241 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2242 |
oldImage photometric ~~ #palette ifTrue:[ |
930 | 2243 |
self information:'Compress colorMap: Only palette images have colormaps.'. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2244 |
^ self |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2245 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2246 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2247 |
usedColors := oldImage usedColors. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2248 |
usedColors size == (1 bitShift:depth) ifTrue:[ |
930 | 2249 |
self information:'Compress colorMap: All colors are used - no compression.'. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2250 |
^ self |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2251 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2252 |
usedColors size == oldImage colorMap size ifTrue:[ |
930 | 2253 |
self information:'Compress colorMap: Colormap already compressed - no compression.'. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2254 |
^ self |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2255 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2256 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2257 |
imageEditView makeUndo. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2258 |
|
930 | 2259 |
self information:('Compress colorMap: %1 colors used.' bindWith:usedColors size). |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2260 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2261 |
self withExecuteCursorDo:[ |
996
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
2262 |
"/ newColorMap := Array new:usedColors size. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2263 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2264 |
"/ translation table |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2265 |
oldToNew := ByteArray new:(1 bitShift:depth). |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2266 |
newColorMap := usedColors asArray. |
996
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
2267 |
newColorMap sort:[:a :b | |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
2268 |
a redByte == b redByte ifTrue:[ |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
2269 |
a greenByte == b greenByte ifTrue:[ |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
2270 |
a blueByte < b blueByte |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
2271 |
] ifFalse:[ |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
2272 |
a greenByte < b greenByte |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
2273 |
] |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
2274 |
] ifFalse:[ |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
2275 |
a redByte < b redByte |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
2276 |
] |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
2277 |
]. |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
2278 |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2279 |
oldImage colorMap asArray keysAndValuesDo:[:oldIdx :clr | |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2280 |
|newPixel| |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2281 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2282 |
(usedColors includes:clr) ifTrue:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2283 |
newPixel := newColorMap indexOf:clr. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2284 |
oldToNew at:oldIdx put:newPixel-1. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2285 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2286 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2287 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2288 |
oldBits := oldImage bits. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2289 |
newBits := ByteArray new:(oldBits size). |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2290 |
depth ~~ 8 ifTrue:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2291 |
"/ expand/compress can only handle 8bits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2292 |
tmpBits := ByteArray uninitializedNew:(oldImage width*oldImage height). |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2293 |
oldBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2294 |
expandPixels:depth |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2295 |
width:oldImage width |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2296 |
height:oldImage height |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2297 |
into:tmpBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2298 |
mapping:oldToNew. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2299 |
tmpBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2300 |
compressPixels:depth |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2301 |
width:oldImage width |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2302 |
height:oldImage height |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2303 |
into:newBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2304 |
mapping:nil |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2305 |
] ifFalse:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2306 |
oldBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2307 |
expandPixels:depth |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2308 |
width:oldImage width |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2309 |
height:oldImage height |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2310 |
into:newBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2311 |
mapping:oldToNew. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2312 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2313 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2314 |
newImage := oldImage species new |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2315 |
width:oldImage width |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2316 |
height:oldImage height |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2317 |
depth:depth |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2318 |
fromArray:newBits. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2319 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2320 |
newImage colorMap:newColorMap. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2321 |
newImage fileName:oldImage fileName. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2322 |
newImage mask:(oldImage mask copy). |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2323 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2324 |
(imageEditView image:newImage) notNil ifTrue: |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2325 |
[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2326 |
self listOfColors contents: newImage colorMap. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2327 |
self findColorMapMode. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2328 |
self updateLabelsAndHistory. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2329 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2330 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2331 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2332 |
"Created: / 28.7.1998 / 20:03:11 / cg" |
996
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
2333 |
"Modified: / 15.9.1998 / 17:53:32 / cg" |
1008 | 2334 |
! |
2335 |
||
2336 |
sortColorMap |
|
2337 |
"calculates a new color map for the image, sorting colors" |
|
2338 |
||
2339 |
|depth newColorMap newImage oldImage usedColors oldToNew oldBits newBits tmpBits| |
|
2340 |
||
2341 |
oldImage := self image. |
|
2342 |
depth := oldImage depth. |
|
2343 |
||
2344 |
oldImage photometric ~~ #palette ifTrue:[ |
|
2345 |
self information:'Compress colorMap: Only palette images have colormaps.'. |
|
2346 |
^ self |
|
2347 |
]. |
|
2348 |
||
2349 |
usedColors := oldImage realColorMap. |
|
2350 |
||
2351 |
imageEditView makeUndo. |
|
2352 |
||
2353 |
self withExecuteCursorDo:[ |
|
2354 |
"/ newColorMap := Array new:usedColors size. |
|
2355 |
||
2356 |
"/ translation table |
|
2357 |
oldToNew := ByteArray new:(1 bitShift:depth). |
|
2358 |
newColorMap := usedColors asArray. |
|
2359 |
newColorMap sort:[:a :b | |
|
2360 |
a redByte == b redByte ifTrue:[ |
|
2361 |
a greenByte == b greenByte ifTrue:[ |
|
2362 |
a blueByte < b blueByte |
|
2363 |
] ifFalse:[ |
|
2364 |
a greenByte < b greenByte |
|
2365 |
] |
|
2366 |
] ifFalse:[ |
|
2367 |
a redByte < b redByte |
|
2368 |
] |
|
2369 |
]. |
|
2370 |
||
2371 |
oldImage colorMap asArray keysAndValuesDo:[:oldIdx :clr | |
|
2372 |
|newPixel| |
|
2373 |
||
2374 |
(usedColors includes:clr) ifTrue:[ |
|
2375 |
newPixel := newColorMap indexOf:clr. |
|
2376 |
oldToNew at:oldIdx put:newPixel-1. |
|
2377 |
] |
|
2378 |
]. |
|
2379 |
||
2380 |
oldBits := oldImage bits. |
|
2381 |
newBits := ByteArray new:(oldBits size). |
|
2382 |
depth ~~ 8 ifTrue:[ |
|
2383 |
"/ expand/compress can only handle 8bits |
|
2384 |
tmpBits := ByteArray uninitializedNew:(oldImage width*oldImage height). |
|
2385 |
oldBits |
|
2386 |
expandPixels:depth |
|
2387 |
width:oldImage width |
|
2388 |
height:oldImage height |
|
2389 |
into:tmpBits |
|
2390 |
mapping:oldToNew. |
|
2391 |
tmpBits |
|
2392 |
compressPixels:depth |
|
2393 |
width:oldImage width |
|
2394 |
height:oldImage height |
|
2395 |
into:newBits |
|
2396 |
mapping:nil |
|
2397 |
] ifFalse:[ |
|
2398 |
oldBits |
|
2399 |
expandPixels:depth |
|
2400 |
width:oldImage width |
|
2401 |
height:oldImage height |
|
2402 |
into:newBits |
|
2403 |
mapping:oldToNew. |
|
2404 |
]. |
|
2405 |
||
2406 |
newImage := oldImage species new |
|
2407 |
width:oldImage width |
|
2408 |
height:oldImage height |
|
2409 |
depth:depth |
|
2410 |
fromArray:newBits. |
|
2411 |
||
2412 |
newImage colorMap:newColorMap. |
|
2413 |
newImage fileName:oldImage fileName. |
|
2414 |
newImage mask:(oldImage mask copy). |
|
2415 |
||
1054 | 2416 |
(imageEditView image:newImage) notNil ifTrue:[ |
1008 | 2417 |
self listOfColors contents: newImage colorMap. |
2418 |
self findColorMapMode. |
|
2419 |
self updateLabelsAndHistory. |
|
2420 |
] |
|
2421 |
] |
|
2422 |
||
2423 |
"Modified: / 15.9.1998 / 17:53:32 / cg" |
|
2424 |
"Created: / 30.9.1998 / 23:51:23 / cg" |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2425 |
! ! |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
2426 |
|
400 | 2427 |
!ImageEditor methodsFor:'user actions - editing'! |
2428 |
||
767 | 2429 |
doBrowseClass |
2430 |
"opens a System Browser on the resourceClass and the resourceSelector" |
|
400 | 2431 |
|
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2432 |
|cls| |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2433 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2434 |
cls := Smalltalk at:(imageEditView resourceClass) ifAbsent:nil. |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2435 |
cls isNil ifTrue:[^ self warn:'No Class specified']. |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2436 |
SystemBrowser |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2437 |
openInClass:cls class |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2438 |
selector:(imageEditView resourceSelector) |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2439 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2440 |
"Modified: / 31.7.1998 / 02:01:15 / cg" |
400 | 2441 |
! |
2442 |
||
905 | 2443 |
doChangeGridMagnification |
2444 |
"change grid magnification" |
|
2445 |
||
911 | 2446 |
imageEditView changeGridMagnification |
905 | 2447 |
! |
2448 |
||
1045 | 2449 |
doCropAll |
986 | 2450 |
"find all borders and cut them off" |
2451 |
||
1045 | 2452 |
imageEditView cropLeft:true right:true top:true bottom:true. |
986 | 2453 |
self updateInfoLabel |
2454 |
||
2455 |
"Modified: / 7.9.1998 / 14:26:23 / cg" |
|
2456 |
"Created: / 7.9.1998 / 16:33:43 / cg" |
|
2457 |
! |
|
2458 |
||
1045 | 2459 |
doCropBottom |
986 | 2460 |
"find a bottom border and cut it off" |
2461 |
||
1045 | 2462 |
imageEditView cropLeft:false right:false top:false bottom:true. |
986 | 2463 |
self updateInfoLabel |
2464 |
||
2465 |
"Created: / 7.9.1998 / 13:00:20 / cg" |
|
2466 |
"Modified: / 7.9.1998 / 14:26:23 / cg" |
|
2467 |
! |
|
2468 |
||
1045 | 2469 |
doCropLeft |
986 | 2470 |
"find a left border and cut it off" |
2471 |
||
1045 | 2472 |
imageEditView cropLeft:true right:false top:false bottom:false. |
986 | 2473 |
self updateInfoLabel |
2474 |
||
2475 |
"Created: / 7.9.1998 / 13:00:14 / cg" |
|
2476 |
"Modified: / 7.9.1998 / 14:26:34 / cg" |
|
2477 |
! |
|
2478 |
||
1045 | 2479 |
doCropManual |
986 | 2480 |
"let user specify borders and cut them off" |
2481 |
||
2482 |
|bindings left top right bottom| |
|
2483 |
||
2484 |
bindings := IdentityDictionary new. |
|
2485 |
bindings at:#left put:(left := 0 asValue). |
|
2486 |
bindings at:#right put:(right := 0 asValue). |
|
2487 |
bindings at:#top put:(top := 0 asValue). |
|
2488 |
bindings at:#bottom put:(bottom := 0 asValue). |
|
1045 | 2489 |
(self openDialogInterface:#gropDialogSpec withBindings:bindings) |
986 | 2490 |
ifTrue:[ |
2491 |
left := left value. |
|
2492 |
right := right value. |
|
2493 |
top := top value. |
|
2494 |
bottom := bottom value. |
|
2495 |
imageEditView |
|
2496 |
makeSubImageX:left y:top |
|
2497 |
width:(imageEditView image width - left - right) |
|
2498 |
height:(imageEditView image height - top - bottom). |
|
2499 |
self updateInfoLabel |
|
2500 |
]. |
|
2501 |
||
2502 |
"Created: / 7.9.1998 / 18:16:07 / cg" |
|
2503 |
"Modified: / 7.9.1998 / 18:20:42 / cg" |
|
2504 |
! |
|
2505 |
||
1045 | 2506 |
doCropRight |
986 | 2507 |
"find a right border and cut it off" |
2508 |
||
1045 | 2509 |
imageEditView cropLeft:false right:true top:false bottom:false. |
986 | 2510 |
self updateInfoLabel |
2511 |
||
2512 |
"Created: / 7.9.1998 / 13:00:14 / cg" |
|
2513 |
"Modified: / 7.9.1998 / 14:26:44 / cg" |
|
2514 |
! |
|
2515 |
||
1045 | 2516 |
doCropTop |
986 | 2517 |
"find a top border and cut it off" |
2518 |
||
1045 | 2519 |
imageEditView cropLeft:false right:false top:true bottom:false. |
986 | 2520 |
self updateInfoLabel |
2521 |
||
2522 |
"Created: / 7.9.1998 / 13:00:19 / cg" |
|
2523 |
"Modified: / 7.9.1998 / 14:26:52 / cg" |
|
2524 |
! |
|
2525 |
||
767 | 2526 |
doFlipHorizontal |
2527 |
"flips horizontally current image" |
|
400 | 2528 |
|
911 | 2529 |
imageEditView flipHorizontal |
400 | 2530 |
! |
2531 |
||
767 | 2532 |
doFlipVertical |
2533 |
"flips vertically current image" |
|
400 | 2534 |
|
911 | 2535 |
imageEditView flipVertical |
400 | 2536 |
! |
2537 |
||
767 | 2538 |
doMagnifyDown |
2539 |
"magnifies current image one step down" |
|
400 | 2540 |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2541 |
|magHolder mag| |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2542 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2543 |
magHolder := self valueOfMagnification. |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2544 |
(mag := magHolder value) > 1 ifTrue: [ |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2545 |
magHolder value: mag - 1 |
400 | 2546 |
] |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2547 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2548 |
"Modified: / 26.7.1998 / 20:24:08 / cg" |
400 | 2549 |
! |
2550 |
||
767 | 2551 |
doMagnifyImage |
2552 |
"magnifies current image" |
|
400 | 2553 |
|
911 | 2554 |
imageEditView magnifyImage. |
400 | 2555 |
self updateInfoLabel |
2556 |
! |
|
2557 |
||
767 | 2558 |
doMagnifyUp |
2559 |
"magnifies current image one step up" |
|
400 | 2560 |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2561 |
|magHolder mag| |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2562 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2563 |
magHolder := self valueOfMagnification. |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2564 |
(mag := magHolder value) < 99 ifTrue: [ |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2565 |
magHolder value: mag + 1 |
400 | 2566 |
] |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2567 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2568 |
"Modified: / 26.7.1998 / 20:23:52 / cg" |
400 | 2569 |
! |
2570 |
||
767 | 2571 |
doNegativeImage |
2572 |
"negates current image by negating the color map" |
|
400 | 2573 |
|
911 | 2574 |
imageEditView negativeImage. |
400 | 2575 |
self listOfColors removeAll. |
901 | 2576 |
self findColorMapMode. |
911 | 2577 |
imageEditView undoImages removeLast |
400 | 2578 |
! |
2579 |
||
767 | 2580 |
doResizeImage |
2581 |
"resizes current image" |
|
400 | 2582 |
|
911 | 2583 |
imageEditView resizeImage. |
400 | 2584 |
self updateInfoLabel |
2585 |
! |
|
2586 |
||
767 | 2587 |
doRotateImage |
2588 |
"rotates current image" |
|
400 | 2589 |
|
911 | 2590 |
imageEditView rotateImage. |
400 | 2591 |
self updateInfoLabel |
2592 |
! |
|
2593 |
||
767 | 2594 |
doUndo |
2595 |
"reverses last edit action" |
|
400 | 2596 |
|
911 | 2597 |
imageEditView undo |
400 | 2598 |
! ! |
2599 |
||
2600 |
!ImageEditor methodsFor:'user actions - loading'! |
|
2601 |
||
767 | 2602 |
doLoadFromClass |
2603 |
"opens a dialog for loading an image from class and a (resource-) selector" |
|
400 | 2604 |
|
1054 | 2605 |
(imageEditView loadFromClass) notNil ifTrue:[ |
2606 |
self image notNil ifTrue: [ |
|
574 | 2607 |
self listOfColors contents: self image usedColors asSet asOrderedCollection. |
2608 |
self findColorMapMode. |
|
767 | 2609 |
self updateLabelsAndHistory |
1054 | 2610 |
] ifFalse: [ |
2611 |
self updateForNoImage |
|
461 | 2612 |
] |
449 | 2613 |
] |
400 | 2614 |
! |
2615 |
||
767 | 2616 |
doLoadFromFile |
2617 |
"opens a dialog for loading an image from a file" |
|
400 | 2618 |
|
767 | 2619 |
self loadFromFile: |
2620 |
(FileSelectionBrowser |
|
2621 |
request: 'Load Image From' |
|
2622 |
fileName: (self image notNil ifTrue: [self image fileName] ifFalse: [nil]) |
|
2623 |
withFileFilters: FileSelectionBrowser loadImageFileNameFilters) |
|
400 | 2624 |
! |
2625 |
||
767 | 2626 |
doNewImage |
2627 |
"opens a dialog with choices of size and color map for creating a new image" |
|
400 | 2628 |
|
2629 |
|aspects| |
|
767 | 2630 |
|
400 | 2631 |
aspects := IdentityDictionary new |
767 | 2632 |
at:#listOfSizes put: self class listOfDefaultSizes asValue; |
2633 |
at:#listOfColorMaps put: self class listOfColorMaps keys asSortedCollection asValue; |
|
2634 |
at:#selectionOfSize put: self class listOfDefaultSizes first copy asValue; |
|
400 | 2635 |
at:#selectionOfColorMap put: self class listOfColorMaps keys asSortedCollection first asValue; |
2636 |
yourself. |
|
2637 |
||
767 | 2638 |
(self openDialogInterface:#dialogSpecForNewImage withBindings:aspects) |
400 | 2639 |
ifTrue: |
2640 |
[ |
|
2641 |
|width height cMap imageClass image| |
|
767 | 2642 |
|
2643 |
width := 128 min: (Integer readFromString: ((aspects at:#selectionOfSize) value upTo: $x) onError:[24]). |
|
400 | 2644 |
height := 128 min: (Integer readFromString: ((aspects at:#selectionOfSize) value copy reverse upTo: $x) reverse onError:[24]). |
2645 |
||
975 | 2646 |
cMap := (self class listOfColorMaps at: (colorMapMode value: (aspects at:#selectionOfColorMap) value) value). |
400 | 2647 |
imageClass := Image implementorForDepth: ((cMap size log: 2) asInteger). |
767 | 2648 |
image := imageClass width: width height: height fromArray: (ByteArray new: width*height). |
400 | 2649 |
|
975 | 2650 |
(colorMapMode value endsWith: 'mask') |
400 | 2651 |
ifTrue: |
2652 |
[ |
|
767 | 2653 |
image mask: (Depth1Image width: width height: height depth: 1 fromArray: (ByteArray new: width*height)) clearMaskedPixels |
400 | 2654 |
]. |
2655 |
image colorMap: cMap. |
|
2656 |
image fillRectangleX:0 y:0 width:width height:height with:Color white. |
|
911 | 2657 |
(imageEditView image: image) notNil |
400 | 2658 |
ifTrue: |
2659 |
[ |
|
2660 |
self listOfColors contents: cMap. |
|
2661 |
self findColorMapMode. |
|
694 | 2662 |
self updateLabelsAndHistory |
400 | 2663 |
] |
767 | 2664 |
] |
929 | 2665 |
! |
2666 |
||
2667 |
grabScreenImage |
|
2668 |
"let user choose an area and grab that are for editing" |
|
2669 |
||
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2670 |
Processor |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2671 |
addTimedBlock:[ |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2672 |
|image d8image img| |
929 | 2673 |
|
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2674 |
image := Image fromUser. |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2675 |
|
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2676 |
image depth > 8 ifTrue:[ |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2677 |
Object errorSignal handle:[:ex | |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2678 |
ex signal == Object haltSignal ifTrue:[ex reject]. |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2679 |
ex signal == Signal noHandlerSignal ifTrue:[ex reject]. |
982
2dda94c7ff25
allow grabbing from depth>8 screens.
Claus Gittinger <cg@exept.de>
parents:
980
diff
changeset
|
2680 |
|
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2681 |
self warn:'Could not convert to depth8 image (too many colors)'. |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2682 |
d8image := nil. |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2683 |
] do:[ |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2684 |
d8image := Depth8Image new. |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2685 |
d8image fromImage:image. |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2686 |
]. |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2687 |
d8image notNil ifTrue:[ |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2688 |
image := d8image |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2689 |
] |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2690 |
]. |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2691 |
(imageEditView image:image) notNil ifTrue:[ |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2692 |
self listOfColors contents:(image colorMap). |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2693 |
self findColorMapMode. |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2694 |
self updateLabelsAndHistory. |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2695 |
] |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2696 |
] |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2697 |
afterSeconds:1 |
929 | 2698 |
|
2699 |
"Created: / 29.7.1998 / 21:24:42 / cg" |
|
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
2700 |
"Modified: / 10.9.1998 / 16:01:23 / cg" |
400 | 2701 |
! ! |
2702 |
||
2703 |
!ImageEditor methodsFor:'user actions - saving'! |
|
2704 |
||
767 | 2705 |
doPrint |
2706 |
"prints current image on the current printer" |
|
400 | 2707 |
|
911 | 2708 |
imageEditView print |
400 | 2709 |
! |
2710 |
||
767 | 2711 |
doSaveImageFile |
2712 |
"saves current image to current file" |
|
400 | 2713 |
|
911 | 2714 |
imageEditView save |
400 | 2715 |
! |
2716 |
||
767 | 2717 |
doSaveImageFileAs |
2718 |
"opens a dialog for saving current image to a file" |
|
400 | 2719 |
|
911 | 2720 |
imageEditView saveImageFileAs. |
694 | 2721 |
self updateLabelsAndHistory |
400 | 2722 |
! |
2723 |
||
767 | 2724 |
doSaveImageMaskFileAs |
2725 |
"opens a dialog for saving mask of current image to a file" |
|
400 | 2726 |
|
911 | 2727 |
imageEditView saveImageMaskFileAs |
400 | 2728 |
! |
2729 |
||
767 | 2730 |
doSaveMethod |
2731 |
"saves current image on current class and selector" |
|
400 | 2732 |
|
911 | 2733 |
imageEditView saveMethod notNil |
400 | 2734 |
ifTrue: |
2735 |
[ |
|
694 | 2736 |
self updateLabelsAndHistory |
400 | 2737 |
] |
2738 |
! |
|
2739 |
||
767 | 2740 |
doSaveMethodAs |
2741 |
"opens a dialog for saving current image on a class and a selector" |
|
400 | 2742 |
|
911 | 2743 |
imageEditView saveMethodAs notNil |
400 | 2744 |
ifTrue: |
2745 |
[ |
|
694 | 2746 |
self updateLabelsAndHistory |
400 | 2747 |
] |
2748 |
! ! |
|
2749 |
||
2750 |
!ImageEditor class methodsFor:'documentation'! |
|
2751 |
||
2752 |
version |
|
2753 |
^ '$Header$' |
|
2754 |
! ! |