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