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