author | Stefan Vogel <sv@exept.de> |
Sun, 02 Mar 2003 21:36:42 +0100 | |
changeset 1687 | f4543a556b89 |
parent 1682 | f1b2491c9dc2 |
child 1690 | 7428f8744d87 |
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 |
||
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
13 |
"{ Package: 'stx:libtool2' }" |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
14 |
|
400 | 15 |
ToolApplicationModel subclass:#ImageEditor |
975 | 16 |
instanceVariableNames:'imageEditView colorMapMode editMode mouseKeyColorMode |
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
17 |
selectedColorIndex postOpenAction imageSeqNr drawingColormap' |
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
18 |
classVariableNames:'LastDirectory LastSizeString MaskClipboard LastColormapMode |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
19 |
DefaultRelativeSizes' |
929 | 20 |
poolDictionaries:'' |
21 |
category:'Interface-UIPainter' |
|
400 | 22 |
! |
23 |
||
24 |
!ImageEditor class methodsFor:'documentation'! |
|
25 |
||
26 |
copyright |
|
27 |
" |
|
767 | 28 |
COPYRIGHT (c) 1997-1998 by eXept Software AG |
400 | 29 |
All Rights Reserved |
30 |
||
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
405 | 33 |
inclusion of the above copyright notice. This software may not |
400 | 34 |
be provided or otherwise made available to, or used by, any |
405 | 35 |
other person. No title to or ownership of the software is |
400 | 36 |
hereby transferred. |
37 |
" |
|
38 |
! |
|
39 |
||
40 |
documentation |
|
41 |
" |
|
737 | 42 |
Image Editor allows you to create, design, modify or just inspect images. |
400 | 43 |
|
44 |
[start with:] |
|
45 |
ImageEditor open |
|
941 | 46 |
ImageEditor openOnClass:Icon andSelector:#startIcon |
400 | 47 |
|
48 |
[see also:] |
|
49 |
ImageEditView Image |
|
50 |
||
51 |
[author:] |
|
544 | 52 |
Thomas Zwick, eXept Software AG |
400 | 53 |
" |
54 |
! ! |
|
55 |
||
56 |
!ImageEditor class methodsFor:'instance creation'! |
|
57 |
||
58 |
openModalOnClass: aClass andSelector: aSelector |
|
900 | 59 |
"opens modal a Image Editor on aClass and aSelector" |
767 | 60 |
" |
61 |
self openModalOnClass: self andSelector: #leftMouseKeyIcon |
|
62 |
" |
|
400 | 63 |
|
767 | 64 |
|imageEditor imageEditView className resourceClassName resourceSelector| |
65 |
||
400 | 66 |
imageEditor := self new. |
767 | 67 |
|
900 | 68 |
aClass isClass ifTrue: [className := aClass name]. |
69 |
aClass isString ifTrue: [className := aClass]. |
|
903 | 70 |
aClass isNil ifTrue: [className := '']. |
400 | 71 |
|
688 | 72 |
imageEditor postOpenAction: [imageEditView := imageEditor imageEditView. imageEditor loadFromOrPrepareForMessage: className, ' ', aSelector]. |
400 | 73 |
imageEditor openModal. |
74 |
||
688 | 75 |
resourceClassName := imageEditView resourceClass. |
767 | 76 |
resourceSelector := imageEditView resourceSelector. |
415 | 77 |
|
815 | 78 |
((className asString ~= resourceClassName) |
79 |
or:[aSelector asString ~= resourceSelector]) |
|
415 | 80 |
ifTrue: [^resourceClassName, ' ', resourceSelector] |
81 |
ifFalse:[^nil] |
|
400 | 82 |
! |
83 |
||
84 |
openOnClass: aClass andSelector: aSelector |
|
900 | 85 |
"opens a Image Editor on aClass and aSelector" |
767 | 86 |
" |
87 |
self openOnClass: self andSelector: #leftMouseKeyIcon |
|
88 |
" |
|
400 | 89 |
|
1057 | 90 |
|editor| |
91 |
||
92 |
editor := self new. |
|
93 |
editor allButOpen. |
|
1381 | 94 |
aSelector notNil ifTrue:[ |
95 |
editor loadFromMessage: aClass name, ' ', aSelector. |
|
96 |
] ifFalse:[ |
|
97 |
editor resourceClass:aClass |
|
98 |
]. |
|
1057 | 99 |
editor openWindow |
100 |
||
101 |
"Modified: / 16.3.1999 / 21:33:49 / cg" |
|
400 | 102 |
! |
103 |
||
767 | 104 |
openOnFile: aFileName |
900 | 105 |
"opens a Image Editor on aFileName" |
767 | 106 |
" |
107 |
self openOnFile: 'bitmaps/SmalltalkX.xbm' |
|
108 |
" |
|
400 | 109 |
|
1057 | 110 |
|editor| |
111 |
||
112 |
editor := self new. |
|
113 |
editor allButOpen. |
|
114 |
editor loadFromFile: aFileName. |
|
115 |
editor openWindow |
|
116 |
||
117 |
"Modified: / 16.3.1999 / 21:33:25 / cg" |
|
400 | 118 |
! |
119 |
||
767 | 120 |
openOnImage: anImage |
900 | 121 |
"opens a Image Editor on anImage" |
767 | 122 |
" |
895 | 123 |
self openOnImage: Icon startIcon |
767 | 124 |
" |
400 | 125 |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
126 |
|editor| |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
127 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
128 |
editor := self new. |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
129 |
editor allButOpen. |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
130 |
editor loadFromImage: anImage. |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
131 |
editor openWindow |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
132 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
133 |
"Modified: / 11.3.1999 / 16:18:33 / cg" |
400 | 134 |
! ! |
135 |
||
136 |
!ImageEditor class methodsFor:'accessing'! |
|
137 |
||
138 |
listOfColorMaps |
|
767 | 139 |
"returns the list of default color maps for a new image" |
400 | 140 |
|
141 |
|colorMap| |
|
898 | 142 |
|
400 | 143 |
(colorMap := OrderedCollection new) |
144 |
add: Color black; |
|
145 |
add: Color white; |
|
146 |
add: Color red; |
|
147 |
add: Color green; |
|
148 |
add: Color blue; |
|
149 |
add: Color cyan; |
|
150 |
add: Color yellow; |
|
151 |
add: Color magenta; |
|
898 | 152 |
add: (Color redByte: 127 greenByte: 0 blueByte: 0); |
153 |
add: (Color redByte: 0 greenByte: 127 blueByte: 0); |
|
154 |
add: (Color redByte: 0 greenByte: 0 blueByte: 127); |
|
155 |
add: (Color redByte: 0 greenByte: 127 blueByte: 127); |
|
156 |
add: (Color redByte: 127 greenByte: 127 blueByte: 0); |
|
157 |
add: (Color redByte: 127 greenByte: 0 blueByte: 127); |
|
158 |
add: (Color redByte: 127 greenByte: 127 blueByte: 127); |
|
159 |
add: (Color redByte: 170 greenByte: 170 blueByte: 170). |
|
160 |
||
400 | 161 |
0 to: 5 do: |
162 |
[:r| |
|
163 |
0 to: 5 do: |
|
164 |
[:g| |
|
165 |
0 to: 5 do: |
|
166 |
[:b| |
|
898 | 167 |
colorMap add: (Color redByte: (r*255//5) ceiling greenByte: (g*255//5) ceiling blueByte: (b*255//5) ceiling) |
400 | 168 |
] |
169 |
] |
|
170 |
]. |
|
171 |
||
172 |
1 to: 25 do: |
|
173 |
[:g| |
|
898 | 174 |
colorMap add: (Color redByte: (g*255//26) ceiling greenByte: (g*255//26) ceiling blueByte: (g*255//26) ceiling) |
400 | 175 |
]. |
176 |
||
177 |
^Dictionary new |
|
178 |
at: '8-plane' put: colorMap; |
|
179 |
at: '8-plane + mask' put: colorMap; |
|
180 |
at: '4-plane' put: (colorMap copyFrom: 1 to: 16); |
|
181 |
at: '4-plane + mask' put: (colorMap copyFrom: 1 to: 16); |
|
182 |
at: '2-plane' put: (colorMap copyFrom: 1 to: 4); |
|
183 |
at: '2-plane + mask' put: (colorMap copyFrom: 1 to: 4); |
|
184 |
at: '1-plane' put: (colorMap copyFrom: 1 to: 2); |
|
185 |
at: '1-plane + mask' put: (colorMap copyFrom: 1 to: 2); |
|
186 |
yourself |
|
187 |
! |
|
188 |
||
189 |
listOfDefaultSizes |
|
767 | 190 |
"returns the list of default sizes for a new image" |
400 | 191 |
|
932
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
192 |
^#('8x8' '16x16' '22x22' '32x32' '48x48' '64x64') |
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
193 |
|
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
194 |
"Modified: / 31.7.1998 / 01:57:34 / cg" |
400 | 195 |
! ! |
196 |
||
460 | 197 |
!ImageEditor class methodsFor:'help specs'! |
198 |
||
1545 | 199 |
flyByHelpSpec |
200 |
<resource: #help> |
|
201 |
||
202 |
^super flyByHelpSpec addPairsFrom:#( |
|
203 |
||
204 |
#drawModeBox |
|
205 |
'Rectangle' |
|
206 |
||
207 |
#drawModeCopy |
|
208 |
'Copy' |
|
209 |
||
210 |
#drawModeFill |
|
1637 | 211 |
'Flood-Fill' |
1545 | 212 |
|
213 |
#drawModeFilledBox |
|
1637 | 214 |
'Filled Rectangle' |
1545 | 215 |
|
216 |
#drawModePaste |
|
217 |
'Paste' |
|
218 |
||
219 |
#drawModePasteUnder |
|
1637 | 220 |
'Paste Under' |
221 |
||
222 |
#drawModePasteWithMask |
|
1656 | 223 |
'Paste with Mask' |
1545 | 224 |
|
225 |
#drawModePoint |
|
226 |
'Point' |
|
227 |
||
1639 | 228 |
#drawModeSpecial |
229 |
'Special Operations' |
|
230 |
||
1545 | 231 |
#fileGrabImage |
1637 | 232 |
'Pick from Screen.' |
1545 | 233 |
|
234 |
#fileLoadFromClass |
|
235 |
'Load from Method' |
|
236 |
||
237 |
#fileLoadFromFile |
|
238 |
'Load from File.' |
|
239 |
||
240 |
#fileNewImage |
|
1637 | 241 |
'New Image' |
1545 | 242 |
|
243 |
#filePrint |
|
244 |
'Print' |
|
245 |
||
246 |
#fileSaveAs |
|
1637 | 247 |
'Save to File.' |
1545 | 248 |
|
249 |
#fileSaveMaskAs |
|
1637 | 250 |
'Save to File.' |
1545 | 251 |
|
252 |
#fileSaveMethod |
|
1637 | 253 |
'Save as Method' |
1545 | 254 |
|
255 |
#fileSaveMethodAs |
|
1637 | 256 |
'Save as Method' |
1545 | 257 |
|
258 |
) |
|
259 |
! |
|
260 |
||
460 | 261 |
helpSpec |
737 | 262 |
"This resource specification was automatically generated |
263 |
by the UIHelpTool of ST/X." |
|
264 |
||
265 |
"Do not manually edit this!! If it is corrupted, |
|
266 |
the UIHelpTool may not be able to read the specification." |
|
460 | 267 |
|
268 |
" |
|
737 | 269 |
UIHelpTool openOnClass:ImageEditor |
460 | 270 |
" |
271 |
||
737 | 272 |
<resource: #help> |
273 |
||
274 |
^super helpSpec addPairsFrom:#( |
|
460 | 275 |
|
276 |
#colorMap |
|
929 | 277 |
'ColorMap functions.' |
278 |
||
279 |
#colorMap1 |
|
280 |
'Convert to depth-1 image.' |
|
281 |
||
986 | 282 |
#colorMap1M |
283 |
'Convert to depth-1 image plus mask.' |
|
284 |
||
929 | 285 |
#colorMap2 |
286 |
'Convert to depth-2 image.' |
|
287 |
||
986 | 288 |
#colorMap2M |
289 |
'Convert to depth-2 image plus mask.' |
|
290 |
||
929 | 291 |
#colorMap4 |
292 |
'Convert to depth-4 image.' |
|
293 |
||
986 | 294 |
#colorMap4M |
295 |
'Convert to depth-4 image plus mask.' |
|
296 |
||
929 | 297 |
#colorMap8 |
298 |
'Convert to depth-8 image.' |
|
299 |
||
300 |
#colorMap8M |
|
301 |
'Convert to depth-8 image plus mask.' |
|
302 |
||
986 | 303 |
#colorMapTable |
304 |
'Shows a list of used colors of the image.' |
|
305 |
||
929 | 306 |
#compressColormap |
307 |
'Remove unneeded entries from the colorMap.' |
|
460 | 308 |
|
1045 | 309 |
#cropAll |
986 | 310 |
'Find and remove all borders.' |
311 |
||
1045 | 312 |
#cropBottom |
986 | 313 |
'Find and remove bottom border.' |
314 |
||
1045 | 315 |
#cropLeft |
986 | 316 |
'Find and remove left border.' |
317 |
||
1045 | 318 |
#cropManual |
986 | 319 |
'Specify border(s) to remove.' |
320 |
||
1045 | 321 |
#cropRight |
986 | 322 |
'Find and remove right border.' |
323 |
||
1045 | 324 |
#cropTop |
986 | 325 |
'Find and remove top border.' |
487 | 326 |
|
460 | 327 |
#drawModeBox |
1637 | 328 |
'Rectangle Drawing Mode.' |
460 | 329 |
|
330 |
#drawModeCopy |
|
1637 | 331 |
'Area Copy Mode.' |
460 | 332 |
|
333 |
#drawModeFill |
|
1637 | 334 |
'Flood Fill Mode.' |
460 | 335 |
|
336 |
#drawModeFilledBox |
|
1637 | 337 |
'Filled Rectangle Drawing Mode.' |
460 | 338 |
|
339 |
#drawModePaste |
|
1637 | 340 |
'Paste Mode.' |
914 | 341 |
|
342 |
#drawModePasteUnder |
|
1637 | 343 |
'Paste-Under Mode.' |
344 |
||
345 |
#drawModePasteWithMask |
|
346 |
'Paste-with-Mask Mode.' |
|
460 | 347 |
|
348 |
#drawModePoint |
|
1637 | 349 |
'Point Drawing Mode.' |
460 | 350 |
|
1639 | 351 |
#drawModeSpecial |
352 |
'Special Operations' |
|
353 |
||
460 | 354 |
#editFlipHorizontal |
1637 | 355 |
'Flip the image horizontally.' |
460 | 356 |
|
357 |
#editFlipVertical |
|
1637 | 358 |
'Flip the image vertically.' |
460 | 359 |
|
360 |
#editMagnifyImage |
|
914 | 361 |
'Magnify the image.' |
460 | 362 |
|
363 |
#editNegate |
|
914 | 364 |
'Invert the images colors.' |
460 | 365 |
|
366 |
#editResize |
|
914 | 367 |
'Resize the image (preserving the old image).' |
460 | 368 |
|
369 |
#editRotate |
|
914 | 370 |
'Rotate the image.' |
460 | 371 |
|
929 | 372 |
#fileGrabImage |
373 |
'Pick an image from the screen.' |
|
374 |
||
460 | 375 |
#fileLoadFromClass |
929 | 376 |
'Select and load an image from a resource method.' |
460 | 377 |
|
378 |
#fileLoadFromFile |
|
929 | 379 |
'Select and load an image from a file.' |
460 | 380 |
|
381 |
#fileNewImage |
|
914 | 382 |
'Create a new image' |
460 | 383 |
|
384 |
#filePrint |
|
385 |
'Print the image on a postscript printer.' |
|
386 |
||
387 |
#fileSaveAs |
|
914 | 388 |
'Save the image to a file.' |
460 | 389 |
|
390 |
#fileSaveMaskAs |
|
914 | 391 |
'Save the mask of the image to a file.' |
460 | 392 |
|
1613 | 393 |
#fileSaveButtonImageAs |
394 |
'Save an image of a button with the image to a file (for html use).' |
|
395 |
||
460 | 396 |
#fileSaveMethod |
914 | 397 |
'Save the image as resource method in the current class and selector.' |
460 | 398 |
|
399 |
#fileSaveMethodAs |
|
914 | 400 |
'Save the image as resource method in a class.' |
460 | 401 |
|
487 | 402 |
#magnificationNumber |
914 | 403 |
'Shows the current magnification.' |
487 | 404 |
|
405 |
#magnifyImageDown |
|
914 | 406 |
'Decrease magnification.' |
487 | 407 |
|
408 |
#magnifyImageUp |
|
914 | 409 |
'Increase magnification.' |
487 | 410 |
|
411 |
#mouseKeyColorMode |
|
1637 | 412 |
'Toggle between left and right mouse button color.' |
487 | 413 |
|
414 |
#previewView |
|
914 | 415 |
'Shows a preview of the image.' |
487 | 416 |
|
905 | 417 |
#settingsGridMagnification |
914 | 418 |
'Change the grid magnification of the edit view.' |
905 | 419 |
|
460 | 420 |
) |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
421 |
|
986 | 422 |
"Modified: / 7.9.1998 / 18:20:26 / cg" |
460 | 423 |
! ! |
424 |
||
737 | 425 |
!ImageEditor class methodsFor:'image specs'! |
426 |
||
1637 | 427 |
copyIcon |
428 |
"This resource specification was automatically generated |
|
429 |
by the ImageEditor of ST/X." |
|
430 |
||
431 |
"Do not manually edit this!! If it is corrupted, |
|
432 |
the ImageEditor may not be able to read the specification." |
|
433 |
||
434 |
" |
|
435 |
self copyIcon inspect |
|
436 |
ImageEditor openOnClass:self andSelector:#copyIcon |
|
437 |
Icon flushCachedIcons |
|
438 |
" |
|
439 |
||
440 |
<resource: #image> |
|
441 |
||
442 |
^Icon |
|
443 |
constantNamed:#'ImageEditor class copyIcon' |
|
444 |
ifAbsentPut:[(Depth2Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@** @@J)UUTB*Z*)@*&**PJ)**$B*Z*)@*&**PJ)**$@@Z*)@@F**P@AUUT@@@@@@b') ; colorMapFromArray:#[0 0 0 0 0 128 255 255 255]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@C? O>@??3??O?<??3??O?<??3??@_<A?0@@@@a') ; yourself); yourself] |
|
445 |
! |
|
446 |
||
447 |
fillIcon |
|
448 |
"This resource specification was automatically generated |
|
449 |
by the ImageEditor of ST/X." |
|
450 |
||
451 |
"Do not manually edit this!! If it is corrupted, |
|
452 |
the ImageEditor may not be able to read the specification." |
|
453 |
||
454 |
" |
|
455 |
self fillIcon inspect |
|
456 |
ImageEditor openOnClass:self andSelector:#fillIcon |
|
457 |
Icon flushCachedIcons |
|
458 |
" |
|
459 |
||
460 |
<resource: #image> |
|
461 |
||
462 |
^Icon |
|
463 |
constantNamed:#'ImageEditor class fillIcon' |
|
464 |
ifAbsentPut:[(Depth2Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@ @@@@*H@@D*(@@DUUP@EAUU@AAEU@@@@U@@DDA@@@@@@@@PP@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C @Q@BN@I<@?8C?0[?!!G<@O P\@@ D@@@@@@@@@a') ; yourself); yourself] |
|
465 |
! |
|
466 |
||
467 |
fillRectIcon |
|
468 |
"This resource specification was automatically generated |
|
469 |
by the ImageEditor of ST/X." |
|
470 |
||
471 |
"Do not manually edit this!! If it is corrupted, |
|
472 |
the ImageEditor may not be able to read the specification." |
|
473 |
||
474 |
" |
|
475 |
self fillRectIcon inspect |
|
476 |
ImageEditor openOnClass:self andSelector:#fillRectIcon |
|
477 |
Icon flushCachedIcons |
|
478 |
" |
|
479 |
||
480 |
<resource: #image> |
|
481 |
||
482 |
^Icon |
|
483 |
constantNamed:#'ImageEditor class fillRectIcon' |
|
484 |
ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@@@@@@@@@@@@D@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@C?0O?@?<C?0O?@?<C?0O?@?<C?0@@@@@@@a') ; yourself); yourself] |
|
485 |
! |
|
486 |
||
737 | 487 |
leftMouseKeyIcon |
488 |
"This resource specification was automatically generated |
|
489 |
by the ImageEditor of ST/X." |
|
490 |
||
491 |
"Do not manually edit this!! If it is corrupted, |
|
492 |
the ImageEditor may not be able to read the specification." |
|
493 |
||
494 |
" |
|
1405 | 495 |
self leftMouseKeyIcon inspect |
737 | 496 |
ImageEditor openOnClass:self andSelector:#leftMouseKeyIcon |
497 |
" |
|
498 |
||
499 |
<resource: #image> |
|
500 |
||
501 |
^Icon |
|
502 |
constantNamed:#'ImageEditor leftMouseKeyIcon' |
|
1433 | 503 |
ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@EJJ@@AR" @@T((@@@@@@@B** @@**(@@J**@@B** @@**(@@J**@@@**@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; 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] |
504 |
! |
|
737 | 505 |
|
1637 | 506 |
pasteIcon |
507 |
"This resource specification was automatically generated |
|
508 |
by the ImageEditor of ST/X." |
|
509 |
||
510 |
"Do not manually edit this!! If it is corrupted, |
|
511 |
the ImageEditor may not be able to read the specification." |
|
512 |
||
513 |
" |
|
514 |
self pasteIcon inspect |
|
515 |
ImageEditor openOnClass:self andSelector:#pasteIcon |
|
516 |
Icon flushCachedIcons |
|
517 |
" |
|
518 |
||
519 |
<resource: #image> |
|
520 |
||
521 |
^Icon |
|
522 |
constantNamed:#'ImageEditor class pasteIcon' |
|
523 |
ifAbsentPut:[(Depth4Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@AU@@@@@CHE@E@2@@@ QDQD@0@@L@@@@@H@@BL#H2L#@@@QDQDQL @@D3L@@@@@@AL3@3M&X@@SL0L0A&@@D3LC@@A @AL3@3@FX@@QDPY&Y& |
|
524 |
@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 0 0 128 128 128 0 128 128 128 212 208 200 255 255 0 255 255 255]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C0A?8O?0??C?<O?0??C?>O?8??#?>O?8_? G>@@a') ; yourself); yourself] |
|
525 |
! |
|
526 |
||
527 |
pasteUnderIcon |
|
528 |
"This resource specification was automatically generated |
|
529 |
by the ImageEditor of ST/X." |
|
530 |
||
531 |
"Do not manually edit this!! If it is corrupted, |
|
532 |
the ImageEditor may not be able to read the specification." |
|
533 |
||
534 |
" |
|
535 |
self pasteUnderIcon inspect |
|
536 |
ImageEditor openOnClass:self andSelector:#pasteUnderIcon |
|
537 |
Icon flushCachedIcons |
|
538 |
" |
|
539 |
||
540 |
<resource: #image> |
|
541 |
||
542 |
^Icon |
|
543 |
constantNamed:#'ImageEditor class pasteUnderIcon' |
|
544 |
ifAbsentPut:[(Depth4Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@AU@@@@@CHE@E@2@@@ QDQD@0@@L@@@@@H@@BL#H2L#@@@QDQDQL @@D3L@@@@@@AL3@3M&X@@SL0L0A&@@D3LC@@A @AL3@3@FX@@QDPY&Y& |
|
545 |
@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 0 0 128 128 128 0 128 128 128 212 208 200 255 255 0 255 255 255]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C0A?8O?0??C?<O?0??C?>O?8??#?>O?8_? G>@@a') ; yourself); yourself] |
|
546 |
! |
|
547 |
||
548 |
pasteWithMaskIcon |
|
549 |
"This resource specification was automatically generated |
|
550 |
by the ImageEditor of ST/X." |
|
551 |
||
552 |
"Do not manually edit this!! If it is corrupted, |
|
553 |
the ImageEditor may not be able to read the specification." |
|
554 |
||
555 |
" |
|
556 |
self pasteWithMaskIcon inspect |
|
557 |
ImageEditor openOnClass:self andSelector:#pasteWithMaskIcon |
|
558 |
Icon flushCachedIcons |
|
559 |
" |
|
560 |
||
561 |
<resource: #image> |
|
562 |
||
563 |
^Icon |
|
564 |
constantNamed:#'ImageEditor class pasteWithMaskIcon' |
|
565 |
ifAbsentPut:[(Depth4Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@AU@@@@@CHE@E@2@@@ QDQD@0@@L@@@@@H@@BL#H2L#@@@QDQDQL @@D3L@@@@@@AL3@3M&X@@SL0L3A&@@D3LCL0A @AL3@3LFX@@QDPY&Y& |
|
566 |
@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 0 0 128 128 128 0 128 128 128 212 208 200 255 255 0 255 255 255]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C0A?8O?0??C?<O?0??C?>O?8??#?>O?8_? G>@@a') ; yourself); yourself] |
|
567 |
! |
|
568 |
||
569 |
pointIcon |
|
570 |
"This resource specification was automatically generated |
|
571 |
by the ImageEditor of ST/X." |
|
572 |
||
573 |
"Do not manually edit this!! If it is corrupted, |
|
574 |
the ImageEditor may not be able to read the specification." |
|
575 |
||
576 |
" |
|
577 |
self pointIcon inspect |
|
578 |
ImageEditor openOnClass:self andSelector:#pointIcon |
|
579 |
Icon flushCachedIcons |
|
580 |
" |
|
581 |
||
582 |
<resource: #image> |
|
583 |
||
584 |
^Icon |
|
585 |
constantNamed:#'ImageEditor class pointIcon' |
|
586 |
ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@C@@@@@B@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@0@G@@8@G@@8@G@@8@G@@X@B@@@@@@@@@a') ; yourself); yourself] |
|
587 |
! |
|
588 |
||
589 |
rectIcon |
|
590 |
"This resource specification was automatically generated |
|
591 |
by the ImageEditor of ST/X." |
|
592 |
||
593 |
"Do not manually edit this!! If it is corrupted, |
|
594 |
the ImageEditor may not be able to read the specification." |
|
595 |
||
596 |
" |
|
597 |
self rectIcon inspect |
|
598 |
ImageEditor openOnClass:self andSelector:#rectIcon |
|
599 |
Icon flushCachedIcons |
|
600 |
" |
|
601 |
||
602 |
<resource: #image> |
|
603 |
||
604 |
^Icon |
|
605 |
constantNamed:#'ImageEditor class rectIcon' |
|
606 |
ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@C@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@C?0HA@ DB@PHA@ DB@PHA@ DC?0@@@@@@@a') ; yourself); yourself] |
|
607 |
! |
|
608 |
||
737 | 609 |
rightMouseKeyIcon |
610 |
"This resource specification was automatically generated |
|
611 |
by the ImageEditor of ST/X." |
|
612 |
||
613 |
"Do not manually edit this!! If it is corrupted, |
|
614 |
the ImageEditor may not be able to read the specification." |
|
615 |
||
616 |
" |
|
1405 | 617 |
self rightMouseKeyIcon inspect |
737 | 618 |
ImageEditor openOnClass:self andSelector:#rightMouseKeyIcon |
619 |
" |
|
620 |
||
621 |
<resource: #image> |
|
622 |
||
623 |
^Icon |
|
624 |
constantNamed:#'ImageEditor rightMouseKeyIcon' |
|
1433 | 625 |
ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@JJE@@B"!!P@@((T@@@@@@@B** @@**(@@J**@@B** @@**(@@J**@@@**@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; 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] |
1637 | 626 |
! |
627 |
||
628 |
specialIcon |
|
629 |
"This resource specification was automatically generated |
|
630 |
by the ImageEditor of ST/X." |
|
631 |
||
632 |
"Do not manually edit this!! If it is corrupted, |
|
633 |
the ImageEditor may not be able to read the specification." |
|
634 |
||
635 |
" |
|
636 |
self specialIcon inspect |
|
637 |
ImageEditor openOnClass:self andSelector:#specialIcon |
|
638 |
Icon flushCachedIcons |
|
639 |
" |
|
640 |
||
641 |
<resource: #image> |
|
642 |
||
643 |
^Icon |
|
644 |
constantNamed:#'ImageEditor class specialIcon' |
|
645 |
ifAbsentPut:[(Depth1Image new) width: 14; height: 14; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@L@@@@B@@@@@0@@@@@@@@@@@@@@@P@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 0 0]; mask:((Depth1Image new) width: 14; height: 14; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@L@@0@G @^@A8@G @L@@0@@@@L@@0@@@@@a') ; yourself); yourself] |
|
1433 | 646 |
! ! |
737 | 647 |
|
400 | 648 |
!ImageEditor class methodsFor:'interface specs'! |
649 |
||
1650 | 650 |
changeHLSDialogSpec |
651 |
"This resource specification was automatically generated |
|
652 |
by the UIPainter of ST/X." |
|
653 |
||
654 |
"Do not manually edit this!! If it is corrupted, |
|
655 |
the UIPainter may not be able to read the specification." |
|
656 |
||
657 |
" |
|
658 |
UIPainter new openOnClass:ImageEditor andSelector:#changeHLSDialogSpec |
|
659 |
ImageEditor new openInterface:#changeHLSDialogSpec |
|
660 |
" |
|
661 |
||
662 |
<resource: #canvas> |
|
663 |
||
664 |
^ |
|
665 |
#(#FullSpec |
|
666 |
#name: #changeHLSDialogSpec |
|
667 |
#window: |
|
668 |
#(#WindowSpec |
|
1651 | 669 |
#label: 'HLS Edit Dialog' |
670 |
#name: 'HLS Edit Dialog' |
|
1650 | 671 |
#min: #(#Point 10 10) |
672 |
#max: #(#Point 800 478) |
|
673 |
#bounds: #(#Rectangle 16 46 328 229) |
|
674 |
) |
|
675 |
#component: |
|
676 |
#(#SpecCollection |
|
677 |
#collection: #( |
|
678 |
#(#LabelSpec |
|
679 |
#label: 'Hue-Shift:' |
|
680 |
#name: 'HueLabel' |
|
1651 | 681 |
#layout: #(#LayoutFrame 20 0 21 0 120 0 43 0) |
1650 | 682 |
#translateLabel: true |
683 |
#adjust: #right |
|
684 |
) |
|
685 |
#(#InputFieldSpec |
|
686 |
#name: 'HueShiftEntryField' |
|
1651 | 687 |
#layout: #(#LayoutFrame 123 0 21 0 166 0 43 0) |
1650 | 688 |
#tabable: true |
689 |
#model: #hueShiftAmount |
|
690 |
#type: #numberInRange |
|
691 |
#minValue: 0 |
|
692 |
#maxValue: 360 |
|
693 |
#acceptChannel: #acceptChannel |
|
694 |
#acceptOnPointerLeave: false |
|
695 |
) |
|
696 |
#(#ThumbWheelSpec |
|
697 |
#name: 'HueWheel' |
|
1651 | 698 |
#layout: #(#LayoutFrame 180 0 22 0 297 0 42 0) |
1650 | 699 |
#model: #hueShiftAmount |
700 |
#orientation: #horizontal |
|
701 |
#step: 1 |
|
702 |
#endlessRotation: true |
|
703 |
) |
|
704 |
#(#LabelSpec |
|
1651 | 705 |
#label: 'Light Factor:' |
1650 | 706 |
#name: 'LightLabel' |
1651 | 707 |
#layout: #(#LayoutFrame 18 0 50 0 120 0 72 0) |
1650 | 708 |
#translateLabel: true |
709 |
#adjust: #right |
|
710 |
) |
|
711 |
#(#InputFieldSpec |
|
712 |
#name: 'LightEntryField' |
|
1651 | 713 |
#layout: #(#LayoutFrame 123 0 50 0 166 0 72 0) |
1650 | 714 |
#tabable: true |
715 |
#model: #lightAmount |
|
716 |
#type: #numberInRange |
|
717 |
#minValue: 0 |
|
718 |
#maxValue: 1000 |
|
719 |
#acceptChannel: #acceptChannel |
|
720 |
#acceptOnPointerLeave: false |
|
721 |
) |
|
722 |
#(#ThumbWheelSpec |
|
723 |
#name: 'LightWheel' |
|
1651 | 724 |
#layout: #(#LayoutFrame 180 0 51 0 297 0 71 0) |
1650 | 725 |
#model: #lightAmount |
726 |
#orientation: #horizontal |
|
727 |
#stop: 1000 |
|
728 |
#step: 1 |
|
729 |
) |
|
730 |
#(#LabelSpec |
|
1651 | 731 |
#label: 'Saturation Factor:' |
1650 | 732 |
#name: 'SaturationLabel' |
1651 | 733 |
#layout: #(#LayoutFrame 9 0 79 0 120 0 101 0) |
1650 | 734 |
#translateLabel: true |
735 |
#adjust: #right |
|
736 |
) |
|
737 |
#(#InputFieldSpec |
|
738 |
#name: 'SaturationEntryField' |
|
1651 | 739 |
#layout: #(#LayoutFrame 123 0 79 0 166 0 101 0) |
1650 | 740 |
#tabable: true |
741 |
#model: #saturationAmount |
|
742 |
#type: #numberInRange |
|
743 |
#minValue: 0 |
|
744 |
#maxValue: 1000 |
|
745 |
#acceptChannel: #acceptChannel |
|
746 |
#acceptOnPointerLeave: false |
|
747 |
) |
|
748 |
#(#ThumbWheelSpec |
|
749 |
#name: 'SaturationWheel' |
|
1651 | 750 |
#layout: #(#LayoutFrame 180 0 80 0 297 0 100 0) |
1650 | 751 |
#model: #saturationAmount |
752 |
#orientation: #horizontal |
|
753 |
#stop: 1000 |
|
754 |
#step: 1 |
|
755 |
) |
|
756 |
#(#LabelSpec |
|
757 |
#name: 'HueColorLabel' |
|
758 |
#layout: #(#LayoutFrame 10 0.0 109 0 -10 1.0 148 0) |
|
759 |
#translateLabel: true |
|
1651 | 760 |
#backgroundChannel: #hlsColor |
1650 | 761 |
) |
762 |
#(#HorizontalPanelViewSpec |
|
763 |
#name: 'HorizontalPanel1' |
|
764 |
#layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1) |
|
765 |
#horizontalLayout: #fitSpace |
|
766 |
#verticalLayout: #center |
|
767 |
#horizontalSpace: 3 |
|
768 |
#verticalSpace: 3 |
|
769 |
#reverseOrderIfOKAtLeft: true |
|
770 |
#component: |
|
771 |
#(#SpecCollection |
|
772 |
#collection: #( |
|
773 |
#(#ActionButtonSpec |
|
774 |
#label: 'Cancel' |
|
775 |
#name: 'Button1' |
|
776 |
#translateLabel: true |
|
777 |
#tabable: true |
|
778 |
#model: #cancel |
|
779 |
#extent: #(#Point 151 22) |
|
780 |
) |
|
781 |
#(#ActionButtonSpec |
|
782 |
#label: 'OK' |
|
783 |
#name: 'Button2' |
|
784 |
#translateLabel: true |
|
785 |
#tabable: true |
|
786 |
#model: #accept |
|
787 |
#extent: #(#Point 152 22) |
|
788 |
) |
|
789 |
) |
|
790 |
||
791 |
) |
|
792 |
) |
|
793 |
) |
|
794 |
||
795 |
) |
|
796 |
) |
|
797 |
! |
|
798 |
||
767 | 799 |
dialogSpecForNewImage |
737 | 800 |
"This resource specification was automatically generated |
801 |
by the UIPainter of ST/X." |
|
519 | 802 |
|
737 | 803 |
"Do not manually edit this!! If it is corrupted, |
804 |
the UIPainter may not be able to read the specification." |
|
519 | 805 |
|
806 |
" |
|
767 | 807 |
UIPainter new openOnClass:ImageEditor andSelector:#dialogSpecForNewImage |
808 |
ImageEditor new openInterface:#dialogSpecForNewImage |
|
519 | 809 |
" |
810 |
||
811 |
<resource: #canvas> |
|
812 |
||
813 |
^ |
|
814 |
||
815 |
#(#FullSpec |
|
672 | 816 |
#window: |
519 | 817 |
#(#WindowSpec |
672 | 818 |
#name: 'New Image' |
975 | 819 |
#layout: #(#LayoutFrame 81 0 288 0 381 0 406 0) |
672 | 820 |
#label: 'New Image' |
821 |
#min: #(#Point 10 10) |
|
822 |
#max: #(#Point 1152 900) |
|
975 | 823 |
#bounds: #(#Rectangle 81 288 382 407) |
672 | 824 |
#usePreferredExtent: false |
519 | 825 |
) |
672 | 826 |
#component: |
519 | 827 |
#(#SpecCollection |
672 | 828 |
#collection: |
519 | 829 |
#( |
830 |
#(#ViewSpec |
|
672 | 831 |
#name: 'View' |
737 | 832 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -35 1.0) |
672 | 833 |
#component: |
519 | 834 |
#(#SpecCollection |
672 | 835 |
#collection: |
519 | 836 |
#( |
837 |
#(#FramedBoxSpec |
|
672 | 838 |
#name: 'framedBox1' |
932
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
839 |
#layout: #(#LayoutFrame 1 0.0 7 0.0 0 0.4 76 0) |
672 | 840 |
#component: |
519 | 841 |
#(#SpecCollection |
672 | 842 |
#collection: |
519 | 843 |
#( |
844 |
#(#ComboBoxSpec |
|
672 | 845 |
#name: 'defaultSizesComboBox' |
975 | 846 |
#layout: #(#LayoutFrame 0 0.0 10 0.0 0 1 35 0.0) |
672 | 847 |
#model: #selectionOfSize |
848 |
#type: #string |
|
849 |
#comboList: #listOfDefaultSizes |
|
519 | 850 |
) |
851 |
) |
|
852 |
) |
|
672 | 853 |
#label: 'Size' |
854 |
#labelPosition: #topLeft |
|
855 |
#style: #(#FontDescription #helvetica #medium #roman 12) |
|
519 | 856 |
) |
857 |
#(#FramedBoxSpec |
|
672 | 858 |
#name: 'framedBox2' |
932
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
859 |
#layout: #(#LayoutFrame 0 0.4 7 0.0 -1 1.0 76 0) |
672 | 860 |
#component: |
519 | 861 |
#(#SpecCollection |
672 | 862 |
#collection: |
519 | 863 |
#( |
864 |
#(#ComboListSpec |
|
672 | 865 |
#name: 'colorMapComboBox' |
975 | 866 |
#layout: #(#LayoutFrame 0 0.0 10 0.0 0 1 35 0.0) |
672 | 867 |
#model: #selectionOfColorMap |
868 |
#comboList: #listOfColorMaps |
|
869 |
#useIndex: false |
|
519 | 870 |
) |
871 |
) |
|
872 |
) |
|
672 | 873 |
#label: 'Color Map' |
874 |
#labelPosition: #topLeft |
|
875 |
#style: #(#FontDescription #helvetica #medium #roman 12) |
|
519 | 876 |
) |
877 |
) |
|
878 |
) |
|
672 | 879 |
#level: 1 |
519 | 880 |
) |
672 | 881 |
#(#UISubSpecification |
975 | 882 |
#name: 'windowSpecForCommitWithoutChannels' |
737 | 883 |
#layout: #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1.0) |
672 | 884 |
#minorKey: #windowSpecForCommitWithoutChannels |
519 | 885 |
) |
886 |
) |
|
887 |
) |
|
888 |
) |
|
767 | 889 |
! |
890 |
||
1045 | 891 |
gropDialogSpec |
986 | 892 |
"This resource specification was automatically generated |
893 |
by the UIPainter of ST/X." |
|
894 |
||
895 |
"Do not manually edit this!! If it is corrupted, |
|
896 |
the UIPainter may not be able to read the specification." |
|
897 |
||
898 |
" |
|
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
899 |
UIPainter new openOnClass:ImageEditor andSelector:#gropDialogSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
900 |
ImageEditor new openInterface:#gropDialogSpec |
986 | 901 |
" |
902 |
||
903 |
<resource: #canvas> |
|
904 |
||
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
905 |
^ |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
906 |
#(#FullSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
907 |
#name: #gropDialogSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
908 |
#window: |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
909 |
#(#WindowSpec |
1480 | 910 |
#label: 'Crop Border(s)' |
1490 | 911 |
#name: 'Crop Border(s)' |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
912 |
#min: #(#Point 10 10) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
913 |
#max: #(#Point 800 478) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
914 |
#bounds: #(#Rectangle 16 46 261 229) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
915 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
916 |
#component: |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
917 |
#(#SpecCollection |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
918 |
#collection: #( |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
919 |
#(#LabelSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
920 |
#label: 'Left:' |
1502 | 921 |
#name: 'GropLeftLabel' |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
922 |
#layout: #(#LayoutFrame 14 0 21 0 90 0 43 0) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
923 |
#translateLabel: true |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
924 |
#adjust: #right |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
925 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
926 |
#(#InputFieldSpec |
1502 | 927 |
#name: 'GropLeftEntryField' |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
928 |
#layout: #(#LayoutFrame 95 0 21 0 132 0 43 0) |
1507 | 929 |
#tabable: true |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
930 |
#model: #left |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
931 |
#type: #number |
1502 | 932 |
#acceptChannel: #acceptChannel |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
933 |
#acceptOnPointerLeave: false |
1502 | 934 |
) |
935 |
#(#ActionButtonSpec |
|
936 |
#label: 'Now' |
|
937 |
#name: 'GropLeftNowButton' |
|
938 |
#layout: #(#LayoutFrame 148 0 21 0 221 0 43 0) |
|
939 |
#translateLabel: true |
|
1507 | 940 |
#tabable: true |
1502 | 941 |
#model: #gropLeftNow |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
942 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
943 |
#(#LabelSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
944 |
#label: 'Right:' |
1502 | 945 |
#name: 'GropRightLabel' |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
946 |
#layout: #(#LayoutFrame 14 0 51 0 90 0 73 0) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
947 |
#translateLabel: true |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
948 |
#adjust: #right |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
949 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
950 |
#(#InputFieldSpec |
1502 | 951 |
#name: 'GropRightEntryField' |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
952 |
#layout: #(#LayoutFrame 95 0 51 0 132 0 73 0) |
1507 | 953 |
#tabable: true |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
954 |
#model: #right |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
955 |
#type: #number |
1502 | 956 |
#acceptChannel: #acceptChannel |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
957 |
#acceptOnPointerLeave: false |
1502 | 958 |
) |
959 |
#(#ActionButtonSpec |
|
960 |
#label: 'Now' |
|
961 |
#name: 'GropRightButton' |
|
962 |
#layout: #(#LayoutFrame 148 0 51 0 221 0 73 0) |
|
963 |
#translateLabel: true |
|
1507 | 964 |
#tabable: true |
1502 | 965 |
#model: #gropRightNow |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
966 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
967 |
#(#LabelSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
968 |
#label: 'Top:' |
1502 | 969 |
#name: 'GropTopLabel' |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
970 |
#layout: #(#LayoutFrame 14 0 81 0 90 0 103 0) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
971 |
#translateLabel: true |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
972 |
#adjust: #right |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
973 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
974 |
#(#InputFieldSpec |
1502 | 975 |
#name: 'GropTopEntryField' |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
976 |
#layout: #(#LayoutFrame 95 0 81 0 132 0 103 0) |
1507 | 977 |
#tabable: true |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
978 |
#model: #top |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
979 |
#type: #number |
1502 | 980 |
#acceptChannel: #acceptChannel |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
981 |
#acceptOnPointerLeave: false |
1502 | 982 |
) |
983 |
#(#ActionButtonSpec |
|
984 |
#label: 'Now' |
|
985 |
#name: 'GropTopButton' |
|
986 |
#layout: #(#LayoutFrame 148 0 81 0 221 0 103 0) |
|
987 |
#translateLabel: true |
|
1507 | 988 |
#tabable: true |
1502 | 989 |
#model: #gropTopNow |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
990 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
991 |
#(#LabelSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
992 |
#label: 'Bottom:' |
1502 | 993 |
#name: 'GropBottomLabel' |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
994 |
#layout: #(#LayoutFrame 14 0 111 0 90 0 133 0) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
995 |
#translateLabel: true |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
996 |
#adjust: #right |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
997 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
998 |
#(#InputFieldSpec |
1502 | 999 |
#name: 'GropBottomEntryField' |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1000 |
#layout: #(#LayoutFrame 95 0 111 0 132 0 133 0) |
1507 | 1001 |
#tabable: true |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1002 |
#model: #bottom |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1003 |
#type: #number |
1502 | 1004 |
#acceptChannel: #acceptChannel |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1005 |
#acceptOnPointerLeave: false |
1502 | 1006 |
) |
1007 |
#(#ActionButtonSpec |
|
1008 |
#label: 'Now' |
|
1009 |
#name: 'GropBottomButton' |
|
1010 |
#layout: #(#LayoutFrame 148 0 111 0 221 0 133 0) |
|
1011 |
#translateLabel: true |
|
1507 | 1012 |
#tabable: true |
1502 | 1013 |
#model: #gropBottomNow |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1014 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1015 |
#(#HorizontalPanelViewSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1016 |
#name: 'HorizontalPanel1' |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1017 |
#layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1018 |
#horizontalLayout: #fitSpace |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1019 |
#verticalLayout: #center |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1020 |
#horizontalSpace: 3 |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1021 |
#verticalSpace: 3 |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1022 |
#reverseOrderIfOKAtLeft: true |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1023 |
#component: |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1024 |
#(#SpecCollection |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1025 |
#collection: #( |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1026 |
#(#ActionButtonSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1027 |
#label: 'Cancel' |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1028 |
#name: 'Button1' |
986 | 1029 |
#translateLabel: true |
1507 | 1030 |
#tabable: true |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1031 |
#model: #cancel |
1490 | 1032 |
#extent: #(#Point 77 22) |
1033 |
) |
|
1034 |
#(#ActionButtonSpec |
|
1035 |
#label: 'Apply' |
|
1036 |
#name: 'Button3' |
|
1037 |
#translateLabel: true |
|
1507 | 1038 |
#tabable: true |
1490 | 1039 |
#model: #applyAction |
1040 |
#extent: #(#Point 78 22) |
|
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1041 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1042 |
#(#ActionButtonSpec |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1043 |
#label: 'OK' |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1044 |
#name: 'Button2' |
986 | 1045 |
#translateLabel: true |
1507 | 1046 |
#tabable: true |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1047 |
#model: #accept |
1490 | 1048 |
#extent: #(#Point 78 22) |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1049 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1050 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1051 |
|
986 | 1052 |
) |
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1053 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1054 |
) |
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1055 |
|
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
1056 |
) |
986 | 1057 |
) |
1058 |
! |
|
1059 |
||
1557 | 1060 |
shiftDialogSpec |
1061 |
"This resource specification was automatically generated |
|
1062 |
by the UIPainter of ST/X." |
|
1063 |
||
1064 |
"Do not manually edit this!! If it is corrupted, |
|
1065 |
the UIPainter may not be able to read the specification." |
|
1066 |
||
1067 |
" |
|
1068 |
UIPainter new openOnClass:ImageEditor andSelector:#shiftDialogSpec |
|
1069 |
ImageEditor new openInterface:#shiftDialogSpec |
|
1070 |
" |
|
1071 |
||
1072 |
<resource: #canvas> |
|
1073 |
||
1074 |
^ |
|
1075 |
#(#FullSpec |
|
1076 |
#name: #shiftDialogSpec |
|
1077 |
#window: |
|
1078 |
#(#WindowSpec |
|
1079 |
#label: 'Shift' |
|
1080 |
#name: 'Shift' |
|
1081 |
#min: #(#Point 10 10) |
|
1082 |
#max: #(#Point 800 478) |
|
1083 |
#bounds: #(#Rectangle 16 46 261 229) |
|
1084 |
) |
|
1085 |
#component: |
|
1086 |
#(#SpecCollection |
|
1087 |
#collection: #( |
|
1088 |
#(#LabelSpec |
|
1089 |
#label: 'Amount:' |
|
1090 |
#name: 'AmountLabel' |
|
1091 |
#layout: #(#LayoutFrame 14 0 21 0 90 0 43 0) |
|
1092 |
#translateLabel: true |
|
1093 |
#adjust: #right |
|
1094 |
) |
|
1095 |
#(#InputFieldSpec |
|
1096 |
#name: 'AmountEntryField' |
|
1097 |
#layout: #(#LayoutFrame 95 0 21 0 132 0 43 0) |
|
1098 |
#tabable: true |
|
1099 |
#model: #shiftAmount |
|
1100 |
#type: #number |
|
1101 |
#acceptChannel: #acceptChannel |
|
1102 |
#acceptOnPointerLeave: false |
|
1103 |
) |
|
1104 |
#(#HorizontalPanelViewSpec |
|
1105 |
#name: 'HorizontalPanel1' |
|
1106 |
#layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1) |
|
1107 |
#horizontalLayout: #fitSpace |
|
1108 |
#verticalLayout: #center |
|
1109 |
#horizontalSpace: 3 |
|
1110 |
#verticalSpace: 3 |
|
1111 |
#reverseOrderIfOKAtLeft: true |
|
1112 |
#component: |
|
1113 |
#(#SpecCollection |
|
1114 |
#collection: #( |
|
1115 |
#(#ActionButtonSpec |
|
1116 |
#label: 'Cancel' |
|
1117 |
#name: 'Button1' |
|
1118 |
#translateLabel: true |
|
1119 |
#tabable: true |
|
1120 |
#model: #cancel |
|
1121 |
#extent: #(#Point 118 22) |
|
1122 |
) |
|
1123 |
#(#ActionButtonSpec |
|
1124 |
#label: 'OK' |
|
1125 |
#name: 'Button2' |
|
1126 |
#translateLabel: true |
|
1127 |
#tabable: true |
|
1128 |
#model: #accept |
|
1129 |
#extent: #(#Point 118 22) |
|
1130 |
) |
|
1131 |
) |
|
1132 |
||
1133 |
) |
|
1134 |
) |
|
1135 |
#(#ArrowButtonSpec |
|
1136 |
#name: 'ArrowButton1' |
|
1649 | 1137 |
#layout: #(#LayoutFrame 105 0 63 0 127 0 85 0) |
1557 | 1138 |
#model: #shiftUpNow |
1139 |
#isTriggerOnDown: true |
|
1140 |
#actionValue: '' |
|
1141 |
#direction: #up |
|
1142 |
) |
|
1143 |
#(#ArrowButtonSpec |
|
1144 |
#name: 'ArrowButton2' |
|
1649 | 1145 |
#layout: #(#LayoutFrame 84 0 86 0 106 0 108 0) |
1557 | 1146 |
#model: #shiftLeftNow |
1147 |
#isTriggerOnDown: true |
|
1148 |
#actionValue: '' |
|
1149 |
#direction: #left |
|
1150 |
) |
|
1151 |
#(#ArrowButtonSpec |
|
1152 |
#name: 'ArrowButton3' |
|
1649 | 1153 |
#layout: #(#LayoutFrame 126 0 86 0 148 0 108 0) |
1557 | 1154 |
#model: #shiftRightNow |
1155 |
#isTriggerOnDown: true |
|
1156 |
#actionValue: '' |
|
1157 |
#direction: #right |
|
1158 |
) |
|
1159 |
#(#ArrowButtonSpec |
|
1160 |
#name: 'ArrowButton4' |
|
1649 | 1161 |
#layout: #(#LayoutFrame 105 0 107 0 127 0 129 0) |
1557 | 1162 |
#model: #shiftDownNow |
1163 |
#isTriggerOnDown: true |
|
1164 |
#actionValue: '' |
|
1165 |
#direction: #down |
|
1166 |
) |
|
1167 |
) |
|
1168 |
||
1169 |
) |
|
1170 |
) |
|
1171 |
! |
|
1172 |
||
1480 | 1173 |
ungropDialogSpec |
1174 |
"This resource specification was automatically generated |
|
1175 |
by the UIPainter of ST/X." |
|
1176 |
||
1177 |
"Do not manually edit this!! If it is corrupted, |
|
1178 |
the UIPainter may not be able to read the specification." |
|
1179 |
||
1180 |
" |
|
1181 |
UIPainter new openOnClass:ImageEditor andSelector:#ungropDialogSpec |
|
1182 |
ImageEditor new openInterface:#ungropDialogSpec |
|
1183 |
" |
|
1184 |
||
1185 |
<resource: #canvas> |
|
1186 |
||
1187 |
^ |
|
1188 |
#(#FullSpec |
|
1189 |
#name: #ungropDialogSpec |
|
1190 |
#window: |
|
1191 |
#(#WindowSpec |
|
1192 |
#label: 'Add Border(s)' |
|
1193 |
#name: 'Add Borders' |
|
1194 |
#min: #(#Point 10 10) |
|
1195 |
#max: #(#Point 800 478) |
|
1196 |
#bounds: #(#Rectangle 16 46 261 229) |
|
1197 |
) |
|
1198 |
#component: |
|
1199 |
#(#SpecCollection |
|
1200 |
#collection: #( |
|
1201 |
#(#LabelSpec |
|
1202 |
#label: 'Left:' |
|
1203 |
#name: 'Label1' |
|
1204 |
#layout: #(#LayoutFrame 14 0 21 0 90 0 43 0) |
|
1205 |
#translateLabel: true |
|
1206 |
#adjust: #right |
|
1207 |
) |
|
1208 |
#(#InputFieldSpec |
|
1209 |
#name: 'EntryField1' |
|
1210 |
#layout: #(#LayoutFrame 95 0 21 0 132 0 43 0) |
|
1211 |
#model: #left |
|
1212 |
#type: #number |
|
1213 |
#acceptOnPointerLeave: false |
|
1214 |
) |
|
1215 |
#(#LabelSpec |
|
1216 |
#label: 'Right:' |
|
1217 |
#name: 'Label2' |
|
1218 |
#layout: #(#LayoutFrame 14 0 51 0 90 0 73 0) |
|
1219 |
#translateLabel: true |
|
1220 |
#adjust: #right |
|
1221 |
) |
|
1222 |
#(#InputFieldSpec |
|
1223 |
#name: 'EntryField2' |
|
1224 |
#layout: #(#LayoutFrame 95 0 51 0 132 0 73 0) |
|
1225 |
#model: #right |
|
1226 |
#type: #number |
|
1227 |
#acceptOnPointerLeave: false |
|
1228 |
) |
|
1229 |
#(#LabelSpec |
|
1230 |
#label: 'Top:' |
|
1231 |
#name: 'Label3' |
|
1232 |
#layout: #(#LayoutFrame 14 0 81 0 90 0 103 0) |
|
1233 |
#translateLabel: true |
|
1234 |
#adjust: #right |
|
1235 |
) |
|
1236 |
#(#InputFieldSpec |
|
1237 |
#name: 'EntryField3' |
|
1238 |
#layout: #(#LayoutFrame 95 0 81 0 132 0 103 0) |
|
1239 |
#model: #top |
|
1240 |
#type: #number |
|
1241 |
#acceptOnPointerLeave: false |
|
1242 |
) |
|
1243 |
#(#LabelSpec |
|
1244 |
#label: 'Bottom:' |
|
1245 |
#name: 'Label4' |
|
1246 |
#layout: #(#LayoutFrame 14 0 111 0 90 0 133 0) |
|
1247 |
#translateLabel: true |
|
1248 |
#adjust: #right |
|
1249 |
) |
|
1250 |
#(#InputFieldSpec |
|
1251 |
#name: 'EntryField4' |
|
1252 |
#layout: #(#LayoutFrame 95 0 111 0 132 0 133 0) |
|
1253 |
#model: #bottom |
|
1254 |
#type: #number |
|
1255 |
#acceptOnPointerLeave: false |
|
1256 |
) |
|
1257 |
#(#HorizontalPanelViewSpec |
|
1258 |
#name: 'HorizontalPanel1' |
|
1259 |
#layout: #(#LayoutFrame 0 0.0 -30 1 0 1.0 0 1) |
|
1260 |
#horizontalLayout: #fitSpace |
|
1261 |
#verticalLayout: #center |
|
1262 |
#horizontalSpace: 3 |
|
1263 |
#verticalSpace: 3 |
|
1264 |
#reverseOrderIfOKAtLeft: true |
|
1265 |
#component: |
|
1266 |
#(#SpecCollection |
|
1267 |
#collection: #( |
|
1268 |
#(#ActionButtonSpec |
|
1269 |
#label: 'Cancel' |
|
1270 |
#name: 'Button1' |
|
1271 |
#translateLabel: true |
|
1272 |
#model: #cancel |
|
1273 |
#extent: #(#Point 118 22) |
|
1274 |
) |
|
1275 |
#(#ActionButtonSpec |
|
1276 |
#label: 'OK' |
|
1277 |
#name: 'Button2' |
|
1278 |
#translateLabel: true |
|
1279 |
#model: #accept |
|
1280 |
#extent: #(#Point 118 22) |
|
1281 |
) |
|
1282 |
) |
|
1283 |
||
1284 |
) |
|
1285 |
) |
|
1286 |
) |
|
1287 |
||
1288 |
) |
|
1289 |
) |
|
1290 |
! |
|
1291 |
||
767 | 1292 |
windowSpec |
1293 |
"This resource specification was automatically generated |
|
1294 |
by the UIPainter of ST/X." |
|
1295 |
||
1296 |
"Do not manually edit this!! If it is corrupted, |
|
1297 |
the UIPainter may not be able to read the specification." |
|
1298 |
||
1299 |
" |
|
1300 |
UIPainter new openOnClass:ImageEditor andSelector:#windowSpec |
|
1301 |
ImageEditor new openInterface:#windowSpec |
|
1302 |
ImageEditor open |
|
1303 |
" |
|
1304 |
||
1305 |
<resource: #canvas> |
|
1306 |
||
1558 | 1307 |
^ |
1308 |
#(#FullSpec |
|
1309 |
#name: #windowSpec |
|
1310 |
#window: |
|
1311 |
#(#WindowSpec |
|
1312 |
#label: 'Image Editor' |
|
1313 |
#name: 'Image Editor' |
|
1314 |
#min: #(#Point 400 320) |
|
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
1315 |
#bounds: #(#Rectangle 16 46 466 396) |
1558 | 1316 |
#menu: #menu |
1317 |
) |
|
1318 |
#component: |
|
1319 |
#(#SpecCollection |
|
1320 |
#collection: #( |
|
1321 |
#(#MenuPanelSpec |
|
1322 |
#name: 'menuToolbarView' |
|
1323 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
1324 |
#menu: #menuToolbar |
|
1325 |
#style: #(#FontDescription #helvetica #medium #roman 10) |
|
1326 |
#showSeparatingLines: true |
|
1327 |
) |
|
1328 |
#(#VariableHorizontalPanelSpec |
|
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
1329 |
#name: 'horizontalPanel' |
1558 | 1330 |
#layout: #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0) |
1637 | 1331 |
#snapMode: #both |
1332 |
#barLevel: 1 |
|
1558 | 1333 |
#component: |
1334 |
#(#SpecCollection |
|
1335 |
#collection: #( |
|
1336 |
#(#ViewSpec |
|
1637 | 1337 |
#name: 'leftView' |
1338 |
#level: 1 |
|
767 | 1339 |
#component: |
1558 | 1340 |
#(#SpecCollection |
1341 |
#collection: #( |
|
1342 |
#(#VariableVerticalPanelSpec |
|
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
1343 |
#name: 'verticalPanel' |
1558 | 1344 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
1637 | 1345 |
#level: 0 |
1346 |
#snapMode: #both |
|
1558 | 1347 |
#component: |
1348 |
#(#SpecCollection |
|
1349 |
#collection: #( |
|
1350 |
#(#ViewSpec |
|
1351 |
#name: 'View1' |
|
1352 |
#component: |
|
767 | 1353 |
#(#SpecCollection |
1558 | 1354 |
#collection: #( |
1355 |
#(#MenuPanelSpec |
|
1356 |
#name: 'MouseButtonColorToolBar' |
|
1357 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 24 0) |
|
1637 | 1358 |
#level: 0 |
1558 | 1359 |
#menu: #menuMouseButtonColors |
1360 |
) |
|
1361 |
#(#DataSetSpec |
|
1362 |
#name: 'colorDataSetView' |
|
1363 |
#layout: #(#LayoutFrame 0 0.0 26 0.0 0 1.0 0 1.0) |
|
1364 |
#activeHelpKey: #colorMapTable |
|
1365 |
#model: #selectionOfColor |
|
1366 |
#menu: #colorMapMenu |
|
1367 |
#style: #(#FontDescription #helvetica #medium #roman 10) |
|
1368 |
#hasHorizontalScrollBar: true |
|
1369 |
#hasVerticalScrollBar: true |
|
1370 |
#miniScrollerHorizontal: true |
|
1371 |
#miniScrollerVertical: true |
|
1372 |
#dataList: #listOfColors |
|
1373 |
#has3Dsepartors: true |
|
1374 |
#has3Dseparators: true |
|
1375 |
#verticalSpacing: 1 |
|
1376 |
#columns: |
|
1377 |
#(#OrderedCollection |
|
1378 |
||
1379 |
#(#DataSetColumnSpec |
|
1380 |
#labelButtonType: #Button |
|
1381 |
#rendererType: #rowSelector |
|
1382 |
#backgroundSelector: #theColorItSelf: |
|
1383 |
) |
|
1384 |
#(#DataSetColumnSpec |
|
1385 |
#label: 'R' |
|
1386 |
#labelAlignment: #left |
|
1387 |
#labelButtonType: #Button |
|
1388 |
#columnAlignment: #right |
|
1389 |
#editorType: #InputField |
|
1390 |
#type: #number |
|
1391 |
#model: #redFromColor: |
|
1392 |
#writeSelector: #redAtColor:put: |
|
1393 |
#selectSelector: #canSelectRedInColor: |
|
1394 |
) |
|
1395 |
||
1396 |
#(#DataSetColumnSpec |
|
1397 |
#label: 'G' |
|
1398 |
#labelAlignment: #left |
|
1399 |
#labelButtonType: #Button |
|
1400 |
#columnAlignment: #right |
|
1401 |
#editorType: #InputField |
|
1402 |
#type: #number |
|
1403 |
#model: #greenFromColor: |
|
1404 |
#writeSelector: #greenAtColor:put: |
|
1405 |
#selectSelector: #canSelectGreenInColor: |
|
1406 |
) |
|
1407 |
#(#DataSetColumnSpec |
|
1408 |
#label: 'B' |
|
1409 |
#labelAlignment: #left |
|
1410 |
#labelButtonType: #Button |
|
1411 |
#columnAlignment: #right |
|
1412 |
#editorType: #InputField |
|
1413 |
#type: #number |
|
1414 |
#model: #blueFromColor: |
|
1415 |
#writeSelector: #blueAtColor:put: |
|
1416 |
#selectSelector: #canSelectBlueInColor: |
|
767 | 1417 |
) |
1558 | 1418 |
) |
1419 |
#columnAdaptor: #colorColumnAdaptor |
|
767 | 1420 |
) |
1558 | 1421 |
) |
1422 |
||
1423 |
) |
|
1424 |
) |
|
1425 |
#(#ArbitraryComponentSpec |
|
1426 |
#name: 'imagePreView' |
|
1427 |
#activeHelpKey: #previewView |
|
1428 |
#menu: #previewMenu |
|
1429 |
#hasHorizontalScrollBar: true |
|
1430 |
#hasVerticalScrollBar: true |
|
1431 |
#miniScrollerHorizontal: true |
|
1432 |
#miniScrollerVertical: true |
|
1433 |
#hasBorder: false |
|
1434 |
#component: #ImageView |
|
767 | 1435 |
) |
1558 | 1436 |
) |
1437 |
||
767 | 1438 |
) |
1637 | 1439 |
#handles: #(#Any 0.5 1.0) |
767 | 1440 |
) |
1558 | 1441 |
) |
1442 |
||
767 | 1443 |
) |
1558 | 1444 |
) |
1445 |
#(#ViewSpec |
|
1637 | 1446 |
#name: 'rightView' |
1558 | 1447 |
#component: |
1448 |
#(#SpecCollection |
|
1449 |
#collection: #( |
|
1637 | 1450 |
#(#MenuPanelSpec |
1451 |
#name: 'ToolBar1' |
|
1452 |
#layout: #(#LayoutFrame 0 0 0 0.0 28 0 0 1.0) |
|
1453 |
#level: 1 |
|
1454 |
#menu: #toolsMenuToolbar |
|
1455 |
#verticalLayout: true |
|
1456 |
#centerItems: true |
|
1457 |
#textDefault: true |
|
1558 | 1458 |
) |
1637 | 1459 |
#(#ViewSpec |
1460 |
#name: 'editingView' |
|
1461 |
#layout: #(#LayoutFrame 28 0.0 0 0.0 0 1.0 0 1.0) |
|
1462 |
#level: 1 |
|
1463 |
#component: |
|
1464 |
#(#SpecCollection |
|
1465 |
#collection: #( |
|
1466 |
#(#ArbitraryComponentSpec |
|
1467 |
#name: 'imageEditView' |
|
1468 |
#layout: #(#LayoutFrame 2 0.0 2 0.0 -2 1.0 -24 1.0) |
|
1469 |
#hasHorizontalScrollBar: true |
|
1470 |
#hasVerticalScrollBar: true |
|
1471 |
#hasBorder: false |
|
1472 |
#component: #ImageEditView |
|
1473 |
) |
|
1474 |
#(#LabelSpec |
|
1475 |
#name: 'coordLabel' |
|
1476 |
#layout: #(#LayoutFrame 2 0.0 -22 1 -83 1.0 0 1.0) |
|
1477 |
#level: -1 |
|
1478 |
#labelChannel: #imageInfoHolder |
|
1479 |
#resizeForLabel: false |
|
1480 |
#adjust: #left |
|
1481 |
) |
|
1482 |
#(#ArrowButtonSpec |
|
1483 |
#name: 'magnifyDownButton' |
|
1484 |
#layout: #(#LayoutFrame -80 1 -22 1 -58 1 0 1) |
|
1485 |
#activeHelpKey: #magnifyImageDown |
|
1486 |
#model: #doMagnifyDown |
|
1487 |
#enableChannel: #imageIsLoaded |
|
1488 |
#isTriggerOnDown: true |
|
1489 |
#direction: #left |
|
1490 |
) |
|
1491 |
#(#ArrowButtonSpec |
|
1492 |
#name: 'magnifyUpButton' |
|
1493 |
#layout: #(#LayoutFrame -24 1 -22 1 -2 1 0 1) |
|
1494 |
#activeHelpKey: #magnifyImageUp |
|
1495 |
#model: #doMagnifyUp |
|
1496 |
#enableChannel: #imageIsLoaded |
|
1497 |
#isTriggerOnDown: true |
|
1498 |
#direction: #right |
|
1499 |
) |
|
1500 |
#(#InputFieldSpec |
|
1501 |
#name: 'magnificationInputField' |
|
1502 |
#layout: #(#LayoutFrame -57 1 -22 1 -26 1 0 1) |
|
1503 |
#activeHelpKey: #magnificationNumber |
|
1504 |
#enableChannel: #imageIsLoaded |
|
1505 |
#model: #valueOfMagnification |
|
1506 |
#type: #numberInRange |
|
1507 |
#acceptOnReturn: false |
|
1508 |
#acceptOnTab: false |
|
1509 |
#numChars: 2 |
|
1510 |
#minValue: 1 |
|
1511 |
#maxValue: 99 |
|
1512 |
#acceptOnPointerLeave: false |
|
1513 |
) |
|
1514 |
) |
|
1515 |
||
1516 |
) |
|
1558 | 1517 |
) |
1518 |
) |
|
1519 |
||
1520 |
) |
|
1521 |
) |
|
1522 |
) |
|
1523 |
||
767 | 1524 |
) |
1637 | 1525 |
#handles: #(#Any 0.3 1.0) |
1558 | 1526 |
) |
1527 |
#(#UISubSpecification |
|
1528 |
#name: 'infoBarSubSpec' |
|
1529 |
#layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0) |
|
1530 |
#majorKey: #ToolApplicationModel |
|
1531 |
#minorKey: #windowSpecForInfoBar |
|
1532 |
) |
|
1533 |
) |
|
1534 |
||
1535 |
) |
|
767 | 1536 |
) |
519 | 1537 |
! ! |
1538 |
||
1539 |
!ImageEditor class methodsFor:'menu specs'! |
|
1540 |
||
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1541 |
colorMapMenu |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1542 |
"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
|
1543 |
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
|
1544 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1545 |
"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
|
1546 |
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
|
1547 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1548 |
" |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1549 |
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
|
1550 |
(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
|
1551 |
" |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1552 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1553 |
<resource: #menu> |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1554 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1555 |
^ |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1556 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1557 |
#(#Menu |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1558 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1559 |
#( |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1560 |
#(#MenuItem |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1561 |
#label: 'Add Color' |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1562 |
#translateLabel: true |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1563 |
#value: #addColorToColormap |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1564 |
) |
1544 | 1565 |
#(#MenuItem |
1682 | 1566 |
#label: 'Pick and Add Color' |
1567 |
#translateLabel: true |
|
1568 |
#value: #pickAndAddColorToColormap |
|
1569 |
) |
|
1570 |
#(#MenuItem |
|
1571 |
#label: '-' |
|
1572 |
) |
|
1573 |
#(#MenuItem |
|
1574 |
#label: 'Darker' |
|
1575 |
#translateLabel: true |
|
1576 |
#value: #makeSelectedColorDarker |
|
1577 |
) |
|
1578 |
#(#MenuItem |
|
1579 |
#label: 'Brighter' |
|
1580 |
#translateLabel: true |
|
1581 |
#value: #makeSelectedColorBrighter |
|
1582 |
) |
|
1583 |
#(#MenuItem |
|
1544 | 1584 |
#label: '-' |
1585 |
) |
|
1586 |
#(#MenuItem |
|
1587 |
#label: 'Inspect Color' |
|
1588 |
#translateLabel: true |
|
1589 |
#value: #inspectColor |
|
1590 |
) |
|
1446 | 1591 |
"/ #(#MenuItem |
1592 |
"/ #label: 'Make Brighter' |
|
1593 |
"/ #translateLabel: true |
|
1594 |
"/ #value: #makeSelectedColorBrighter |
|
1595 |
"/ ) |
|
1596 |
"/ #(#MenuItem |
|
1597 |
"/ #label: 'Make Darker' |
|
1598 |
"/ #translateLabel: true |
|
1599 |
"/ #value: #makeSelectedColorDarker |
|
1600 |
"/ ) |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1601 |
) nil |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1602 |
nil |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1603 |
) |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1604 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1605 |
"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
|
1606 |
! |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
1607 |
|
400 | 1608 |
menu |
737 | 1609 |
"This resource specification was automatically generated |
1610 |
by the MenuEditor of ST/X." |
|
400 | 1611 |
|
737 | 1612 |
"Do not manually edit this!! If it is corrupted, |
1613 |
the MenuEditor may not be able to read the specification." |
|
400 | 1614 |
|
1615 |
" |
|
1616 |
MenuEditor new openOnClass:ImageEditor andSelector:#menu |
|
1617 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menu)) startUp |
|
1618 |
" |
|
1619 |
||
1620 |
<resource: #menu> |
|
1621 |
||
1124 | 1622 |
^ |
1623 |
#(#Menu |
|
1624 |
#( |
|
1625 |
#(#MenuItem |
|
1637 | 1626 |
#activeHelpKey: #file |
1489 | 1627 |
#label: '&File' |
1124 | 1628 |
#translateLabel: true |
1629 |
#submenu: |
|
1630 |
#(#Menu |
|
1631 |
#( |
|
1632 |
#(#MenuItem |
|
1637 | 1633 |
#activeHelpKey: #fileNewImage |
1124 | 1634 |
#label: 'New...' |
1637 | 1635 |
#itemValue: #doNewImage |
1124 | 1636 |
#translateLabel: true |
1637 |
) |
|
1638 |
#(#MenuItem |
|
1682 | 1639 |
#activeHelpKey: #fileNewImage |
1640 |
#label: 'New from ClipBoard' |
|
1641 |
#itemValue: #doNewImageFromClipboard |
|
1642 |
#translateLabel: true |
|
1643 |
) |
|
1644 |
#(#MenuItem |
|
1124 | 1645 |
#label: '-' |
1646 |
) |
|
1647 |
#(#MenuItem |
|
1637 | 1648 |
#activeHelpKey: #fileLoadFromClass |
1124 | 1649 |
#label: 'Load...' |
1637 | 1650 |
#itemValue: #doLoadFromClass |
1124 | 1651 |
#translateLabel: true |
1652 |
) |
|
1653 |
#(#MenuItem |
|
1637 | 1654 |
#activeHelpKey: #fileLoadFromFile |
1570 | 1655 |
#label: 'Load from File...' |
1637 | 1656 |
#itemValue: #doLoadFromFile |
1124 | 1657 |
#translateLabel: true |
1658 |
) |
|
1659 |
#(#MenuItem |
|
1637 | 1660 |
#activeHelpKey: #fileGrabImage |
1656 | 1661 |
#label: 'Grab from Screen...' |
1637 | 1662 |
#itemValue: #grabScreenImage |
1124 | 1663 |
#translateLabel: true |
1664 |
) |
|
1665 |
#(#MenuItem |
|
1637 | 1666 |
#enabled: #imageHasNextImage |
1496 | 1667 |
#label: 'Next in Sequence' |
1637 | 1668 |
#itemValue: #nextImageInSequence |
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
1669 |
#translateLabel: true |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
1670 |
) |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
1671 |
#(#MenuItem |
1124 | 1672 |
#label: '-' |
1673 |
) |
|
1674 |
#(#MenuItem |
|
1675 |
#activeHelpKey: #fileSaveMethod |
|
1676 |
#enabled: #imageIsLoadedAndClassDefined |
|
1637 | 1677 |
#label: 'Save' |
1678 |
#itemValue: #doSaveMethod |
|
1679 |
#translateLabel: true |
|
1124 | 1680 |
) |
1681 |
#(#MenuItem |
|
1682 |
#activeHelpKey: #fileSaveMethodAs |
|
1683 |
#enabled: #imageIsLoaded |
|
1637 | 1684 |
#label: 'Save As...' |
1685 |
#itemValue: #doSaveMethodAs |
|
1686 |
#translateLabel: true |
|
1124 | 1687 |
) |
1688 |
#(#MenuItem |
|
1689 |
#activeHelpKey: #fileSaveAs |
|
1690 |
#enabled: #imageIsLoaded |
|
1637 | 1691 |
#label: 'Save to File...' |
1692 |
#itemValue: #doSaveImageFileAs |
|
1693 |
#translateLabel: true |
|
1124 | 1694 |
) |
1695 |
#(#MenuItem |
|
1696 |
#activeHelpKey: #fileSaveMaskAs |
|
1697 |
#enabled: #imageIsLoaded |
|
1637 | 1698 |
#label: 'Save Mask to File...' |
1699 |
#itemValue: #doSaveImageMaskFileAs |
|
1700 |
#translateLabel: true |
|
1124 | 1701 |
) |
1702 |
#(#MenuItem |
|
1613 | 1703 |
#activeHelpKey: #fileSaveButtonImageAs |
1704 |
#enabled: #imageIsLoaded |
|
1656 | 1705 |
#label: 'Save as Button to File...' |
1637 | 1706 |
#itemValue: #doSaveButtonImageToFileAs |
1707 |
#translateLabel: true |
|
1613 | 1708 |
) |
1709 |
#(#MenuItem |
|
1124 | 1710 |
#label: '-' |
1711 |
) |
|
1712 |
#(#MenuItem |
|
1309
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
1713 |
#activeHelpKey: #fileShowStoreString |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
1714 |
#enabled: #imageIsLoaded |
1637 | 1715 |
#label: 'Show storeString' |
1716 |
#itemValue: #doShowStoreString |
|
1717 |
#translateLabel: true |
|
1309
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
1718 |
) |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
1719 |
#(#MenuItem |
1433 | 1720 |
#activeHelpKey: #fileEditMask |
1721 |
#enabled: #imageIsLoaded |
|
1637 | 1722 |
#label: 'Edit Mask' |
1723 |
#itemValue: #doEditMask |
|
1724 |
#translateLabel: true |
|
1433 | 1725 |
) |
1726 |
#(#MenuItem |
|
1309
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
1727 |
#label: '-' |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
1728 |
) |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
1729 |
#(#MenuItem |
1124 | 1730 |
#activeHelpKey: #filePrint |
1731 |
#enabled: #imageIsLoaded |
|
1637 | 1732 |
#label: 'Print' |
1733 |
#itemValue: #doPrint |
|
1734 |
#translateLabel: true |
|
1124 | 1735 |
) |
1736 |
#(#MenuItem |
|
1737 |
#label: '-' |
|
1738 |
) |
|
1739 |
#(#MenuItem |
|
1740 |
#activeHelpKey: #fileBrowseClass |
|
1741 |
#enabled: #hasClassDefined |
|
1637 | 1742 |
#label: 'Browse Class' |
1743 |
#itemValue: #doBrowseClass |
|
1744 |
#translateLabel: true |
|
1124 | 1745 |
) |
1746 |
#(#MenuItem |
|
1747 |
#label: '-' |
|
1748 |
) |
|
1749 |
#(#MenuItem |
|
1637 | 1750 |
#activeHelpKey: #fileExit |
1124 | 1751 |
#label: 'Exit' |
1637 | 1752 |
#itemValue: #closeRequest |
1124 | 1753 |
#translateLabel: true |
1754 |
) |
|
1755 |
) |
|
1756 |
nil |
|
1757 |
nil |
|
400 | 1758 |
) |
1124 | 1759 |
) |
1760 |
#(#MenuItem |
|
1637 | 1761 |
#activeHelpKey: #edit |
1762 |
#enabled: #imageIsLoaded |
|
1124 | 1763 |
#label: 'Edit' |
1764 |
#translateLabel: true |
|
1765 |
#submenu: |
|
1766 |
#(#Menu |
|
1767 |
#( |
|
1768 |
#(#MenuItem |
|
1769 |
#activeHelpKey: #editUndo |
|
1770 |
#enabled: #valueOfCanUndo |
|
1637 | 1771 |
#label: 'Undo' |
1772 |
#itemValue: #doUndo |
|
1773 |
#translateLabel: true |
|
1124 | 1774 |
) |
1775 |
#(#MenuItem |
|
1776 |
#label: '-' |
|
1777 |
) |
|
1778 |
#(#MenuItem |
|
1637 | 1779 |
#activeHelpKey: #editFlipVertical |
1124 | 1780 |
#label: 'Flip - Vertical' |
1637 | 1781 |
#itemValue: #doFlipVertical |
1124 | 1782 |
#translateLabel: true |
1783 |
) |
|
1784 |
#(#MenuItem |
|
1637 | 1785 |
#activeHelpKey: #editFlipHorizontal |
1124 | 1786 |
#label: 'Flip - Horizontal' |
1637 | 1787 |
#itemValue: #doFlipHorizontal |
1124 | 1788 |
#translateLabel: true |
1789 |
) |
|
1790 |
#(#MenuItem |
|
1791 |
#label: '-' |
|
1792 |
) |
|
1793 |
#(#MenuItem |
|
1637 | 1794 |
#activeHelpKey: #editResize |
1124 | 1795 |
#label: 'Resize...' |
1637 | 1796 |
#itemValue: #doResizeImage |
1124 | 1797 |
#translateLabel: true |
1798 |
) |
|
1799 |
#(#MenuItem |
|
1637 | 1800 |
#activeHelpKey: #editMagnifyImage |
1124 | 1801 |
#label: 'Magnify...' |
1637 | 1802 |
#itemValue: #doMagnifyImage |
1124 | 1803 |
#translateLabel: true |
1804 |
) |
|
1805 |
#(#MenuItem |
|
1637 | 1806 |
#activeHelpKey: #editMagnifyImage |
1479 | 1807 |
#label: 'Magnify By...' |
1637 | 1808 |
#itemValue: #doMagnifyImageBy |
1479 | 1809 |
#translateLabel: true |
1810 |
) |
|
1811 |
#(#MenuItem |
|
1637 | 1812 |
#activeHelpKey: #editRotate |
1124 | 1813 |
#label: 'Rotate...' |
1637 | 1814 |
#itemValue: #doRotateImage |
1124 | 1815 |
#translateLabel: true |
1816 |
) |
|
1817 |
#(#MenuItem |
|
1818 |
#label: '-' |
|
1819 |
) |
|
1820 |
#(#MenuItem |
|
1146 | 1821 |
#label: 'Invert' |
1637 | 1822 |
#itemValue: #doNegativeImage |
1146 | 1823 |
#translateLabel: true |
1824 |
) |
|
1825 |
#(#MenuItem |
|
1826 |
#label: '-' |
|
1827 |
) |
|
1828 |
#(#MenuItem |
|
1124 | 1829 |
#label: 'Crop' |
1830 |
#translateLabel: true |
|
1831 |
#submenu: |
|
400 | 1832 |
#(#Menu |
1124 | 1833 |
#( |
1834 |
#(#MenuItem |
|
1637 | 1835 |
#activeHelpKey: #cropAll |
1124 | 1836 |
#label: 'All' |
1637 | 1837 |
#itemValue: #doCropAll |
1124 | 1838 |
#translateLabel: true |
400 | 1839 |
) |
1124 | 1840 |
#(#MenuItem |
1841 |
#label: '-' |
|
986 | 1842 |
) |
1124 | 1843 |
#(#MenuItem |
1637 | 1844 |
#activeHelpKey: #cropLeft |
1124 | 1845 |
#label: 'Left' |
1637 | 1846 |
#itemValue: #doCropLeft |
1124 | 1847 |
#translateLabel: true |
1848 |
) |
|
1849 |
#(#MenuItem |
|
1637 | 1850 |
#activeHelpKey: #cropRight |
1124 | 1851 |
#label: 'Right' |
1637 | 1852 |
#itemValue: #doCropRight |
1124 | 1853 |
#translateLabel: true |
986 | 1854 |
) |
1124 | 1855 |
#(#MenuItem |
1637 | 1856 |
#activeHelpKey: #cropTop |
1124 | 1857 |
#label: 'Top' |
1637 | 1858 |
#itemValue: #doCropTop |
1124 | 1859 |
#translateLabel: true |
672 | 1860 |
) |
1124 | 1861 |
#(#MenuItem |
1637 | 1862 |
#activeHelpKey: #cropBottom |
1124 | 1863 |
#label: 'Bottom' |
1637 | 1864 |
#itemValue: #doCropBottom |
1124 | 1865 |
#translateLabel: true |
400 | 1866 |
) |
1124 | 1867 |
#(#MenuItem |
1868 |
#label: '-' |
|
400 | 1869 |
) |
1124 | 1870 |
#(#MenuItem |
1637 | 1871 |
#activeHelpKey: #cropManual |
1124 | 1872 |
#label: 'Manual...' |
1637 | 1873 |
#itemValue: #doCropManual |
1124 | 1874 |
#translateLabel: true |
400 | 1875 |
) |
1124 | 1876 |
) |
1877 |
nil |
|
400 | 1878 |
nil |
1124 | 1879 |
) |
400 | 1880 |
) |
1489 | 1881 |
#(#MenuItem |
1637 | 1882 |
#activeHelpKey: #shiftManual |
1557 | 1883 |
#label: 'Shift...' |
1637 | 1884 |
#itemValue: #doShiftManual |
1557 | 1885 |
#translateLabel: true |
1886 |
) |
|
1887 |
#(#MenuItem |
|
1637 | 1888 |
#activeHelpKey: #uncropManual |
1656 | 1889 |
#label: 'Uncrop (Add Border)...' |
1637 | 1890 |
#itemValue: #doUnCropManual |
1489 | 1891 |
#translateLabel: true |
1892 |
) |
|
1124 | 1893 |
) |
1894 |
nil |
|
1895 |
nil |
|
400 | 1896 |
) |
1124 | 1897 |
) |
1898 |
#(#MenuItem |
|
1637 | 1899 |
#enabled: #imageIsLoaded |
1900 |
#label: 'Mode' |
|
1901 |
#translateLabel: true |
|
1902 |
#submenuChannel: #modeMenu |
|
1903 |
) |
|
1904 |
#(#MenuItem |
|
1905 |
#activeHelpKey: #colorMap |
|
1906 |
#enabled: #imageIsLoaded |
|
1124 | 1907 |
#label: 'ColorMap' |
1908 |
#translateLabel: true |
|
1909 |
#submenu: |
|
1910 |
#(#Menu |
|
1911 |
#( |
|
1912 |
#(#MenuItem |
|
1649 | 1913 |
#label: 'Depth' |
1124 | 1914 |
#translateLabel: true |
1649 | 1915 |
#submenu: |
1916 |
#(#Menu |
|
1917 |
#( |
|
1918 |
#(#MenuItem |
|
1919 |
#activeHelpKey: #colorMap8 |
|
1920 |
#label: '8-Plane' |
|
1921 |
#itemValue: #colorMapMode: |
|
1922 |
#translateLabel: true |
|
1923 |
#argument: '8-plane' |
|
1924 |
#choice: #colorMapMode |
|
1925 |
#choiceValue: '8-plane' |
|
1926 |
) |
|
1927 |
#(#MenuItem |
|
1928 |
#activeHelpKey: #colorMap4 |
|
1929 |
#label: '4-Plane' |
|
1930 |
#itemValue: #colorMapMode: |
|
1931 |
#translateLabel: true |
|
1932 |
#argument: '4-plane' |
|
1933 |
#choice: #colorMapMode |
|
1934 |
#choiceValue: '4-plane' |
|
1935 |
) |
|
1936 |
#(#MenuItem |
|
1937 |
#activeHelpKey: #colorMap2 |
|
1938 |
#label: '2-Plane' |
|
1939 |
#itemValue: #colorMapMode: |
|
1940 |
#translateLabel: true |
|
1941 |
#argument: '2-plane' |
|
1942 |
#choice: #colorMapMode |
|
1943 |
#choiceValue: '2-plane' |
|
1944 |
) |
|
1945 |
#(#MenuItem |
|
1946 |
#activeHelpKey: #colorMap1 |
|
1947 |
#label: '1-Plane' |
|
1948 |
#itemValue: #colorMapMode: |
|
1949 |
#translateLabel: true |
|
1950 |
#argument: '1-plane' |
|
1951 |
#choice: #colorMapMode |
|
1952 |
#choiceValue: '1-plane' |
|
1953 |
) |
|
1954 |
#(#MenuItem |
|
1955 |
#label: '-' |
|
1956 |
) |
|
1957 |
#(#MenuItem |
|
1958 |
#activeHelpKey: #colorMap8M |
|
1959 |
#label: '8-Plane + Mask' |
|
1960 |
#itemValue: #colorMapMode: |
|
1961 |
#translateLabel: true |
|
1962 |
#argument: '8-plane + mask' |
|
1963 |
#choice: #colorMapMode |
|
1964 |
#choiceValue: '8-plane + mask' |
|
1965 |
) |
|
1966 |
#(#MenuItem |
|
1967 |
#activeHelpKey: #colorMap4M |
|
1968 |
#label: '4-Plane + Mask' |
|
1969 |
#itemValue: #colorMapMode: |
|
1970 |
#translateLabel: true |
|
1971 |
#argument: '4-plane + mask' |
|
1972 |
#choice: #colorMapMode |
|
1973 |
#choiceValue: '4-plane + mask' |
|
1974 |
) |
|
1975 |
#(#MenuItem |
|
1976 |
#activeHelpKey: #colorMap2M |
|
1977 |
#label: '2-Plane + Mask' |
|
1978 |
#itemValue: #colorMapMode: |
|
1979 |
#translateLabel: true |
|
1980 |
#argument: '2-plane + mask' |
|
1981 |
#choice: #colorMapMode |
|
1982 |
#choiceValue: '2-plane + mask' |
|
1983 |
) |
|
1984 |
#(#MenuItem |
|
1985 |
#activeHelpKey: #colorMap1M |
|
1986 |
#label: '1-Plane + Mask' |
|
1987 |
#itemValue: #colorMapMode: |
|
1988 |
#translateLabel: true |
|
1989 |
#argument: '1-plane + mask' |
|
1990 |
#choice: #colorMapMode |
|
1991 |
#choiceValue: '1-plane + mask' |
|
1992 |
) |
|
1993 |
) |
|
1994 |
nil |
|
1995 |
nil |
|
1996 |
) |
|
1124 | 1997 |
) |
1998 |
#(#MenuItem |
|
1649 | 1999 |
#label: 'Colors' |
1124 | 2000 |
#translateLabel: true |
1649 | 2001 |
#submenu: |
2002 |
#(#Menu |
|
2003 |
#( |
|
2004 |
#(#MenuItem |
|
2005 |
#activeHelpKey: #compressColormap |
|
2006 |
#enabled: #hasColormap |
|
2007 |
#label: 'Compress Colormap' |
|
2008 |
#itemValue: #compressColorMap |
|
2009 |
#translateLabel: true |
|
2010 |
) |
|
2011 |
#(#MenuItem |
|
2012 |
#enabled: #hasColormap |
|
2013 |
#label: 'Sort Colormap' |
|
2014 |
#itemValue: #sortColorMap |
|
2015 |
#translateLabel: true |
|
2016 |
) |
|
2017 |
#(#MenuItem |
|
2018 |
#label: 'Reduce Number of Colors...' |
|
2019 |
#itemValue: #reduceNumberOfColors |
|
2020 |
#translateLabel: true |
|
2021 |
) |
|
2022 |
) |
|
2023 |
nil |
|
2024 |
nil |
|
2025 |
) |
|
1124 | 2026 |
) |
2027 |
#(#MenuItem |
|
1649 | 2028 |
#label: 'Process' |
1598 | 2029 |
#translateLabel: true |
1649 | 2030 |
#submenu: |
2031 |
#(#Menu |
|
2032 |
#( |
|
2033 |
#(#MenuItem |
|
2034 |
#label: 'Make GrayScale' |
|
2035 |
#itemValue: #makeGrayScale |
|
2036 |
#translateLabel: true |
|
2037 |
) |
|
2038 |
#(#MenuItem |
|
2039 |
#label: 'Make Brighter' |
|
2040 |
#itemValue: #makeBrighter |
|
2041 |
#translateLabel: true |
|
2042 |
) |
|
2043 |
#(#MenuItem |
|
2044 |
#label: 'Make Darker' |
|
2045 |
#itemValue: #makeDarker |
|
2046 |
#translateLabel: true |
|
2047 |
) |
|
2048 |
#(#MenuItem |
|
2049 |
#label: 'Make Inverse' |
|
2050 |
#itemValue: #makeInverse |
|
2051 |
#translateLabel: true |
|
2052 |
) |
|
2053 |
#(#MenuItem |
|
2054 |
#label: '-' |
|
2055 |
) |
|
2056 |
#(#MenuItem |
|
1650 | 2057 |
#label: 'Change HLS...' |
2058 |
#itemValue: #changeHLS |
|
1649 | 2059 |
#translateLabel: true |
2060 |
) |
|
2061 |
) |
|
2062 |
nil |
|
2063 |
nil |
|
2064 |
) |
|
1436 | 2065 |
) |
1480 | 2066 |
#(#MenuItem |
1649 | 2067 |
#label: 'Mask' |
1637 | 2068 |
#translateLabel: true |
1649 | 2069 |
#submenu: |
2070 |
#(#Menu |
|
2071 |
#( |
|
2072 |
#(#MenuItem |
|
2073 |
#activeHelpKey: #copyMask |
|
2074 |
#enabled: #hasMask |
|
2075 |
#label: 'Copy Mask' |
|
2076 |
#itemValue: #copyMask |
|
2077 |
#translateLabel: true |
|
2078 |
) |
|
2079 |
#(#MenuItem |
|
2080 |
#activeHelpKey: #pasteMask |
|
2081 |
#enabled: #hasMask |
|
2082 |
#label: 'Paste Mask' |
|
2083 |
#itemValue: #pasteMask |
|
2084 |
#translateLabel: true |
|
2085 |
) |
|
2086 |
#(#MenuItem |
|
2087 |
#label: 'Clear Masked Pixels' |
|
2088 |
#itemValue: #clearMaskedPixels |
|
2089 |
#translateLabel: true |
|
2090 |
) |
|
2091 |
) |
|
2092 |
nil |
|
2093 |
nil |
|
2094 |
) |
|
1598 | 2095 |
) |
1124 | 2096 |
) |
2097 |
nil |
|
2098 |
nil |
|
756 | 2099 |
) |
1124 | 2100 |
) |
2101 |
#(#MenuItem |
|
2102 |
#label: 'Settings' |
|
2103 |
#translateLabel: true |
|
2104 |
#submenu: |
|
2105 |
#(#Menu |
|
2106 |
#( |
|
2107 |
#(#MenuItem |
|
1637 | 2108 |
#activeHelpKey: #settingsGridMagnification |
1353 | 2109 |
#label: 'Grid Magnification Limit...' |
1637 | 2110 |
#itemValue: #doChangeGridMagnification |
1124 | 2111 |
#translateLabel: true |
2112 |
) |
|
2113 |
) |
|
2114 |
nil |
|
2115 |
nil |
|
400 | 2116 |
) |
1124 | 2117 |
) |
2118 |
#(#MenuItem |
|
1637 | 2119 |
#activeHelpKey: #history |
1124 | 2120 |
#label: 'History' |
2121 |
#translateLabel: true |
|
2122 |
#submenuChannel: #menuHistory |
|
2123 |
) |
|
2124 |
#(#MenuItem |
|
1637 | 2125 |
#activeHelpKey: #help |
1124 | 2126 |
#label: 'Help' |
2127 |
#translateLabel: true |
|
2128 |
#startGroup: #right |
|
2129 |
#submenuChannel: #menuHelp |
|
2130 |
) |
|
2131 |
) |
|
2132 |
nil |
|
2133 |
nil |
|
400 | 2134 |
) |
2135 |
! |
|
2136 |
||
679 | 2137 |
menuMouseButtonColors |
737 | 2138 |
"This resource specification was automatically generated |
2139 |
by the MenuEditor of ST/X." |
|
679 | 2140 |
|
737 | 2141 |
"Do not manually edit this!! If it is corrupted, |
2142 |
the MenuEditor may not be able to read the specification." |
|
679 | 2143 |
|
2144 |
" |
|
2145 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuMouseButtonColors |
|
2146 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuMouseButtonColors)) startUp |
|
2147 |
" |
|
2148 |
||
2149 |
<resource: #menu> |
|
2150 |
||
2151 |
^ |
|
2152 |
||
2153 |
#(#Menu |
|
2154 |
||
2155 |
#( |
|
2156 |
#(#MenuItem |
|
2157 |
#label: 'Left Mouse Button' |
|
2158 |
#nameKey: #leftMouseKeyButton |
|
2159 |
#activeHelpKey: #mouseKeyColorMode |
|
975 | 2160 |
#enabled: #imageIsLoaded |
679 | 2161 |
#labelImage: #(#ResourceRetriever nil #leftMouseKeyIcon) |
975 | 2162 |
#choice: #mouseKeyColorMode |
2163 |
#choiceValue: 1 |
|
679 | 2164 |
) |
2165 |
#(#MenuItem |
|
2166 |
#label: 'Right Mouse Button' |
|
2167 |
#nameKey: #rightMouseKeyButton |
|
2168 |
#activeHelpKey: #mouseKeyColorMode |
|
975 | 2169 |
#enabled: #imageIsLoaded |
679 | 2170 |
#labelImage: #(#ResourceRetriever nil #rightMouseKeyIcon) |
975 | 2171 |
#choice: #mouseKeyColorMode |
2172 |
#choiceValue: 2 |
|
679 | 2173 |
) |
2174 |
) nil |
|
2175 |
nil |
|
2176 |
) |
|
2177 |
! |
|
2178 |
||
400 | 2179 |
menuToolbar |
737 | 2180 |
"This resource specification was automatically generated |
2181 |
by the MenuEditor of ST/X." |
|
400 | 2182 |
|
737 | 2183 |
"Do not manually edit this!! If it is corrupted, |
2184 |
the MenuEditor may not be able to read the specification." |
|
400 | 2185 |
|
2186 |
" |
|
2187 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuToolbar |
|
2188 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuToolbar)) startUp |
|
2189 |
" |
|
2190 |
||
2191 |
<resource: #menu> |
|
2192 |
||
1196 | 2193 |
^ |
2194 |
#(#Menu |
|
2195 |
#( |
|
2196 |
#(#MenuItem |
|
1637 | 2197 |
#activeHelpKey: #fileNewImage |
1196 | 2198 |
#label: 'newImage' |
1637 | 2199 |
#itemValue: #doNewImage |
2200 |
#translateLabel: true |
|
1196 | 2201 |
#isButton: true |
2202 |
#labelImage: #(#ResourceRetriever #Icon #newIcon) |
|
2203 |
) |
|
2204 |
#(#MenuItem |
|
1637 | 2205 |
#activeHelpKey: #fileLoadFromClass |
1196 | 2206 |
#label: 'loadFromClass' |
1637 | 2207 |
#itemValue: #doLoadFromClass |
2208 |
#translateLabel: true |
|
1196 | 2209 |
#isButton: true |
2210 |
#labelImage: #(#ResourceRetriever #Icon #loadIcon) |
|
2211 |
) |
|
2212 |
#(#MenuItem |
|
2213 |
#activeHelpKey: #fileSaveMethod |
|
2214 |
#enabled: #imageIsLoaded |
|
1637 | 2215 |
#label: 'saveMethod' |
2216 |
#itemValue: #doSaveMethod |
|
2217 |
#translateLabel: true |
|
2218 |
#isButton: true |
|
1196 | 2219 |
#labelImage: #(#ResourceRetriever #Icon #saveIcon) |
2220 |
) |
|
2221 |
#(#MenuItem |
|
2222 |
#label: '' |
|
2223 |
) |
|
2224 |
#(#MenuItem |
|
2225 |
#label: '' |
|
2226 |
) |
|
2227 |
#(#MenuItem |
|
1637 | 2228 |
#activeHelpKey: #editUndo |
2229 |
#enabled: #valueOfCanUndo |
|
2230 |
#label: 'Undo' |
|
2231 |
#itemValue: #doUndo |
|
2232 |
#translateLabel: true |
|
2233 |
#isButton: true |
|
2234 |
#labelImage: #(#ResourceRetriever #ToolbarIconLibrary #undo16x16Icon2) |
|
1196 | 2235 |
) |
1637 | 2236 |
) |
2237 |
nil |
|
2238 |
nil |
|
2239 |
) |
|
2240 |
! |
|
2241 |
||
2242 |
modeMenu |
|
2243 |
"This resource specification was automatically generated |
|
2244 |
by the MenuEditor of ST/X." |
|
2245 |
||
2246 |
"Do not manually edit this!! If it is corrupted, |
|
2247 |
the MenuEditor may not be able to read the specification." |
|
2248 |
||
2249 |
" |
|
2250 |
MenuEditor new openOnClass:ImageEditor andSelector:#modeMenu |
|
2251 |
(Menu new fromLiteralArrayEncoding:(ImageEditor modeMenu)) startUp |
|
2252 |
" |
|
2253 |
||
2254 |
<resource: #menu> |
|
2255 |
||
2256 |
^ |
|
2257 |
#(#Menu |
|
2258 |
#( |
|
1196 | 2259 |
#(#MenuItem |
2260 |
#activeHelpKey: #drawModePoint |
|
2261 |
#enabled: #imageIsLoaded |
|
1637 | 2262 |
#label: 'Point' |
2263 |
#translateLabel: true |
|
1196 | 2264 |
#choice: #editMode |
2265 |
#choiceValue: #point |
|
2266 |
) |
|
2267 |
#(#MenuItem |
|
2268 |
#activeHelpKey: #drawModeBox |
|
2269 |
#enabled: #imageIsLoaded |
|
1637 | 2270 |
#label: 'Rect' |
2271 |
#translateLabel: true |
|
1196 | 2272 |
#choice: #editMode |
2273 |
#choiceValue: #box |
|
2274 |
) |
|
2275 |
#(#MenuItem |
|
2276 |
#activeHelpKey: #drawModeFilledBox |
|
2277 |
#enabled: #imageIsLoaded |
|
1656 | 2278 |
#label: 'Filled Rectangle' |
1637 | 2279 |
#translateLabel: true |
1196 | 2280 |
#choice: #editMode |
2281 |
#choiceValue: #filledBox |
|
2282 |
) |
|
2283 |
#(#MenuItem |
|
2284 |
#activeHelpKey: #drawModeFill |
|
2285 |
#enabled: #imageIsLoaded |
|
1637 | 2286 |
#label: 'Fill' |
2287 |
#translateLabel: true |
|
1196 | 2288 |
#choice: #editMode |
2289 |
#choiceValue: #fill |
|
2290 |
) |
|
2291 |
#(#MenuItem |
|
2292 |
#activeHelpKey: #drawModeCopy |
|
2293 |
#enabled: #imageIsLoaded |
|
1637 | 2294 |
#label: 'Copy' |
2295 |
#translateLabel: true |
|
1196 | 2296 |
#choice: #editMode |
2297 |
#choiceValue: #copy |
|
2298 |
) |
|
2299 |
#(#MenuItem |
|
2300 |
#activeHelpKey: #drawModePaste |
|
2301 |
#enabled: #imageIsLoaded |
|
1637 | 2302 |
#label: 'Paste' |
2303 |
#translateLabel: true |
|
1196 | 2304 |
#choice: #editMode |
2305 |
#choiceValue: #paste |
|
2306 |
) |
|
2307 |
#(#MenuItem |
|
2308 |
#activeHelpKey: #drawModePasteUnder |
|
2309 |
#enabled: #imageIsLoaded |
|
1637 | 2310 |
#label: 'Paste Under' |
2311 |
#translateLabel: true |
|
1196 | 2312 |
#choice: #editMode |
2313 |
#choiceValue: #pasteUnder |
|
2314 |
) |
|
1411 | 2315 |
#(#MenuItem |
1579 | 2316 |
#activeHelpKey: #drawModePasteWithMask |
2317 |
#enabled: #imageIsLoaded |
|
1656 | 2318 |
#label: 'Paste with Mask' |
1637 | 2319 |
#translateLabel: true |
1579 | 2320 |
#choice: #editMode |
2321 |
#choiceValue: #pasteWithMask |
|
2322 |
) |
|
2323 |
#(#MenuItem |
|
1411 | 2324 |
#activeHelpKey: #drawModeSpecial |
2325 |
#enabled: #imageIsLoaded |
|
1637 | 2326 |
#label: 'Special' |
2327 |
#translateLabel: true |
|
1411 | 2328 |
#choice: #editMode |
2329 |
#choiceValue: #specialOperation |
|
2330 |
) |
|
1196 | 2331 |
) |
2332 |
nil |
|
2333 |
nil |
|
400 | 2334 |
) |
1558 | 2335 |
! |
2336 |
||
2337 |
previewMenu |
|
2338 |
"This resource specification was automatically generated |
|
2339 |
by the MenuEditor of ST/X." |
|
2340 |
||
2341 |
"Do not manually edit this!! If it is corrupted, |
|
2342 |
the MenuEditor may not be able to read the specification." |
|
2343 |
||
2344 |
" |
|
2345 |
MenuEditor new openOnClass:ImageEditor andSelector:#previewMenu |
|
2346 |
(Menu new fromLiteralArrayEncoding:(ImageEditor previewMenu)) startUp |
|
2347 |
" |
|
2348 |
||
2349 |
<resource: #menu> |
|
2350 |
||
2351 |
^ |
|
2352 |
#(#Menu |
|
2353 |
#( |
|
2354 |
#(#MenuItem |
|
2355 |
#label: 'TileMode' |
|
2356 |
#translateLabel: true |
|
2357 |
#indication: #tileModeHolder |
|
2358 |
) |
|
2359 |
) |
|
2360 |
nil |
|
2361 |
nil |
|
2362 |
) |
|
1637 | 2363 |
! |
2364 |
||
2365 |
toolsMenuToolbar |
|
2366 |
"This resource specification was automatically generated |
|
2367 |
by the MenuEditor of ST/X." |
|
2368 |
||
2369 |
"Do not manually edit this!! If it is corrupted, |
|
2370 |
the MenuEditor may not be able to read the specification." |
|
2371 |
||
2372 |
" |
|
2373 |
MenuEditor new openOnClass:ImageEditor andSelector:#toolsMenuToolbar |
|
2374 |
(Menu new fromLiteralArrayEncoding:(ImageEditor toolsMenuToolbar)) startUp |
|
2375 |
" |
|
2376 |
||
2377 |
<resource: #menu> |
|
2378 |
||
2379 |
^ |
|
2380 |
#(#Menu |
|
2381 |
#( |
|
2382 |
#(#MenuItem |
|
2383 |
#activeHelpKey: #drawModePoint |
|
2384 |
#enabled: #imageIsLoaded |
|
2385 |
#label: 'Point' |
|
2386 |
#translateLabel: true |
|
2387 |
#isButton: true |
|
2388 |
#labelImage: #(#ResourceRetriever #ImageEditor #pointIcon) |
|
2389 |
#choice: #editMode |
|
2390 |
#choiceValue: #point |
|
2391 |
) |
|
2392 |
#(#MenuItem |
|
2393 |
#activeHelpKey: #drawModeBox |
|
2394 |
#enabled: #imageIsLoaded |
|
2395 |
#label: 'Rect' |
|
2396 |
#translateLabel: true |
|
2397 |
#isButton: true |
|
2398 |
#labelImage: #(#ResourceRetriever #ImageEditor #rectIcon) |
|
2399 |
#choice: #editMode |
|
2400 |
#choiceValue: #box |
|
2401 |
) |
|
2402 |
#(#MenuItem |
|
2403 |
#activeHelpKey: #drawModeFilledBox |
|
2404 |
#enabled: #imageIsLoaded |
|
2405 |
#label: 'FillRect' |
|
2406 |
#translateLabel: true |
|
2407 |
#isButton: true |
|
2408 |
#labelImage: #(#ResourceRetriever #ImageEditor #fillRectIcon) |
|
2409 |
#choice: #editMode |
|
2410 |
#choiceValue: #filledBox |
|
2411 |
) |
|
2412 |
#(#MenuItem |
|
2413 |
#activeHelpKey: #drawModeFill |
|
2414 |
#enabled: #imageIsLoaded |
|
2415 |
#label: 'Fill' |
|
2416 |
#translateLabel: true |
|
2417 |
#isButton: true |
|
2418 |
#labelImage: #(#ResourceRetriever #ImageEditor #fillIcon) |
|
2419 |
#choice: #editMode |
|
2420 |
#choiceValue: #fill |
|
2421 |
) |
|
2422 |
#(#MenuItem |
|
2423 |
#activeHelpKey: #drawModeCopy |
|
2424 |
#enabled: #imageIsLoaded |
|
2425 |
#label: 'Copy' |
|
2426 |
#translateLabel: true |
|
2427 |
#isButton: true |
|
2428 |
#labelImage: #(#ResourceRetriever #ImageEditor #copyIcon) |
|
2429 |
#choice: #editMode |
|
2430 |
#choiceValue: #copy |
|
2431 |
) |
|
2432 |
#(#MenuItem |
|
2433 |
#activeHelpKey: #drawModePaste |
|
2434 |
#enabled: #imageIsLoaded |
|
2435 |
#label: 'Paste' |
|
2436 |
#translateLabel: true |
|
2437 |
#isButton: true |
|
2438 |
#labelImage: #(#ResourceRetriever #ImageEditor #pasteIcon) |
|
2439 |
#choice: #editMode |
|
2440 |
#choiceValue: #paste |
|
2441 |
) |
|
2442 |
#(#MenuItem |
|
2443 |
#activeHelpKey: #drawModePasteUnder |
|
2444 |
#enabled: #imageIsLoaded |
|
2445 |
#label: 'Paste Under' |
|
2446 |
#translateLabel: true |
|
2447 |
#isButton: true |
|
2448 |
#labelImage: #(#ResourceRetriever #ImageEditor #pasteUnderIcon) |
|
2449 |
#choice: #editMode |
|
2450 |
#choiceValue: #pasteUnder |
|
2451 |
) |
|
2452 |
#(#MenuItem |
|
2453 |
#activeHelpKey: #drawModePasteWithMask |
|
2454 |
#enabled: #imageIsLoaded |
|
2455 |
#label: 'Paste With Mask' |
|
2456 |
#translateLabel: true |
|
2457 |
#isButton: true |
|
2458 |
#labelImage: #(#ResourceRetriever #ImageEditor #pasteWithMaskIcon) |
|
2459 |
#choice: #editMode |
|
2460 |
#choiceValue: #pasteWithMask |
|
2461 |
) |
|
2462 |
#(#MenuItem |
|
2463 |
#activeHelpKey: #drawModeSpecial |
|
2464 |
#enabled: #imageIsLoaded |
|
2465 |
#label: 'Special' |
|
2466 |
#translateLabel: true |
|
2467 |
#isButton: true |
|
2468 |
#labelImage: #(#ResourceRetriever #ImageEditor #specialIcon) |
|
2469 |
#choice: #editMode |
|
2470 |
#choiceValue: #specialOperation |
|
2471 |
) |
|
2472 |
) |
|
2473 |
nil |
|
2474 |
nil |
|
2475 |
) |
|
400 | 2476 |
! ! |
2477 |
||
2478 |
!ImageEditor methodsFor:'accessing'! |
|
2479 |
||
2480 |
image |
|
767 | 2481 |
"returns the current editing image" |
400 | 2482 |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2483 |
^ imageEditView image |
400 | 2484 |
! |
2485 |
||
2486 |
postOpenAction: anAction |
|
767 | 2487 |
"sets an action which is evaluated after opening" |
400 | 2488 |
|
2489 |
postOpenAction := anAction |
|
1381 | 2490 |
! |
2491 |
||
2492 |
resourceClass:aClass |
|
2493 |
imageEditView resourceClass:aClass |
|
400 | 2494 |
! ! |
2495 |
||
1398 | 2496 |
!ImageEditor methodsFor:'accessing-views'! |
400 | 2497 |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2498 |
colorDataSetView |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2499 |
"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
|
2500 |
|
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1583
diff
changeset
|
2501 |
^(self componentAt: #colorDataSetView) |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2502 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2503 |
"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
|
2504 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2505 |
|
487 | 2506 |
coordLabel |
767 | 2507 |
"returns the view the coord label" |
487 | 2508 |
|
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1583
diff
changeset
|
2509 |
^self componentAt: #coordLabel |
487 | 2510 |
! |
2511 |
||
400 | 2512 |
imageEditView |
911 | 2513 |
"returns the view of the image" |
400 | 2514 |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2515 |
imageEditView isNil ifTrue:[ |
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1583
diff
changeset
|
2516 |
imageEditView := (self componentAt: #imageEditView) scrolledView. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2517 |
imageEditView addDependent:self. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2518 |
]. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2519 |
^ imageEditView |
1345 | 2520 |
|
2521 |
"Modified: / 10.2.2000 / 23:19:20 / cg" |
|
400 | 2522 |
! |
2523 |
||
2524 |
imagePreView |
|
767 | 2525 |
"returns the preview of the image" |
400 | 2526 |
|
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1583
diff
changeset
|
2527 |
^ (self componentAt: #imagePreView) subViews first |
475 | 2528 |
! ! |
2529 |
||
400 | 2530 |
!ImageEditor methodsFor:'aspects'! |
2531 |
||
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2532 |
activityInfoHolder |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2533 |
^ self valueOfInfoLabel |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2534 |
|
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2535 |
"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
|
2536 |
! |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2537 |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2538 |
colorColumnAdaptor |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2539 |
^ self |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2540 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2541 |
"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
|
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 |
|
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2544 |
hasClassAndSelectorDefined |
1054 | 2545 |
^ [ |
2546 |
|clsName| |
|
2547 |
||
2548 |
(clsName := imageEditView resourceClass) size > 0 |
|
2549 |
and:[(Smalltalk at:clsName ifAbsent:nil) notNil |
|
2550 |
and:[imageEditView resourceSelector notNil]] |
|
2551 |
] |
|
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2552 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2553 |
"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
|
2554 |
! |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2555 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2556 |
hasClassDefined |
1054 | 2557 |
^ [ |
2558 |
|clsName| |
|
2559 |
||
1443 | 2560 |
(clsName := imageEditView resourceClass) size > 0 |
1054 | 2561 |
and:[(Smalltalk at:clsName ifAbsent:nil) notNil] |
2562 |
] |
|
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2563 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2564 |
"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
|
2565 |
! |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2566 |
|
1008 | 2567 |
hasColormap |
2568 |
^ [self image notNil and:[self image colorMap notNil]] |
|
2569 |
||
2570 |
"Created: / 30.9.1998 / 23:53:55 / cg" |
|
2571 |
! |
|
2572 |
||
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
2573 |
imageHasNextImage |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
2574 |
"returns whether an image is loaded as value holder" |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
2575 |
|
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
2576 |
^ [self image notNil |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
2577 |
and:[self image imageSequence notNil]] |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
2578 |
|
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
2579 |
"Created: / 31.7.1998 / 02:04:18 / cg" |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
2580 |
! |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
2581 |
|
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2582 |
imageInfoHolder |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2583 |
|holder| |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2584 |
(holder := builder bindingAt:#imageInfoHolder) isNil ifTrue:[ |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2585 |
builder aspectAt:#imageInfoHolder put:(holder := '' asValue). |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2586 |
]. |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2587 |
^ holder |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2588 |
|
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2589 |
"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
|
2590 |
! |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
2591 |
|
400 | 2592 |
imageIsLoaded |
767 | 2593 |
"returns whether an image is loaded as value holder" |
400 | 2594 |
|
2595 |
|holder| |
|
2596 |
(holder := builder bindingAt:#imageIsLoaded) isNil ifTrue:[ |
|
2597 |
builder aspectAt:#imageIsLoaded put:(holder := false asValue). |
|
2598 |
]. |
|
2599 |
^ holder |
|
2600 |
! |
|
2601 |
||
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2602 |
imageIsLoadedAndClassDefined |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2603 |
"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
|
2604 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2605 |
^ [self hasClassAndSelectorDefined value |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2606 |
and:[self imageIsLoaded value]] |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2607 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2608 |
"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
|
2609 |
! |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
2610 |
|
400 | 2611 |
listOfColors |
767 | 2612 |
"returns the list of colors in a List" |
400 | 2613 |
|
2614 |
|holder| |
|
2615 |
(holder := builder bindingAt:#listOfColors) isNil ifTrue:[ |
|
2616 |
builder aspectAt:#listOfColors put:(holder := List new). |
|
942 | 2617 |
holder addDependent:self. |
400 | 2618 |
]. |
2619 |
^ holder |
|
2620 |
! |
|
2621 |
||
2622 |
selectionOfColor |
|
1682 | 2623 |
"returns a valueHolder for the current selection of the edit color. |
2624 |
Here, an AspectAdaptor which accesses selectedColorIndex is returned." |
|
400 | 2625 |
|
2626 |
|holder| |
|
1682 | 2627 |
|
400 | 2628 |
(holder := builder bindingAt:#selectionOfColor) isNil ifTrue:[ |
2629 |
builder aspectAt:#selectionOfColor put:( |
|
1682 | 2630 |
holder := AspectAdaptor new subject:self; forAspect:#selectedColorIndex ). |
400 | 2631 |
]. |
2632 |
^ holder |
|
2633 |
! |
|
2634 |
||
1558 | 2635 |
tileModeHolder |
2636 |
|holder| |
|
2637 |
(holder := builder bindingAt:#tileModeHolder) isNil ifTrue:[ |
|
2638 |
builder aspectAt:#tileModeHolder put:(holder := false asValue). |
|
2639 |
holder addDependent:self. |
|
2640 |
]. |
|
2641 |
^ holder |
|
2642 |
! |
|
2643 |
||
400 | 2644 |
valueOfMagnification |
767 | 2645 |
"returns current magnification of the image as an AspectAdaptor" |
400 | 2646 |
|
2647 |
|holder| |
|
2648 |
(holder := builder bindingAt:#valueOfMagnification) isNil ifTrue:[ |
|
2649 |
builder aspectAt:#valueOfMagnification put:( |
|
2650 |
holder := AspectAdaptor new subject:self; forAspect:#magnification) |
|
2651 |
]. |
|
2652 |
^ holder |
|
2653 |
! ! |
|
2654 |
||
767 | 2655 |
!ImageEditor methodsFor:'change & update'! |
2656 |
||
2657 |
findColorMapMode |
|
899 | 2658 |
"finds the colorMapMode for a new image" |
767 | 2659 |
|
1054 | 2660 |
|image listOfColors| |
2661 |
||
2662 |
image := self image. |
|
2663 |
image depth > 8 ifTrue: [ |
|
2664 |
colorMapMode value: ''. |
|
2665 |
self listOfColors removeAll. |
|
2666 |
^ nil |
|
2667 |
]. |
|
2668 |
||
2669 |
colorMapMode value:(image depth printString, '-plane'). |
|
2670 |
||
2671 |
(listOfColors := self listOfColors) isEmpty ifTrue:[ |
|
2672 |
self colorMapMode: colorMapMode value. |
|
2673 |
listOfColors := self listOfColors. |
|
2674 |
image := self image. |
|
767 | 2675 |
]. |
1491
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2676 |
imageEditView drawingColors:(Array |
1054 | 2677 |
with: (listOfColors at:1) |
2678 |
with: (listOfColors at:2 ifAbsent:[listOfColors at:1])). |
|
2679 |
||
2680 |
image mask notNil ifTrue: [ |
|
2681 |
colorMapMode value:(colorMapMode value, ' + mask'). |
|
2682 |
||
1491
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2683 |
(listOfColors detect: [:clr| clr = (Color colorId:0)] ifNone: nil) isNil |
1054 | 2684 |
ifTrue:[ |
1491
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2685 |
listOfColors addFirst:(Color colorId:0). |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2686 |
imageEditView drawingColors: (Array |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2687 |
with:(listOfColors at:2 ifAbsent:[listOfColors at:1]) |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2688 |
with:(listOfColors at:1)). |
898 | 2689 |
] |
767 | 2690 |
]. |
1054 | 2691 |
self selectionOfColor |
1446 | 2692 |
setValue: 0; |
1054 | 2693 |
value: (self listOfColors indexOf: imageEditView selectedColor). |
767 | 2694 |
! |
2695 |
||
942 | 2696 |
update:something with:aParameter from:changedObject |
1491
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2697 |
|clrIndex img | |
1436 | 2698 |
|
2699 |
img := self image. |
|
1558 | 2700 |
|
2701 |
changedObject == self tileModeHolder ifTrue:[ |
|
2702 |
self imagePreView tileMode:(changedObject value) tileOffset:(img extent). |
|
2703 |
self imagePreView clear; invalidate. |
|
2704 |
^ self |
|
2705 |
]. |
|
2706 |
||
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2707 |
changedObject == self listOfColors ifTrue:[ |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2708 |
something == #at: ifTrue:[ |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2709 |
"/ colormap entry changed at aParameter |
960 | 2710 |
|
2711 |
clrIndex := aParameter. |
|
2712 |
(self hasMask) ifTrue:[ |
|
2713 |
clrIndex := clrIndex - 1. |
|
2714 |
]. |
|
2715 |
||
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
2716 |
(img colorMap ? drawingColormap) at:clrIndex put:(changedObject at:aParameter). |
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2717 |
self colorMapChanged. |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2718 |
^ self |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2719 |
]. |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2720 |
]. |
1124 | 2721 |
|
2722 |
changedObject == imageEditView undoImages ifTrue:[ |
|
2723 |
self valueOfCanUndo value:(changedObject notEmpty). |
|
2724 |
^ self. |
|
2725 |
]. |
|
2726 |
||
1345 | 2727 |
changedObject == imageEditView ifTrue:[ |
2728 |
something == #imageColors ifTrue:[ |
|
1436 | 2729 |
self listOfColors contents:img colorMap. |
1345 | 2730 |
self findColorMapMode. |
2731 |
^ self. |
|
2732 |
]. |
|
2733 |
something == #image ifTrue:[ |
|
1436 | 2734 |
self imagePreView image:img. |
2735 |
self listOfColors contents:img colorMap. |
|
2736 |
self findColorMapMode. |
|
1558 | 2737 |
self tileModeHolder value ifTrue:[ |
2738 |
self imagePreView tileMode:true tileOffset:(img extent). |
|
2739 |
]. |
|
1345 | 2740 |
^ self. |
2741 |
]. |
|
2742 |
something == #subImageIn ifTrue:[ |
|
1436 | 2743 |
self imagePreView image ~~ img ifTrue:[ |
1406 | 2744 |
self halt:'should not happen'. |
2745 |
]. |
|
1558 | 2746 |
self tileModeHolder value ifTrue:[ |
2747 |
self imagePreView invalidate. |
|
2748 |
] ifFalse:[ |
|
2749 |
self imagePreView invalidate:aParameter. |
|
2750 |
]. |
|
1345 | 2751 |
^ self. |
2752 |
]. |
|
1491
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2753 |
something == #selectedColor ifTrue:[ |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2754 |
(aParameter = (Color colorId:0)) ifTrue:[ |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2755 |
self halt. |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2756 |
]. |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2757 |
clrIndex := self listOfColors indexOf:aParameter. |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2758 |
self selectionOfColor value:clrIndex. |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2759 |
^ self. |
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
2760 |
]. |
1345 | 2761 |
^ self. |
2762 |
]. |
|
2763 |
||
2764 |
changedObject == imageEditView image ifTrue:[ |
|
1377 | 2765 |
self halt:'to be implemented'. |
1345 | 2766 |
^ self. |
2767 |
]. |
|
2768 |
||
942 | 2769 |
super update:something with:aParameter from:changedObject |
2770 |
||
1345 | 2771 |
"Modified: / 10.2.2000 / 23:36:49 / cg" |
942 | 2772 |
! |
2773 |
||
1054 | 2774 |
updateForNoImage |
767 | 2775 |
"updates channels and view, if image is loaded" |
2776 |
||
2777 |
self imageIsLoaded value: false. |
|
2778 |
self listOfColors removeAll. |
|
2779 |
self imagePreView image: nil |
|
2780 |
||
2781 |
||
2782 |
||
2783 |
||
2784 |
! |
|
2785 |
||
2786 |
updateLabelsAndHistory |
|
2787 |
"updates labels and history, if something has changed" |
|
2788 |
||
2789 |
self imageIsLoaded value: self image notNil. |
|
2790 |
||
2791 |
self image isNil ifTrue: [^nil]. |
|
2792 |
||
2793 |
self updateInfoLabel. |
|
2794 |
||
911 | 2795 |
imageEditView resourceMessage asCollectionOfWords size = 2 |
2796 |
ifTrue: [self addToHistory: imageEditView resourceMessage -> #loadFromMessage:]. |
|
767 | 2797 |
|
2798 |
self image fileName notNil |
|
2799 |
ifTrue: [self addToHistory: self image fileName -> #loadFromFile:]. |
|
2800 |
||
2801 |
||
2802 |
||
2803 |
! ! |
|
2804 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2805 |
!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
|
2806 |
|
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2807 |
atColor:aOldColor put:aNewColor |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2808 |
"a color changed to a new color |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2809 |
" |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2810 |
|index list| |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2811 |
|
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2812 |
list := self listOfColors. |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2813 |
index := list identityIndexOf:aOldColor. |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2814 |
|
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2815 |
index ~~ 0 ifTrue:[ |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2816 |
list at:index put:aNewColor |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2817 |
] ifFalse:[ |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2818 |
self halt:'should not happen'. |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2819 |
list add:aNewColor |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2820 |
]. |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2821 |
! |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2822 |
|
942 | 2823 |
blueAtColor:aColor put:newBlue |
2824 |
"helper used to return a new row element, when blue is changed" |
|
2825 |
||
2826 |
|byte| |
|
2827 |
||
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2828 |
aColor isNil ifTrue:[^ self]. "/ mask cannot be changed |
942 | 2829 |
byte := newBlue clampBetween:0 and:255. |
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2830 |
byte = aColor blueByte ifTrue:[^ self ]. |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2831 |
|
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2832 |
self atColor:aColor |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2833 |
put:(Color redByte:(aColor redByte) greenByte:(aColor greenByte) blueByte:byte). |
942 | 2834 |
! |
2835 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2836 |
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
|
2837 |
"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
|
2838 |
|
930 | 2839 |
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
|
2840 |
^ 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
|
2841 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2842 |
"Created: / 26.7.1998 / 12:30:35 / cg" |
930 | 2843 |
"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
|
2844 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2845 |
|
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2846 |
canSelectBlueInColor:aColor |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2847 |
^ aColor blueByte notNil |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2848 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2849 |
"Created: / 7.8.1998 / 22:50:34 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2850 |
"Modified: / 7.8.1998 / 22:52:57 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2851 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2852 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2853 |
canSelectGreenInColor:aColor |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2854 |
^ aColor greenByte notNil |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2855 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2856 |
"Created: / 7.8.1998 / 22:50:22 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2857 |
"Modified: / 7.8.1998 / 22:52:46 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2858 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2859 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2860 |
canSelectRedInColor:aColor |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2861 |
^ aColor redByte notNil |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2862 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2863 |
"Created: / 7.8.1998 / 22:50:00 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2864 |
"Modified: / 7.8.1998 / 22:51:03 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2865 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
2866 |
|
942 | 2867 |
greenAtColor:aColor put:newGreen |
2868 |
"helper used to return a new row element, when green is changed" |
|
2869 |
||
2870 |
|byte| |
|
2871 |
||
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2872 |
aColor isNil ifTrue:[^ self]. "/ mask cannot be changed |
942 | 2873 |
byte := newGreen clampBetween:0 and:255. |
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2874 |
byte = aColor greenByte ifTrue:[^ self]. |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2875 |
|
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2876 |
self atColor:aColor |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2877 |
put:(Color redByte:(aColor redByte) greenByte:byte blueByte:(aColor blueByte)). |
942 | 2878 |
! |
2879 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2880 |
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
|
2881 |
"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
|
2882 |
|
930 | 2883 |
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
|
2884 |
^ 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
|
2885 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2886 |
"Created: / 26.7.1998 / 12:30:29 / cg" |
930 | 2887 |
"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
|
2888 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2889 |
|
942 | 2890 |
redAtColor:aColor put:newRed |
2891 |
"helper used to return a new row element, when red is changed" |
|
2892 |
||
2893 |
|byte| |
|
2894 |
||
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2895 |
aColor isNil ifTrue:[^ self]. "/ mask cannot be changed |
942 | 2896 |
byte := newRed clampBetween:0 and:255. |
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2897 |
byte = aColor redByte ifTrue:[^ self]. |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2898 |
|
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2899 |
self atColor:aColor |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
2900 |
put:(Color redByte:byte greenByte:(aColor greenByte) blueByte:(aColor blueByte)). |
942 | 2901 |
! |
2902 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2903 |
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
|
2904 |
"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
|
2905 |
|
930 | 2906 |
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
|
2907 |
^ 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
|
2908 |
|
930 | 2909 |
"Modified: / 31.7.1998 / 01:11:35 / cg" |
1449
49ad9f552d64
oops - fixed bg-color access in dataset
Claus Gittinger <cg@exept.de>
parents:
1446
diff
changeset
|
2910 |
! |
49ad9f552d64
oops - fixed bg-color access in dataset
Claus Gittinger <cg@exept.de>
parents:
1446
diff
changeset
|
2911 |
|
49ad9f552d64
oops - fixed bg-color access in dataset
Claus Gittinger <cg@exept.de>
parents:
1446
diff
changeset
|
2912 |
theColorItSelf:aColor |
49ad9f552d64
oops - fixed bg-color access in dataset
Claus Gittinger <cg@exept.de>
parents:
1446
diff
changeset
|
2913 |
^ aColor |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2914 |
! ! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
2915 |
|
672 | 2916 |
!ImageEditor methodsFor:'help'! |
2917 |
||
2918 |
defaultInfoLabel |
|
767 | 2919 |
"returns the default info label" |
672 | 2920 |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2921 |
|resourceClass| |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2922 |
|
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2923 |
resourceClass := imageEditView resourceClass. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2924 |
(resourceClass isSymbol and: [(Smalltalk at:resourceClass) isClass]) |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2925 |
ifTrue:[ |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2926 |
^ resourceClass, ' >> ', imageEditView resourceSelector |
672 | 2927 |
]. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2928 |
^ 'No class and selector defined.' |
674 | 2929 |
! |
2930 |
||
702 | 2931 |
openDocumentation |
767 | 2932 |
"opens the documentation file of the Image Editor" |
674 | 2933 |
|
763 | 2934 |
self openHTMLDocument: 'tools/uipainter/ImageEditor.html' |
2935 |
||
672 | 2936 |
! ! |
2937 |
||
767 | 2938 |
!ImageEditor methodsFor:'loading'! |
2939 |
||
2940 |
loadFromFile: aFileName |
|
2941 |
"loads an image from aFileName and sets up color map list and other info labels" |
|
2942 |
||
960 | 2943 |
|img| |
2944 |
||
980
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2945 |
self withCursor:Cursor wait do:[ |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2946 |
(imageEditView loadFromFile: aFileName) notNil ifTrue:[ |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2947 |
(img := self image) notNil ifTrue:[ |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2948 |
img colorMap notNil ifTrue:[ |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2949 |
self listOfColors contents:(img usedColors asSet asOrderedCollection). |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2950 |
] ifFalse:[ |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2951 |
self listOfColors removeAll. |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2952 |
]. |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2953 |
self findColorMapMode. |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
2954 |
self updateLabelsAndHistory. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2955 |
img := img onDevice:device. |
1057 | 2956 |
imageEditView image:img. |
960 | 2957 |
] ifFalse:[ |
1054 | 2958 |
self updateForNoImage |
1057 | 2959 |
]. |
767 | 2960 |
] |
2961 |
] |
|
960 | 2962 |
|
1057 | 2963 |
"Modified: / 16.3.1999 / 21:44:26 / cg" |
767 | 2964 |
! |
2965 |
||
960 | 2966 |
loadFromImage:anImage |
767 | 2967 |
"loads an image from anImage and sets up color map list and other info labels" |
2968 |
||
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2969 |
|img| |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2970 |
|
1057 | 2971 |
anImage notNil ifTrue:[ |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2972 |
img := anImage onDevice:device. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2973 |
]. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2974 |
|
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2975 |
imageEditView image:img. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2976 |
|
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2977 |
img notNil ifTrue:[ |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2978 |
img colorMap notNil ifTrue:[ |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2979 |
self listOfColors contents:(img usedColors asSet asOrderedCollection). |
960 | 2980 |
] ifFalse:[ |
767 | 2981 |
self listOfColors removeAll. |
2982 |
]. |
|
2983 |
self findColorMapMode. |
|
2984 |
self updateLabelsAndHistory. |
|
960 | 2985 |
] ifFalse:[ |
1054 | 2986 |
self updateForNoImage |
767 | 2987 |
] |
960 | 2988 |
|
1057 | 2989 |
"Modified: / 16.3.1999 / 21:43:56 / cg" |
767 | 2990 |
! |
2991 |
||
2992 |
loadFromMessage: aMessage |
|
2993 |
"loads an image by evaluating aMessage and sets up color map list and other info labels" |
|
2994 |
||
960 | 2995 |
|img| |
2996 |
||
2997 |
(imageEditView loadFromMessage: aMessage) notNil ifTrue:[ |
|
2998 |
(img := self image) notNil ifTrue:[ |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
2999 |
img := img onDevice:device. |
960 | 3000 |
self listOfColors contents:(img usedColors asSet asOrderedCollection). |
767 | 3001 |
self findColorMapMode. |
3002 |
self updateLabelsAndHistory. |
|
1057 | 3003 |
imageEditView image:img. |
960 | 3004 |
] ifFalse:[ |
1054 | 3005 |
self updateForNoImage |
767 | 3006 |
] |
3007 |
] |
|
960 | 3008 |
|
1057 | 3009 |
"Modified: / 16.3.1999 / 21:44:41 / cg" |
767 | 3010 |
! |
3011 |
||
3012 |
loadFromOrPrepareForMessage: aMessage |
|
3013 |
"loads an image by evaluating aMessage; |
|
3014 |
if no image could extract from aMessage; do set the class and the selector from |
|
3015 |
the aMessage for a saving at the end of editing" |
|
3016 |
||
911 | 3017 |
(imageEditView loadFromMessage: aMessage) notNil |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
3018 |
ifTrue: [ |
767 | 3019 |
self listOfColors contents: self image usedColors asSet asOrderedCollection. |
3020 |
self findColorMapMode. |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
3021 |
] ifFalse: [ |
911 | 3022 |
imageEditView resourceMessage: aMessage. |
767 | 3023 |
]. |
3024 |
self updateLabelsAndHistory. |
|
1057 | 3025 |
|
3026 |
"Modified: / 16.3.1999 / 21:45:07 / cg" |
|
767 | 3027 |
! ! |
3028 |
||
400 | 3029 |
!ImageEditor methodsFor:'menu modes'! |
3030 |
||
975 | 3031 |
colorMapMode |
3032 |
"returns colorMapMode" |
|
400 | 3033 |
|
975 | 3034 |
colorMapMode isNil ifTrue: [colorMapMode := '' asValue]. |
400 | 3035 |
|
975 | 3036 |
^colorMapMode |
400 | 3037 |
! |
3038 |
||
975 | 3039 |
editMode |
3040 |
"returns editMode" |
|
400 | 3041 |
|
1054 | 3042 |
editMode isNil ifTrue: [ |
975 | 3043 |
editMode := #point asValue. |
1329 | 3044 |
editMode onChangeEvaluate:[imageEditView editMode:(editMode value)] |
975 | 3045 |
]. |
3046 |
||
3047 |
^editMode |
|
400 | 3048 |
! |
3049 |
||
975 | 3050 |
mouseKeyColorMode |
3051 |
"returns mouseKeyColorMode" |
|
400 | 3052 |
|
1345 | 3053 |
mouseKeyColorMode isNil ifTrue:[ |
975 | 3054 |
mouseKeyColorMode := 1 asValue. |
1345 | 3055 |
mouseKeyColorMode onChangeEvaluate: [ |
3056 |
imageEditView mouseKeyColorMode:mouseKeyColorMode value. |
|
3057 |
self selectionOfColor value: (self listOfColors indexOf:imageEditView selectedColor). |
|
3058 |
] |
|
956 | 3059 |
]. |
400 | 3060 |
|
975 | 3061 |
^mouseKeyColorMode |
1345 | 3062 |
|
3063 |
"Modified: / 10.2.2000 / 23:16:42 / cg" |
|
400 | 3064 |
! ! |
3065 |
||
1558 | 3066 |
!ImageEditor methodsFor:'private'! |
3067 |
||
1598 | 3068 |
updateImage |
3069 |
|img| |
|
3070 |
||
3071 |
img := imageEditView image. |
|
3072 |
imageEditView image:img. |
|
3073 |
self fetchImageData. |
|
3074 |
! |
|
3075 |
||
1558 | 3076 |
updateImagePreView |
3077 |
self tileModeHolder value ifTrue:[ |
|
3078 |
self imagePreView tileMode:true tileOffset:(self image extent). |
|
3079 |
] |
|
3080 |
! ! |
|
3081 |
||
535 | 3082 |
!ImageEditor methodsFor:'queries'! |
3083 |
||
960 | 3084 |
hasMask |
1556 | 3085 |
^ colorMapMode value notNil and:[colorMapMode value endsWith:'mask'] |
960 | 3086 |
|
3087 |
"Created: / 18.8.1998 / 17:17:38 / cg" |
|
3088 |
! |
|
3089 |
||
535 | 3090 |
preferredExtent |
767 | 3091 |
"returns the preferred extent" |
535 | 3092 |
|
3093 |
^super preferredExtent max: (Screen current width//3)@(Screen current height//3.5) |
|
3094 |
||
3095 |
||
3096 |
! ! |
|
3097 |
||
400 | 3098 |
!ImageEditor methodsFor:'selection'! |
3099 |
||
3100 |
magnification |
|
767 | 3101 |
"returns the magnification of the image" |
400 | 3102 |
|
911 | 3103 |
self imageEditView isNil ifTrue: [^1]. |
3104 |
^imageEditView magnification x |
|
400 | 3105 |
! |
3106 |
||
3107 |
magnification: aValue |
|
767 | 3108 |
"sets the magnification of the image" |
400 | 3109 |
|
905 | 3110 |
|magnification| |
3111 |
magnification := (aValue ? 1) asPoint. |
|
911 | 3112 |
(magnification = imageEditView magnification or: [magnification = (0@0)]) ifTrue: [^nil]. |
3113 |
imageEditView magnification: magnification |
|
400 | 3114 |
! |
3115 |
||
3116 |
selectedColorIndex |
|
767 | 3117 |
"returns the index of the selected color" |
400 | 3118 |
|
3119 |
^selectedColorIndex |
|
3120 |
! |
|
3121 |
||
3122 |
selectedColorIndex: anIndex |
|
767 | 3123 |
"sets the index of the selected color" |
400 | 3124 |
|
1054 | 3125 |
|clr pixel| |
3126 |
||
3127 |
selectedColorIndex := anIndex. |
|
3128 |
clr := self listOfColors at:anIndex ifAbsent:nil. |
|
3129 |
clr isNil ifTrue:[^ self]. |
|
3130 |
||
1075 | 3131 |
pixel := anIndex - 1. |
1054 | 3132 |
(self listOfColors at:1) = Color noColor ifTrue:[ |
3133 |
anIndex == 1 ifTrue:[ |
|
3134 |
pixel := nil. "/ mask |
|
3135 |
] ifFalse:[ |
|
1075 | 3136 |
pixel := pixel - 1 |
1054 | 3137 |
] |
3138 |
]. |
|
3139 |
imageEditView selectedColorIndex:pixel. |
|
3140 |
imageEditView selectedColor:clr. |
|
400 | 3141 |
|
3142 |
! ! |
|
3143 |
||
3144 |
!ImageEditor methodsFor:'startup / release'! |
|
3145 |
||
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
3146 |
closeDownViews |
1644 | 3147 |
builder notNil ifTrue:[ |
3148 |
DefaultRelativeSizes := |
|
3149 |
Array |
|
3150 |
with:(builder componentAt:#horizontalPanel) relativeCorners |
|
3151 |
with:(builder componentAt:#verticalPanel) relativeCorners. |
|
3152 |
]. |
|
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
3153 |
super closeDownViews |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
3154 |
! |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
3155 |
|
400 | 3156 |
closeRequest |
767 | 3157 |
"close request" |
400 | 3158 |
|
911 | 3159 |
imageEditView checkModified ifTrue:[super closeRequest] |
400 | 3160 |
|
3161 |
! |
|
3162 |
||
3163 |
open |
|
767 | 3164 |
"after opening, sets the masterApplication of the imageEditView to self" |
400 | 3165 |
|
3166 |
super open. |
|
444 | 3167 |
|
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1583
diff
changeset
|
3168 |
imageEditView := (self componentAt: #imageEditView) subViews first. |
400 | 3169 |
! |
3170 |
||
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
3171 |
postBuildWith:aBuilder |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
3172 |
super postBuildWith:aBuilder. |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
3173 |
|
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
3174 |
DefaultRelativeSizes notNil ifTrue:[ |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
3175 |
(aBuilder componentAt:#horizontalPanel) relativeCorners:DefaultRelativeSizes first. |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
3176 |
(aBuilder componentAt:#verticalPanel) relativeCorners:DefaultRelativeSizes second. |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
3177 |
]. |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
3178 |
! |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
3179 |
|
400 | 3180 |
postOpenWith:aBuilder |
767 | 3181 |
"after opening, sets the masterApplication of the imageEditView to self; |
3182 |
evaluate the postOpenAction" |
|
400 | 3183 |
|
1124 | 3184 |
imageEditView undoImages addDependent:self. |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3185 |
imageEditView imageInfoHolder:(self imageInfoHolder). |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3186 |
imageEditView activityInfoHolder:(self activityInfoHolder). |
1345 | 3187 |
imageEditView clickInfoCallBack:[:button :point | |
3188 |
|mouseButtonColorToolBar| |
|
3189 |
||
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1583
diff
changeset
|
3190 |
mouseButtonColorToolBar := self componentAt:#MouseButtonColorToolBar. |
1345 | 3191 |
(mouseButtonColorToolBar itemAt:button) toggleIndication. |
3192 |
mouseButtonColorToolBar do: [:i| i updateIndicators]. |
|
3193 |
]. |
|
3194 |
imageEditView addDependent:self. |
|
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3195 |
|
400 | 3196 |
postOpenAction notNil ifTrue: [postOpenAction value]. |
3197 |
||
1250 | 3198 |
super postOpenWith:aBuilder. |
3199 |
||
3200 |
aBuilder keyboardProcessor menuBar:nil. |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
3201 |
|
1345 | 3202 |
"Modified: / 10.2.2000 / 23:17:43 / cg" |
400 | 3203 |
! ! |
3204 |
||
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3205 |
!ImageEditor methodsFor:'user actions - colormap'! |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3206 |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3207 |
addColorToColormap |
1682 | 3208 |
self addColorToColormap:(Color black) |
3209 |
! |
|
3210 |
||
3211 |
addColorToColormap:newColor |
|
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
3212 |
|depth img cMap newColorMap newImage oldCListSize newMode listOfColors| |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3213 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3214 |
img := self image. |
1499
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
3215 |
img isNil ifTrue:[ |
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
3216 |
self warn:'No Image.'. |
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
3217 |
^ self |
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
3218 |
]. |
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
3219 |
|
1054 | 3220 |
depth := img depth. |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3221 |
cMap := img colorMap. |
1054 | 3222 |
cMap isNil ifTrue:[ |
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
3223 |
drawingColormap isNil ifTrue:[ |
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
3224 |
self information:'Image has no colormap.\The shown colorMap is for drawing only.' withCRs. |
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
3225 |
drawingColormap := OrderedCollection new. |
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
3226 |
]. |
1682 | 3227 |
drawingColormap add:newColor. |
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
3228 |
self listOfColors contents:drawingColormap. |
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
3229 |
self selectionOfColor value:(drawingColormap size). |
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
3230 |
|
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
3231 |
"/ self warn:'Image has no colormap.\Change colorMap mode first.' withCRs. |
1054 | 3232 |
^ self |
3233 |
]. |
|
3234 |
||
1583 | 3235 |
("(depth == 1)" false |
1054 | 3236 |
or:[cMap size == (1 bitShift:depth)]) ifTrue:[ |
3237 |
depth >= 8 ifTrue:[ |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3238 |
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
|
3239 |
^ self |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3240 |
]. |
1054 | 3241 |
(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
|
3242 |
ifFalse:[ |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3243 |
^ self |
1057 | 3244 |
]. |
3245 |
||
3246 |
imageEditView makeUndo. |
|
3247 |
newMode := (depth*2) printString , (colorMapMode value copyFrom:2). |
|
3248 |
self colorMapMode:newMode. |
|
3249 |
] ifFalse:[ |
|
3250 |
imageEditView makeUndo. |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3251 |
]. |
1054 | 3252 |
|
3253 |
cMap := cMap asArray. |
|
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
3254 |
listOfColors := self listOfColors. |
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
3255 |
oldCListSize := listOfColors size. |
1054 | 3256 |
|
3257 |
"/ (colorMapMode value asString endsWith:'mask') ifTrue:[ |
|
3258 |
"/ cMap last = Color noColor ifTrue:[ |
|
3259 |
"/ cMap := cMap copyWithoutLast:1 |
|
3260 |
"/ ] ifFalse:[ |
|
3261 |
"/ cMap first = Color noColor ifTrue:[ |
|
3262 |
"/ cMap := cMap copyFrom:2 |
|
3263 |
"/ ] |
|
3264 |
"/ ]. |
|
3265 |
"/ ]. |
|
3266 |
"/ |
|
3267 |
||
1682 | 3268 |
newColorMap := cMap copyWith:newColor. |
1054 | 3269 |
|
3270 |
newImage := img species new |
|
3271 |
width:img width |
|
3272 |
height:img height |
|
3273 |
depth:depth |
|
3274 |
fromArray:img bits. |
|
3275 |
||
3276 |
newImage colorMap:newColorMap. |
|
3277 |
newImage fileName:img fileName. |
|
3278 |
newImage mask:(img mask copy). |
|
3279 |
||
3280 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
3281 |
listOfColors contents: newImage colorMap. |
1054 | 3282 |
self findColorMapMode. |
3283 |
"/ mhmh - somehow, we get two colors added ... (sigh findColorMapMode adds another one ...) |
|
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
3284 |
listOfColors size > (oldCListSize + 1) ifTrue:[ |
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
3285 |
listOfColors removeLast |
1054 | 3286 |
]. |
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
3287 |
self selectionOfColor value:(listOfColors size). |
1054 | 3288 |
self updateLabelsAndHistory. |
3289 |
] |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3290 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3291 |
"Created: / 12.3.1999 / 00:20:28 / cg" |
1057 | 3292 |
"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
|
3293 |
! |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3294 |
|
1650 | 3295 |
changeHLS |
3296 |
"interactive Hue/Light/Saturation editing" |
|
3297 |
||
3298 |
|bindings hueShift lightValue saturationValue originalColormap firstChange acceptChannel |
|
1652 | 3299 |
shiftAction avgColorHolder avgColor shiftedColor shiftProcess readySema| |
3300 |
||
3301 |
readySema := Semaphore new. |
|
3302 |
[ |
|
3303 |
originalColormap := imageEditView image colorMap copy. |
|
3304 |
avgColor := imageEditView image averageColor. |
|
3305 |
readySema signal. |
|
3306 |
] forkAt:7. |
|
1649 | 3307 |
|
3308 |
acceptChannel := TriggerValue new. |
|
1652 | 3309 |
avgColorHolder := avgColor asValue. |
1649 | 3310 |
|
3311 |
firstChange := true. |
|
3312 |
||
1651 | 3313 |
shiftedColor := [:clr :hShift :lFactor :sFactor | |
3314 |
Color |
|
3315 |
hue:((clr hue) ? 0 + hShift) |
|
3316 |
light:((clr light * lFactor / 100) min:100) |
|
3317 |
saturation:((clr saturation * sFactor / 100) min:100)]. |
|
1652 | 3318 |
|
1649 | 3319 |
shiftAction := |
3320 |
[ |
|
1650 | 3321 |
|hShift lFactor sFactor| |
3322 |
||
1649 | 3323 |
acceptChannel value:true. |
3324 |
||
3325 |
firstChange ifTrue:[ |
|
3326 |
imageEditView makeUndo. |
|
3327 |
firstChange := false. |
|
3328 |
]. |
|
1652 | 3329 |
readySema notNil ifTrue:[readySema wait. readySema := nil]. |
1650 | 3330 |
|
3331 |
hShift := hueShift value. |
|
3332 |
lFactor := lightValue value. |
|
3333 |
sFactor := saturationValue value. |
|
3334 |
||
1652 | 3335 |
avgColorHolder value:(shiftedColor value:avgColor value:hShift value:lFactor value:sFactor). |
3336 |
||
3337 |
shiftProcess notNil ifTrue:[ |
|
3338 |
shiftProcess terminate. |
|
3339 |
shiftProcess waitUntilTerminated. |
|
3340 |
shiftProcess := nil. |
|
3341 |
]. |
|
3342 |
shiftProcess := |
|
3343 |
[ |
|
3344 |
[ |
|
1656 | 3345 |
imageEditView image |
3346 |
colorMap:originalColormap copy; |
|
3347 |
colorMapProcessing:[:clr | shiftedColor value:clr value:hShift value:lFactor value:sFactor]. |
|
1652 | 3348 |
self updateImage. |
3349 |
self updateInfoLabel. |
|
3350 |
] ensure:[ shiftProcess := nil ]. |
|
3351 |
] forkAt:7. |
|
1649 | 3352 |
]. |
3353 |
||
3354 |
bindings := IdentityDictionary new. |
|
1650 | 3355 |
bindings at:#hueShiftAmount put:(hueShift := 0 asValue). |
1656 | 3356 |
hueShift onChangeEvaluate:shiftAction. |
1650 | 3357 |
|
3358 |
bindings at:#lightAmount put:(lightValue := 100 asValue). |
|
1656 | 3359 |
lightValue onChangeEvaluate:shiftAction. |
1650 | 3360 |
|
3361 |
bindings at:#saturationAmount put:(saturationValue := 100 asValue). |
|
1656 | 3362 |
saturationValue onChangeEvaluate:shiftAction. |
1650 | 3363 |
|
1649 | 3364 |
bindings at:#acceptChannel put:acceptChannel. |
1652 | 3365 |
bindings at:#hlsColor put:avgColorHolder. |
1650 | 3366 |
|
3367 |
(self openDialogInterface:#changeHLSDialogSpec withBindings:bindings) |
|
1649 | 3368 |
ifFalse:[ |
3369 |
firstChange ~~ true ifTrue:[ |
|
3370 |
imageEditView undo |
|
3371 |
] |
|
3372 |
]. |
|
3373 |
! |
|
3374 |
||
1403 | 3375 |
clearMaskedPixels |
3376 |
"clear all masked pixels (to pixelValue 0)" |
|
3377 |
||
1460 | 3378 |
|newImage oldImage| |
1403 | 3379 |
|
3380 |
oldImage := self image. |
|
3381 |
||
3382 |
imageEditView makeUndo. |
|
3383 |
||
3384 |
self withExecuteCursorDo:[ |
|
3385 |
newImage := oldImage clearMaskedPixels. |
|
1460 | 3386 |
0 to:newImage height - 1 do:[:y | |
3387 |
0 to:newImage width - 1 do:[:x | |
|
3388 |
(newImage maskAtX:x y:y) == 0 ifTrue:[ |
|
3389 |
newImage pixelAtX:x y:y put:0 |
|
3390 |
] |
|
3391 |
] |
|
3392 |
]. |
|
3393 |
||
1403 | 3394 |
(imageEditView image:newImage) notNil ifTrue:[ |
1446 | 3395 |
self fetchImageData. |
1403 | 3396 |
] |
3397 |
] |
|
3398 |
! |
|
3399 |
||
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3400 |
colorMapChanged |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3401 |
|img| |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3402 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3403 |
img := self image. |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3404 |
img release. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
3405 |
|
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
3406 |
self imageEditView invalidate. |
960 | 3407 |
self imagePreView invalidate. |
3408 |
||
3409 |
"/ (imageEditView image:img) notNil ifTrue:[ |
|
3410 |
"/ self updateLabelsAndHistory. |
|
3411 |
"/ self imagePreView image:img |
|
3412 |
"/ ] |
|
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3413 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3414 |
"Created: / 7.8.1998 / 22:26:10 / cg" |
960 | 3415 |
"Modified: / 18.8.1998 / 17:08:55 / cg" |
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3416 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
3417 |
|
975 | 3418 |
colorMapMode:aMode |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3419 |
"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
|
3420 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3421 |
|depth numColors newColorMap newImage |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3422 |
oldImage image newColors realColorMap oldFileName |
1008 | 3423 |
usedColors useNearest usageCounts tmpBits tmpMap quest |
3424 |
prevMode maskThreshold maskImage| |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3425 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3426 |
self withExecuteCursorDo:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3427 |
oldImage := self image. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3428 |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
3429 |
prevMode := colorMapMode value. |
1008 | 3430 |
oldImage depth > 8 ifTrue:[ |
3431 |
prevMode := nil |
|
3432 |
]. |
|
3433 |
||
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3434 |
newColorMap := self class listOfColorMaps at:aMode. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3435 |
depth := (newColorMap size log: 2) asInteger. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3436 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3437 |
useNearest := false. |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3438 |
depth == 1 ifTrue:[ |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3439 |
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
|
3440 |
] ifFalse:[ |
1008 | 3441 |
prevMode isNil ifTrue:[ |
3442 |
quest := 'Compute colormap (or use standard)' |
|
3443 |
] ifFalse:[ |
|
3444 |
quest := 'Keep colormap (or use standard)' |
|
3445 |
] |
|
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3446 |
]. |
1008 | 3447 |
((prevMode = aMode) |
1057 | 3448 |
or:[depth > oldImage depth |
3449 |
or:[self confirm:(resources string:quest)]]) ifTrue:[ |
|
1008 | 3450 |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3451 |
"/ keep the colormap |
1008 | 3452 |
newColorMap atAllPut:Color black. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3453 |
depth > oldImage depth ifTrue:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3454 |
"/ easy - simply copy the part |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3455 |
numColors := 1 bitShift:oldImage depth. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3456 |
0 to:numColors-1 do:[:pixel | |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3457 |
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
|
3458 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3459 |
] ifFalse:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3460 |
"/ see if all used color fit the new colormap |
986 | 3461 |
usedColors := oldImage usedColorsMax:(1 bitShift:depth). |
1403 | 3462 |
(usedColors notNil and:[usedColors size > (1 bitShift:depth)]) ifTrue:[ |
3463 |
usedColors := oldImage realUsedColors |
|
3464 |
]. |
|
986 | 3465 |
(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
|
3466 |
"/ yea - just install them |
986 | 3467 |
usedColors asArray keysAndValuesDo:[:idx :clr | |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3468 |
newColorMap at:idx put:clr |
1008 | 3469 |
]. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3470 |
] ifFalse:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3471 |
"/ copy over those that are most often used. |
986 | 3472 |
oldImage depth < 8 ifTrue:[ |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3473 |
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
|
3474 |
oldImage bits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3475 |
expandPixels:(oldImage depth) |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3476 |
width:oldImage width |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3477 |
height:oldImage height |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3478 |
into:tmpBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3479 |
mapping:nil. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3480 |
] ifFalse:[ |
986 | 3481 |
oldImage depth == 8 ifTrue:[ |
3482 |
tmpBits := oldImage bits |
|
3483 |
] ifFalse:[ |
|
1124 | 3484 |
colorMapMode value:prevMode. |
1471 | 3485 |
self warn:('Too many used colors in image (', oldImage usedColors size printString , ').'). |
986 | 3486 |
^ self |
1471 | 3487 |
"/ (self confirm:('Too many used colors in image (', oldImage usedColors size printString , ').\\Dither ?' withCRs)) |
3488 |
"/ ifFalse:[. |
|
3489 |
"/ ^ self |
|
3490 |
"/ ]. |
|
3491 |
"/ self image: (Image newForDepth:depth) fromImage:oldImage. |
|
3492 |
"/ ^ self. |
|
986 | 3493 |
] |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3494 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3495 |
usageCounts := tmpBits usageCounts. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3496 |
tmpMap := Array new:usageCounts size. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3497 |
oldImage colorMap asArray keysAndValuesDo:[:i :clr | |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3498 |
tmpMap at:i put:clr |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3499 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3500 |
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
|
3501 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3502 |
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
|
3503 |
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
|
3504 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3505 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3506 |
useNearest := Dialog |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3507 |
confirmWithCancel:(resources |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3508 |
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
|
3509 |
with:usedColors size |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3510 |
with:(1 bitShift:depth)) withCRs |
1542 | 3511 |
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
|
3512 |
useNearest isNil ifTrue:[ |
1542 | 3513 |
colorMapMode value:prevMode. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3514 |
^ self "/ cancel |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3515 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3516 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3517 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3518 |
] ifFalse:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3519 |
"/ standard colormap |
921
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
3520 |
usedColors := oldImage usedColors. |
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
3521 |
(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
|
3522 |
useNearest := Dialog |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3523 |
confirmWithCancel:(resources |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
3524 |
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
|
3525 |
) withCRs |
1542 | 3526 |
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
|
3527 |
useNearest isNil ifTrue:[ |
1542 | 3528 |
colorMapMode value:prevMode. |
921
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
3529 |
^ self "/ cancel |
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
3530 |
]. |
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
3531 |
]. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3532 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3533 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3534 |
imageEditView makeUndo. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3535 |
|
1424
d7367ae7f85e
fixed conversion of 3-3-2 8-bit truecolor images
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
3536 |
newImage := Image newForDepth:depth. |
d7367ae7f85e
fixed conversion of 3-3-2 8-bit truecolor images
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
3537 |
newImage depth:depth. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3538 |
oldFileName := oldImage fileName. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3539 |
|
1008 | 3540 |
Image imageErrorSignal handle:[:ex| |
3541 |
Color colorErrorSignal handle:[:ex| |
|
1542 | 3542 |
colorMapMode value:prevMode. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3543 |
imageEditView undo. |
1008 | 3544 |
^ self warn:(resources string:'Conversion failed !!') |
3545 |
] do:[ |
|
1393 | 3546 |
newImage := Image newForDepth:depth. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3547 |
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
|
3548 |
newImage colorMap:newColorMap. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3549 |
newImage photometric:#palette. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3550 |
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
|
3551 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3552 |
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
|
3553 |
[:x :y :clr | |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3554 |
|newColor| |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3555 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3556 |
(newColorMap includes:clr) |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3557 |
ifTrue: [newColor := clr] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3558 |
ifFalse: [ |
1008 | 3559 |
newColor := clr nearestIn:newColorMap. |
3560 |
useNearest ifFalse:[ |
|
3561 |
(newColor deltaFrom:clr) > 0.5 ifTrue:[ |
|
3562 |
newColor := oldImage colorFromValue:0 |
|
3563 |
] |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3564 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3565 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3566 |
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
|
3567 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3568 |
image := newImage |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3569 |
]. |
1008 | 3570 |
] do:[ |
3571 |
image := newImage fromImage:oldImage |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3572 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3573 |
|
1008 | 3574 |
(aMode asString endsWith:'mask') ifTrue:[ |
3575 |
image mask isNil ifTrue:[ |
|
3576 |
(self confirm:'Generate mask from black ?') ifTrue:[ |
|
3577 |
maskThreshold := 0.1. |
|
3578 |
maskImage := Depth1Image fromImage:(image asThresholdMonochromeImage:maskThreshold). |
|
3579 |
] ifFalse:[ |
|
3580 |
maskImage := Depth1Image extent:image extent. |
|
3581 |
maskImage data:(ByteArray |
|
3582 |
new:(maskImage bytesPerRow * maskImage height) |
|
3583 |
withAll:16rFF). |
|
3584 |
||
3585 |
"/ maskImage fillRectangle:(image bounds) withColor:(Color colorId:1). |
|
3586 |
]. |
|
3587 |
image mask:maskImage. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3588 |
]. |
1008 | 3589 |
] ifFalse:[ |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3590 |
image mask: nil. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3591 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3592 |
realColorMap := OrderedCollection new. |
1054 | 3593 |
image realColorMap do:[:clr| |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3594 |
(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
|
3595 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3596 |
newColors := realColorMap copyFrom: 1 to: (newColorMap size min: realColorMap size). |
1054 | 3597 |
newColorMap do:[:clr| |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3598 |
((newColors size < newColorMap size) and: [(newColors includes: clr) not]) |
1054 | 3599 |
ifTrue:[ |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3600 |
newColors add: clr |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3601 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3602 |
]. |
975 | 3603 |
image colorMap: newColors. |
1446 | 3604 |
image fileName: oldFileName. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3605 |
|
1054 | 3606 |
(imageEditView image: image) notNil ifTrue:[ |
1446 | 3607 |
self fetchImageData. |
3608 |
"/ self listOfColors contents: image colorMap. |
|
3609 |
"/ self findColorMapMode. |
|
3610 |
"/ self updateLabelsAndHistory. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3611 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3612 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3613 |
|
1057 | 3614 |
"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
|
3615 |
! |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3616 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3617 |
compressColorMap |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3618 |
"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
|
3619 |
|
927 | 3620 |
|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
|
3621 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3622 |
oldImage := self image. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3623 |
depth := oldImage depth. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3624 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3625 |
oldImage photometric ~~ #palette ifTrue:[ |
930 | 3626 |
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
|
3627 |
^ self |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3628 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3629 |
|
1403 | 3630 |
usedColors := oldImage realUsedColors. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3631 |
usedColors size == (1 bitShift:depth) ifTrue:[ |
930 | 3632 |
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
|
3633 |
^ self |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3634 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3635 |
usedColors size == oldImage colorMap size ifTrue:[ |
930 | 3636 |
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
|
3637 |
^ self |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3638 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3639 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3640 |
imageEditView makeUndo. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3641 |
|
930 | 3642 |
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
|
3643 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3644 |
self withExecuteCursorDo:[ |
996
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3645 |
"/ newColorMap := Array new:usedColors size. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3646 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3647 |
"/ translation table |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3648 |
oldToNew := ByteArray new:(1 bitShift:depth). |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3649 |
newColorMap := usedColors asArray. |
996
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3650 |
newColorMap sort:[:a :b | |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3651 |
a redByte == b redByte ifTrue:[ |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3652 |
a greenByte == b greenByte ifTrue:[ |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3653 |
a blueByte < b blueByte |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3654 |
] ifFalse:[ |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3655 |
a greenByte < b greenByte |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3656 |
] |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3657 |
] ifFalse:[ |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3658 |
a redByte < b redByte |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3659 |
] |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3660 |
]. |
9423ae277168
sort colors when compressing the colorMap
Claus Gittinger <cg@exept.de>
parents:
990
diff
changeset
|
3661 |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3662 |
oldImage colorMap asArray keysAndValuesDo:[:oldIdx :clr | |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3663 |
|newPixel| |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3664 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3665 |
(usedColors includes:clr) ifTrue:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3666 |
newPixel := newColorMap indexOf:clr. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3667 |
oldToNew at:oldIdx put:newPixel-1. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3668 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3669 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3670 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3671 |
oldBits := oldImage bits. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3672 |
newBits := ByteArray new:(oldBits size). |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3673 |
depth ~~ 8 ifTrue:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3674 |
"/ expand/compress can only handle 8bits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3675 |
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
|
3676 |
oldBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3677 |
expandPixels:depth |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3678 |
width:oldImage width |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3679 |
height:oldImage height |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3680 |
into:tmpBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3681 |
mapping:oldToNew. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3682 |
tmpBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3683 |
compressPixels:depth |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3684 |
width:oldImage width |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3685 |
height:oldImage height |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3686 |
into:newBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3687 |
mapping:nil |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3688 |
] ifFalse:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3689 |
oldBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3690 |
expandPixels:depth |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3691 |
width:oldImage width |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3692 |
height:oldImage height |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3693 |
into:newBits |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3694 |
mapping:oldToNew. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3695 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3696 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3697 |
newImage := oldImage species new |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3698 |
width:oldImage width |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3699 |
height:oldImage height |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3700 |
depth:depth |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3701 |
fromArray:newBits. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3702 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3703 |
newImage colorMap:newColorMap. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3704 |
newImage fileName:oldImage fileName. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3705 |
newImage mask:(oldImage mask copy). |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3706 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3707 |
(imageEditView image:newImage) notNil ifTrue: |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3708 |
[ |
1446 | 3709 |
self fetchImageData. |
3710 |
"/ self listOfColors contents: newImage colorMap. |
|
3711 |
"/ self findColorMapMode. |
|
3712 |
"/ self updateLabelsAndHistory. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3713 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3714 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3715 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
3716 |
"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
|
3717 |
"Modified: / 15.9.1998 / 17:53:32 / cg" |
1008 | 3718 |
! |
3719 |
||
1480 | 3720 |
copyMask |
3721 |
|mask| |
|
3722 |
||
3723 |
mask := self image mask. |
|
3724 |
MaskClipboard := mask subImageIn: (0@0 extent:mask extent). |
|
3725 |
! |
|
3726 |
||
1446 | 3727 |
fetchImageData |
1460 | 3728 |
|image| |
3729 |
||
3730 |
(image := imageEditView image) notNil ifTrue:[ |
|
3731 |
self listOfColors contents:(image colorMap). |
|
3732 |
self findColorMapMode. |
|
3733 |
self updateLabelsAndHistory. |
|
3734 |
] |
|
1446 | 3735 |
! |
3736 |
||
1544 | 3737 |
inspectColor |
1682 | 3738 |
|clrIndex| |
3739 |
||
3740 |
clrIndex := self selectedColorIndexOrNil. |
|
3741 |
clrIndex isNil ifTrue:[ |
|
1544 | 3742 |
^ self |
3743 |
]. |
|
1682 | 3744 |
(self image colorFromValue:clrIndex-1) inspect |
1544 | 3745 |
! |
3746 |
||
1598 | 3747 |
makeBrighter |
3748 |
| anyChange| |
|
3749 |
||
3750 |
self withExecuteCursorDo:[ |
|
3751 |
anyChange := imageEditView makeBrighter. |
|
3752 |
anyChange ifFalse:[ |
|
3753 |
Dialog warn:'Image unchanged'. |
|
3754 |
] ifTrue:[ |
|
3755 |
self updateImage. |
|
3756 |
] |
|
3757 |
]. |
|
3758 |
! |
|
3759 |
||
3760 |
makeDarker |
|
3761 |
| anyChange| |
|
3762 |
||
3763 |
self withExecuteCursorDo:[ |
|
3764 |
anyChange := imageEditView makeDarker. |
|
3765 |
anyChange ifFalse:[ |
|
3766 |
Dialog warn:'Image unchanged'. |
|
3767 |
] ifTrue:[ |
|
3768 |
self updateImage. |
|
3769 |
] |
|
3770 |
]. |
|
3771 |
! |
|
3772 |
||
1436 | 3773 |
makeGrayScale |
1598 | 3774 |
|anyChange| |
1436 | 3775 |
|
3776 |
self withExecuteCursorDo:[ |
|
3777 |
anyChange := imageEditView makeGrayScale. |
|
3778 |
anyChange ifFalse:[ |
|
3779 |
Dialog warn:'Image unchanged'. |
|
3780 |
] ifTrue:[ |
|
1598 | 3781 |
self updateImage. |
3782 |
] |
|
3783 |
]. |
|
3784 |
! |
|
3785 |
||
3786 |
makeInverse |
|
3787 |
| anyChange| |
|
3788 |
||
3789 |
self withExecuteCursorDo:[ |
|
3790 |
anyChange := imageEditView makeInverse. |
|
3791 |
anyChange ifFalse:[ |
|
3792 |
Dialog warn:'Image unchanged'. |
|
3793 |
] ifTrue:[ |
|
3794 |
self updateImage. |
|
1436 | 3795 |
] |
3796 |
]. |
|
3797 |
! |
|
3798 |
||
1446 | 3799 |
makeSelectedColorBrighter |
1682 | 3800 |
self processSelectedColorWith:[:clr | clr lightened] |
1446 | 3801 |
! |
3802 |
||
3803 |
makeSelectedColorDarker |
|
1682 | 3804 |
self processSelectedColorWith:[:clr | clr darkened] |
1446 | 3805 |
! |
3806 |
||
1480 | 3807 |
pasteMask |
3808 |
|img mask| |
|
3809 |
||
3810 |
imageEditView makeUndo. |
|
3811 |
||
3812 |
img := self image. |
|
3813 |
mask := img mask. |
|
3814 |
||
3815 |
mask |
|
3816 |
copyFrom:MaskClipboard |
|
3817 |
x:0 y:0 |
|
3818 |
toX:0 y:0 |
|
3819 |
width:(mask width min:MaskClipboard width) |
|
3820 |
height:(mask height min:MaskClipboard height). |
|
3821 |
img mask:mask. |
|
3822 |
(imageEditView image:img copy) notNil ifTrue:[ |
|
3823 |
self fetchImageData. |
|
3824 |
] |
|
3825 |
! |
|
3826 |
||
1682 | 3827 |
pickAndAddColorToColormap |
3828 |
self addColorToColormap:(Color fromUser) |
|
3829 |
! |
|
3830 |
||
3831 |
processSelectedColorWith:aBlock |
|
3832 |
|img cMap clr newImage selectedColorIndex oldSelection| |
|
3833 |
||
3834 |
selectedColorIndex := self selectedColorIndexOrNil. |
|
3835 |
selectedColorIndex isNil ifTrue:[^ self]. |
|
3836 |
||
3837 |
img := self image. |
|
3838 |
cMap := img colorMap. |
|
3839 |
cMap isNil ifTrue:[ |
|
3840 |
self warn:'Image has no colormap\change colorMap mode first.' withCRs. |
|
3841 |
^ self |
|
3842 |
]. |
|
3843 |
imageEditView makeUndo. |
|
3844 |
||
3845 |
cMap := cMap asArray. |
|
3846 |
clr := cMap at:selectedColorIndex. |
|
3847 |
cMap at:selectedColorIndex put:(aBlock value:clr). |
|
3848 |
||
3849 |
newImage := img species new |
|
3850 |
width:img width |
|
3851 |
height:img height |
|
3852 |
depth:nil |
|
3853 |
fromArray:img bits. |
|
3854 |
||
3855 |
newImage colorMap:cMap. |
|
3856 |
newImage fileName:img fileName. |
|
3857 |
newImage mask:(img mask copy). |
|
3858 |
||
3859 |
oldSelection := self selectionOfColor value. |
|
3860 |
||
3861 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
3862 |
self fetchImageData. |
|
3863 |
"/ self listOfColors contents: newImage colorMap. |
|
3864 |
"/ self findColorMapMode. |
|
3865 |
"/ self updateLabelsAndHistory. |
|
3866 |
]. |
|
3867 |
self selectionOfColor value:oldSelection. |
|
3868 |
||
3869 |
"Created: / 12.3.1999 / 00:20:28 / cg" |
|
3870 |
"Modified: / 16.3.1999 / 21:57:26 / cg" |
|
3871 |
! |
|
3872 |
||
1124 | 3873 |
reduceNumberOfColors |
3874 |
|s n anyChange img| |
|
3875 |
||
3876 |
s := Dialog request:'Number of color bits to strip (1-7) ?'. |
|
1435 | 3877 |
s size == 0 ifTrue:[^ self]. |
1124 | 3878 |
n := Integer readFrom:s onError:0. |
3879 |
(n between:1 and:7) ifFalse:[ |
|
3880 |
Dialog warn:'Image unchanged'. |
|
3881 |
^ self |
|
3882 |
]. |
|
3883 |
||
3884 |
self withExecuteCursorDo:[ |
|
3885 |
anyChange := imageEditView reduceColorResolutionBy:n. |
|
3886 |
anyChange ifFalse:[ |
|
3887 |
Dialog warn:'Image unchanged'. |
|
3888 |
] ifTrue:[ |
|
3889 |
img := imageEditView image. |
|
3890 |
imageEditView image:img. |
|
1446 | 3891 |
|
3892 |
self fetchImageData. |
|
3893 |
"/ self listOfColors contents:(img colorMap). |
|
3894 |
"/ self findColorMapMode. |
|
3895 |
"/ self updateLabelsAndHistory. |
|
1124 | 3896 |
Dialog information:(img usedColors size printString , ' colors used.') |
3897 |
] |
|
3898 |
]. |
|
3899 |
! |
|
3900 |
||
1682 | 3901 |
selectedColorIndexOrNil |
3902 |
| img clrIndex| |
|
3903 |
||
3904 |
img := self image. |
|
3905 |
img isNil ifTrue:[ |
|
3906 |
self warn:'No Image.'. |
|
3907 |
^ nil |
|
3908 |
]. |
|
3909 |
clrIndex := self selectionOfColor value. |
|
3910 |
img mask notNil ifTrue: [ clrIndex := clrIndex - 1 ]. |
|
3911 |
^ clrIndex |
|
3912 |
! |
|
3913 |
||
1008 | 3914 |
sortColorMap |
3915 |
"calculates a new color map for the image, sorting colors" |
|
3916 |
||
3917 |
|depth newColorMap newImage oldImage usedColors oldToNew oldBits newBits tmpBits| |
|
3918 |
||
3919 |
oldImage := self image. |
|
3920 |
depth := oldImage depth. |
|
3921 |
||
3922 |
oldImage photometric ~~ #palette ifTrue:[ |
|
3923 |
self information:'Compress colorMap: Only palette images have colormaps.'. |
|
3924 |
^ self |
|
3925 |
]. |
|
3926 |
||
3927 |
usedColors := oldImage realColorMap. |
|
3928 |
||
3929 |
imageEditView makeUndo. |
|
3930 |
||
3931 |
self withExecuteCursorDo:[ |
|
3932 |
"/ newColorMap := Array new:usedColors size. |
|
3933 |
||
3934 |
"/ translation table |
|
3935 |
oldToNew := ByteArray new:(1 bitShift:depth). |
|
3936 |
newColorMap := usedColors asArray. |
|
3937 |
newColorMap sort:[:a :b | |
|
3938 |
a redByte == b redByte ifTrue:[ |
|
3939 |
a greenByte == b greenByte ifTrue:[ |
|
3940 |
a blueByte < b blueByte |
|
3941 |
] ifFalse:[ |
|
3942 |
a greenByte < b greenByte |
|
3943 |
] |
|
3944 |
] ifFalse:[ |
|
3945 |
a redByte < b redByte |
|
3946 |
] |
|
3947 |
]. |
|
3948 |
||
3949 |
oldImage colorMap asArray keysAndValuesDo:[:oldIdx :clr | |
|
3950 |
|newPixel| |
|
3951 |
||
3952 |
(usedColors includes:clr) ifTrue:[ |
|
3953 |
newPixel := newColorMap indexOf:clr. |
|
3954 |
oldToNew at:oldIdx put:newPixel-1. |
|
3955 |
] |
|
3956 |
]. |
|
3957 |
||
3958 |
oldBits := oldImage bits. |
|
3959 |
newBits := ByteArray new:(oldBits size). |
|
3960 |
depth ~~ 8 ifTrue:[ |
|
3961 |
"/ expand/compress can only handle 8bits |
|
3962 |
tmpBits := ByteArray uninitializedNew:(oldImage width*oldImage height). |
|
3963 |
oldBits |
|
3964 |
expandPixels:depth |
|
3965 |
width:oldImage width |
|
3966 |
height:oldImage height |
|
3967 |
into:tmpBits |
|
3968 |
mapping:oldToNew. |
|
3969 |
tmpBits |
|
3970 |
compressPixels:depth |
|
3971 |
width:oldImage width |
|
3972 |
height:oldImage height |
|
3973 |
into:newBits |
|
3974 |
mapping:nil |
|
3975 |
] ifFalse:[ |
|
3976 |
oldBits |
|
3977 |
expandPixels:depth |
|
3978 |
width:oldImage width |
|
3979 |
height:oldImage height |
|
3980 |
into:newBits |
|
3981 |
mapping:oldToNew. |
|
3982 |
]. |
|
3983 |
||
3984 |
newImage := oldImage species new |
|
3985 |
width:oldImage width |
|
3986 |
height:oldImage height |
|
3987 |
depth:depth |
|
3988 |
fromArray:newBits. |
|
3989 |
||
3990 |
newImage colorMap:newColorMap. |
|
3991 |
newImage fileName:oldImage fileName. |
|
3992 |
newImage mask:(oldImage mask copy). |
|
3993 |
||
1054 | 3994 |
(imageEditView image:newImage) notNil ifTrue:[ |
1446 | 3995 |
self fetchImageData. |
3996 |
"/ self listOfColors contents: newImage colorMap. |
|
3997 |
"/ self findColorMapMode. |
|
3998 |
"/ self updateLabelsAndHistory. |
|
1008 | 3999 |
] |
4000 |
] |
|
4001 |
||
4002 |
"Modified: / 15.9.1998 / 17:53:32 / cg" |
|
4003 |
"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
|
4004 |
! ! |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
4005 |
|
400 | 4006 |
!ImageEditor methodsFor:'user actions - editing'! |
4007 |
||
767 | 4008 |
doBrowseClass |
4009 |
"opens a System Browser on the resourceClass and the resourceSelector" |
|
400 | 4010 |
|
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
4011 |
|cls| |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
4012 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
4013 |
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
|
4014 |
cls isNil ifTrue:[^ self warn:'No Class specified']. |
1488 | 4015 |
UserPreferences systemBrowserClass |
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
4016 |
openInClass:cls class |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
4017 |
selector:(imageEditView resourceSelector) |
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
4018 |
|
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
4019 |
"Modified: / 31.7.1998 / 02:01:15 / cg" |
400 | 4020 |
! |
4021 |
||
1045 | 4022 |
doCropAll |
986 | 4023 |
"find all borders and cut them off" |
4024 |
||
1045 | 4025 |
imageEditView cropLeft:true right:true top:true bottom:true. |
986 | 4026 |
self updateInfoLabel |
4027 |
||
4028 |
"Modified: / 7.9.1998 / 14:26:23 / cg" |
|
4029 |
"Created: / 7.9.1998 / 16:33:43 / cg" |
|
4030 |
! |
|
4031 |
||
1045 | 4032 |
doCropBottom |
986 | 4033 |
"find a bottom border and cut it off" |
4034 |
||
1045 | 4035 |
imageEditView cropLeft:false right:false top:false bottom:true. |
986 | 4036 |
self updateInfoLabel |
4037 |
||
4038 |
"Created: / 7.9.1998 / 13:00:20 / cg" |
|
4039 |
"Modified: / 7.9.1998 / 14:26:23 / cg" |
|
4040 |
! |
|
4041 |
||
1045 | 4042 |
doCropLeft |
986 | 4043 |
"find a left border and cut it off" |
4044 |
||
1045 | 4045 |
imageEditView cropLeft:true right:false top:false bottom:false. |
986 | 4046 |
self updateInfoLabel |
4047 |
||
4048 |
"Created: / 7.9.1998 / 13:00:14 / cg" |
|
4049 |
"Modified: / 7.9.1998 / 14:26:34 / cg" |
|
4050 |
! |
|
4051 |
||
1045 | 4052 |
doCropManual |
986 | 4053 |
"let user specify borders and cut them off" |
4054 |
||
1502 | 4055 |
|bindings left top right bottom img firstChange gropAction acceptChannel| |
4056 |
||
4057 |
acceptChannel := TriggerValue new. |
|
1490 | 4058 |
|
4059 |
firstChange := true. |
|
4060 |
||
1502 | 4061 |
gropAction := |
4062 |
[:lV :rV :tV :bV | |l r t b| |
|
4063 |
acceptChannel value:true. |
|
4064 |
||
4065 |
l := lV value. |
|
4066 |
r := rV value. |
|
4067 |
t := tV value. |
|
4068 |
b := bV value. |
|
4069 |
(l + r + t + b) == 0 ifTrue:[ |
|
4070 |
Screen current beep |
|
4071 |
] ifFalse:[ |
|
4072 |
img := imageEditView image. |
|
4073 |
firstChange ifTrue:[ |
|
4074 |
imageEditView makeUndo. |
|
4075 |
firstChange := false. |
|
4076 |
]. |
|
4077 |
imageEditView |
|
4078 |
makeSubImageX:l y:t |
|
4079 |
width:(img width - l - r) |
|
4080 |
height:(img height - t - b). |
|
4081 |
self updateInfoLabel |
|
4082 |
]. |
|
1490 | 4083 |
]. |
986 | 4084 |
|
4085 |
bindings := IdentityDictionary new. |
|
1507 | 4086 |
bindings at:#left put:(left := 1 asValue). |
4087 |
bindings at:#right put:(right := 1 asValue). |
|
4088 |
bindings at:#top put:(top := 1 asValue). |
|
4089 |
bindings at:#bottom put:(bottom := 1 asValue). |
|
1502 | 4090 |
bindings at:#acceptChannel put:acceptChannel. |
4091 |
||
4092 |
bindings at:#gropLeftNow put:[ gropAction value:left value:0 value:0 value:0 ]. |
|
4093 |
bindings at:#gropRightNow put:[ gropAction value:0 value:right value:0 value:0 ]. |
|
4094 |
bindings at:#gropTopNow put:[ gropAction value:0 value:0 value:top value:0 ]. |
|
4095 |
bindings at:#gropBottomNow put:[ gropAction value:0 value:0 value:0 value:bottom ]. |
|
4096 |
||
4097 |
bindings at:#applyAction put:[ gropAction value:left value:right value:top value:bottom ]. |
|
1490 | 4098 |
|
4099 |
(self openDialogInterface:#gropDialogSpec withBindings:bindings) |
|
1507 | 4100 |
ifFalse:[ |
4101 |
firstChange ~~ true ifTrue:[ |
|
1558 | 4102 |
imageEditView undo. |
4103 |
self updateImagePreView. |
|
1507 | 4104 |
] |
4105 |
]. |
|
986 | 4106 |
|
4107 |
"Created: / 7.9.1998 / 18:16:07 / cg" |
|
4108 |
"Modified: / 7.9.1998 / 18:20:42 / cg" |
|
4109 |
! |
|
4110 |
||
1045 | 4111 |
doCropRight |
986 | 4112 |
"find a right border and cut it off" |
4113 |
||
1045 | 4114 |
imageEditView cropLeft:false right:true top:false bottom:false. |
986 | 4115 |
self updateInfoLabel |
4116 |
||
4117 |
"Created: / 7.9.1998 / 13:00:14 / cg" |
|
4118 |
"Modified: / 7.9.1998 / 14:26:44 / cg" |
|
4119 |
! |
|
4120 |
||
1045 | 4121 |
doCropTop |
986 | 4122 |
"find a top border and cut it off" |
4123 |
||
1045 | 4124 |
imageEditView cropLeft:false right:false top:true bottom:false. |
986 | 4125 |
self updateInfoLabel |
4126 |
||
4127 |
"Created: / 7.9.1998 / 13:00:19 / cg" |
|
4128 |
"Modified: / 7.9.1998 / 14:26:52 / cg" |
|
4129 |
! |
|
4130 |
||
1433 | 4131 |
doEditMask |
4132 |
"" |
|
4133 |
||
4134 |
self image mask edit |
|
4135 |
! |
|
4136 |
||
767 | 4137 |
doFlipHorizontal |
4138 |
"flips horizontally current image" |
|
400 | 4139 |
|
911 | 4140 |
imageEditView flipHorizontal |
400 | 4141 |
! |
4142 |
||
767 | 4143 |
doFlipVertical |
4144 |
"flips vertically current image" |
|
400 | 4145 |
|
911 | 4146 |
imageEditView flipVertical |
400 | 4147 |
! |
4148 |
||
767 | 4149 |
doMagnifyDown |
4150 |
"magnifies current image one step down" |
|
400 | 4151 |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
4152 |
|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
|
4153 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
4154 |
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
|
4155 |
(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
|
4156 |
magHolder value: mag - 1 |
400 | 4157 |
] |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
4158 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
4159 |
"Modified: / 26.7.1998 / 20:24:08 / cg" |
400 | 4160 |
! |
4161 |
||
767 | 4162 |
doMagnifyImage |
1479 | 4163 |
"magnifies the current image to a new size" |
400 | 4164 |
|
1353 | 4165 |
|box newSize image| |
4166 |
||
4167 |
image := imageEditView image. |
|
4168 |
||
4169 |
box := EnterBox new. |
|
4170 |
box title:(resources string:'Images new size:'). |
|
4171 |
box okText:(resources string:'OK'). |
|
4172 |
box abortText:(resources string:'Cancel'). |
|
4173 |
box initialText:image extent printString. |
|
4174 |
box showAtPointer. |
|
4175 |
(box accepted |
|
4176 |
and: [(newSize := Object readFromString:(box contents) onError:nil) notNil]) |
|
4177 |
ifTrue:[ |
|
1479 | 4178 |
newSize isPoint ifFalse:[ |
4179 |
self warn:'please enter the new size as ''x @ y''.'. |
|
4180 |
^ self. |
|
4181 |
]. |
|
4182 |
imageEditView magnifyImageTo:newSize. |
|
4183 |
]. |
|
4184 |
||
4185 |
self updateInfoLabel |
|
4186 |
! |
|
4187 |
||
4188 |
doMagnifyImageBy |
|
4189 |
"magnifies the current image (by a scale)" |
|
4190 |
||
4191 |
|box oldSize newSize scale image| |
|
4192 |
||
4193 |
image := imageEditView image. |
|
4194 |
oldSize := image extent. |
|
4195 |
||
4196 |
box := EnterBox new. |
|
4197 |
box title:(resources string:'Scale factor (<1 to shrink; >1 to magnify):'). |
|
4198 |
box okText:(resources string:'OK'). |
|
4199 |
box abortText:(resources string:'Cancel'). |
|
4200 |
box initialText:1 printString. |
|
4201 |
box showAtPointer. |
|
4202 |
||
4203 |
(box accepted |
|
4204 |
and: [(scale := Object readFromString:(box contents) onError:nil) notNil]) |
|
4205 |
ifTrue:[ |
|
4206 |
scale isNumber ifFalse:[ |
|
4207 |
self warn:'please enter a scale factor (<1 to shrink; >1 to magnify).'. |
|
4208 |
^ self. |
|
4209 |
]. |
|
4210 |
newSize := oldSize * scale. |
|
1353 | 4211 |
imageEditView magnifyImageTo:newSize. |
4212 |
]. |
|
4213 |
||
400 | 4214 |
self updateInfoLabel |
4215 |
! |
|
4216 |
||
767 | 4217 |
doMagnifyUp |
4218 |
"magnifies current image one step up" |
|
400 | 4219 |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
4220 |
|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
|
4221 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
4222 |
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
|
4223 |
(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
|
4224 |
magHolder value: mag + 1 |
400 | 4225 |
] |
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
4226 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
4227 |
"Modified: / 26.7.1998 / 20:23:52 / cg" |
400 | 4228 |
! |
4229 |
||
767 | 4230 |
doNegativeImage |
4231 |
"negates current image by negating the color map" |
|
400 | 4232 |
|
1598 | 4233 |
self image depth ~~ 1 ifTrue:[ |
4234 |
Dialog warn:'Only useful for depth 1 images'. |
|
4235 |
^ self |
|
4236 |
]. |
|
911 | 4237 |
imageEditView negativeImage. |
400 | 4238 |
self listOfColors removeAll. |
901 | 4239 |
self findColorMapMode. |
911 | 4240 |
imageEditView undoImages removeLast |
400 | 4241 |
! |
4242 |
||
767 | 4243 |
doResizeImage |
1353 | 4244 |
"resizes the current image" |
4245 |
||
4246 |
|box newSize image| |
|
4247 |
||
4248 |
image := imageEditView image. |
|
4249 |
||
4250 |
box := EnterBox new. |
|
4251 |
box title:(resources string:'Images new size:'). |
|
4252 |
box okText:(resources string:'OK'). |
|
4253 |
box abortText:(resources string:'Cancel'). |
|
4254 |
box initialText:image extent printString. |
|
4255 |
box showAtPointer. |
|
4256 |
(box accepted |
|
4257 |
and: [(newSize := Object readFromString:(box contents) onError:nil) notNil]) |
|
4258 |
ifTrue:[ |
|
4259 |
imageEditView resizeImageTo:newSize. |
|
4260 |
]. |
|
400 | 4261 |
! |
4262 |
||
767 | 4263 |
doRotateImage |
4264 |
"rotates current image" |
|
400 | 4265 |
|
1353 | 4266 |
|box rotation| |
4267 |
||
4268 |
box := EnterBox new. |
|
4269 |
box title:(resources string:'Rotate by (degrees, clockwise):'). |
|
4270 |
box okText:(resources string:'OK'). |
|
4271 |
box abortText:(resources string:'Cancel'). |
|
4272 |
box initialText: '0'. |
|
4273 |
box showAtPointer. |
|
4274 |
(box accepted and: [(rotation := Object readFromString: box contents onError:nil) notNil]) |
|
4275 |
ifTrue:[ |
|
4276 |
imageEditView rotateImageBy:rotation. |
|
1558 | 4277 |
self updateInfoLabel. |
1353 | 4278 |
]. |
400 | 4279 |
! |
4280 |
||
1557 | 4281 |
doShiftManual |
4282 |
"let user specify amount and shift" |
|
4283 |
||
4284 |
|bindings amount img firstChange shiftAction acceptChannel| |
|
4285 |
||
4286 |
acceptChannel := TriggerValue new. |
|
4287 |
||
4288 |
firstChange := true. |
|
4289 |
||
4290 |
shiftAction := |
|
4291 |
[:shiftH :shiftV | |
|
4292 |
acceptChannel value:true. |
|
4293 |
||
4294 |
img := imageEditView image. |
|
4295 |
firstChange ifTrue:[ |
|
4296 |
imageEditView makeUndo. |
|
4297 |
firstChange := false. |
|
4298 |
]. |
|
4299 |
imageEditView shiftImageHorizontal:shiftH value vertical:shiftV value. |
|
4300 |
self updateInfoLabel |
|
4301 |
]. |
|
4302 |
||
4303 |
bindings := IdentityDictionary new. |
|
4304 |
bindings at:#shiftAmount put:(amount := 1 asValue). |
|
4305 |
bindings at:#acceptChannel put:acceptChannel. |
|
4306 |
||
4307 |
bindings at:#shiftLeftNow put:[ shiftAction value:(-1*amount value) value:0 ]. |
|
4308 |
bindings at:#shiftRightNow put:[ shiftAction value:amount value value:0 ]. |
|
4309 |
bindings at:#shiftUpNow put:[ shiftAction value:0 value:(-1*amount value) ]. |
|
4310 |
bindings at:#shiftDownNow put:[ shiftAction value:0 value:amount value ]. |
|
4311 |
||
4312 |
(self openDialogInterface:#shiftDialogSpec withBindings:bindings) |
|
4313 |
ifFalse:[ |
|
4314 |
firstChange ~~ true ifTrue:[ |
|
4315 |
imageEditView undo |
|
4316 |
] |
|
4317 |
]. |
|
4318 |
||
4319 |
"Created: / 7.9.1998 / 18:16:07 / cg" |
|
4320 |
"Modified: / 7.9.1998 / 18:20:42 / cg" |
|
4321 |
! |
|
4322 |
||
1480 | 4323 |
doUnCropManual |
4324 |
"let user specify borders and add them" |
|
4325 |
||
4326 |
|bindings left top right bottom img| |
|
4327 |
||
4328 |
bindings := IdentityDictionary new. |
|
4329 |
bindings at:#left put:(left := 0 asValue). |
|
4330 |
bindings at:#right put:(right := 0 asValue). |
|
4331 |
bindings at:#top put:(top := 0 asValue). |
|
4332 |
bindings at:#bottom put:(bottom := 0 asValue). |
|
4333 |
(self openDialogInterface:#ungropDialogSpec withBindings:bindings) |
|
4334 |
ifTrue:[ |
|
4335 |
left := left value. |
|
4336 |
right := right value. |
|
4337 |
top := top value. |
|
4338 |
bottom := bottom value. |
|
4339 |
img := imageEditView image. |
|
4340 |
||
4341 |
imageEditView |
|
4342 |
makeBorderedImageX:left y:top |
|
4343 |
width:(img width + left + right) |
|
4344 |
height:(img height + top + bottom). |
|
4345 |
self updateInfoLabel |
|
4346 |
]. |
|
4347 |
||
4348 |
"Created: / 7.9.1998 / 18:16:07 / cg" |
|
4349 |
"Modified: / 7.9.1998 / 18:20:42 / cg" |
|
4350 |
! |
|
4351 |
||
767 | 4352 |
doUndo |
4353 |
"reverses last edit action" |
|
400 | 4354 |
|
1436 | 4355 |
imageEditView undo. |
400 | 4356 |
! ! |
4357 |
||
4358 |
!ImageEditor methodsFor:'user actions - loading'! |
|
4359 |
||
767 | 4360 |
doLoadFromClass |
4361 |
"opens a dialog for loading an image from class and a (resource-) selector" |
|
400 | 4362 |
|
1122 | 4363 |
|img| |
4364 |
||
1054 | 4365 |
(imageEditView loadFromClass) notNil ifTrue:[ |
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4366 |
imageSeqNr := nil. |
1122 | 4367 |
(img := self image) notNil ifTrue: [ |
4368 |
self listOfColors contents: img usedColors asSet asOrderedCollection. |
|
574 | 4369 |
self findColorMapMode. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4370 |
self updateLabelsAndHistory. |
1054 | 4371 |
] ifFalse: [ |
4372 |
self updateForNoImage |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4373 |
]. |
449 | 4374 |
] |
400 | 4375 |
! |
4376 |
||
767 | 4377 |
doLoadFromFile |
4378 |
"opens a dialog for loading an image from a file" |
|
400 | 4379 |
|
1353 | 4380 |
|img file dir filters| |
4381 |
||
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4382 |
imageSeqNr := nil. |
1353 | 4383 |
img := self image. |
4384 |
img notNil ifTrue: [ |
|
4385 |
file := img fileName |
|
4386 |
] ifFalse:[ |
|
4387 |
dir := LastDirectory |
|
4388 |
]. |
|
4389 |
||
4390 |
filters := FileSelectionBrowser loadImageFileNameFilters. |
|
4391 |
||
4392 |
file notNil ifTrue:[ |
|
4393 |
file := FileSelectionBrowser |
|
4394 |
request:'Load Image From' |
|
4395 |
fileName:file |
|
4396 |
withFileFilters:filters. |
|
4397 |
] ifFalse:[ |
|
4398 |
file := FileSelectionBrowser |
|
4399 |
request:'Load Image From' |
|
4400 |
inDirectory:dir |
|
4401 |
withFileFilters:filters. |
|
4402 |
]. |
|
4403 |
file notNil ifTrue:[ |
|
4404 |
LastDirectory := file asFilename directoryName. |
|
4405 |
self loadFromFile:file |
|
4406 |
] |
|
400 | 4407 |
! |
4408 |
||
767 | 4409 |
doNewImage |
4410 |
"opens a dialog with choices of size and color map for creating a new image" |
|
400 | 4411 |
|
1637 | 4412 |
|aspects width height cMapString cMap imageClass image szString| |
767 | 4413 |
|
400 | 4414 |
aspects := IdentityDictionary new |
767 | 4415 |
at:#listOfSizes put: self class listOfDefaultSizes asValue; |
4416 |
at:#listOfColorMaps put: self class listOfColorMaps keys asSortedCollection asValue; |
|
1637 | 4417 |
at:#selectionOfSize put: (LastSizeString ? self class listOfDefaultSizes first copy) asValue; |
4418 |
at:#selectionOfColorMap put: (LastColormapMode ? self class listOfColorMaps keys asSortedCollection first) asValue; |
|
400 | 4419 |
yourself. |
4420 |
||
767 | 4421 |
(self openDialogInterface:#dialogSpecForNewImage withBindings:aspects) |
1383 | 4422 |
ifTrue:[ |
4423 |
szString := (aspects at:#selectionOfSize) value. |
|
4424 |
width := 128 min: (Integer readFromString: (szString upTo: $x) onError:[24]). |
|
4425 |
height := 128 min: (Integer readFromString: (szString copy reverse upTo: $x) reverse onError:[24]). |
|
400 | 4426 |
|
1637 | 4427 |
cMapString := (aspects at:#selectionOfColorMap) value. |
975 | 4428 |
cMap := (self class listOfColorMaps at: (colorMapMode value: (aspects at:#selectionOfColorMap) value) value). |
400 | 4429 |
imageClass := Image implementorForDepth: ((cMap size log: 2) asInteger). |
767 | 4430 |
image := imageClass width: width height: height fromArray: (ByteArray new: width*height). |
400 | 4431 |
|
1637 | 4432 |
LastSizeString := szString. |
4433 |
LastColormapMode := cMapString. |
|
4434 |
||
975 | 4435 |
(colorMapMode value endsWith: 'mask') |
400 | 4436 |
ifTrue: |
4437 |
[ |
|
767 | 4438 |
image mask: (Depth1Image width: width height: height depth: 1 fromArray: (ByteArray new: width*height)) clearMaskedPixels |
400 | 4439 |
]. |
4440 |
image colorMap: cMap. |
|
4441 |
image fillRectangleX:0 y:0 width:width height:height with:Color white. |
|
911 | 4442 |
(imageEditView image: image) notNil |
400 | 4443 |
ifTrue: |
4444 |
[ |
|
4445 |
self listOfColors contents: cMap. |
|
4446 |
self findColorMapMode. |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4447 |
self updateLabelsAndHistory. |
400 | 4448 |
] |
767 | 4449 |
] |
929 | 4450 |
! |
4451 |
||
1682 | 4452 |
doNewImageFromClipboard |
4453 |
|image| |
|
4454 |
||
4455 |
image := imageEditView clipBoard. |
|
4456 |
||
4457 |
(imageEditView image:image) notNil |
|
4458 |
ifTrue:[ |
|
4459 |
self listOfColors contents:(image colorMap). |
|
4460 |
self findColorMapMode. |
|
4461 |
self updateLabelsAndHistory. |
|
4462 |
] |
|
4463 |
! |
|
4464 |
||
929 | 4465 |
grabScreenImage |
4466 |
"let user choose an area and grab that are for editing" |
|
4467 |
||
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
4468 |
Processor |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
4469 |
addTimedBlock:[ |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
4470 |
|image d8image img| |
929 | 4471 |
|
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4472 |
imageSeqNr := nil. |
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
4473 |
image := Image fromUser. |
1121 | 4474 |
image isNil ifFalse:[ |
4475 |
image depth > 8 ifTrue:[ |
|
1687
f4543a556b89
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
1682
diff
changeset
|
4476 |
Error handle:[:ex | |sig| |
1537
e86a686eeba2
class based exceptions - no longer need to send #haltSÃgnal
Claus Gittinger <cg@exept.de>
parents:
1507
diff
changeset
|
4477 |
(sig := ex signal) == HaltInterrupt ifTrue:[ex reject]. |
1122 | 4478 |
sig == Signal noHandlerSignal ifTrue:[ex reject]. |
1121 | 4479 |
|
4480 |
self warn:'Could not convert to depth8 image (too many colors)'. |
|
4481 |
d8image := nil. |
|
4482 |
] do:[ |
|
4483 |
d8image := Depth8Image new. |
|
4484 |
d8image fromImage:image. |
|
4485 |
]. |
|
4486 |
d8image notNil ifTrue:[ |
|
4487 |
image := d8image |
|
4488 |
] |
|
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
4489 |
]. |
1121 | 4490 |
(imageEditView image:image) notNil ifTrue:[ |
4491 |
self listOfColors contents:(image colorMap). |
|
4492 |
self findColorMapMode. |
|
4493 |
self updateLabelsAndHistory. |
|
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
4494 |
] |
1121 | 4495 |
] |
4496 |
] |
|
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
4497 |
afterSeconds:1 |
929 | 4498 |
|
4499 |
"Created: / 29.7.1998 / 21:24:42 / cg" |
|
1537
e86a686eeba2
class based exceptions - no longer need to send #haltSÃgnal
Claus Gittinger <cg@exept.de>
parents:
1507
diff
changeset
|
4500 |
"Modified: / 16.11.2001 / 16:21:19 / cg" |
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4501 |
! |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4502 |
|
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4503 |
nextImageInSequence |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4504 |
"display the next image in the image sequence" |
1383 | 4505 |
|img seq frame listOfColors| |
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4506 |
|
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4507 |
imageEditView releaseUndos. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4508 |
|
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4509 |
seq := self image imageSequence. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4510 |
imageSeqNr isNil ifTrue:[ |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4511 |
imageSeqNr := 1. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4512 |
]. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4513 |
imageSeqNr := imageSeqNr + 1. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4514 |
imageSeqNr > seq size ifTrue:[ |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4515 |
self information:'Back to first image in sequence'. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4516 |
imageSeqNr := 1. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4517 |
]. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4518 |
frame := seq at:imageSeqNr. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4519 |
imageEditView image:(frame image). |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4520 |
|
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4521 |
(img := self image) notNil ifTrue:[ |
1383 | 4522 |
listOfColors := self listOfColors. |
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4523 |
img colorMap notNil ifTrue:[ |
1383 | 4524 |
listOfColors contents:(img usedColors asSet asOrderedCollection). |
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4525 |
] ifFalse:[ |
1383 | 4526 |
listOfColors removeAll. |
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4527 |
]. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4528 |
self findColorMapMode. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4529 |
self updateLabelsAndHistory. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4530 |
img := img onDevice:device. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4531 |
imageEditView image:img. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4532 |
] ifFalse:[ |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4533 |
self updateForNoImage |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4534 |
]. |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
4535 |
|
400 | 4536 |
! ! |
4537 |
||
4538 |
!ImageEditor methodsFor:'user actions - saving'! |
|
4539 |
||
767 | 4540 |
doPrint |
4541 |
"prints current image on the current printer" |
|
400 | 4542 |
|
911 | 4543 |
imageEditView print |
400 | 4544 |
! |
4545 |
||
1613 | 4546 |
doSaveButtonImageToFileAs |
4547 |
"opens a dialog for saving current image to a file" |
|
4548 |
||
4549 |
imageEditView saveButtonImageToFileAs. |
|
4550 |
self updateLabelsAndHistory. |
|
4551 |
! |
|
4552 |
||
767 | 4553 |
doSaveImageFile |
4554 |
"saves current image to current file" |
|
400 | 4555 |
|
1481 | 4556 |
imageEditView save. |
400 | 4557 |
! |
4558 |
||
767 | 4559 |
doSaveImageFileAs |
4560 |
"opens a dialog for saving current image to a file" |
|
400 | 4561 |
|
911 | 4562 |
imageEditView saveImageFileAs. |
1481 | 4563 |
self updateLabelsAndHistory. |
400 | 4564 |
! |
4565 |
||
767 | 4566 |
doSaveImageMaskFileAs |
4567 |
"opens a dialog for saving mask of current image to a file" |
|
400 | 4568 |
|
1481 | 4569 |
imageEditView saveImageMaskFileAs. |
400 | 4570 |
! |
4571 |
||
767 | 4572 |
doSaveMethod |
4573 |
"saves current image on current class and selector" |
|
400 | 4574 |
|
911 | 4575 |
imageEditView saveMethod notNil |
400 | 4576 |
ifTrue: |
4577 |
[ |
|
694 | 4578 |
self updateLabelsAndHistory |
400 | 4579 |
] |
4580 |
! |
|
4581 |
||
767 | 4582 |
doSaveMethodAs |
4583 |
"opens a dialog for saving current image on a class and a selector" |
|
400 | 4584 |
|
911 | 4585 |
imageEditView saveMethodAs notNil |
400 | 4586 |
ifTrue: |
4587 |
[ |
|
694 | 4588 |
self updateLabelsAndHistory |
400 | 4589 |
] |
1309
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4590 |
! |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4591 |
|
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4592 |
doShowStoreString |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4593 |
"opens a dialog showing the storeString |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4594 |
(sometimes useful to embed an image into source code)" |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4595 |
|
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4596 |
|img| |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4597 |
|
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4598 |
img := imageEditView image. |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
4599 |
TextBox openOn:img storeString |
400 | 4600 |
! ! |
4601 |
||
1353 | 4602 |
!ImageEditor methodsFor:'user actions - settings'! |
4603 |
||
4604 |
doChangeGridMagnification |
|
4605 |
"change grid magnification" |
|
4606 |
||
4607 |
|box oldGridLimit newGridLimit| |
|
4608 |
||
4609 |
oldGridLimit := imageEditView class gridMagnificationLimit asPoint. |
|
4610 |
||
4611 |
box := EnterBox new. |
|
4612 |
box title:(resources string:'Grid Magnification Limit:'). |
|
4613 |
box okText:(resources string:'OK'). |
|
4614 |
box abortText:(resources string:'Cancel'). |
|
4615 |
box initialText:(oldGridLimit x printString). |
|
4616 |
box showAtPointer. |
|
4617 |
||
4618 |
(box accepted |
|
4619 |
and: [(newGridLimit := Number readFromString:(box contents) onError:[2]) notNil] |
|
4620 |
) ifTrue:[ |
|
4621 |
newGridLimit := (99 min: (2 max:newGridLimit)) asPoint. |
|
4622 |
imageEditView class gridMagnificationLimit:newGridLimit. |
|
4623 |
imageEditView invalidate |
|
4624 |
] |
|
4625 |
||
4626 |
! ! |
|
4627 |
||
400 | 4628 |
!ImageEditor class methodsFor:'documentation'! |
4629 |
||
4630 |
version |
|
4631 |
^ '$Header$' |
|
4632 |
! ! |