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