author | Claus Gittinger <cg@exept.de> |
Wed, 31 Jul 2019 17:12:55 +0200 | |
changeset 3744 | 71fa6500e535 |
parent 3740 | 6b1e0eefb50a |
child 3750 | bf5d920267cc |
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 |
" |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
12 |
"{ Package: 'stx:libtool2' }" |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
13 |
|
3180 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
1975 | 16 |
ResourceSpecEditor subclass:#ImageEditor |
975 | 17 |
instanceVariableNames:'imageEditView colorMapMode editMode mouseKeyColorMode |
1960 | 18 |
selectedColorIndex postOpenAction imageSeqNr drawingColormap |
2767 | 19 |
lastShiftUsedWrap lastGrabbedScreenArea |
3379 | 20 |
allowedToChangeImageDimensionAndDepth savedImage savedFile' |
3416 | 21 |
classVariableNames:'DefaultRelativeSizes LastColormapMode LastDirectory |
3497 | 22 |
LastSizeString LastURL MaskClipboard LastDepth |
3550 | 23 |
LastNumThresholdGrayColors LastMagnifyTo LastMagnifyBy |
24 |
LastMagnifySmoothing' |
|
929 | 25 |
poolDictionaries:'' |
26 |
category:'Interface-UIPainter' |
|
400 | 27 |
! |
28 |
||
29 |
!ImageEditor class methodsFor:'documentation'! |
|
30 |
||
31 |
copyright |
|
32 |
" |
|
767 | 33 |
COPYRIGHT (c) 1997-1998 by eXept Software AG |
400 | 34 |
All Rights Reserved |
35 |
||
36 |
This software is furnished under a license and may be used |
|
37 |
only in accordance with the terms of that license and with the |
|
405 | 38 |
inclusion of the above copyright notice. This software may not |
400 | 39 |
be provided or otherwise made available to, or used by, any |
405 | 40 |
other person. No title to or ownership of the software is |
400 | 41 |
hereby transferred. |
42 |
" |
|
43 |
! |
|
44 |
||
45 |
documentation |
|
46 |
" |
|
737 | 47 |
Image Editor allows you to create, design, modify or just inspect images. |
3375 | 48 |
It is also used subclasses as a tool to post-process captured screen images and |
49 |
bitmaps in expecco. |
|
400 | 50 |
|
3530 | 51 |
The actual drawing functionality is found in ImageEditView; |
52 |
the code here (an appModel) provides nice menus, previews, colormap manipulation etc. |
|
53 |
||
400 | 54 |
[start with:] |
55 |
ImageEditor open |
|
941 | 56 |
ImageEditor openOnClass:Icon andSelector:#startIcon |
3466 | 57 |
(Image fromFile:'../../goodies/bitmaps/gifImages/garfield.gif') edit |
58 |
(Image fromScreen:(0@0 corner:100@100)) edit |
|
400 | 59 |
|
60 |
[see also:] |
|
61 |
ImageEditView Image |
|
62 |
||
63 |
[author:] |
|
544 | 64 |
Thomas Zwick, eXept Software AG |
1806 | 65 |
Claus Gittinger, eXept Software AG |
400 | 66 |
" |
67 |
! ! |
|
68 |
||
69 |
!ImageEditor class methodsFor:'instance creation'! |
|
70 |
||
3357 | 71 |
openLoadingImageWith:aBlock modal:modalBoolean |
3376 | 72 |
"opens an Image Editor on anImage. |
3427 | 73 |
Returns the editor (to access its attributes)" |
1975 | 74 |
|
75 |
|editor| |
|
76 |
||
77 |
editor := self new. |
|
78 |
editor allButOpen. |
|
79 |
aBlock value:editor. |
|
3357 | 80 |
modalBoolean ifTrue:[ |
81 |
editor openWindowModal. |
|
82 |
] ifFalse:[ |
|
83 |
editor openWindow. |
|
84 |
]. |
|
2764 | 85 |
^ editor |
3427 | 86 |
|
87 |
"Modified (comment): / 07-03-2017 / 16:36:16 / cg" |
|
1975 | 88 |
! |
89 |
||
400 | 90 |
openModalOnClass: aClass andSelector: aSelector |
1975 | 91 |
"opens a modal Image Editor on aClass and aSelector. |
92 |
Returns the real name of the edited resource method (in case, user changed it)." |
|
93 |
||
94 |
|imageEditor imageEditView className resourceClass resourceSelector| |
|
767 | 95 |
|
400 | 96 |
imageEditor := self new. |
767 | 97 |
|
900 | 98 |
aClass isClass ifTrue: [className := aClass name]. |
99 |
aClass isString ifTrue: [className := aClass]. |
|
903 | 100 |
aClass isNil ifTrue: [className := '']. |
400 | 101 |
|
2764 | 102 |
imageEditor postOpenAction: [ |
103 |
imageEditView := imageEditor imageEditView. |
|
104 |
imageEditor loadFromOrPrepareForClass: aClass andSelector: aSelector |
|
105 |
]. |
|
400 | 106 |
imageEditor openModal. |
107 |
||
1975 | 108 |
resourceClass := imageEditView resourceClass. |
109 |
resourceSelector := imageEditView resourceSelector. |
|
110 |
||
111 |
(resourceClass isNil or:[resourceSelector isNil]) ifTrue:[^ nil]. |
|
112 |
^ Array with:resourceClass with:resourceSelector |
|
1966 | 113 |
|
114 |
" |
|
115 |
self openModalOnClass: self andSelector: #leftMouseKeyIcon |
|
116 |
" |
|
400 | 117 |
! |
118 |
||
3357 | 119 |
openModalOnFile:aFileName |
3427 | 120 |
"opens an Image Editor on aFileName. |
121 |
Returns the editor (to access its attributes)" |
|
122 |
||
123 |
^ self openOnFile:aFileName modal:true |
|
3357 | 124 |
|
125 |
" |
|
126 |
self openModalOnFile: '../../goodies/bitmaps/gifImages/back.gif' |
|
127 |
" |
|
3411 | 128 |
|
3427 | 129 |
"Modified: / 07-03-2017 / 16:36:32 / cg" |
3357 | 130 |
! |
131 |
||
2764 | 132 |
openModalOnImage:anImage |
133 |
"opens a modal Image Editor on an image. |
|
134 |
Returns the modified image or nil if unsaved/unchanged" |
|
135 |
||
136 |
|imageEditor imageEditView newImage| |
|
137 |
||
138 |
imageEditor := self new. |
|
2767 | 139 |
imageEditor allowedToChangeImageDimensionAndDepth:false. |
2764 | 140 |
imageEditor postOpenAction: [ |
141 |
imageEditView := imageEditor imageEditView. |
|
142 |
imageEditor loadFromImage: anImage |
|
143 |
]. |
|
144 |
imageEditor openModal. |
|
145 |
||
2766 | 146 |
newImage := imageEditor savedImage. |
2764 | 147 |
^ newImage |
148 |
! |
|
149 |
||
1966 | 150 |
openOnClass:aClass andSelector:aSelector |
3427 | 151 |
"opens an Image Editor on aClass and aSelector. |
152 |
Returns the editor (to access its attributes)" |
|
153 |
||
154 |
^ self openOnClass:aClass andSelector:aSelector modal:false |
|
1057 | 155 |
|
1966 | 156 |
" |
157 |
self openOnClass:self andSelector:#leftMouseKeyIcon |
|
158 |
self openOnClass:self andSelector:nil |
|
159 |
" |
|
160 |
||
3427 | 161 |
"Modified: / 07-03-2017 / 16:36:58 / cg" |
162 |
! |
|
163 |
||
164 |
openOnClass:aClass andSelector:aSelector modal:modal |
|
165 |
"opens an Image Editor on aClass and aSelector. |
|
166 |
Returns the editor (to access its attributes)" |
|
167 |
||
168 |
^ self |
|
169 |
openLoadingImageWith:[:editor | |
|
170 |
editor loadFromClass:(aClass theNonMetaclass) andSelector:aSelector |
|
171 |
] |
|
172 |
modal:modal. |
|
173 |
||
174 |
" |
|
175 |
self openOnClass:self andSelector:#leftMouseKeyIcon modal:true |
|
176 |
self openOnClass:self andSelector:nil |
|
177 |
" |
|
178 |
||
179 |
"Created: / 07-03-2017 / 16:34:36 / cg" |
|
400 | 180 |
! |
181 |
||
1966 | 182 |
openOnFile:aFileName |
3427 | 183 |
"opens an Image Editor on aFileName. |
184 |
Returns the editor (to access its attributes)" |
|
185 |
||
186 |
^ self openOnFile:aFileName modal:false |
|
1057 | 187 |
|
1966 | 188 |
" |
1975 | 189 |
self openOnFile: '../../goodies/bitmaps/gifImages/back.gif' |
1966 | 190 |
" |
191 |
||
3427 | 192 |
"Modified: / 07-03-2017 / 16:37:33 / cg" |
193 |
! |
|
194 |
||
195 |
openOnFile:aFileName modal:modal |
|
196 |
"opens an Image Editor on aFileName. |
|
197 |
Returns the editor (to access its attributes)" |
|
198 |
||
199 |
^ self |
|
200 |
openLoadingImageWith:[:editor | |
|
201 |
editor loadFromFile:aFileName. |
|
202 |
] |
|
203 |
modal:modal. |
|
204 |
||
205 |
" |
|
206 |
self openOnFile: '../../goodies/bitmaps/gifImages/back.gif' modal:false |
|
207 |
self openOnFile: '../../goodies/bitmaps/gifImages/back.gif' modal:true |
|
208 |
" |
|
209 |
||
210 |
"Created: / 07-03-2017 / 16:33:12 / cg" |
|
400 | 211 |
! |
212 |
||
1966 | 213 |
openOnImage:anImage |
3427 | 214 |
"opens an Image Editor on anImage. |
215 |
Returns the editor (to access its attributes)" |
|
216 |
||
217 |
^ self |
|
3375 | 218 |
openLoadingImageWith:[:editor | editor loadFromImage: anImage ] |
219 |
modal:false |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
220 |
|
1966 | 221 |
" |
222 |
self openOnImage: Icon startIcon |
|
223 |
" |
|
224 |
||
3427 | 225 |
"Modified: / 07-03-2017 / 16:37:57 / cg" |
400 | 226 |
! ! |
227 |
||
228 |
!ImageEditor class methodsFor:'accessing'! |
|
229 |
||
230 |
listOfColorMaps |
|
767 | 231 |
"returns the list of default color maps for a new image" |
400 | 232 |
|
233 |
|colorMap| |
|
898 | 234 |
|
400 | 235 |
(colorMap := OrderedCollection new) |
236 |
add: Color black; |
|
237 |
add: Color white; |
|
238 |
add: Color red; |
|
239 |
add: Color green; |
|
240 |
add: Color blue; |
|
241 |
add: Color cyan; |
|
242 |
add: Color yellow; |
|
243 |
add: Color magenta; |
|
898 | 244 |
add: (Color redByte: 127 greenByte: 0 blueByte: 0); |
245 |
add: (Color redByte: 0 greenByte: 127 blueByte: 0); |
|
246 |
add: (Color redByte: 0 greenByte: 0 blueByte: 127); |
|
247 |
add: (Color redByte: 0 greenByte: 127 blueByte: 127); |
|
248 |
add: (Color redByte: 127 greenByte: 127 blueByte: 0); |
|
249 |
add: (Color redByte: 127 greenByte: 0 blueByte: 127); |
|
250 |
add: (Color redByte: 127 greenByte: 127 blueByte: 127); |
|
251 |
add: (Color redByte: 170 greenByte: 170 blueByte: 170). |
|
252 |
||
3346 | 253 |
0 to: 5 do: [:r| |
254 |
0 to: 5 do: [:g| |
|
255 |
0 to: 5 do: [:b| |
|
898 | 256 |
colorMap add: (Color redByte: (r*255//5) ceiling greenByte: (g*255//5) ceiling blueByte: (b*255//5) ceiling) |
400 | 257 |
] |
258 |
] |
|
259 |
]. |
|
260 |
||
3346 | 261 |
1 to: 25 do: [:g| |
898 | 262 |
colorMap add: (Color redByte: (g*255//26) ceiling greenByte: (g*255//26) ceiling blueByte: (g*255//26) ceiling) |
400 | 263 |
]. |
264 |
||
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
265 |
^ Dictionary new |
2571 | 266 |
at: #depth32 put:(FixedPalette redShift:16 redMask:16rFF greenShift:8 greenMask:16rFF blueShift:0 blueMask:16rFF); |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
267 |
at: #depth24 put:(FixedPalette redShift:16 redMask:16rFF greenShift:8 greenMask:16rFF blueShift:0 blueMask:16rFF); |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
268 |
at: #masked24 put:(FixedPalette redShift:16 redMask:16rFF greenShift:8 greenMask:16rFF blueShift:0 blueMask:16rFF); |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
269 |
at: #depth16 put:(FixedPalette redShift:11 redMask:16r1F greenShift:5 greenMask:16r3F blueShift:0 blueMask:16r1F); |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
270 |
at: #masked16 put:(FixedPalette redShift:11 redMask:16r1F greenShift:5 greenMask:16r3F blueShift:0 blueMask:16r1F); |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
271 |
at: #depth8 put: colorMap; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
272 |
at: #masked8 put: colorMap; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
273 |
at: #depth4 put: (colorMap copyFrom: 1 to: 16); |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
274 |
at: #masked4 put: (colorMap copyFrom: 1 to: 16); |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
275 |
at: #depth2 put: (colorMap copyFrom: 1 to: 4); |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
276 |
at: #masked2 put: (colorMap copyFrom: 1 to: 4); |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
277 |
at: #depth1 put: (colorMap copyFrom: 1 to: 2); |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
278 |
at: #masked1 put: (colorMap copyFrom: 1 to: 2); |
400 | 279 |
yourself |
280 |
! |
|
281 |
||
282 |
listOfDefaultSizes |
|
767 | 283 |
"returns the list of default sizes for a new image" |
400 | 284 |
|
1960 | 285 |
^ #('8x8' '16x16' '22x22' '32x32' '48x48' '64x64') |
932
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
286 |
|
7111238cda23
fixed dimension of new-image dialog.
Claus Gittinger <cg@exept.de>
parents:
930
diff
changeset
|
287 |
"Modified: / 31.7.1998 / 01:57:34 / cg" |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
288 |
! |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
289 |
|
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
290 |
namesOfColorMaps |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
291 |
^ Dictionary new |
2571 | 292 |
at: #depth32 put: '32-plane (rgba)'; |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
293 |
at: #depth24 put: '24-plane'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
294 |
at: #masked24 put: '24-plane + mask'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
295 |
at: #depth16 put: '16-plane'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
296 |
at: #masked16 put: '16-plane + mask'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
297 |
at: #depth8 put: ' 8-plane'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
298 |
at: #masked8 put: ' 8-plane + mask'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
299 |
at: #depth4 put: ' 4-plane'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
300 |
at: #masked4 put: ' 4-plane + mask'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
301 |
at: #depth2 put: ' 2-plane'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
302 |
at: #masked2 put: ' 2-plane + mask'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
303 |
at: #depth1 put: ' 1-plane'; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
304 |
at: #masked1 put: ' 1-plane + mask' ; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
305 |
yourself |
400 | 306 |
! ! |
307 |
||
460 | 308 |
!ImageEditor class methodsFor:'help specs'! |
309 |
||
3644 | 310 |
helpSpec |
2871 | 311 |
"This resource specification was automatically generated |
312 |
by the UIHelpTool of ST/X." |
|
313 |
||
314 |
"Do not manually edit this!! If it is corrupted, |
|
315 |
the UIHelpTool may not be able to read the specification." |
|
316 |
||
317 |
" |
|
3408 | 318 |
UIHelpTool openOnClass:ImageEditor |
2871 | 319 |
" |
320 |
||
321 |
<resource: #help> |
|
322 |
||
3644 | 323 |
^super helpSpec addPairsFrom: #( |
2871 | 324 |
|
3417 | 325 |
#autoCropAll |
326 |
'Find and remove all borders' |
|
327 |
||
328 |
#autoCropBottom |
|
329 |
'Find and remove bottom border' |
|
330 |
||
331 |
#autoCropLeft |
|
332 |
'Find and remove left border' |
|
333 |
||
334 |
#autoCropRight |
|
335 |
'Find and remove right border' |
|
336 |
||
337 |
#autoCropTop |
|
338 |
'Find and remove top border' |
|
339 |
||
460 | 340 |
#colorMap |
2765 | 341 |
'ColorMap functions' |
929 | 342 |
|
343 |
#colorMap1 |
|
2765 | 344 |
'Convert to depth-1 image' |
929 | 345 |
|
986 | 346 |
#colorMap1M |
2765 | 347 |
'Convert to depth-1 image plus mask' |
986 | 348 |
|
929 | 349 |
#colorMap2 |
2765 | 350 |
'Convert to depth-2 image' |
351 |
||
352 |
#colorMap24 |
|
353 |
'Convert to depth-24 image (rgb)' |
|
929 | 354 |
|
986 | 355 |
#colorMap2M |
2765 | 356 |
'Convert to depth-2 image plus mask' |
357 |
||
358 |
#colorMap32 |
|
359 |
'Convert to depth-32 image (rgba)' |
|
986 | 360 |
|
929 | 361 |
#colorMap4 |
2765 | 362 |
'Convert to depth-4 image' |
929 | 363 |
|
986 | 364 |
#colorMap4M |
2765 | 365 |
'Convert to depth-4 image plus mask' |
986 | 366 |
|
929 | 367 |
#colorMap8 |
2765 | 368 |
'Convert to depth-8 image' |
929 | 369 |
|
370 |
#colorMap8M |
|
2765 | 371 |
'Convert to depth-8 image plus mask' |
2571 | 372 |
|
986 | 373 |
#colorMapTable |
2765 | 374 |
'Shows a list of used colors of the image' |
986 | 375 |
|
929 | 376 |
#compressColormap |
2765 | 377 |
'Remove unneeded entries from the colorMap' |
460 | 378 |
|
1045 | 379 |
#cropAll |
3417 | 380 |
'Crop (cut off) all four sides by the amounts entered into the above fields.' |
986 | 381 |
|
1045 | 382 |
#cropBottom |
3417 | 383 |
'Cut off the specified number of pixels at the bottom' |
384 |
||
385 |
#cropBySelectingArea |
|
386 |
'Select new area in the right detail view.' |
|
986 | 387 |
|
1045 | 388 |
#cropLeft |
3417 | 389 |
'Cut off the specified number of pixels at the left' |
986 | 390 |
|
1045 | 391 |
#cropManual |
986 | 392 |
'Specify border(s) to remove.' |
393 |
||
1045 | 394 |
#cropRight |
3417 | 395 |
'Cut off the specified number of pixels at the right' |
986 | 396 |
|
1045 | 397 |
#cropTop |
3417 | 398 |
'Cut off the specified number of pixels at the top' |
399 |
||
400 |
#cropubImage |
|
401 |
'Select a subarea as the image''s new dimension' |
|
487 | 402 |
|
460 | 403 |
#drawModeBox |
2765 | 404 |
'Rectangle Drawing Mode' |
460 | 405 |
|
2375 | 406 |
#drawModeCircle |
2765 | 407 |
'Circle Drawing Mode' |
2375 | 408 |
|
460 | 409 |
#drawModeCopy |
2765 | 410 |
'Area Copy Mode' |
460 | 411 |
|
3423 | 412 |
#drawModeCropSubImage |
413 |
'Select and extract a subimage' |
|
414 |
||
460 | 415 |
#drawModeFill |
2765 | 416 |
'Flood Fill Mode' |
460 | 417 |
|
418 |
#drawModeFilledBox |
|
2765 | 419 |
'Filled Rectangle Drawing Mode' |
460 | 420 |
|
3408 | 421 |
#drawModeFilledCircle |
422 |
'Filled Circle Drawing Mode' |
|
423 |
||
424 |
#drawModeMaskOutsideCircle |
|
425 |
'Mask everything outside a Circle' |
|
426 |
||
427 |
#drawModeMaskOutsideRectangle |
|
428 |
'Mask everything outside a Rectangle' |
|
429 |
||
460 | 430 |
#drawModePaste |
3512 | 431 |
'Paste-Over Mode (only paste pixels; keep mask as is)' |
914 | 432 |
|
3562 | 433 |
#drawModePasteMasked |
434 |
'Paste-Under Mode (only paste previously masked pixels)' |
|
435 |
||
914 | 436 |
#drawModePasteUnder |
3561 | 437 |
'Paste-Under Mode (only paste previously masked pixels where the new pixel is also masked)' |
438 |
||
1637 | 439 |
#drawModePasteWithMask |
3512 | 440 |
'Paste-with-Mask Mode (both pixel and mask are pasted)' |
460 | 441 |
|
442 |
#drawModePoint |
|
2765 | 443 |
'Point Drawing Mode' |
2375 | 444 |
|
1639 | 445 |
#drawModeSpecial |
2871 | 446 |
'Special operations (select rectangle, then choose operation)' |
1639 | 447 |
|
2765 | 448 |
#drawModeSpray |
449 |
'Spray Drawing Mode' |
|
450 |
||
3562 | 451 |
#drawingAlpha |
452 |
'The alpha value (in percent) to be used in edit operations.\If the "mask"-color is selected, only the alpha value will be changed.\Otherwise, the selected color plus this alpha value will be used for drawing' |
|
453 |
||
454 |
#drawingColor1 |
|
455 |
'The color associated to the left mouse button.\Also the color used in fill operations' |
|
456 |
||
457 |
#drawingColor2 |
|
458 |
'The color associated to the right mouse button.\Also the second color used in gradient fill operations' |
|
459 |
||
3408 | 460 |
#edit3DProjection |
461 |
'Generate a 3D projection' |
|
462 |
||
460 | 463 |
#editFlipHorizontal |
2765 | 464 |
'Flip the image horizontally' |
460 | 465 |
|
466 |
#editFlipVertical |
|
2765 | 467 |
'Flip the image vertically' |
460 | 468 |
|
469 |
#editMagnifyImage |
|
2765 | 470 |
'Magnify the image' |
460 | 471 |
|
472 |
#editNegate |
|
2765 | 473 |
'Invert the images colors' |
460 | 474 |
|
475 |
#editResize |
|
2765 | 476 |
'Resize the image (preserving the old image)' |
460 | 477 |
|
478 |
#editRotate |
|
2765 | 479 |
'Rotate the image' |
460 | 480 |
|
3408 | 481 |
#fileEditMask |
482 |
'Load Mask from a File' |
|
483 |
||
2701
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
484 |
#fileGrabImageFromScreen |
2765 | 485 |
'Pick an image from the screen (specify area)' |
2701
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
486 |
|
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
487 |
#fileGrabImageFromWindow |
2765 | 488 |
'Pick an image from a window on the screen (click on window)' |
929 | 489 |
|
460 | 490 |
#fileLoadFromClass |
2765 | 491 |
'Select and load an image from a resource method' |
460 | 492 |
|
493 |
#fileLoadFromFile |
|
2765 | 494 |
'Select and load an image from a file' |
460 | 495 |
|
2796 | 496 |
#fileLoadFromURL |
497 |
'Load an image from the net, given its URL' |
|
498 |
||
460 | 499 |
#fileNewImage |
914 | 500 |
'Create a new image' |
460 | 501 |
|
3200 | 502 |
#fileNewImageFromClipboard |
503 |
'Create a new image and initialize it from the clipboard' |
|
504 |
||
505 |
#fileNewMaskFromClipboard |
|
506 |
'Paste the image in the clipboard as a mask. Must be a depth-1 image' |
|
507 |
||
460 | 508 |
#filePrint |
3417 | 509 |
'Print the image on a postscript printer' |
3408 | 510 |
|
511 |
#filePrint |
|
3417 | 512 |
'Print' |
2765 | 513 |
|
514 |
#fileSave |
|
515 |
'Save the image' |
|
460 | 516 |
|
517 |
#fileSaveAs |
|
2765 | 518 |
'Save the image to a file' |
519 |
||
520 |
#fileSaveButtonImageAs |
|
521 |
'Save an image of a button with the image to a file (for html use)' |
|
460 | 522 |
|
523 |
#fileSaveMaskAs |
|
2765 | 524 |
'Save the mask of the image to a file' |
1613 | 525 |
|
460 | 526 |
#fileSaveMethod |
2765 | 527 |
'Save the image as resource method in the current class and selector' |
460 | 528 |
|
529 |
#fileSaveMethodAs |
|
2765 | 530 |
'Save the image as resource method in a class' |
460 | 531 |
|
3408 | 532 |
#floodFillMaxError |
3433 | 533 |
'Specify the max. allowed deviation from the clicked pixel in a flood-fill operation.\Pixels where the hue/light values differ less than that fraction\will be included in the fill.\The range must be between 0 and 1. With 0, only areas with exactly the same pixel will be filled.\With 1, every other pixel is included.\\When filling gradiented areas, start with small values, such as 0.05, and increase slowly (undo and try with higher value).\This is especially useful when masking background areas from screenshots.' |
3408 | 534 |
|
3562 | 535 |
#hueShift |
536 |
'' |
|
537 |
||
538 |
#lightFactor |
|
539 |
'' |
|
540 |
||
3408 | 541 |
#magnificationNumber |
542 |
'Shows the current magnification' |
|
543 |
||
544 |
#magnifyImageDown |
|
545 |
'Decrease magnification' |
|
546 |
||
547 |
#magnifyImageUp |
|
548 |
'Increase magnification' |
|
549 |
||
550 |
#mouseKeyColorMode |
|
551 |
'Toggle between left and right mouse button color' |
|
552 |
||
553 |
#nextImageInSequence |
|
554 |
'Go to the next image in the animated gif image sequence.' |
|
555 |
||
556 |
#previewView |
|
557 |
'Shows a preview of the image' |
|
558 |
||
559 |
#previousImageInSequence |
|
560 |
'Go to the previous image in the animated gif image sequence.' |
|
561 |
||
3562 | 562 |
#resetHueShift |
563 |
'Reset the hue shift to zero (for unchanged hue)' |
|
564 |
||
565 |
#resetLightFactor |
|
566 |
'Reset the light factor to 1 (for unchanged brightness)' |
|
567 |
||
568 |
#resetSaturationFactor |
|
569 |
'Reset the saturation factor to 1 (for unchanged saturation)' |
|
570 |
||
571 |
#saturationFactor |
|
572 |
'' |
|
573 |
||
3408 | 574 |
#settingsGridMagnification |
575 |
'Change the grid magnification of the edit view' |
|
576 |
||
577 |
#xdrawModeBox |
|
578 |
'Rectangle' |
|
579 |
||
580 |
#xdrawModeCopy |
|
581 |
'Copy' |
|
582 |
||
583 |
#xdrawModeFill |
|
584 |
'Flood-fill' |
|
585 |
||
586 |
#xdrawModeFilledBox |
|
587 |
'Filled rectangle' |
|
588 |
||
589 |
#xdrawModePaste |
|
590 |
'Paste' |
|
591 |
||
592 |
#xdrawModePasteUnder |
|
593 |
'Paste under' |
|
594 |
||
595 |
#xdrawModePasteWithMask |
|
596 |
'Paste with Mask' |
|
597 |
||
598 |
#xdrawModePoint |
|
599 |
'Point' |
|
600 |
||
601 |
#xfileGrabImage |
|
602 |
'Pick from screen' |
|
603 |
||
604 |
#xfileLoadFromClass |
|
605 |
'Load from method...' |
|
606 |
||
607 |
#xfileLoadFromFile |
|
608 |
'Load from file...' |
|
609 |
||
610 |
#xfileNewImage |
|
611 |
'New image' |
|
612 |
||
613 |
#xfileSaveAs |
|
614 |
'Save to file...' |
|
615 |
||
616 |
#xfileSaveMaskAs |
|
617 |
'Save mask to file...' |
|
618 |
||
619 |
#xfileSaveMethod |
|
620 |
'Save as method' |
|
621 |
||
622 |
#xfileSaveMethodAs |
|
623 |
'Save as Method...' |
|
3405 | 624 |
|
460 | 625 |
) |
2871 | 626 |
|
3513 | 627 |
"Modified: / 16-02-2017 / 12:30:55 / cg" |
3644 | 628 |
"Modified: / 28-02-2019 / 11:57:39 / Claus Gittinger" |
460 | 629 |
! ! |
630 |
||
737 | 631 |
!ImageEditor class methodsFor:'image specs'! |
632 |
||
3419 | 633 |
brighterIcon |
634 |
"This resource specification was automatically generated |
|
635 |
by the ImageEditor of ST/X." |
|
636 |
||
637 |
"Do not manually edit this!! If it is corrupted, |
|
638 |
the ImageEditor may not be able to read the specification." |
|
639 |
||
640 |
" |
|
641 |
self brighterIcon inspect |
|
642 |
ImageEditor openOnClass:self andSelector:#brighterIcon |
|
643 |
Icon flushCachedIcons |
|
644 |
" |
|
645 |
||
646 |
<resource: #image> |
|
647 |
||
648 |
^Icon |
|
649 |
constantNamed:'ImageEditor class brighterIcon' |
|
650 |
ifAbsentPut:[(Depth8Image width:14 height:14) bits:(ByteArray fromPackedString:' |
|
651 |
@PDA@PDA@PDA@PDA@PG%9^W%9^W%;>?/;>?/;>W%9^W%9^W/;>?/;>?/9^W%9^W%A [/;>?/;>?%9^W%9^TFA.?/;>?/;>W%9^W%9PXF;>?/;>?/9^W%A XF |
|
652 |
A XFA [/;>?%9^TFA XFA XFA.?/;>W%9^W%9PXF;>?/;>?/9^W%9^W%A [/;>?/;>?%9^W%9^TFA.?/;>?/;>W%9^W%9^W/;>?/;>?/9^W%9^W%9^?/;>?/ |
|
653 |
;><A@PDA@PDA@PDA@PDA@P@a') |
|
654 |
colorMapFromArray:#[88 88 88 0 0 0 255 0 0 0 255 0 0 0 255 0 255 255 255 255 127 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127 127 127 127 170 170 170 0 0 51 0 0 102 0 0 153 0 0 204 0 51 0 0 51 51 0 51 102 0 51 153 0 51 204 0 51 255 0 102 0 0 102 51 0 102 102 0 102 153 0 102 204 0 102 255 0 153 0 0 153 51 0 153 102 0 153 153 0 153 204 0 153 255 0 204 0 0 204 51 0 204 102 0 204 153 0 204 204 0 204 255 0 255 51 0 255 102 0 255 153 0 255 204 51 0 0 51 0 51 51 0 102 51 0 153 51 0 204 51 0 255 51 51 0 51 51 51 51 51 102 51 51 153 51 51 204 51 51 255 51 102 0 51 102 51 51 102 102 51 102 153 51 102 204 51 102 255 51 153 0 51 153 51 51 153 102 51 153 153 51 153 204 51 153 255 51 204 0 51 204 51 51 204 102 51 204 153 51 204 204 51 204 255 51 255 0 51 255 51 51 255 102 51 255 153 51 255 204 51 255 255 102 0 0 102 0 51 102 0 102 102 0 153 102 0 204 102 0 255 102 51 0 102 51 51 102 51 102 102 51 153 102 51 204 102 51 255 102 102 0 102 102 51 102 102 102 102 102 153 102 102 204 102 102 255 102 153 0 102 153 51 102 153 102 102 153 153 102 153 204 102 153 255 102 204 0 102 204 51 102 204 102 102 204 153 102 204 204 102 204 255 102 255 0 102 255 51 102 255 102 102 255 153 102 255 204 102 255 255 153 0 0 153 0 51 153 0 102 153 0 153 153 0 204 153 0 255 153 51 0 153 51 51 153 51 102 153 51 153 153 51 204 153 51 255 153 102 0 153 102 51 153 102 102 153 102 153 153 102 204 153 102 255 153 153 0 153 153 51 153 153 102 153 153 153 153 153 204 153 153 255 153 204 0 153 204 51 153 204 102 153 204 153 153 204 204 153 204 255 153 255 0 153 255 51 153 255 102 153 255 153 153 255 204 153 255 255 204 0 0 204 0 51 204 0 102 204 0 153 204 0 204 204 0 255 204 51 0 204 51 51 204 51 102 204 51 153 204 51 204 204 51 255 204 102 0 204 102 51 204 102 102 204 102 153 204 102 204 204 102 255 204 153 0 204 153 51 204 153 102 204 153 153 204 153 204 204 153 255 204 204 0 204 204 51 204 204 102 204 204 153 204 204 204 204 204 255 204 255 0 204 255 51 204 255 102 204 255 153 204 255 204 204 255 255 255 0 51 255 0 102 255 0 153 255 0 204 255 51 0 255 51 51 255 51 102 255 51 153 255 51 204 255 51 255 255 102 0 255 102 51 255 102 102 255 102 153 255 102 204 255 102 255 255 153 0 255 153 51 255 153 102 255 153 153 255 153 204 255 153 255 255 204 0 255 204 51 255 204 102 255 204 153 255 204 204 255 204 255 255 255 51 255 255 102 255 255 153 255 255 204 255 255 255 9 9 9 19 19 19 29 29 29 39 39 39 49 49 49 58 58 58 68 68 68 78 78 78 98 98 98 107 107 107 117 117 117 137 137 137 147 147 147 156 156 156 166 166 166] |
|
655 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'@@C??O?<??3??O?<??3??O?<??3??O?<??0@@@@a'); yourself); yourself] |
|
656 |
! |
|
657 |
||
2272 | 658 |
circleIcon |
659 |
"This resource specification was automatically generated |
|
660 |
by the ImageEditor of ST/X." |
|
3442 | 661 |
|
2272 | 662 |
"Do not manually edit this!! If it is corrupted, |
663 |
the ImageEditor may not be able to read the specification." |
|
3442 | 664 |
|
2272 | 665 |
" |
666 |
self circleIcon inspect |
|
667 |
ImageEditor openOnClass:self andSelector:#circleIcon |
|
3442 | 668 |
Icon flushCachedIcons |
669 |
" |
|
670 |
||
671 |
<resource: #image> |
|
672 |
||
673 |
^Icon |
|
674 |
constantNamed:'ImageEditor class circleIcon' |
|
675 |
ifAbsentPut:[(Depth1Image width:14 height:14) bits:(ByteArray fromPackedString:'@@@@@@QAAD@@@C@X@@@@@@@CLA @@@Q@AD@@@@@a') |
|
676 |
colorMapFromArray:#[0 0 0 127 127 127] |
|
677 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'@@@@@@_@CF@PDC@XH@ BB@HLA PD@1 A<@@@@@a'); yourself); yourself] |
|
2272 | 678 |
! |
679 |
||
1637 | 680 |
copyIcon |
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
681 |
<resource: #image> |
1637 | 682 |
"This resource specification was automatically generated |
683 |
by the ImageEditor of ST/X." |
|
684 |
"Do not manually edit this!! If it is corrupted, |
|
685 |
the ImageEditor may not be able to read the specification." |
|
686 |
" |
|
687 |
self copyIcon inspect |
|
688 |
ImageEditor openOnClass:self andSelector:#copyIcon |
|
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
689 |
Icon flushCachedIcons" |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
690 |
|
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
691 |
^ Icon constantNamed:'ImageEditor class copyIcon' |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
692 |
ifAbsentPut:[ |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
693 |
(Depth2Image new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
694 |
width:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
695 |
height:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
696 |
photometric:(#palette); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
697 |
bitsPerSample:(#( 2 )); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
698 |
samplesPerPixel:(1); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
699 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
700 |
fromPackedString:'@@@@@@@@@@@** @@J)UUTB*Z*)@*&**PJ)**$B*Z*)@*&**PJ)**$@@Z*)@@F**P@AUUT@@@@@@b'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
701 |
colorMapFromArray:#[ 0 0 0 0 0 128 255 255 255 ]; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
702 |
mask:((ImageMask new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
703 |
width:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
704 |
height:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
705 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
706 |
fromPackedString:'@@C? O>@??3??O?<??3??O?<??3??@_<A?0@@@@a'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
707 |
yourself); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
708 |
yourself |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
709 |
] |
1637 | 710 |
! |
711 |
||
3417 | 712 |
cropSubImageIcon |
713 |
"This resource specification was automatically generated |
|
714 |
by the ImageEditor of ST/X." |
|
715 |
||
716 |
"Do not manually edit this!! If it is corrupted, |
|
717 |
the ImageEditor may not be able to read the specification." |
|
718 |
||
719 |
" |
|
720 |
self cropSubImageIcon inspect |
|
721 |
ImageEditor openOnClass:self andSelector:#cropSubImageIcon |
|
722 |
Icon flushCachedIcons |
|
723 |
" |
|
724 |
||
725 |
<resource: #image> |
|
726 |
||
727 |
^Icon |
|
728 |
constantNamed:'ImageEditor class cropSubImageIcon' |
|
729 |
ifAbsentPut:[(Depth2Image width:14 height:14) bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@J**@@BUU @@%UX@@IUV@@BUU @@%UX@@J**@@@@@@@@@@@@@@@@@@b') |
|
730 |
colorMapFromArray:#[0 0 0 255 255 255 127 127 127 0 255 0] |
|
3464 | 731 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'??2@AH@D.@R?9K?$''>R_9I?$''?R_=HA4 @S??@@a'); yourself); yourself] |
3417 | 732 |
! |
733 |
||
3419 | 734 |
darkerIcon |
735 |
"This resource specification was automatically generated |
|
736 |
by the ImageEditor of ST/X." |
|
737 |
||
738 |
"Do not manually edit this!! If it is corrupted, |
|
739 |
the ImageEditor may not be able to read the specification." |
|
740 |
||
741 |
" |
|
742 |
self darkerIcon inspect |
|
743 |
ImageEditor openOnClass:self andSelector:#darkerIcon |
|
744 |
Icon flushCachedIcons |
|
745 |
" |
|
746 |
||
747 |
<resource: #image> |
|
748 |
||
749 |
^Icon |
|
750 |
constantNamed:'ImageEditor class darkerIcon' |
|
751 |
ifAbsentPut:[(Depth8Image width:14 height:14) bits:(ByteArray fromPackedString:' |
|
752 |
@PDA@PDA@PDA@PDA@PG/;>?/;>?/9^W%9^W%9^?/;>?/;>?%9^W%9^W%;>?/;>?/;>W%9^W%9^W/;>?/;>?/9^W%9^W%9^?/;>?/;>?%9^W%9^W%;>?/A XF |
|
753 |
A XFA [%9^W/;><FA XFA XFA.W%9^?/;>?/;>?%9^W%9^W%;>?/;>?/;>W%9^W%9^W/;>?/;>?/9^W%9^W%9^?/;>?/;>?%9^W%9^W%;>?/;>?/;>W%9^W% |
|
754 |
9^TA@PDA@PDA@PDA@PDA@P@a') |
|
755 |
colorMapFromArray:#[88 88 88 0 0 0 255 0 0 0 255 0 0 0 255 0 255 255 255 255 127 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127 127 127 127 170 170 170 0 0 51 0 0 102 0 0 153 0 0 204 0 51 0 0 51 51 0 51 102 0 51 153 0 51 204 0 51 255 0 102 0 0 102 51 0 102 102 0 102 153 0 102 204 0 102 255 0 153 0 0 153 51 0 153 102 0 153 153 0 153 204 0 153 255 0 204 0 0 204 51 0 204 102 0 204 153 0 204 204 0 204 255 0 255 51 0 255 102 0 255 153 0 255 204 51 0 0 51 0 51 51 0 102 51 0 153 51 0 204 51 0 255 51 51 0 51 51 51 51 51 102 51 51 153 51 51 204 51 51 255 51 102 0 51 102 51 51 102 102 51 102 153 51 102 204 51 102 255 51 153 0 51 153 51 51 153 102 51 153 153 51 153 204 51 153 255 51 204 0 51 204 51 51 204 102 51 204 153 51 204 204 51 204 255 51 255 0 51 255 51 51 255 102 51 255 153 51 255 204 51 255 255 102 0 0 102 0 51 102 0 102 102 0 153 102 0 204 102 0 255 102 51 0 102 51 51 102 51 102 102 51 153 102 51 204 102 51 255 102 102 0 102 102 51 102 102 102 102 102 153 102 102 204 102 102 255 102 153 0 102 153 51 102 153 102 102 153 153 102 153 204 102 153 255 102 204 0 102 204 51 102 204 102 102 204 153 102 204 204 102 204 255 102 255 0 102 255 51 102 255 102 102 255 153 102 255 204 102 255 255 153 0 0 153 0 51 153 0 102 153 0 153 153 0 204 153 0 255 153 51 0 153 51 51 153 51 102 153 51 153 153 51 204 153 51 255 153 102 0 153 102 51 153 102 102 153 102 153 153 102 204 153 102 255 153 153 0 153 153 51 153 153 102 153 153 153 153 153 204 153 153 255 153 204 0 153 204 51 153 204 102 153 204 153 153 204 204 153 204 255 153 255 0 153 255 51 153 255 102 153 255 153 153 255 204 153 255 255 204 0 0 204 0 51 204 0 102 204 0 153 204 0 204 204 0 255 204 51 0 204 51 51 204 51 102 204 51 153 204 51 204 204 51 255 204 102 0 204 102 51 204 102 102 204 102 153 204 102 204 204 102 255 204 153 0 204 153 51 204 153 102 204 153 153 204 153 204 204 153 255 204 204 0 204 204 51 204 204 102 204 204 153 204 204 204 204 204 255 204 255 0 204 255 51 204 255 102 204 255 153 204 255 204 204 255 255 255 0 51 255 0 102 255 0 153 255 0 204 255 51 0 255 51 51 255 51 102 255 51 153 255 51 204 255 51 255 255 102 0 255 102 51 255 102 102 255 102 153 255 102 204 255 102 255 255 153 0 255 153 51 255 153 102 255 153 153 255 153 204 255 153 255 255 204 0 255 204 51 255 204 102 255 204 153 255 204 204 255 204 255 255 255 51 255 255 102 255 255 153 255 255 204 255 255 255 9 9 9 19 19 19 29 29 29 39 39 39 49 49 49 58 58 58 68 68 68 78 78 78 98 98 98 107 107 107 117 117 117 137 137 137 147 147 147 156 156 156 166 166 166] |
|
756 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'@@C??O?<??3??O?<??3??O?<??3??O?<??0@@@@a'); yourself); yourself] |
|
757 |
! |
|
758 |
||
2155 | 759 |
defaultIcon |
760 |
<resource: #programImage> |
|
761 |
||
762 |
^ ToolbarIconLibrary startImageEditorIcon |
|
763 |
! |
|
764 |
||
3419 | 765 |
editIcon |
766 |
"This resource specification was automatically generated |
|
767 |
by the ImageEditor of ST/X." |
|
768 |
||
769 |
"Do not manually edit this!! If it is corrupted, |
|
770 |
the ImageEditor may not be able to read the specification." |
|
771 |
||
772 |
" |
|
773 |
self editIcon inspect |
|
774 |
ImageEditor openOnClass:self andSelector:#editIcon |
|
775 |
Icon flushCachedIcons |
|
776 |
" |
|
777 |
||
778 |
<resource: #image> |
|
779 |
||
780 |
^Icon |
|
781 |
constantNamed:'ImageEditor class editIcon' |
|
782 |
ifAbsentPut:[(Depth8Image width:15 height:16) bits:(ByteArray fromPackedString:' |
|
783 |
@@@@@@@3V41AJ0T@@@@@@@@@@B1(TD4>EP@@@@@@@@@@@CA!!S4X2D@@@@@@@@@@@LV)XTTHX@@@@@@@@@@@@K6UTS$LR@@@@@@@@@@@9OE9VRQ8@@@@@@@@@ |
|
784 |
@@@8Z5%WR!!P@@@@@@@@@@B8;X5)RG2@@@@@@@@@@@CY-W51SF @@@@@@@@@@@B5)XE4%E0@@@@@@@@@@@B%,Y3TO@@@@@@@@@@@@@BM,M04@@@@@@@@@@@@@ |
|
785 |
@@ IDP@@@@@@@@@@@@@@@@\K@@@@@@@@@@@@@@@@@A,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') |
|
786 |
colorMapFromArray:#[0 0 0 0 137 0 0 206 0 87 87 87 133 60 36 145 109 112 155 31 0 160 115 98 161 124 106 163 140 130 166 46 5 169 113 95 174 218 230 182 93 58 183 59 8 186 100 65 192 147 138 193 129 103 193 132 116 195 100 52 195 120 93 197 82 32 204 208 220 205 177 176 207 90 27 210 109 64 210 140 105 213 175 169 213 217 227 215 172 138 220 114 42 222 120 43 222 209 212 223 137 33 223 153 96 226 180 137 228 90 9 228 142 66 232 174 56 234 184 145 240 178 78 241 195 142 241 212 187 242 102 12 242 177 95 245 202 137 245 209 172 247 181 30 247 183 8 247 198 128 248 122 26 248 194 1 248 198 0 248 201 137 248 203 113 248 214 181 249 193 57 249 210 160 250 206 0 253 222 69 253 226 47 254 116 14 254 128 21 254 136 5 254 141 47 254 144 8 254 147 36 254 147 47 254 158 0 254 158 1 254 159 21 254 161 10 254 162 0 254 165 54 254 165 69 254 167 2 254 167 5 254 171 10 254 176 36 254 177 17 254 178 11 254 181 24 254 184 75 254 184 94 254 187 34 254 191 0 254 191 42 254 191 54 254 194 26 254 197 55 254 201 65 254 203 3 254 203 78 254 203 97 254 207 47 254 209 81 254 212 90 254 213 16 254 214 81 254 216 73 254 219 0 254 220 37 254 223 0 254 225 166 254 226 7 254 226 119 254 231 26 254 231 65 254 231 201 254 239 98] |
|
787 |
mask:((Depth1Image width:15 height:16) bits:(ByteArray fromPackedString:'A>@O0@?@G8@_ C<@O0A?@G8@_ A<@G @\@A @D@@@@@b'); yourself); yourself] |
|
788 |
! |
|
789 |
||
3418 | 790 |
emptyIcon |
791 |
"This resource specification was automatically generated |
|
792 |
by the ImageEditor of ST/X." |
|
793 |
||
794 |
"Do not manually edit this!! If it is corrupted, |
|
795 |
the ImageEditor may not be able to read the specification." |
|
796 |
||
797 |
" |
|
798 |
self emptyIcon inspect |
|
799 |
ImageEditor openOnClass:self andSelector:#emptyIcon |
|
800 |
Icon flushCachedIcons |
|
801 |
" |
|
802 |
||
803 |
<resource: #image> |
|
804 |
||
805 |
^Icon |
|
806 |
constantNamed:'ImageEditor class emptyIcon' |
|
807 |
ifAbsentPut:[(Depth4Image width:14 height:14) bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
808 |
@@@@@@@@@@@b') |
|
809 |
colorMapFromArray:#[0 0 0] |
|
810 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); yourself); yourself] |
|
811 |
! |
|
812 |
||
813 |
emptyIcon2 |
|
814 |
"This resource specification was automatically generated |
|
815 |
by the ImageEditor of ST/X." |
|
816 |
||
817 |
"Do not manually edit this!! If it is corrupted, |
|
818 |
the ImageEditor may not be able to read the specification." |
|
819 |
||
820 |
" |
|
821 |
self emptyIcon2 inspect |
|
822 |
ImageEditor openOnClass:self andSelector:#emptyIcon2 |
|
823 |
Icon flushCachedIcons |
|
824 |
" |
|
825 |
||
826 |
<resource: #image> |
|
827 |
||
828 |
^Icon |
|
829 |
constantNamed:'ImageEditor class emptyIcon2' |
|
830 |
ifAbsentPut:[(Depth4Image width:28 height:14) bits:(ByteArray fromPackedString:' |
|
831 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
832 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
833 |
@@@@@@@@@@@@@@@@@@@@@@@a') |
|
834 |
colorMapFromArray:#[0 0 0] |
|
835 |
mask:((Depth1Image width:28 height:14) bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b'); yourself); yourself] |
|
836 |
! |
|
837 |
||
3405 | 838 |
fillCircleIcon |
839 |
"This resource specification was automatically generated |
|
840 |
by the ImageEditor of ST/X." |
|
841 |
||
842 |
"Do not manually edit this!! If it is corrupted, |
|
843 |
the ImageEditor may not be able to read the specification." |
|
844 |
||
845 |
" |
|
846 |
self fillCircleIcon inspect |
|
847 |
ImageEditor openOnClass:self andSelector:#fillCircleIcon |
|
848 |
Icon flushCachedIcons |
|
849 |
" |
|
850 |
||
851 |
<resource: #image> |
|
852 |
||
853 |
^Icon |
|
854 |
constantNamed:'ImageEditor class fillCircleIcon' |
|
3443 | 855 |
ifAbsentPut:[(Depth1Image width:14 height:14) bits:(ByteArray fromPackedString:'@@@@@@QA@@@@@B@H@@@@@@@CH@ @@@@@AD@@@@@a') |
856 |
colorMapFromArray:#[0 0 0 127 127 127] |
|
857 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'@@@@@@_@C>@_<C?8O? ?>C?8O? _<@? A<@@@@@a'); yourself); yourself] |
|
3405 | 858 |
! |
859 |
||
3418 | 860 |
fillDiagonalGradientRectIcon |
861 |
"This resource specification was automatically generated |
|
862 |
by the ImageEditor of ST/X." |
|
863 |
||
864 |
"Do not manually edit this!! If it is corrupted, |
|
865 |
the ImageEditor may not be able to read the specification." |
|
866 |
||
867 |
" |
|
868 |
self fillDiagonalGradientRectIcon inspect |
|
869 |
ImageEditor openOnClass:self andSelector:#fillDiagonalGradientRectIcon |
|
870 |
Icon flushCachedIcons |
|
871 |
" |
|
872 |
||
873 |
<resource: #image> |
|
874 |
||
875 |
^Icon |
|
876 |
constantNamed:'ImageEditor class fillDiagonalGradientRectIcon' |
|
877 |
ifAbsentPut:[(Depth4Image width:14 height:14) bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@QDQDQD@@@DQDQDQ@@@ADH"H"H@@@QBH"H"@@@DP"L3L0@@ADH#L3L@@@QBH3DQ@@@DP"L1DP@@ADH#LQD@@@@@@@@@ |
|
878 |
@@@@@@@@@@@b') |
|
879 |
colorMapFromArray:#[0 0 0 255 0 0 127 0 0 191 0 0 91 0 0] |
|
880 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'@@@@@C?0O?@?<C?0O?@?<C?0O?@?<C?0@@@@@@@a'); yourself); yourself] |
|
881 |
! |
|
882 |
||
2871 | 883 |
fillGradientRectIcon |
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
884 |
<resource: #image> |
2871 | 885 |
"This resource specification was automatically generated |
886 |
by the ImageEditor of ST/X." |
|
887 |
"Do not manually edit this!! If it is corrupted, |
|
888 |
the ImageEditor may not be able to read the specification." |
|
889 |
" |
|
890 |
self fillGradientRectIcon inspect |
|
891 |
ImageEditor openOnClass:self andSelector:#fillGradientRectIcon |
|
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
892 |
Icon flushCachedIcons" |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
893 |
|
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
894 |
^ Icon constantNamed:'ImageEditor class fillGradientRectIcon' |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
895 |
ifAbsentPut:[ |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
896 |
(Depth4Image new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
897 |
width:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
898 |
height:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
899 |
photometric:(#palette); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
900 |
bitsPerSample:(#[ 4 ]); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
901 |
samplesPerPixel:(1); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
902 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
903 |
fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ADQDQDQ@@@QDQDQDP@@BH"H"H"@@@"H"H"H @@L3L3L3L@@CL3L3L3@@@QDQDQDP@@DQDQDQD@@@@@@@@@ |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
904 |
@@@@@@@@@@@b'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
905 |
colorMapFromArray:#[ 0 0 0 255 0 0 127 0 0 191 0 0 63 0 0 ]; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
906 |
mask:((ImageMask new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
907 |
width:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
908 |
height:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
909 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
910 |
fromPackedString:'@@@@@C?0O?@?<C?0O?@?<C?0O?@?<C?0@@@@@@@a'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
911 |
yourself); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
912 |
yourself |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
913 |
] |
2871 | 914 |
! |
915 |
||
916 |
fillHorizontalGradientRectIcon |
|
917 |
"This resource specification was automatically generated |
|
918 |
by the ImageEditor of ST/X." |
|
3418 | 919 |
|
2871 | 920 |
"Do not manually edit this!! If it is corrupted, |
921 |
the ImageEditor may not be able to read the specification." |
|
3418 | 922 |
|
2871 | 923 |
" |
924 |
self fillHorizontalGradientRectIcon inspect |
|
925 |
ImageEditor openOnClass:self andSelector:#fillHorizontalGradientRectIcon |
|
3418 | 926 |
Icon flushCachedIcons |
927 |
" |
|
928 |
||
929 |
<resource: #image> |
|
930 |
||
931 |
^Icon |
|
932 |
constantNamed:'ImageEditor class fillHorizontalGradientRectIcon' |
|
933 |
ifAbsentPut:[(Depth4Image width:14 height:14) bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@ADH#LQD@@@QBH3DQ@@@DP"L1DP@@ADH#LQD@@@QBH3DQ@@@DP"L1DP@@ADH#LQD@@@QBH3DQ@@@DP"L1DP@@ADH#LQD@@@@@@@@@ |
|
934 |
@@@@@@@@@@@b') |
|
935 |
colorMapFromArray:#[0 0 0 255 0 0 127 0 0 191 0 0 91 0 0] |
|
936 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'@@@@@C?0O?@?<C?0O?@?<C?0O?@?<C?0@@@@@@@a'); yourself); yourself] |
|
2871 | 937 |
! |
938 |
||
1637 | 939 |
fillIcon |
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
940 |
<resource: #image> |
1637 | 941 |
"This resource specification was automatically generated |
942 |
by the ImageEditor of ST/X." |
|
943 |
"Do not manually edit this!! If it is corrupted, |
|
944 |
the ImageEditor may not be able to read the specification." |
|
945 |
" |
|
946 |
self fillIcon inspect |
|
947 |
ImageEditor openOnClass:self andSelector:#fillIcon |
|
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
948 |
Icon flushCachedIcons" |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
949 |
|
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
950 |
^ Icon constantNamed:'ImageEditor class fillIcon' |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
951 |
ifAbsentPut:[ |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
952 |
(Depth2Image new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
953 |
width:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
954 |
height:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
955 |
photometric:(#palette); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
956 |
bitsPerSample:(#( 2 )); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
957 |
samplesPerPixel:(1); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
958 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
959 |
fromPackedString:'@@@@@@@@@@@@@ @@@@*H@@D*(@@DUUP@EAUU@AAEU@@@@U@@DDA@@@@@@@@PP@@@@@@@@@@@@@@b'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
960 |
colorMapFromArray:#[ 0 0 0 255 0 0 255 255 255 ]; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
961 |
mask:((ImageMask new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
962 |
width:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
963 |
height:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
964 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
965 |
fromPackedString:'C @Q@BN@I<@?8C?0[?!!G<@O P\@@ D@@@@@@@@@a'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
966 |
yourself); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
967 |
yourself |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
968 |
] |
1637 | 969 |
! |
970 |
||
971 |
fillRectIcon |
|
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
972 |
<resource: #image> |
1637 | 973 |
"This resource specification was automatically generated |
974 |
by the ImageEditor of ST/X." |
|
975 |
"Do not manually edit this!! If it is corrupted, |
|
976 |
the ImageEditor may not be able to read the specification." |
|
977 |
" |
|
978 |
self fillRectIcon inspect |
|
979 |
ImageEditor openOnClass:self andSelector:#fillRectIcon |
|
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
980 |
Icon flushCachedIcons" |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
981 |
|
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
982 |
^ Icon constantNamed:'ImageEditor class fillRectIcon' |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
983 |
ifAbsentPut:[ |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
984 |
(Depth1Image new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
985 |
width:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
986 |
height:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
987 |
photometric:(#palette); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
988 |
bitsPerSample:(#( 1 )); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
989 |
samplesPerPixel:(1); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
990 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
991 |
fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@@@@@@@@@@@@D@@@@a'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
992 |
colorMapFromArray:#[ 0 0 0 255 0 0 ]; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
993 |
mask:((ImageMask new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
994 |
width:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
995 |
height:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
996 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
997 |
fromPackedString:'@@@@@C?0O?@?<C?0O?@?<C?0O?@?<C?0@@@@@@@a'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
998 |
yourself); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
999 |
yourself |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1000 |
] |
1637 | 1001 |
! |
1002 |
||
2871 | 1003 |
fillVerticalGradientRectIcon |
1004 |
"This resource specification was automatically generated |
|
1005 |
by the ImageEditor of ST/X." |
|
3418 | 1006 |
|
2871 | 1007 |
"Do not manually edit this!! If it is corrupted, |
1008 |
the ImageEditor may not be able to read the specification." |
|
3418 | 1009 |
|
2871 | 1010 |
" |
3418 | 1011 |
self fillVerticalGradientRectIcon inspect |
1012 |
ImageEditor openOnClass:self andSelector:#fillVerticalGradientRectIcon |
|
1013 |
Icon flushCachedIcons |
|
1014 |
" |
|
1015 |
||
1016 |
<resource: #image> |
|
1017 |
||
1018 |
^Icon |
|
1019 |
constantNamed:'ImageEditor class fillVerticalGradientRectIcon' |
|
1020 |
ifAbsentPut:[(Depth4Image width:14 height:14) bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@DQDQDQD@@ADQDQDQ@@@H"H"H"H@@BH"H"H"@@@3L3L3L0@@L3L3L3L@@ADQDQDQ@@@QDQDQDP@@DQDQDQD@@@@@@@@@ |
|
1021 |
@@@@@@@@@@@b') |
|
1022 |
colorMapFromArray:#[0 0 0 255 0 0 127 0 0 191 0 0 91 0 0] |
|
1023 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'@@@@@C?0O?@?<C?0O?@?<C?0O?@?<C?0@@@@@@@a'); yourself); yourself] |
|
2871 | 1024 |
! |
1025 |
||
2837 | 1026 |
flipHorizontalIcon |
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1027 |
<resource: #image> |
2837 | 1028 |
"This resource specification was automatically generated |
1029 |
by the ImageEditor of ST/X." |
|
1030 |
"Do not manually edit this!! If it is corrupted, |
|
1031 |
the ImageEditor may not be able to read the specification." |
|
1032 |
" |
|
1033 |
self flipHorizontalIcon inspect |
|
1034 |
ImageEditor openOnClass:self andSelector:#flipHorizontalIcon |
|
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1035 |
Icon flushCachedIcons" |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1036 |
|
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1037 |
^ Icon constantNamed:'ImageEditor class flipHorizontalIcon' |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1038 |
ifAbsentPut:[ |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1039 |
(Depth1Image new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1040 |
width:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1041 |
height:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1042 |
photometric:(#palette); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1043 |
bitsPerSample:(#( 1 )); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1044 |
samplesPerPixel:(1); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1045 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1046 |
fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1047 |
colorMapFromArray:#[ 0 0 0 ]; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1048 |
mask:((ImageMask new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1049 |
width:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1050 |
height:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1051 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1052 |
fromPackedString:'@@@A@C?8HP )JC$8_?1??C$8JR !!BC?8@P@@@@@a'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1053 |
yourself); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1054 |
yourself |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1055 |
] |
2837 | 1056 |
! |
1057 |
||
1058 |
flipVerticalIcon |
|
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1059 |
<resource: #image> |
2837 | 1060 |
"This resource specification was automatically generated |
1061 |
by the ImageEditor of ST/X." |
|
1062 |
"Do not manually edit this!! If it is corrupted, |
|
1063 |
the ImageEditor may not be able to read the specification." |
|
1064 |
" |
|
1065 |
self flipVerticalIcon inspect |
|
1066 |
ImageEditor openOnClass:self andSelector:#flipVerticalIcon |
|
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1067 |
Icon flushCachedIcons" |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1068 |
|
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1069 |
^ Icon constantNamed:'ImageEditor class flipVerticalIcon' |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1070 |
ifAbsentPut:[ |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1071 |
(Depth1Image new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1072 |
width:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1073 |
height:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1074 |
photometric:(#palette); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1075 |
bitsPerSample:(#( 1 )); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1076 |
samplesPerPixel:(1); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1077 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1078 |
fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1079 |
colorMapFromArray:#[ 0 0 0 ]; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1080 |
mask:((ImageMask new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1081 |
width:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1082 |
height:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1083 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1084 |
fromPackedString:'@@@C@C?0I9@/4BLPH1A?>BLPH1@/4B^PO?@C@@@a'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1085 |
yourself); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1086 |
yourself |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1087 |
] |
2837 | 1088 |
! |
1089 |
||
737 | 1090 |
leftMouseKeyIcon |
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1091 |
<resource: #image> |
737 | 1092 |
"This resource specification was automatically generated |
1093 |
by the ImageEditor of ST/X." |
|
1094 |
"Do not manually edit this!! If it is corrupted, |
|
1095 |
the ImageEditor may not be able to read the specification." |
|
1096 |
" |
|
1405 | 1097 |
self leftMouseKeyIcon inspect |
737 | 1098 |
ImageEditor openOnClass:self andSelector:#leftMouseKeyIcon |
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1099 |
Icon flushCachedIcons" |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1100 |
|
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1101 |
^ Icon constantNamed:'ImageEditor class leftMouseKeyIcon' |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1102 |
ifAbsentPut:[ |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1103 |
(Depth2Image new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1104 |
width:16; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1105 |
height:16; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1106 |
photometric:(#palette); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1107 |
bitsPerSample:(#( 2 )); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1108 |
samplesPerPixel:(1); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1109 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1110 |
fromPackedString:'@@@@@@@@@@@@@@@@@EJJ@@AR" @@T((@@@@@@@B** @@**(@@J**@@B** @@**(@@J**@@@**@@@@@@@@@@@@@@a'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1111 |
colorMapFromArray:#[ 0 0 0 255 0 0 255 255 255 ]; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1112 |
mask:((ImageMask new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1113 |
width:16; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1114 |
height:16; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1115 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1116 |
fromPackedString:'@@@@@@?0G? _>A?8G? _>A?8G? _>A?8G? O<@_ @@@b'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1117 |
yourself); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1118 |
yourself |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1119 |
] |
1433 | 1120 |
! |
737 | 1121 |
|
3405 | 1122 |
maskOutsideCircleIcon |
1123 |
"This resource specification was automatically generated |
|
1124 |
by the ImageEditor of ST/X." |
|
1125 |
||
1126 |
"Do not manually edit this!! If it is corrupted, |
|
1127 |
the ImageEditor may not be able to read the specification." |
|
1128 |
||
1129 |
" |
|
1130 |
self maskOutsideCircleIcon inspect |
|
1131 |
ImageEditor openOnClass:self andSelector:#maskOutsideCircleIcon |
|
1132 |
Icon flushCachedIcons |
|
1133 |
" |
|
1134 |
||
1135 |
<resource: #image> |
|
1136 |
||
1137 |
^Icon |
|
1138 |
constantNamed:'ImageEditor class maskOutsideCircleIcon' |
|
1139 |
ifAbsentPut:[(Depth1Image width:14 height:14) bits:(ByteArray fromPackedString:'??3??O1=<A3 CN@L0@S@AL@G8@3 CO@\?G3??@@a') |
|
3407 | 1140 |
colorMapFromArray:#[0 0 0 255 127 127] |
3405 | 1141 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'??3??O?<??3??O?<??3??O?<??3??O?<??3??@@a'); yourself); yourself] |
1142 |
! |
|
1143 |
||
1144 |
maskOutsideRectangleIcon |
|
1145 |
"This resource specification was automatically generated |
|
1146 |
by the ImageEditor of ST/X." |
|
1147 |
||
1148 |
"Do not manually edit this!! If it is corrupted, |
|
1149 |
the ImageEditor may not be able to read the specification." |
|
1150 |
||
1151 |
" |
|
1152 |
self maskOutsideRectangleIcon inspect |
|
1153 |
ImageEditor openOnClass:self andSelector:#maskOutsideRectangleIcon |
|
1154 |
Icon flushCachedIcons |
|
1155 |
" |
|
1156 |
||
1157 |
<resource: #image> |
|
1158 |
||
1159 |
^Icon |
|
1160 |
constantNamed:'ImageEditor class maskOutsideRectangleIcon' |
|
1161 |
ifAbsentPut:[(Depth1Image width:14 height:14) bits:(ByteArray fromPackedString:'??3??L@M0@3@CL@L0@3@CL@L0@3@CL@L??7??@@a') |
|
3407 | 1162 |
colorMapFromArray:#[0 0 0 255 127 127] |
3405 | 1163 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'??3??O?<??3??O?<??3??O?<??3??O?<??3??@@a'); yourself); yourself] |
1164 |
! |
|
1165 |
||
1637 | 1166 |
pasteIcon |
1167 |
"This resource specification was automatically generated |
|
1168 |
by the ImageEditor of ST/X." |
|
3561 | 1169 |
|
1637 | 1170 |
"Do not manually edit this!! If it is corrupted, |
1171 |
the ImageEditor may not be able to read the specification." |
|
3561 | 1172 |
|
1637 | 1173 |
" |
1174 |
self pasteIcon inspect |
|
1175 |
ImageEditor openOnClass:self andSelector:#pasteIcon |
|
3561 | 1176 |
Icon flushCachedIcons |
1177 |
" |
|
1178 |
||
1179 |
<resource: #image> |
|
1180 |
||
1181 |
^Icon |
|
1182 |
constantNamed:'ImageEditor class pasteIcon' |
|
1183 |
ifAbsentPut:[(Depth8Image width:14 height:14) bits:(ByteArray fromPackedString:' |
|
1184 |
:N#(:N#(:N#(:N#(:N#(:N#(:O#8:N#(:N#(:N#5>^#8:N#8:OW9:N#(:O''(=/[6=/[6:OW(:N#(=^#(:N#(:N#(>^#(:N#9=_''5>_W9=_''5:N#(:@DA@PDA |
|
1185 |
@PDA=_''(@@C(@_[6= @@@@@@@@@@@N A=/[6@@XFA XFA @@:@G6=/X@A X@@@XF@@C(@_[6= @F@@@@@@X@@N A=/[6@@XF@@@FA @@@@DA@PD@A XFA XF |
|
1186 |
@@@@@@@@@@@@@@@@@@@@@@@a') |
|
1187 |
colorMapFromArray:#[0 0 0 0 0 128 128 128 0 128 128 128 212 208 200 255 255 0 255 255 255 0 0 51 0 0 102 0 0 153 0 0 204 0 0 255 0 51 0 0 51 51 0 51 102 0 51 153 0 51 204 0 51 255 0 102 0 0 102 51 0 102 102 0 102 153 0 102 204 0 102 255 0 153 0 0 153 51 0 153 102 0 153 153 0 153 204 0 153 255 0 204 0 0 204 51 0 204 102 0 204 153 0 204 204 0 204 255 0 255 0 0 255 51 0 255 102 0 255 153 0 255 204 0 255 255 51 0 0 51 0 51 51 0 102 51 0 153 51 0 204 51 0 255 51 51 0 51 51 51 51 51 102 51 51 153 51 51 204 51 51 255 51 102 0 51 102 51 51 102 102 51 102 153 51 102 204 51 102 255 51 153 0 51 153 51 51 153 102 51 153 153 51 153 204 51 153 255 51 204 0 51 204 51 51 204 102 51 204 153 51 204 204 51 204 255 51 255 0 51 255 51 51 255 102 51 255 153 51 255 204 51 255 255 102 0 0 102 0 51 102 0 102 102 0 153 102 0 204 102 0 255 102 51 0 102 51 51 102 51 102 102 51 153 102 51 204 102 51 255 102 102 0 102 102 51 102 102 102 102 102 153 102 102 204 102 102 255 102 153 0 102 153 51 102 153 102 102 153 153 102 153 204 102 153 255 102 204 0 102 204 51 102 204 102 102 204 153 102 204 204 102 204 255 102 255 0 102 255 51 102 255 102 102 255 153 102 255 204 102 255 255 153 0 0 153 0 51 153 0 102 153 0 153 153 0 204 153 0 255 153 51 0 153 51 51 153 51 102 153 51 153 153 51 204 153 51 255 153 102 0 153 102 51 153 102 102 153 102 153 153 102 204 153 102 255 153 153 0 153 153 51 153 153 102 153 153 153 153 153 204 153 153 255 153 204 0 153 204 51 153 204 102 153 204 153 153 204 204 153 204 255 153 255 0 153 255 51 153 255 102 153 255 153 153 255 204 153 255 255 204 0 0 204 0 51 204 0 102 204 0 153 204 0 204 204 0 255 204 51 0 204 51 51 204 51 102 204 51 153 204 51 204 204 51 255 204 102 0 204 102 51 204 102 102 204 102 153 204 102 204 204 102 255 204 153 0 204 153 51 204 153 102 204 153 153 204 153 204 204 153 255 204 204 0 204 204 51 204 204 102 204 204 153 204 204 204 204 204 255 204 255 0 204 255 51 204 255 102 204 255 153 204 255 204 204 255 255 255 0 0 255 0 51 255 0 102 255 0 153 255 0 204 255 0 255 255 51 0 255 51 51 255 51 102 255 51 153 255 51 204 255 51 255 255 102 0 255 102 51 255 102 102 255 102 153 255 102 204 255 102 255 255 153 0 255 153 51 255 153 102 255 153 153 255 153 204 255 153 255 255 204 0 255 204 51 255 204 102 255 204 153 255 204 204 255 204 255 255 255 51 255 255 102 255 255 153 255 255 204 9 9 9 19 19 19 29 29 29 39 39 39 49 49 49 58 58 58 68 68 68 78 78 78 88 88 88 98 98 98 107 107 107 117 117 117 127 127 127 137 137 137 147 147 147 156 156 156 166 166 166 176 176 176 186 186 186 196 196 196 205 205 205 215 215 215 225 225 225 235 235 235 245 245 245 191 191 191 233 231 227 127 127 127 255 255 127 191 191 127] |
|
1188 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'C0A?8O?0??C?<O?0??C?>O?8??#?>O?8_? G>@@a'); yourself); yourself] |
|
1189 |
! |
|
1190 |
||
1191 |
pasteMaskedIcon |
|
1192 |
"This resource specification was automatically generated |
|
1193 |
by the ImageEditor of ST/X." |
|
1194 |
||
1195 |
"Do not manually edit this!! If it is corrupted, |
|
1196 |
the ImageEditor may not be able to read the specification." |
|
1197 |
||
1198 |
" |
|
1199 |
self pasteMaskedIcon inspect |
|
1200 |
ImageEditor openOnClass:self andSelector:#pasteMaskedIcon |
|
1201 |
Icon flushCachedIcons |
|
1202 |
" |
|
1203 |
||
1204 |
<resource: #image> |
|
1205 |
||
1206 |
^Icon |
|
1207 |
constantNamed:'ImageEditor class pasteMaskedIcon' |
|
1208 |
ifAbsentPut:[(Depth8Image width:14 height:14) bits:(ByteArray fromPackedString:' |
|
1209 |
:N#(:N#(:N#(:N#(:N#(:N#(:O#8:N#(:N#(:N#5>^#8:N#8:OW9:N#(:O''(=/[6=/[6:OW(:N#(=^#(:N#(:N#(>^#(:N#9=_''5>_W9=_''5:N#(:@DA@PDA |
|
1210 |
@PDA=_''(@@C(@_[6=/[6= D@@@@@@N A=/[6= XFA XFA @@:@G6=/[6A X@@@XF@@C(@_[6=/XF= @@@@X@@N A=/[6= XF@@@FA @@@@DA@PDA@PDAA XF |
|
1211 |
@@@@@@@@@@@@@@@@@@@@@@@a') |
|
1212 |
colorMapFromArray:#[0 0 0 0 0 128 128 128 0 128 128 128 212 208 200 255 255 0 255 255 255 0 0 51 0 0 102 0 0 153 0 0 204 0 0 255 0 51 0 0 51 51 0 51 102 0 51 153 0 51 204 0 51 255 0 102 0 0 102 51 0 102 102 0 102 153 0 102 204 0 102 255 0 153 0 0 153 51 0 153 102 0 153 153 0 153 204 0 153 255 0 204 0 0 204 51 0 204 102 0 204 153 0 204 204 0 204 255 0 255 0 0 255 51 0 255 102 0 255 153 0 255 204 0 255 255 51 0 0 51 0 51 51 0 102 51 0 153 51 0 204 51 0 255 51 51 0 51 51 51 51 51 102 51 51 153 51 51 204 51 51 255 51 102 0 51 102 51 51 102 102 51 102 153 51 102 204 51 102 255 51 153 0 51 153 51 51 153 102 51 153 153 51 153 204 51 153 255 51 204 0 51 204 51 51 204 102 51 204 153 51 204 204 51 204 255 51 255 0 51 255 51 51 255 102 51 255 153 51 255 204 51 255 255 102 0 0 102 0 51 102 0 102 102 0 153 102 0 204 102 0 255 102 51 0 102 51 51 102 51 102 102 51 153 102 51 204 102 51 255 102 102 0 102 102 51 102 102 102 102 102 153 102 102 204 102 102 255 102 153 0 102 153 51 102 153 102 102 153 153 102 153 204 102 153 255 102 204 0 102 204 51 102 204 102 102 204 153 102 204 204 102 204 255 102 255 0 102 255 51 102 255 102 102 255 153 102 255 204 102 255 255 153 0 0 153 0 51 153 0 102 153 0 153 153 0 204 153 0 255 153 51 0 153 51 51 153 51 102 153 51 153 153 51 204 153 51 255 153 102 0 153 102 51 153 102 102 153 102 153 153 102 204 153 102 255 153 153 0 153 153 51 153 153 102 153 153 153 153 153 204 153 153 255 153 204 0 153 204 51 153 204 102 153 204 153 153 204 204 153 204 255 153 255 0 153 255 51 153 255 102 153 255 153 153 255 204 153 255 255 204 0 0 204 0 51 204 0 102 204 0 153 204 0 204 204 0 255 204 51 0 204 51 51 204 51 102 204 51 153 204 51 204 204 51 255 204 102 0 204 102 51 204 102 102 204 102 153 204 102 204 204 102 255 204 153 0 204 153 51 204 153 102 204 153 153 204 153 204 204 153 255 204 204 0 204 204 51 204 204 102 204 204 153 204 204 204 204 204 255 204 255 0 204 255 51 204 255 102 204 255 153 204 255 204 204 255 255 255 0 0 255 0 51 255 0 102 255 0 153 255 0 204 255 0 255 255 51 0 255 51 51 255 51 102 255 51 153 255 51 204 255 51 255 255 102 0 255 102 51 255 102 102 255 102 153 255 102 204 255 102 255 255 153 0 255 153 51 255 153 102 255 153 153 255 153 204 255 153 255 255 204 0 255 204 51 255 204 102 255 204 153 255 204 204 255 204 255 255 255 51 255 255 102 255 255 153 255 255 204 9 9 9 19 19 19 29 29 29 39 39 39 49 49 49 58 58 58 68 68 68 78 78 78 88 88 88 98 98 98 107 107 107 117 117 117 127 127 127 137 137 137 147 147 147 156 156 156 166 166 166 176 176 176 186 186 186 196 196 196 205 205 205 215 215 215 225 225 225 235 235 235 245 245 245 191 191 191 233 231 227 127 127 127 255 255 127 191 191 127] |
|
1213 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'C0A?8O?0??C?<O?0??C?>O?8??#?>O?8_? G>@@a'); yourself); yourself] |
|
1637 | 1214 |
! |
1215 |
||
1216 |
pasteUnderIcon |
|
1217 |
"This resource specification was automatically generated |
|
1218 |
by the ImageEditor of ST/X." |
|
3561 | 1219 |
|
1637 | 1220 |
"Do not manually edit this!! If it is corrupted, |
1221 |
the ImageEditor may not be able to read the specification." |
|
3561 | 1222 |
|
1637 | 1223 |
" |
1224 |
self pasteUnderIcon inspect |
|
1225 |
ImageEditor openOnClass:self andSelector:#pasteUnderIcon |
|
3561 | 1226 |
Icon flushCachedIcons |
1227 |
" |
|
1228 |
||
1229 |
<resource: #image> |
|
1230 |
||
1231 |
^Icon |
|
1232 |
constantNamed:'ImageEditor class pasteUnderIcon' |
|
1233 |
ifAbsentPut:[(Depth8Image width:14 height:14) bits:(ByteArray fromPackedString:' |
|
1234 |
:N#(:N#(:N#(:N#(:N#(:N#(:O#8:N#(:N#(:N#5>^#8:N#8:OW9:N#(:O''(=/[6=/[6:OW(:N#(=^#(:N#(:N#(>^#(:N#9=_''5>_W9=_''5:N#(:@DA@PDA |
|
1235 |
@PDA=_''(@@C(@_K2</K2< D@@@@@@N A</K2</K2@PXFA @@:@G2</K2</H@@@XF@@C(@_K2</K2@@@@@@X@@N A</K2</K2@@@FA @@@@DA@PDA@PDAA XF |
|
1236 |
@@@@@@@@@@@@@@@@@@@@@@@a') |
|
1237 |
colorMapFromArray:#[0 0 0 0 0 128 128 128 0 128 128 128 212 208 200 255 255 0 255 255 255 0 0 51 0 0 102 0 0 153 0 0 204 0 0 255 0 51 0 0 51 51 0 51 102 0 51 153 0 51 204 0 51 255 0 102 0 0 102 51 0 102 102 0 102 153 0 102 204 0 102 255 0 153 0 0 153 51 0 153 102 0 153 153 0 153 204 0 153 255 0 204 0 0 204 51 0 204 102 0 204 153 0 204 204 0 204 255 0 255 0 0 255 51 0 255 102 0 255 153 0 255 204 0 255 255 51 0 0 51 0 51 51 0 102 51 0 153 51 0 204 51 0 255 51 51 0 51 51 51 51 51 102 51 51 153 51 51 204 51 51 255 51 102 0 51 102 51 51 102 102 51 102 153 51 102 204 51 102 255 51 153 0 51 153 51 51 153 102 51 153 153 51 153 204 51 153 255 51 204 0 51 204 51 51 204 102 51 204 153 51 204 204 51 204 255 51 255 0 51 255 51 51 255 102 51 255 153 51 255 204 51 255 255 102 0 0 102 0 51 102 0 102 102 0 153 102 0 204 102 0 255 102 51 0 102 51 51 102 51 102 102 51 153 102 51 204 102 51 255 102 102 0 102 102 51 102 102 102 102 102 153 102 102 204 102 102 255 102 153 0 102 153 51 102 153 102 102 153 153 102 153 204 102 153 255 102 204 0 102 204 51 102 204 102 102 204 153 102 204 204 102 204 255 102 255 0 102 255 51 102 255 102 102 255 153 102 255 204 102 255 255 153 0 0 153 0 51 153 0 102 153 0 153 153 0 204 153 0 255 153 51 0 153 51 51 153 51 102 153 51 153 153 51 204 153 51 255 153 102 0 153 102 51 153 102 102 153 102 153 153 102 204 153 102 255 153 153 0 153 153 51 153 153 102 153 153 153 153 153 204 153 153 255 153 204 0 153 204 51 153 204 102 153 204 153 153 204 204 153 204 255 153 255 0 153 255 51 153 255 102 153 255 153 153 255 204 153 255 255 204 0 0 204 0 51 204 0 102 204 0 153 204 0 204 204 0 255 204 51 0 204 51 51 204 51 102 204 51 153 204 51 204 204 51 255 204 102 0 204 102 51 204 102 102 204 102 153 204 102 204 204 102 255 204 153 0 204 153 51 204 153 102 204 153 153 204 153 204 204 153 255 204 204 0 204 204 51 204 204 102 204 204 153 204 204 204 204 204 255 204 255 0 204 255 51 204 255 102 204 255 153 204 255 204 204 255 255 255 0 0 255 0 51 255 0 102 255 0 153 255 0 204 255 0 255 255 51 0 255 51 51 255 51 102 255 51 153 255 51 204 255 51 255 255 102 0 255 102 51 255 102 102 255 102 153 255 102 204 255 102 255 255 153 0 255 153 51 255 153 102 255 153 153 255 153 204 255 153 255 255 204 0 255 204 51 255 204 102 255 204 153 255 204 204 255 204 255 255 255 51 255 255 102 255 255 153 255 255 204 9 9 9 19 19 19 29 29 29 39 39 39 49 49 49 58 58 58 68 68 68 78 78 78 88 88 88 98 98 98 107 107 107 117 117 117 127 127 127 137 137 137 147 147 147 156 156 156 166 166 166 176 176 176 186 186 186 196 196 196 205 205 205 215 215 215 225 225 225 235 235 235 245 245 245 191 191 191 233 231 227 127 127 127 255 255 127 191 191 127] |
|
1238 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'C0A?8O?0??C?<O?0??C?>O?8??#?>O?8_? G>@@a'); yourself); yourself] |
|
1637 | 1239 |
! |
1240 |
||
1241 |
pasteWithMaskIcon |
|
1242 |
"This resource specification was automatically generated |
|
1243 |
by the ImageEditor of ST/X." |
|
3561 | 1244 |
|
1637 | 1245 |
"Do not manually edit this!! If it is corrupted, |
1246 |
the ImageEditor may not be able to read the specification." |
|
3561 | 1247 |
|
1637 | 1248 |
" |
1249 |
self pasteWithMaskIcon inspect |
|
1250 |
ImageEditor openOnClass:self andSelector:#pasteWithMaskIcon |
|
3561 | 1251 |
Icon flushCachedIcons |
1252 |
" |
|
1253 |
||
1254 |
<resource: #image> |
|
1255 |
||
1256 |
^Icon |
|
1257 |
constantNamed:'ImageEditor class pasteWithMaskIcon' |
|
1258 |
ifAbsentPut:[(Depth8Image width:14 height:14) bits:(ByteArray fromPackedString:' |
|
1259 |
:N#(:N#(:N#(:N#(:N#(:N#(:O#8:N#(:N#(:N#5>^#8:N#8:OW9:N#(:O''(=/[6=/[6:OW(:N#(=^#(:N#(:N#(>^#(:N#9=_''5>_W9=_''5:N#(:@DA@PDA |
|
1260 |
@PDA=_''(@@C(@_C0<OC0<O@@@@@@@N A<OC0<@XFA XFA @@:@G0<OC0A [0@@XF@@C(@_C0<O@F<O@@@@X@@N A<OC0<@XF<@@FA @@@@DA@PD@A XFA XF |
|
1261 |
@@@@@@@@@@@@@@@@@@@@@@@a') |
|
1262 |
colorMapFromArray:#[0 0 0 0 0 128 128 128 0 128 128 128 212 208 200 255 255 0 255 255 255 0 0 51 0 0 102 0 0 153 0 0 204 0 0 255 0 51 0 0 51 51 0 51 102 0 51 153 0 51 204 0 51 255 0 102 0 0 102 51 0 102 102 0 102 153 0 102 204 0 102 255 0 153 0 0 153 51 0 153 102 0 153 153 0 153 204 0 153 255 0 204 0 0 204 51 0 204 102 0 204 153 0 204 204 0 204 255 0 255 0 0 255 51 0 255 102 0 255 153 0 255 204 0 255 255 51 0 0 51 0 51 51 0 102 51 0 153 51 0 204 51 0 255 51 51 0 51 51 51 51 51 102 51 51 153 51 51 204 51 51 255 51 102 0 51 102 51 51 102 102 51 102 153 51 102 204 51 102 255 51 153 0 51 153 51 51 153 102 51 153 153 51 153 204 51 153 255 51 204 0 51 204 51 51 204 102 51 204 153 51 204 204 51 204 255 51 255 0 51 255 51 51 255 102 51 255 153 51 255 204 51 255 255 102 0 0 102 0 51 102 0 102 102 0 153 102 0 204 102 0 255 102 51 0 102 51 51 102 51 102 102 51 153 102 51 204 102 51 255 102 102 0 102 102 51 102 102 102 102 102 153 102 102 204 102 102 255 102 153 0 102 153 51 102 153 102 102 153 153 102 153 204 102 153 255 102 204 0 102 204 51 102 204 102 102 204 153 102 204 204 102 204 255 102 255 0 102 255 51 102 255 102 102 255 153 102 255 204 102 255 255 153 0 0 153 0 51 153 0 102 153 0 153 153 0 204 153 0 255 153 51 0 153 51 51 153 51 102 153 51 153 153 51 204 153 51 255 153 102 0 153 102 51 153 102 102 153 102 153 153 102 204 153 102 255 153 153 0 153 153 51 153 153 102 153 153 153 153 153 204 153 153 255 153 204 0 153 204 51 153 204 102 153 204 153 153 204 204 153 204 255 153 255 0 153 255 51 153 255 102 153 255 153 153 255 204 153 255 255 204 0 0 204 0 51 204 0 102 204 0 153 204 0 204 204 0 255 204 51 0 204 51 51 204 51 102 204 51 153 204 51 204 204 51 255 204 102 0 204 102 51 204 102 102 204 102 153 204 102 204 204 102 255 204 153 0 204 153 51 204 153 102 204 153 153 204 153 204 204 153 255 204 204 0 204 204 51 204 204 102 204 204 153 204 204 204 204 204 255 204 255 0 204 255 51 204 255 102 204 255 153 204 255 204 204 255 255 255 0 0 255 0 51 255 0 102 255 0 153 255 0 204 255 0 255 255 51 0 255 51 51 255 51 102 255 51 153 255 51 204 255 51 255 255 102 0 255 102 51 255 102 102 255 102 153 255 102 204 255 102 255 255 153 0 255 153 51 255 153 102 255 153 153 255 153 204 255 153 255 255 204 0 255 204 51 255 204 102 255 204 153 255 204 204 255 204 255 255 255 51 255 255 102 255 255 153 255 255 204 9 9 9 19 19 19 29 29 29 39 39 39 49 49 49 58 58 58 68 68 68 78 78 78 88 88 88 98 98 98 107 107 107 117 117 117 127 127 127 137 137 137 147 147 147 156 156 156 166 166 166 176 176 176 186 186 186 196 196 196 205 205 205 215 215 215 225 225 225 235 235 235 245 245 245 191 191 191 233 231 227 127 127 127 255 255 127 191 191 127] |
|
1263 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'C0A?8O?0??C?<O?0??C?>O?8??#?>O?8_? G>@@a'); yourself); yourself] |
|
1637 | 1264 |
! |
1265 |
||
1266 |
pointIcon |
|
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1267 |
<resource: #image> |
1637 | 1268 |
"This resource specification was automatically generated |
1269 |
by the ImageEditor of ST/X." |
|
1270 |
"Do not manually edit this!! If it is corrupted, |
|
1271 |
the ImageEditor may not be able to read the specification." |
|
1272 |
" |
|
1273 |
self pointIcon inspect |
|
1274 |
ImageEditor openOnClass:self andSelector:#pointIcon |
|
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1275 |
Icon flushCachedIcons" |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1276 |
|
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1277 |
^ Icon constantNamed:'ImageEditor class pointIcon' |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1278 |
ifAbsentPut:[ |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1279 |
(Depth1Image new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1280 |
width:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1281 |
height:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1282 |
photometric:(#palette); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1283 |
bitsPerSample:(#( 1 )); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1284 |
samplesPerPixel:(1); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1285 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1286 |
fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@C@@@@@@@@@@@@@@@a'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1287 |
colorMapFromArray:#[ 0 0 0 255 255 255 ]; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1288 |
mask:((ImageMask new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1289 |
width:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1290 |
height:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1291 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1292 |
fromPackedString:'@@@@@@@0@G@@8@G@@8@G@@8@G@@X@@@@@@@@@@@a'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1293 |
yourself); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1294 |
yourself |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1295 |
] |
1637 | 1296 |
! |
1297 |
||
1298 |
rectIcon |
|
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1299 |
<resource: #image> |
1637 | 1300 |
"This resource specification was automatically generated |
1301 |
by the ImageEditor of ST/X." |
|
1302 |
"Do not manually edit this!! If it is corrupted, |
|
1303 |
the ImageEditor may not be able to read the specification." |
|
1304 |
" |
|
1305 |
self rectIcon inspect |
|
1306 |
ImageEditor openOnClass:self andSelector:#rectIcon |
|
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1307 |
Icon flushCachedIcons" |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1308 |
|
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1309 |
^ Icon constantNamed:'ImageEditor class rectIcon' |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1310 |
ifAbsentPut:[ |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1311 |
(Depth1Image new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1312 |
width:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1313 |
height:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1314 |
photometric:(#palette); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1315 |
bitsPerSample:(#( 1 )); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1316 |
samplesPerPixel:(1); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1317 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1318 |
fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@C@@@@@@@@@@@@@@@a'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1319 |
colorMapFromArray:#[ 0 0 0 255 0 0 ]; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1320 |
mask:((ImageMask new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1321 |
width:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1322 |
height:14; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1323 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1324 |
fromPackedString:'@@@@@C?0HA@ DB@PHA@ DB@PHA@ DC?0@@@@@@@a'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1325 |
yourself); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1326 |
yourself |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1327 |
] |
1637 | 1328 |
! |
1329 |
||
737 | 1330 |
rightMouseKeyIcon |
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1331 |
<resource: #image> |
737 | 1332 |
"This resource specification was automatically generated |
1333 |
by the ImageEditor of ST/X." |
|
1334 |
"Do not manually edit this!! If it is corrupted, |
|
1335 |
the ImageEditor may not be able to read the specification." |
|
1336 |
" |
|
1405 | 1337 |
self rightMouseKeyIcon inspect |
737 | 1338 |
ImageEditor openOnClass:self andSelector:#rightMouseKeyIcon |
3121
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1339 |
Icon flushCachedIcons" |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1340 |
|
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1341 |
^ Icon constantNamed:'ImageEditor class rightMouseKeyIcon' |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1342 |
ifAbsentPut:[ |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1343 |
(Depth2Image new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1344 |
width:16; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1345 |
height:16; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1346 |
photometric:(#palette); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1347 |
bitsPerSample:(#( 2 )); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1348 |
samplesPerPixel:(1); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1349 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1350 |
fromPackedString:'@@@@@@@@@@@@@@@@@JJE@@B"!!P@@((T@@@@@@@B** @@**(@@J**@@B** @@**(@@J**@@@**@@@@@@@@@@@@@@a'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1351 |
colorMapFromArray:#[ 0 0 0 255 0 0 255 255 255 ]; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1352 |
mask:((ImageMask new) |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1353 |
width:16; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1354 |
height:16; |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1355 |
bits:(ByteArray |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1356 |
fromPackedString:'@@@@@@?0G? _>A?8G? _>A?8G? _>A?8G? O<@_ @@@b'); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1357 |
yourself); |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1358 |
yourself |
b88abf599041
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
3103
diff
changeset
|
1359 |
] |
1637 | 1360 |
! |
1361 |
||
3419 | 1362 |
slightlyBrighterIcon |
1363 |
"This resource specification was automatically generated |
|
1364 |
by the ImageEditor of ST/X." |
|
1365 |
||
1366 |
"Do not manually edit this!! If it is corrupted, |
|
1367 |
the ImageEditor may not be able to read the specification." |
|
1368 |
||
1369 |
" |
|
1370 |
self slightlyBrighterIcon inspect |
|
1371 |
ImageEditor openOnClass:self andSelector:#slightlyBrighterIcon |
|
1372 |
Icon flushCachedIcons |
|
1373 |
" |
|
1374 |
||
1375 |
<resource: #image> |
|
1376 |
||
1377 |
^Icon |
|
1378 |
constantNamed:'ImageEditor class slightlyBrighterIcon' |
|
1379 |
ifAbsentPut:[(Depth8Image width:14 height:14) bits:(ByteArray fromPackedString:' |
|
1380 |
@PDA@PDA@PDA@PDA@PD@@@@@@@@@;>?/;>?/;0@@@@@@@@C/;>?/;>?/@@@@@@@@A [/;>?/;><@@@@@@@@FA.?/;>?/;0@@@@@@@@XF;>?/;>?/@@@@A XF |
|
1381 |
A XFA [/;><@@@@FA XFA XFA.?/;0@@@@@@@@XF;>?/;>?/@@@@@@@@A [/;>?/;><@@@@@@@@FA.?/;>?/;0@@@@@@@@C/;>?/;>?/@@@@@@@@@N?/;>?/ |
|
1382 |
;><A@PDA@PDA@PDA@PDA@P@a') |
|
1383 |
colorMapFromArray:#[88 88 88 0 0 0 255 0 0 0 255 0 0 0 255 0 255 255 255 255 127 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127 127 127 127 170 170 170 0 0 51 0 0 102 0 0 153 0 0 204 0 51 0 0 51 51 0 51 102 0 51 153 0 51 204 0 51 255 0 102 0 0 102 51 0 102 102 0 102 153 0 102 204 0 102 255 0 153 0 0 153 51 0 153 102 0 153 153 0 153 204 0 153 255 0 204 0 0 204 51 0 204 102 0 204 153 0 204 204 0 204 255 0 255 51 0 255 102 0 255 153 0 255 204 51 0 0 51 0 51 51 0 102 51 0 153 51 0 204 51 0 255 51 51 0 51 51 51 51 51 102 51 51 153 51 51 204 51 51 255 51 102 0 51 102 51 51 102 102 51 102 153 51 102 204 51 102 255 51 153 0 51 153 51 51 153 102 51 153 153 51 153 204 51 153 255 51 204 0 51 204 51 51 204 102 51 204 153 51 204 204 51 204 255 51 255 0 51 255 51 51 255 102 51 255 153 51 255 204 51 255 255 102 0 0 102 0 51 102 0 102 102 0 153 102 0 204 102 0 255 102 51 0 102 51 51 102 51 102 102 51 153 102 51 204 102 51 255 102 102 0 102 102 51 102 102 102 102 102 153 102 102 204 102 102 255 102 153 0 102 153 51 102 153 102 102 153 153 102 153 204 102 153 255 102 204 0 102 204 51 102 204 102 102 204 153 102 204 204 102 204 255 102 255 0 102 255 51 102 255 102 102 255 153 102 255 204 102 255 255 153 0 0 153 0 51 153 0 102 153 0 153 153 0 204 153 0 255 153 51 0 153 51 51 153 51 102 153 51 153 153 51 204 153 51 255 153 102 0 153 102 51 153 102 102 153 102 153 153 102 204 153 102 255 153 153 0 153 153 51 153 153 102 153 153 153 153 153 204 153 153 255 153 204 0 153 204 51 153 204 102 153 204 153 153 204 204 153 204 255 153 255 0 153 255 51 153 255 102 153 255 153 153 255 204 153 255 255 204 0 0 204 0 51 204 0 102 204 0 153 204 0 204 204 0 255 204 51 0 204 51 51 204 51 102 204 51 153 204 51 204 204 51 255 204 102 0 204 102 51 204 102 102 204 102 153 204 102 204 204 102 255 204 153 0 204 153 51 204 153 102 204 153 153 204 153 204 204 153 255 204 204 0 204 204 51 204 204 102 204 204 153 204 204 204 204 204 255 204 255 0 204 255 51 204 255 102 204 255 153 204 255 204 204 255 255 255 0 51 255 0 102 255 0 153 255 0 204 255 51 0 255 51 51 255 51 102 255 51 153 255 51 204 255 51 255 255 102 0 255 102 51 255 102 102 255 102 153 255 102 204 255 102 255 255 153 0 255 153 51 255 153 102 255 153 153 255 153 204 255 153 255 255 204 0 255 204 51 255 204 102 255 204 153 255 204 204 255 204 255 255 255 51 255 255 102 255 255 153 255 255 204 255 255 255 9 9 9 19 19 19 29 29 29 39 39 39 49 49 49 58 58 58 68 68 68 78 78 78 98 98 98 107 107 107 117 117 117 137 137 137 147 147 147 156 156 156 166 166 166] |
|
1384 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'@@C??O?<??3??O?<??3??O?<??3??O?<??0@@@@a'); yourself); yourself] |
|
1385 |
! |
|
1386 |
||
1387 |
slightlyDarkerIcon |
|
1388 |
"This resource specification was automatically generated |
|
1389 |
by the ImageEditor of ST/X." |
|
1390 |
||
1391 |
"Do not manually edit this!! If it is corrupted, |
|
1392 |
the ImageEditor may not be able to read the specification." |
|
1393 |
||
1394 |
" |
|
1395 |
self slightlyDarkerIcon inspect |
|
1396 |
ImageEditor openOnClass:self andSelector:#slightlyDarkerIcon |
|
1397 |
Icon flushCachedIcons |
|
1398 |
" |
|
1399 |
||
1400 |
<resource: #image> |
|
1401 |
||
1402 |
^Icon |
|
1403 |
constantNamed:'ImageEditor class slightlyDarkerIcon' |
|
1404 |
ifAbsentPut:[(Depth8Image width:14 height:14) bits:(ByteArray fromPackedString:' |
|
1405 |
@PDA@PDA@PDA@PDA@PG/;>?/;>?/@@@@@@@@@N?/;>?/;><@@@@@@@@@;>?/;>?/;0@@@@@@@@C/;>?/;>?/@@@@@@@@@N?/;>?/;><@@@@@@@@@;>?/A XF |
|
1406 |
A XFA X@@@C/;><FA XFA XFA @@@N?/;>?/;><@@@@@@@@@;>?/;>?/;0@@@@@@@@C/;>?/;>?/@@@@@@@@@N?/;>?/;><@@@@@@@@@;>?/;>?/;0@@@@@@ |
|
1407 |
@@@A@PDA@PDA@PDA@PDA@P@a') |
|
1408 |
colorMapFromArray:#[88 88 88 0 0 0 255 0 0 0 255 0 0 0 255 0 255 255 255 255 127 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127 127 127 127 170 170 170 0 0 51 0 0 102 0 0 153 0 0 204 0 51 0 0 51 51 0 51 102 0 51 153 0 51 204 0 51 255 0 102 0 0 102 51 0 102 102 0 102 153 0 102 204 0 102 255 0 153 0 0 153 51 0 153 102 0 153 153 0 153 204 0 153 255 0 204 0 0 204 51 0 204 102 0 204 153 0 204 204 0 204 255 0 255 51 0 255 102 0 255 153 0 255 204 51 0 0 51 0 51 51 0 102 51 0 153 51 0 204 51 0 255 51 51 0 51 51 51 51 51 102 51 51 153 51 51 204 51 51 255 51 102 0 51 102 51 51 102 102 51 102 153 51 102 204 51 102 255 51 153 0 51 153 51 51 153 102 51 153 153 51 153 204 51 153 255 51 204 0 51 204 51 51 204 102 51 204 153 51 204 204 51 204 255 51 255 0 51 255 51 51 255 102 51 255 153 51 255 204 51 255 255 102 0 0 102 0 51 102 0 102 102 0 153 102 0 204 102 0 255 102 51 0 102 51 51 102 51 102 102 51 153 102 51 204 102 51 255 102 102 0 102 102 51 102 102 102 102 102 153 102 102 204 102 102 255 102 153 0 102 153 51 102 153 102 102 153 153 102 153 204 102 153 255 102 204 0 102 204 51 102 204 102 102 204 153 102 204 204 102 204 255 102 255 0 102 255 51 102 255 102 102 255 153 102 255 204 102 255 255 153 0 0 153 0 51 153 0 102 153 0 153 153 0 204 153 0 255 153 51 0 153 51 51 153 51 102 153 51 153 153 51 204 153 51 255 153 102 0 153 102 51 153 102 102 153 102 153 153 102 204 153 102 255 153 153 0 153 153 51 153 153 102 153 153 153 153 153 204 153 153 255 153 204 0 153 204 51 153 204 102 153 204 153 153 204 204 153 204 255 153 255 0 153 255 51 153 255 102 153 255 153 153 255 204 153 255 255 204 0 0 204 0 51 204 0 102 204 0 153 204 0 204 204 0 255 204 51 0 204 51 51 204 51 102 204 51 153 204 51 204 204 51 255 204 102 0 204 102 51 204 102 102 204 102 153 204 102 204 204 102 255 204 153 0 204 153 51 204 153 102 204 153 153 204 153 204 204 153 255 204 204 0 204 204 51 204 204 102 204 204 153 204 204 204 204 204 255 204 255 0 204 255 51 204 255 102 204 255 153 204 255 204 204 255 255 255 0 51 255 0 102 255 0 153 255 0 204 255 51 0 255 51 51 255 51 102 255 51 153 255 51 204 255 51 255 255 102 0 255 102 51 255 102 102 255 102 153 255 102 204 255 102 255 255 153 0 255 153 51 255 153 102 255 153 153 255 153 204 255 153 255 255 204 0 255 204 51 255 204 102 255 204 153 255 204 204 255 204 255 255 255 51 255 255 102 255 255 153 255 255 204 255 255 255 9 9 9 19 19 19 29 29 29 39 39 39 49 49 49 58 58 58 68 68 68 78 78 78 98 98 98 107 107 107 117 117 117 137 137 137 147 147 147 156 156 156 166 166 166] |
|
1409 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'@@C??O?<??3??O?<??3??O?<??3??O?<??0@@@@a'); yourself); yourself] |
|
1410 |
! |
|
1411 |
||
3191 | 1412 |
smoothIcon |
1413 |
"This resource specification was automatically generated |
|
1414 |
by the ImageEditor of ST/X." |
|
1415 |
||
1416 |
"Do not manually edit this!! If it is corrupted, |
|
1417 |
the ImageEditor may not be able to read the specification." |
|
1418 |
||
1419 |
" |
|
1420 |
self smoothIcon inspect |
|
1421 |
ImageEditor openOnClass:self andSelector:#smoothIcon |
|
1422 |
Icon flushCachedIcons |
|
1423 |
" |
|
1424 |
||
1425 |
<resource: #image> |
|
1426 |
||
1427 |
^Icon |
|
1428 |
constantNamed:'ImageEditor smoothIcon' |
|
1429 |
ifAbsentPut:[(Depth4Image new) width:14; height:14; bits:(ByteArray fromPackedString:'@@@@@@@@@@@RH@@@H!!@@HRD@@RD @BHQ@@DRH@@ADP@ADP@@@@@QD@@@@@@@DQ@@@@@@@ADP@@@@@QD@@QD@@BHQ@@DRH@@!!HP@AHR@@D"@@@BHP@@@@@@@@ |
|
1430 |
@@@@@@@@@@@b') ; colorMapFromArray:#[127 126 127 255 0 0 255 255 255]; mask:((ImageMask new) width:14; height:14; bits:(ByteArray fromPackedString:'_?1<_G1<_G1??D_DQ<QG1G?<_G1<_G1<_?0@@@@a') ; yourself); yourself] |
|
1431 |
! |
|
1432 |
||
2881 | 1433 |
specialCircleIcon |
1434 |
"This resource specification was automatically generated |
|
1435 |
by the ImageEditor of ST/X." |
|
3442 | 1436 |
|
2881 | 1437 |
"Do not manually edit this!! If it is corrupted, |
1438 |
the ImageEditor may not be able to read the specification." |
|
3442 | 1439 |
|
2881 | 1440 |
" |
1441 |
self specialCircleIcon inspect |
|
1442 |
ImageEditor openOnClass:self andSelector:#specialCircleIcon |
|
3442 | 1443 |
Icon flushCachedIcons |
1444 |
" |
|
1445 |
||
1446 |
<resource: #image> |
|
1447 |
||
1448 |
^Icon |
|
1449 |
constantNamed:'ImageEditor class specialCircleIcon' |
|
1450 |
ifAbsentPut:[(Depth2Image width:14 height:14) bits:(ByteArray fromPackedString:'@@@@@@@@@@@@PA@@@RBD@@P@@P@P@@A@D@@@PA@@@D@PHHA@A@@A@@D@A@@@PA@@@@@@@@@@@@@b') |
|
1451 |
colorMapFromArray:#[0 0 0 255 0 0 127 127 127] |
|
1452 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'@@@@@@-@E:@''$D^HQ8!!G"D^HH1@PH@-@@0@@@@@a'); yourself); yourself] |
|
2881 | 1453 |
! |
1454 |
||
3419 | 1455 |
specialRectangleIcon |
1637 | 1456 |
"This resource specification was automatically generated |
1457 |
by the ImageEditor of ST/X." |
|
3419 | 1458 |
|
1637 | 1459 |
"Do not manually edit this!! If it is corrupted, |
1460 |
the ImageEditor may not be able to read the specification." |
|
3419 | 1461 |
|
1637 | 1462 |
" |
3419 | 1463 |
self specialRectangleIcon inspect |
1464 |
ImageEditor openOnClass:self andSelector:#specialRectangleIcon |
|
1465 |
Icon flushCachedIcons |
|
1466 |
" |
|
1467 |
||
1468 |
<resource: #image> |
|
1469 |
||
1470 |
^Icon |
|
1471 |
constantNamed:'ImageEditor class specialRectangleIcon' |
|
3442 | 1472 |
ifAbsentPut:[(Depth2Image width:14 height:14) bits:(ByteArray fromPackedString:'@@@@@@@@@@@UPAU@DBB@PA@@@D@P@@A@D@@@PA@@@D@PHHA@D@@@PA@@@D@UPAU@@@@@@@@@@@@b') |
1473 |
colorMapFromArray:#[0 0 0 255 0 0 127 127 127] |
|
1474 |
mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'@@@@@G-8Q8!!G"D^HQ8!!G"D^HP0!!@BG-8@0@@@@@a'); yourself); yourself] |
|
2375 | 1475 |
! |
1476 |
||
1477 |
sprayIcon |
|
1478 |
"This resource specification was automatically generated |
|
1479 |
by the ImageEditor of ST/X." |
|
3191 | 1480 |
|
2375 | 1481 |
"Do not manually edit this!! If it is corrupted, |
1482 |
the ImageEditor may not be able to read the specification." |
|
3191 | 1483 |
|
2375 | 1484 |
" |
1485 |
self sprayIcon inspect |
|
1486 |
ImageEditor openOnClass:self andSelector:#sprayIcon |
|
3191 | 1487 |
Icon flushCachedIcons |
1488 |
" |
|
1489 |
||
1490 |
<resource: #image> |
|
1491 |
||
1492 |
^Icon |
|
1493 |
constantNamed:'ImageEditor sprayIcon' |
|
1494 |
ifAbsentPut:[(Depth4Image new) width:14; height:14; bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@P@@@@@@DA@P@@@@@PDA@@@@@@@PDA@@@@@@@PD@@@@"H@@PD@@@H"@@@@@@@ADP@@@@@@@QD@@@@@@@DQ@@@@@@@ADP@@ |
|
1495 |
@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((ImageMask new) width:14; height:14; bits:(ByteArray fromPackedString:'@@@@@@@HA%PF*@ITA2 O%@>@C8@O @>@C8@O @@a') ; yourself); yourself] |
|
1433 | 1496 |
! ! |
737 | 1497 |
|
400 | 1498 |
!ImageEditor class methodsFor:'interface specs'! |
1499 |
||
1650 | 1500 |
changeHLSDialogSpec |
1501 |
"This resource specification was automatically generated |
|
1502 |
by the UIPainter of ST/X." |
|
1503 |
||
1504 |
"Do not manually edit this!! If it is corrupted, |
|
1505 |
the UIPainter may not be able to read the specification." |
|
1506 |
||
1507 |
" |
|
1508 |
UIPainter new openOnClass:ImageEditor andSelector:#changeHLSDialogSpec |
|
1509 |
ImageEditor new openInterface:#changeHLSDialogSpec |
|
1510 |
" |
|
1511 |
||
1512 |
<resource: #canvas> |
|
1513 |
||
1514 |
^ |
|
3468 | 1515 |
#(FullSpec |
1516 |
name: changeHLSDialogSpec |
|
3562 | 1517 |
uuid: 'b5dfeb64-6197-11e8-a86d-b8f6b1108e05' |
3468 | 1518 |
window: |
1519 |
(WindowSpec |
|
1520 |
label: 'HLS Edit Dialog' |
|
1521 |
name: 'HLS Edit Dialog' |
|
3562 | 1522 |
uuid: '3787f3b8-6194-11e8-a86d-b8f6b1108e05' |
3468 | 1523 |
min: (Point 10 10) |
1524 |
bounds: (Rectangle 0 0 378 312) |
|
1525 |
) |
|
1526 |
component: |
|
1527 |
(SpecCollection |
|
1528 |
collection: ( |
|
1529 |
(LabelSpec |
|
1530 |
label: 'Hue-Shift:' |
|
1531 |
name: 'HueLabel' |
|
3562 | 1532 |
layout: (LayoutFrame 4 0 21 0 171 0 43 0) |
1533 |
activeHelpKey: hueShift |
|
1534 |
uuid: '3787f638-6194-11e8-a86d-b8f6b1108e05' |
|
3468 | 1535 |
translateLabel: true |
1536 |
adjust: right |
|
1537 |
) |
|
1538 |
(InputFieldSpec |
|
1539 |
name: 'HueShiftEntryField' |
|
3562 | 1540 |
layout: (LayoutFrame 172 0 21 0 243 0 43 0) |
1541 |
activeHelpKey: hueShift |
|
1542 |
uuid: '3787f84a-6194-11e8-a86d-b8f6b1108e05' |
|
3468 | 1543 |
tabable: true |
3562 | 1544 |
model: hueShiftHolder |
3468 | 1545 |
type: numberInRange |
1546 |
minValue: 0 |
|
1547 |
maxValue: 360 |
|
1548 |
acceptChannel: acceptChannel |
|
3562 | 1549 |
acceptOnPointerLeave: true |
3468 | 1550 |
) |
1551 |
(ThumbWheelSpec |
|
1552 |
name: 'HueWheel' |
|
1553 |
layout: (LayoutFrame 246 0 22 0 363 0 42 0) |
|
3562 | 1554 |
activeHelpKey: hueShift |
1555 |
uuid: '3787fafc-6194-11e8-a86d-b8f6b1108e05' |
|
1556 |
model: hueShiftHolder |
|
3468 | 1557 |
orientation: horizontal |
1558 |
step: 1 |
|
1559 |
endlessRotation: true |
|
1560 |
) |
|
3562 | 1561 |
(ActionButtonSpec |
1562 |
name: 'resetHueShift' |
|
1563 |
layout: (LayoutFrame -10 1 27 0 0 1 37 0) |
|
1564 |
activeHelpKey: resetHueShift |
|
1565 |
uuid: 'e8c1e754-6196-11e8-a86d-b8f6b1108e05' |
|
1566 |
translateLabel: true |
|
1567 |
model: resetHueShift |
|
1568 |
) |
|
3468 | 1569 |
(LabelSpec |
1570 |
label: 'Light Factor:' |
|
1571 |
name: 'LightLabel' |
|
3562 | 1572 |
layout: (LayoutFrame 4 0 50 0 171 0 72 0) |
1573 |
activeHelpKey: lightFactor |
|
1574 |
uuid: '3787fda4-6194-11e8-a86d-b8f6b1108e05' |
|
3468 | 1575 |
translateLabel: true |
1576 |
adjust: right |
|
1577 |
) |
|
1578 |
(InputFieldSpec |
|
1579 |
name: 'LightEntryField' |
|
3562 | 1580 |
layout: (LayoutFrame 172 0 50 0 243 0 72 0) |
1581 |
activeHelpKey: lightFactor |
|
1582 |
uuid: '3787feee-6194-11e8-a86d-b8f6b1108e05' |
|
3468 | 1583 |
tabable: true |
3562 | 1584 |
model: lightFactorHolder |
3468 | 1585 |
type: numberInRange |
3562 | 1586 |
minValue: 0.0 |
1587 |
maxValue: 10.0 |
|
3468 | 1588 |
acceptChannel: acceptChannel |
3562 | 1589 |
acceptOnPointerLeave: true |
3468 | 1590 |
) |
1591 |
(ThumbWheelSpec |
|
1592 |
name: 'LightWheel' |
|
1593 |
layout: (LayoutFrame 246 0 51 0 363 0 71 0) |
|
3562 | 1594 |
activeHelpKey: lightFactor |
1595 |
uuid: '378800d8-6194-11e8-a86d-b8f6b1108e05' |
|
1596 |
model: lightFactorHolder |
|
3468 | 1597 |
orientation: horizontal |
3562 | 1598 |
start: 0.0 |
1599 |
stop: 10.0 |
|
1600 |
step: 0.001 |
|
1601 |
) |
|
1602 |
(ActionButtonSpec |
|
1603 |
name: 'Button3' |
|
1604 |
layout: (LayoutFrame -10 1 56 0 0 1 66 0) |
|
1605 |
activeHelpKey: resetLightFactor |
|
1606 |
uuid: 'e8c1eb50-6196-11e8-a86d-b8f6b1108e05' |
|
1607 |
translateLabel: true |
|
1608 |
model: resetLightFactor |
|
3468 | 1609 |
) |
1610 |
(LabelSpec |
|
1611 |
label: 'Saturation Factor:' |
|
1612 |
name: 'SaturationLabel' |
|
3562 | 1613 |
layout: (LayoutFrame 4 0 79 0 171 0 101 0) |
1614 |
activeHelpKey: saturationFactor |
|
1615 |
uuid: '3788022c-6194-11e8-a86d-b8f6b1108e05' |
|
3468 | 1616 |
translateLabel: true |
1617 |
adjust: right |
|
1618 |
) |
|
1619 |
(InputFieldSpec |
|
1620 |
name: 'SaturationEntryField' |
|
3562 | 1621 |
layout: (LayoutFrame 172 0 79 0 243 0 101 0) |
1622 |
activeHelpKey: saturationFactor |
|
1623 |
uuid: '37880358-6194-11e8-a86d-b8f6b1108e05' |
|
3468 | 1624 |
tabable: true |
3562 | 1625 |
model: saturationFactorHolder |
3468 | 1626 |
type: numberInRange |
3562 | 1627 |
minValue: 0.0 |
1628 |
maxValue: 10.0 |
|
3468 | 1629 |
acceptChannel: acceptChannel |
3562 | 1630 |
acceptOnPointerLeave: true |
3468 | 1631 |
) |
1632 |
(ThumbWheelSpec |
|
1633 |
name: 'SaturationWheel' |
|
1634 |
layout: (LayoutFrame 246 0 80 0 363 0 100 0) |
|
3562 | 1635 |
activeHelpKey: saturationFactor |
1636 |
uuid: '3788051a-6194-11e8-a86d-b8f6b1108e05' |
|
1637 |
model: saturationFactorHolder |
|
3468 | 1638 |
orientation: horizontal |
3562 | 1639 |
start: 0.0 |
1640 |
stop: 10.0 |
|
1641 |
step: 0.001 |
|
1642 |
) |
|
1643 |
(ActionButtonSpec |
|
1644 |
name: 'Button4' |
|
1645 |
layout: (LayoutFrame -10 1 85 0 0 1 95 0) |
|
1646 |
activeHelpKey: resetSaturationFactor |
|
1647 |
uuid: 'e8c1efce-6196-11e8-a86d-b8f6b1108e05' |
|
1648 |
translateLabel: true |
|
1649 |
model: resetSaturationFactor |
|
3468 | 1650 |
) |
1651 |
(LabelSpec |
|
1652 |
label: 'Color Shift' |
|
1653 |
name: 'Label2' |
|
1654 |
layout: (LayoutFrame 5 0 127 0 -15 0.5 149 0) |
|
3562 | 1655 |
uuid: '37880650-6194-11e8-a86d-b8f6b1108e05' |
3468 | 1656 |
translateLabel: true |
1657 |
) |
|
1658 |
(LabelSpec |
|
1659 |
name: 'HueColorLabel' |
|
1660 |
layout: (LayoutFrame 18 0.0 150 0 -41 0.5 234 0) |
|
3562 | 1661 |
uuid: '37880768-6194-11e8-a86d-b8f6b1108e05' |
3468 | 1662 |
level: -1 |
1663 |
backgroundChannel: hlsColor |
|
1664 |
translateLabel: true |
|
1665 |
) |
|
1666 |
(LabelSpec |
|
1667 |
label: 'Preview' |
|
1668 |
name: 'Label3' |
|
1669 |
layout: (LayoutFrame 5 0.5 127 0 -5 1 149 0) |
|
3562 | 1670 |
uuid: '37880894-6194-11e8-a86d-b8f6b1108e05' |
3468 | 1671 |
translateLabel: true |
1672 |
) |
|
1673 |
(LabelSpec |
|
1674 |
name: 'PreviewLabel' |
|
1675 |
layout: (LayoutFrame 36 0.5 150 0 -23 1.0 234 0) |
|
3562 | 1676 |
uuid: '378809ac-6194-11e8-a86d-b8f6b1108e05' |
3468 | 1677 |
level: -1 |
1678 |
translateLabel: true |
|
1679 |
labelChannel: previewImageHolder |
|
1680 |
) |
|
1681 |
(HorizontalPanelViewSpec |
|
1682 |
name: 'HorizontalPanel1' |
|
3562 | 1683 |
layout: (LayoutFrame 0 0.0 -30 1 -16 1.0 0 1) |
1684 |
uuid: '37880ace-6194-11e8-a86d-b8f6b1108e05' |
|
3468 | 1685 |
horizontalLayout: fitSpace |
1686 |
verticalLayout: center |
|
1687 |
horizontalSpace: 3 |
|
1688 |
verticalSpace: 3 |
|
1689 |
reverseOrderIfOKAtLeft: true |
|
1690 |
component: |
|
1691 |
(SpecCollection |
|
1692 |
collection: ( |
|
1693 |
(ActionButtonSpec |
|
1694 |
label: 'Cancel' |
|
1695 |
name: 'Button1' |
|
3562 | 1696 |
uuid: '37880cd6-6194-11e8-a86d-b8f6b1108e05' |
3468 | 1697 |
translateLabel: true |
1698 |
tabable: true |
|
1699 |
model: cancel |
|
3562 | 1700 |
extent: (Point 175 28) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1701 |
) |
3468 | 1702 |
(ActionButtonSpec |
1703 |
label: 'OK' |
|
1704 |
name: 'Button2' |
|
3562 | 1705 |
uuid: '37880ee8-6194-11e8-a86d-b8f6b1108e05' |
3468 | 1706 |
translateLabel: true |
1707 |
tabable: true |
|
1708 |
model: accept |
|
3562 | 1709 |
extent: (Point 175 28) |
3468 | 1710 |
) |
1711 |
) |
|
1712 |
||
1713 |
) |
|
1714 |
keepSpaceForOSXResizeHandleH: true |
|
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1715 |
) |
3468 | 1716 |
) |
1717 |
||
1718 |
) |
|
1719 |
) |
|
3562 | 1720 |
|
1721 |
"Modified: / 27-05-2018 / 12:27:58 / Claus Gittinger" |
|
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1722 |
! |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1723 |
|
3413 | 1724 |
cropSpec |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1725 |
"This resource specification was automatically generated |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1726 |
by the UIPainter of ST/X." |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1727 |
|
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1728 |
"Do not manually edit this!! If it is corrupted, |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1729 |
the UIPainter may not be able to read the specification." |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1730 |
|
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1731 |
" |
3413 | 1732 |
UIPainter new openOnClass:ImageEditor andSelector:#cropSpec |
1733 |
ImageEditor new openInterface:#cropSpec |
|
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1734 |
" |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1735 |
|
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1736 |
<resource: #canvas> |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1737 |
|
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
1738 |
^ |
3376 | 1739 |
#(FullSpec |
3413 | 1740 |
name: cropSpec |
3376 | 1741 |
window: |
1742 |
(WindowSpec |
|
1743 |
label: 'Crop Border(s)' |
|
1744 |
name: 'Crop Border(s)' |
|
1745 |
min: (Point 10 10) |
|
3408 | 1746 |
bounds: (Rectangle 0 0 364 312) |
3376 | 1747 |
) |
1748 |
component: |
|
1749 |
(SpecCollection |
|
1750 |
collection: ( |
|
1751 |
(LabelSpec |
|
1752 |
label: 'Left:' |
|
3413 | 1753 |
name: 'CropLeftLabel' |
3376 | 1754 |
layout: (LayoutFrame 14 0 24 0 90 0 46 0) |
3413 | 1755 |
activeHelpKey: cropLeft |
3376 | 1756 |
translateLabel: true |
3404 | 1757 |
adjust: left |
3376 | 1758 |
) |
1759 |
(InputFieldSpec |
|
3413 | 1760 |
name: 'CropLeftEntryField' |
3404 | 1761 |
layout: (LayoutFrame 95 0 24 0 125 0 46 0) |
3413 | 1762 |
activeHelpKey: cropLeft |
3376 | 1763 |
tabable: true |
3413 | 1764 |
model: cropLeftAmount |
3376 | 1765 |
type: number |
1766 |
acceptChannel: acceptChannel |
|
1767 |
acceptOnPointerLeave: false |
|
1768 |
) |
|
1769 |
(ActionButtonSpec |
|
3413 | 1770 |
label: 'Crop Now' |
1771 |
name: 'CropLeftNowButton' |
|
3417 | 1772 |
layout: (LayoutFrame 133 0 21 0 229 0 50 0) |
3413 | 1773 |
activeHelpKey: cropLeft |
3376 | 1774 |
translateLabel: true |
1775 |
resizeForLabel: true |
|
1776 |
tabable: true |
|
3413 | 1777 |
model: cropLeftNow |
3376 | 1778 |
autoRepeat: true |
1779 |
usePreferredWidth: true |
|
1780 |
) |
|
3417 | 1781 |
(ActionButtonSpec |
1782 |
label: 'Auto' |
|
1783 |
name: 'Button6' |
|
1784 |
layout: (LayoutFrame 236 0 21 0 289 0 50 0) |
|
1785 |
activeHelpKey: autoCropLeft |
|
1786 |
translateLabel: true |
|
1787 |
resizeForLabel: true |
|
1788 |
tabable: true |
|
1789 |
model: autoCropLeft |
|
1790 |
autoRepeat: true |
|
1791 |
usePreferredWidth: true |
|
1792 |
) |
|
3376 | 1793 |
(LabelSpec |
1794 |
label: 'Right:' |
|
3413 | 1795 |
name: 'CropRightLabel' |
3376 | 1796 |
layout: (LayoutFrame 14 0 55 0 90 0 77 0) |
3413 | 1797 |
activeHelpKey: cropRight |
3376 | 1798 |
translateLabel: true |
3404 | 1799 |
adjust: left |
3376 | 1800 |
) |
1801 |
(InputFieldSpec |
|
3413 | 1802 |
name: 'CropRightEntryField' |
3404 | 1803 |
layout: (LayoutFrame 95 0 55 0 125 0 77 0) |
3413 | 1804 |
activeHelpKey: cropRight |
3376 | 1805 |
tabable: true |
3413 | 1806 |
model: cropRightAmount |
3376 | 1807 |
type: number |
1808 |
acceptChannel: acceptChannel |
|
1809 |
acceptOnPointerLeave: false |
|
1810 |
) |
|
1811 |
(ActionButtonSpec |
|
3413 | 1812 |
label: 'Crop Now' |
1813 |
name: 'CropRightButton' |
|
3417 | 1814 |
layout: (LayoutFrame 133 0 51 0 229 0 80 0) |
3413 | 1815 |
activeHelpKey: cropRight |
3376 | 1816 |
translateLabel: true |
1817 |
resizeForLabel: true |
|
1818 |
tabable: true |
|
3413 | 1819 |
model: cropRightNow |
3376 | 1820 |
autoRepeat: true |
1821 |
usePreferredWidth: true |
|
1822 |
) |
|
3417 | 1823 |
(ActionButtonSpec |
1824 |
label: 'Auto' |
|
1825 |
name: 'Button7' |
|
1826 |
layout: (LayoutFrame 236 0 51 0 289 0 80 0) |
|
1827 |
activeHelpKey: autoCropRight |
|
1828 |
translateLabel: true |
|
1829 |
resizeForLabel: true |
|
1830 |
tabable: true |
|
1831 |
model: autoCropRight |
|
1832 |
autoRepeat: true |
|
1833 |
usePreferredWidth: true |
|
1834 |
) |
|
3376 | 1835 |
(LabelSpec |
1836 |
label: 'Top:' |
|
3413 | 1837 |
name: 'CropTopLabel' |
3376 | 1838 |
layout: (LayoutFrame 14 0 85 0 90 0 107 0) |
3413 | 1839 |
activeHelpKey: cropTop |
3376 | 1840 |
translateLabel: true |
3404 | 1841 |
adjust: left |
3376 | 1842 |
) |
1843 |
(InputFieldSpec |
|
3413 | 1844 |
name: 'CropTopEntryField' |
3404 | 1845 |
layout: (LayoutFrame 95 0 85 0 125 0 107 0) |
3413 | 1846 |
activeHelpKey: cropTop |
3376 | 1847 |
tabable: true |
3413 | 1848 |
model: cropTopAmount |
3376 | 1849 |
type: number |
1850 |
acceptChannel: acceptChannel |
|
1851 |
acceptOnPointerLeave: false |
|
1852 |
) |
|
1853 |
(ActionButtonSpec |
|
3413 | 1854 |
label: 'Crop Now' |
1855 |
name: 'CropTopButton' |
|
3417 | 1856 |
layout: (LayoutFrame 133 0 81 0 229 0 110 0) |
3413 | 1857 |
activeHelpKey: cropTop |
3376 | 1858 |
translateLabel: true |
1859 |
resizeForLabel: true |
|
1860 |
tabable: true |
|
3413 | 1861 |
model: cropTopNow |
3376 | 1862 |
autoRepeat: true |
1863 |
usePreferredWidth: true |
|
1864 |
) |
|
3417 | 1865 |
(ActionButtonSpec |
1866 |
label: 'Auto' |
|
1867 |
name: 'Button8' |
|
1868 |
layout: (LayoutFrame 236 0 81 0 289 0 110 0) |
|
1869 |
activeHelpKey: autoCropTop |
|
1870 |
translateLabel: true |
|
1871 |
resizeForLabel: true |
|
1872 |
tabable: true |
|
1873 |
model: autoCropTop |
|
1874 |
autoRepeat: true |
|
1875 |
usePreferredWidth: true |
|
1876 |
) |
|
3376 | 1877 |
(LabelSpec |
1878 |
label: 'Bottom:' |
|
3413 | 1879 |
name: 'CropBottomLabel' |
3376 | 1880 |
layout: (LayoutFrame 14 0 115 0 90 0 137 0) |
3413 | 1881 |
activeHelpKey: cropBottom |
3376 | 1882 |
translateLabel: true |
3404 | 1883 |
adjust: left |
3376 | 1884 |
) |
1885 |
(InputFieldSpec |
|
3413 | 1886 |
name: 'CropBottomEntryField' |
3404 | 1887 |
layout: (LayoutFrame 95 0 115 0 125 0 137 0) |
3413 | 1888 |
activeHelpKey: cropBottom |
3376 | 1889 |
tabable: true |
3413 | 1890 |
model: cropBottomAmount |
3376 | 1891 |
type: number |
1892 |
acceptChannel: acceptChannel |
|
1893 |
acceptOnPointerLeave: false |
|
1894 |
) |
|
1895 |
(ActionButtonSpec |
|
3413 | 1896 |
label: 'Crop Now' |
1897 |
name: 'CropBottomButton' |
|
3417 | 1898 |
layout: (LayoutFrame 133 0 111 0 229 0 140 0) |
3413 | 1899 |
activeHelpKey: cropBottom |
3376 | 1900 |
translateLabel: true |
1901 |
resizeForLabel: true |
|
1902 |
tabable: true |
|
3413 | 1903 |
model: cropBottomNow |
3376 | 1904 |
autoRepeat: true |
1905 |
usePreferredWidth: true |
|
1906 |
) |
|
3408 | 1907 |
(ActionButtonSpec |
3417 | 1908 |
label: 'Auto' |
1909 |
name: 'Button9' |
|
1910 |
layout: (LayoutFrame 236 0 111 0 289 0 140 0) |
|
1911 |
activeHelpKey: autoCropBottom |
|
1912 |
translateLabel: true |
|
1913 |
resizeForLabel: true |
|
1914 |
tabable: true |
|
1915 |
model: autoCropBottom |
|
1916 |
autoRepeat: true |
|
1917 |
usePreferredWidth: true |
|
1918 |
) |
|
1919 |
(ActionButtonSpec |
|
1920 |
label: 'All' |
|
3408 | 1921 |
name: 'Button4' |
3417 | 1922 |
layout: (LayoutFrame 133 0 148 0 229 0 176 0) |
3413 | 1923 |
activeHelpKey: cropAll |
3408 | 1924 |
translateLabel: true |
1925 |
resizeForLabel: true |
|
1926 |
tabable: true |
|
1927 |
model: applyCropAction |
|
1928 |
) |
|
3376 | 1929 |
(HorizontalPanelViewSpec |
1930 |
name: 'HorizontalPanel1' |
|
3413 | 1931 |
layout: (LayoutFrame 0 0.0 -30 1 0 1.0 0 1) |
3400 | 1932 |
visibilityChannel: cropBoxIsDialog |
3376 | 1933 |
horizontalLayout: fitSpace |
1934 |
verticalLayout: center |
|
1935 |
horizontalSpace: 3 |
|
1936 |
verticalSpace: 3 |
|
1937 |
reverseOrderIfOKAtLeft: true |
|
1938 |
component: |
|
1939 |
(SpecCollection |
|
1940 |
collection: ( |
|
1941 |
(ActionButtonSpec |
|
1942 |
label: 'Cancel' |
|
1943 |
name: 'Button1' |
|
1944 |
translateLabel: true |
|
1945 |
resizeForLabel: true |
|
1946 |
tabable: true |
|
1947 |
model: cancel |
|
3413 | 1948 |
extent: (Point 116 28) |
1650 | 1949 |
) |
3376 | 1950 |
(ActionButtonSpec |
1951 |
label: 'Apply' |
|
1952 |
name: 'Button3' |
|
1953 |
translateLabel: true |
|
1954 |
resizeForLabel: true |
|
1955 |
tabable: true |
|
3408 | 1956 |
model: applyCropAction |
3413 | 1957 |
extent: (Point 116 28) |
3376 | 1958 |
) |
1959 |
(ActionButtonSpec |
|
1960 |
label: 'OK' |
|
1961 |
name: 'Button2' |
|
1962 |
translateLabel: true |
|
1963 |
resizeForLabel: true |
|
1964 |
tabable: true |
|
1965 |
model: accept |
|
3413 | 1966 |
extent: (Point 116 28) |
3376 | 1967 |
) |
1968 |
) |
|
1969 |
||
1970 |
) |
|
3408 | 1971 |
) |
3417 | 1972 |
(ActionButtonSpec |
1973 |
label: 'All' |
|
1974 |
name: 'Button10' |
|
1975 |
layout: (LayoutFrame 236 0 148 0 289 0 176 0) |
|
1976 |
activeHelpKey: autoCropAll |
|
1977 |
translateLabel: true |
|
1978 |
resizeForLabel: true |
|
1979 |
tabable: true |
|
1980 |
model: autoCropAll |
|
1981 |
) |
|
3376 | 1982 |
) |
1983 |
||
1984 |
) |
|
1985 |
) |
|
1650 | 1986 |
! |
1987 |
||
767 | 1988 |
dialogSpecForNewImage |
737 | 1989 |
"This resource specification was automatically generated |
1990 |
by the UIPainter of ST/X." |
|
519 | 1991 |
|
737 | 1992 |
"Do not manually edit this!! If it is corrupted, |
1993 |
the UIPainter may not be able to read the specification." |
|
519 | 1994 |
|
1995 |
" |
|
767 | 1996 |
UIPainter new openOnClass:ImageEditor andSelector:#dialogSpecForNewImage |
1997 |
ImageEditor new openInterface:#dialogSpecForNewImage |
|
519 | 1998 |
" |
1999 |
||
2000 |
<resource: #canvas> |
|
2001 |
||
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
2002 |
^ |
3494 | 2003 |
#(FullSpec |
2004 |
name: dialogSpecForNewImage |
|
2005 |
window: |
|
2006 |
(WindowSpec |
|
2007 |
label: 'New Image' |
|
2008 |
name: 'New Image' |
|
2009 |
min: (Point 10 10) |
|
2010 |
bounds: (Rectangle 0 0 301 119) |
|
2011 |
) |
|
2012 |
component: |
|
2013 |
(SpecCollection |
|
2014 |
collection: ( |
|
2015 |
(ViewSpec |
|
2016 |
name: 'View' |
|
2017 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 -35 1.0) |
|
2018 |
level: 1 |
|
2019 |
component: |
|
2020 |
(SpecCollection |
|
2021 |
collection: ( |
|
2022 |
(FramedBoxSpec |
|
2023 |
label: 'Size' |
|
2024 |
name: 'framedBox1' |
|
2025 |
layout: (LayoutFrame 1 0.0 7 0.0 0 0.40000000000000002 76 0) |
|
2026 |
style: (FontDescription helvetica medium roman 12) |
|
2027 |
labelPosition: topLeft |
|
2028 |
translateLabel: true |
|
2029 |
component: |
|
2030 |
(SpecCollection |
|
2031 |
collection: ( |
|
2032 |
(ComboBoxSpec |
|
2033 |
name: 'defaultSizesComboBox' |
|
2034 |
layout: (LayoutFrame 0 0.0 10 0.0 0 1 35 0.0) |
|
2035 |
model: selectionOfSize |
|
2036 |
type: string |
|
2037 |
acceptOnPointerLeave: false |
|
2038 |
comboList: listOfDefaultSizes |
|
2039 |
isFilenameBox: false |
|
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2040 |
) |
3494 | 2041 |
) |
2042 |
||
2043 |
) |
|
2044 |
) |
|
2045 |
(FramedBoxSpec |
|
2046 |
label: 'Color Map' |
|
2047 |
name: 'framedBox2' |
|
2048 |
layout: (LayoutFrame 0 0.40000000000000002 7 0.0 -1 1.0 76 0) |
|
2049 |
style: (FontDescription helvetica medium roman 12) |
|
2050 |
labelPosition: topLeft |
|
2051 |
translateLabel: true |
|
2052 |
component: |
|
2053 |
(SpecCollection |
|
2054 |
collection: ( |
|
2055 |
(ComboListSpec |
|
2056 |
name: 'colorMapComboBox' |
|
2057 |
layout: (LayoutFrame 0 0.0 10 0.0 0 1 35 0.0) |
|
2058 |
model: selectionOfColorMap |
|
2059 |
comboList: listOfColorMaps |
|
2060 |
useIndex: false |
|
2061 |
hidePullDownMenuButton: false |
|
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2062 |
) |
3494 | 2063 |
) |
2064 |
||
2065 |
) |
|
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
2066 |
) |
3494 | 2067 |
) |
2068 |
||
2069 |
) |
|
1457
8c15098c3469
ok button is left in some viewStyles
Claus Gittinger <cg@exept.de>
parents:
1449
diff
changeset
|
2070 |
) |
3494 | 2071 |
(UISubSpecification |
2072 |
name: 'windowSpecForCommitWithoutChannels' |
|
2073 |
layout: (LayoutFrame 2 0.0 -37 1 -2 1.0 -2 1.0) |
|
2074 |
minorKey: windowSpecForCommitWithoutChannels |
|
2075 |
keepSpaceForOSXResizeHandleH: true |
|
2076 |
) |
|
2077 |
) |
|
2078 |
||
2079 |
) |
|
2080 |
) |
|
986 | 2081 |
! |
2082 |
||
3413 | 2083 |
floodFillToleranceSpec |
2084 |
"This resource specification was automatically generated |
|
2085 |
by the UIPainter of ST/X." |
|
2086 |
||
2087 |
"Do not manually edit this!! If it is corrupted, |
|
2088 |
the UIPainter may not be able to read the specification." |
|
2089 |
||
2090 |
" |
|
2091 |
UIPainter new openOnClass:ImageEditor andSelector:#floodFillToleranceSpec |
|
2092 |
ImageEditor new openInterface:#floodFillToleranceSpec |
|
2093 |
" |
|
2094 |
||
2095 |
<resource: #canvas> |
|
2096 |
||
2097 |
^ |
|
2098 |
#(FullSpec |
|
2099 |
name: floodFillToleranceSpec |
|
2100 |
window: |
|
2101 |
(WindowSpec |
|
2102 |
label: 'Flood Fill Tolerance' |
|
2103 |
name: 'Flood Fill Tolerance' |
|
2104 |
min: (Point 10 10) |
|
2105 |
bounds: (Rectangle 0 0 364 312) |
|
2106 |
) |
|
2107 |
component: |
|
2108 |
(SpecCollection |
|
2109 |
collection: ( |
|
2110 |
(LabelSpec |
|
2111 |
label: 'Flood Fill Tolerance:' |
|
2112 |
name: 'Label1' |
|
2113 |
layout: (LayoutFrame 14 0 10 0 242 0 32 0) |
|
2114 |
activeHelpKey: floodFillMaxError |
|
2115 |
visibilityChannel: cropBoxIsNotDialog |
|
2116 |
translateLabel: true |
|
2117 |
adjust: left |
|
2118 |
) |
|
2119 |
(LabelSpec |
|
2120 |
label: 'Hue:' |
|
2121 |
name: 'Label2' |
|
3440 | 2122 |
layout: (LayoutFrame 29 0 38 0 127 0 60 0) |
3413 | 2123 |
activeHelpKey: floodFillMaxError |
2124 |
visibilityChannel: cropBoxIsNotDialog |
|
2125 |
translateLabel: true |
|
2126 |
adjust: left |
|
2127 |
) |
|
2128 |
(InputFieldSpec |
|
2129 |
name: 'EntryField2' |
|
2130 |
layout: (LayoutFrame 132 0 38 0 190 0 60 0) |
|
2131 |
activeHelpKey: floodFillMaxError |
|
2132 |
visibilityChannel: cropBoxIsNotDialog |
|
2133 |
tabable: true |
|
2134 |
model: floodFillMaxHueError |
|
2135 |
type: number |
|
2136 |
acceptChannel: acceptChannel |
|
2137 |
acceptOnPointerLeave: true |
|
2138 |
) |
|
2139 |
(LabelSpec |
|
2140 |
label: 'Light:' |
|
2141 |
name: 'Label3' |
|
3440 | 2142 |
layout: (LayoutFrame 29 0 64 0 127 0 86 0) |
3413 | 2143 |
activeHelpKey: floodFillMaxError |
2144 |
visibilityChannel: cropBoxIsNotDialog |
|
2145 |
translateLabel: true |
|
2146 |
adjust: left |
|
2147 |
) |
|
2148 |
(InputFieldSpec |
|
2149 |
name: 'EntryField3' |
|
2150 |
layout: (LayoutFrame 132 0 64 0 190 0 86 0) |
|
2151 |
activeHelpKey: floodFillMaxError |
|
2152 |
visibilityChannel: cropBoxIsNotDialog |
|
2153 |
tabable: true |
|
2154 |
model: floodFillMaxLightError |
|
2155 |
type: number |
|
2156 |
acceptChannel: acceptChannel |
|
2157 |
acceptOnPointerLeave: true |
|
2158 |
) |
|
2159 |
(HorizontalPanelViewSpec |
|
2160 |
name: 'HorizontalPanel1' |
|
2161 |
layout: (LayoutFrame 0 0.0 -30 1 0 1.0 0 1) |
|
2162 |
visibilityChannel: cropBoxIsDialog |
|
2163 |
horizontalLayout: fitSpace |
|
2164 |
verticalLayout: center |
|
2165 |
horizontalSpace: 3 |
|
2166 |
verticalSpace: 3 |
|
2167 |
reverseOrderIfOKAtLeft: true |
|
2168 |
component: |
|
2169 |
(SpecCollection |
|
2170 |
collection: ( |
|
2171 |
(ActionButtonSpec |
|
2172 |
label: 'Cancel' |
|
2173 |
name: 'Button1' |
|
2174 |
translateLabel: true |
|
2175 |
resizeForLabel: true |
|
2176 |
tabable: true |
|
2177 |
model: cancel |
|
2178 |
extent: (Point 116 28) |
|
2179 |
) |
|
2180 |
(ActionButtonSpec |
|
2181 |
label: 'Apply' |
|
2182 |
name: 'Button3' |
|
2183 |
translateLabel: true |
|
2184 |
resizeForLabel: true |
|
2185 |
tabable: true |
|
2186 |
model: applyCropAction |
|
2187 |
extent: (Point 116 28) |
|
2188 |
) |
|
2189 |
(ActionButtonSpec |
|
2190 |
label: 'OK' |
|
2191 |
name: 'Button2' |
|
2192 |
translateLabel: true |
|
2193 |
resizeForLabel: true |
|
2194 |
tabable: true |
|
2195 |
model: accept |
|
2196 |
extent: (Point 116 28) |
|
2197 |
) |
|
2198 |
) |
|
2199 |
||
2200 |
) |
|
2201 |
) |
|
2202 |
) |
|
2203 |
||
2204 |
) |
|
2205 |
) |
|
2206 |
! |
|
2207 |
||
1557 | 2208 |
shiftDialogSpec |
2209 |
"This resource specification was automatically generated |
|
2210 |
by the UIPainter of ST/X." |
|
2211 |
||
2212 |
"Do not manually edit this!! If it is corrupted, |
|
2213 |
the UIPainter may not be able to read the specification." |
|
2214 |
||
2215 |
" |
|
2216 |
UIPainter new openOnClass:ImageEditor andSelector:#shiftDialogSpec |
|
2217 |
ImageEditor new openInterface:#shiftDialogSpec |
|
2218 |
" |
|
2219 |
||
2220 |
<resource: #canvas> |
|
2221 |
||
2222 |
^ |
|
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2223 |
#(FullSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2224 |
name: shiftDialogSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2225 |
window: |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2226 |
(WindowSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2227 |
label: 'Shift' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2228 |
name: 'Shift' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2229 |
min: (Point 10 10) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2230 |
bounds: (Rectangle 14 46 259 229) |
1557 | 2231 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2232 |
component: |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2233 |
(SpecCollection |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2234 |
collection: ( |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2235 |
(LabelSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2236 |
label: 'Amount:' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2237 |
name: 'AmountLabel' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2238 |
layout: (LayoutFrame 14 0 21 0 90 0 43 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2239 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2240 |
adjust: right |
1557 | 2241 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2242 |
(InputFieldSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2243 |
name: 'AmountEntryField' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2244 |
layout: (LayoutFrame 95 0 21 0 139 0 43 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2245 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2246 |
model: shiftAmount |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2247 |
type: number |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2248 |
acceptChannel: acceptChannel |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2249 |
acceptOnPointerLeave: false |
1557 | 2250 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2251 |
(HorizontalPanelViewSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2252 |
name: 'HorizontalPanel1' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2253 |
layout: (LayoutFrame 0 0.0 -30 1 0 1.0 0 1) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2254 |
horizontalLayout: fitSpace |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2255 |
verticalLayout: center |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2256 |
horizontalSpace: 3 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2257 |
verticalSpace: 3 |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2258 |
reverseOrderIfOKAtLeft: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2259 |
component: |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2260 |
(SpecCollection |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2261 |
collection: ( |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2262 |
(ActionButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2263 |
label: 'Cancel' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2264 |
name: 'Button1' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2265 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2266 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2267 |
model: cancel |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2268 |
extent: (Point 118 22) |
1557 | 2269 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2270 |
(ActionButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2271 |
label: 'OK' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2272 |
name: 'Button2' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2273 |
translateLabel: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2274 |
tabable: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2275 |
model: accept |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2276 |
extent: (Point 118 22) |
1557 | 2277 |
) |
2278 |
) |
|
2279 |
||
2280 |
) |
|
2281 |
) |
|
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2282 |
(ArrowButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2283 |
name: 'upArrowButton' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2284 |
layout: (LayoutFrame 105 0 63 0 127 0 85 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2285 |
model: shiftUpNow |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2286 |
isTriggerOnDown: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2287 |
autoRepeat: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2288 |
actionValue: '' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2289 |
direction: up |
1557 | 2290 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2291 |
(ArrowButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2292 |
name: 'leftArrowButton' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2293 |
layout: (LayoutFrame 84 0 86 0 106 0 108 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2294 |
model: shiftLeftNow |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2295 |
isTriggerOnDown: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2296 |
autoRepeat: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2297 |
actionValue: '' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2298 |
direction: left |
1557 | 2299 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2300 |
(ArrowButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2301 |
name: 'rightArrowButton' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2302 |
layout: (LayoutFrame 126 0 86 0 148 0 108 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2303 |
model: shiftRightNow |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2304 |
isTriggerOnDown: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2305 |
autoRepeat: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2306 |
actionValue: '' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2307 |
direction: right |
1557 | 2308 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2309 |
(ArrowButtonSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2310 |
name: 'downArrowButton' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2311 |
layout: (LayoutFrame 105 0 107 0 127 0 129 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2312 |
model: shiftDownNow |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2313 |
isTriggerOnDown: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2314 |
autoRepeat: true |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2315 |
actionValue: '' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2316 |
direction: down |
1557 | 2317 |
) |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2318 |
(CheckBoxSpec |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2319 |
label: 'Wrap' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2320 |
name: 'CheckBox1' |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2321 |
layout: (LayoutFrame 153 0 22 0 289 0 44 0) |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2322 |
model: wrap |
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
2323 |
translateLabel: true |
1713 | 2324 |
) |
1557 | 2325 |
) |
2326 |
||
2327 |
) |
|
2328 |
) |
|
2329 |
! |
|
2330 |
||
3413 | 2331 |
uncropSpec |
1480 | 2332 |
"This resource specification was automatically generated |
2333 |
by the UIPainter of ST/X." |
|
1796 | 2334 |
|
1480 | 2335 |
"Do not manually edit this!! If it is corrupted, |
2336 |
the UIPainter may not be able to read the specification." |
|
1796 | 2337 |
|
1480 | 2338 |
" |
3413 | 2339 |
UIPainter new openOnClass:ImageEditor andSelector:#uncropSpec |
2340 |
ImageEditor new openInterface:#uncropSpec |
|
1480 | 2341 |
" |
1796 | 2342 |
|
2343 |
<resource: #canvas> |
|
2344 |
||
2345 |
^ |
|
3413 | 2346 |
#(FullSpec |
2347 |
name: uncropSpec |
|
2348 |
window: |
|
2349 |
(WindowSpec |
|
2350 |
label: 'Add Border(s)' |
|
2351 |
name: 'Add Border(s)' |
|
2352 |
min: (Point 10 10) |
|
2353 |
max: (Point 800 478) |
|
2354 |
bounds: (Rectangle 0 0 261 228) |
|
2355 |
) |
|
2356 |
component: |
|
2357 |
(SpecCollection |
|
2358 |
collection: ( |
|
2359 |
(LabelSpec |
|
2360 |
label: 'Left:' |
|
2361 |
name: 'Label1' |
|
2362 |
layout: (LayoutFrame 14 0 21 0 90 0 43 0) |
|
2363 |
translateLabel: true |
|
2364 |
adjust: right |
|
2365 |
) |
|
2366 |
(InputFieldSpec |
|
2367 |
name: 'EntryField1' |
|
2368 |
layout: (LayoutFrame 95 0 21 0 132 0 43 0) |
|
2369 |
model: cropLeftAmount |
|
2370 |
type: number |
|
2371 |
acceptOnPointerLeave: false |
|
2372 |
) |
|
2373 |
(LabelSpec |
|
2374 |
label: 'Right:' |
|
2375 |
name: 'Label2' |
|
2376 |
layout: (LayoutFrame 14 0 51 0 90 0 73 0) |
|
2377 |
translateLabel: true |
|
2378 |
adjust: right |
|
2379 |
) |
|
2380 |
(InputFieldSpec |
|
2381 |
name: 'EntryField2' |
|
2382 |
layout: (LayoutFrame 95 0 51 0 132 0 73 0) |
|
2383 |
model: cropRightAmount |
|
2384 |
type: number |
|
2385 |
acceptOnPointerLeave: false |
|
2386 |
) |
|
2387 |
(LabelSpec |
|
2388 |
label: 'Top:' |
|
2389 |
name: 'Label3' |
|
2390 |
layout: (LayoutFrame 14 0 81 0 90 0 103 0) |
|
2391 |
translateLabel: true |
|
2392 |
adjust: right |
|
2393 |
) |
|
2394 |
(InputFieldSpec |
|
2395 |
name: 'EntryField3' |
|
2396 |
layout: (LayoutFrame 95 0 81 0 132 0 103 0) |
|
2397 |
model: cropTopAmount |
|
2398 |
type: number |
|
2399 |
acceptOnPointerLeave: false |
|
2400 |
) |
|
2401 |
(LabelSpec |
|
2402 |
label: 'Bottom:' |
|
2403 |
name: 'Label4' |
|
2404 |
layout: (LayoutFrame 14 0 111 0 90 0 133 0) |
|
2405 |
translateLabel: true |
|
2406 |
adjust: right |
|
2407 |
) |
|
2408 |
(InputFieldSpec |
|
2409 |
name: 'EntryField4' |
|
2410 |
layout: (LayoutFrame 95 0 111 0 132 0 133 0) |
|
2411 |
model: cropBottomAmount |
|
2412 |
type: number |
|
2413 |
acceptOnPointerLeave: false |
|
2414 |
) |
|
2415 |
(HorizontalPanelViewSpec |
|
2416 |
name: 'HorizontalPanel1' |
|
2417 |
layout: (LayoutFrame 0 0.0 -30 1 0 1.0 0 1) |
|
2418 |
horizontalLayout: fitSpace |
|
2419 |
verticalLayout: center |
|
2420 |
horizontalSpace: 3 |
|
2421 |
verticalSpace: 3 |
|
2422 |
reverseOrderIfOKAtLeft: true |
|
2423 |
component: |
|
2424 |
(SpecCollection |
|
2425 |
collection: ( |
|
2426 |
(ActionButtonSpec |
|
2427 |
label: 'Cancel' |
|
2428 |
name: 'Button1' |
|
2429 |
translateLabel: true |
|
2430 |
model: cancel |
|
2431 |
extent: (Point 124 22) |
|
1796 | 2432 |
) |
3413 | 2433 |
(ActionButtonSpec |
2434 |
label: 'OK' |
|
2435 |
name: 'Button2' |
|
2436 |
translateLabel: true |
|
2437 |
model: accept |
|
2438 |
extent: (Point 125 22) |
|
2439 |
) |
|
2440 |
) |
|
2441 |
||
2442 |
) |
|
1796 | 2443 |
) |
3413 | 2444 |
) |
2445 |
||
2446 |
) |
|
2447 |
) |
|
1480 | 2448 |
! |
2449 |
||
767 | 2450 |
windowSpec |
2451 |
"This resource specification was automatically generated |
|
2452 |
by the UIPainter of ST/X." |
|
2453 |
||
2454 |
"Do not manually edit this!! If it is corrupted, |
|
2455 |
the UIPainter may not be able to read the specification." |
|
2456 |
||
2457 |
" |
|
2458 |
UIPainter new openOnClass:ImageEditor andSelector:#windowSpec |
|
2459 |
ImageEditor new openInterface:#windowSpec |
|
2460 |
ImageEditor open |
|
2461 |
" |
|
2462 |
||
2463 |
<resource: #canvas> |
|
2464 |
||
1558 | 2465 |
^ |
3195 | 2466 |
#(FullSpec |
2467 |
name: windowSpec |
|
3546 | 2468 |
uuid: 'ea3a8340-1e4a-11b2-83b1-485b39758412' |
3195 | 2469 |
window: |
2470 |
(WindowSpec |
|
2471 |
label: 'Image Editor' |
|
2472 |
name: 'Image Editor' |
|
3546 | 2473 |
uuid: 'ea3a8bec-1e4a-11b2-83b1-485b39758412' |
3443 | 2474 |
min: (Point 800 400) |
2475 |
bounds: (Rectangle 0 0 800 446) |
|
3195 | 2476 |
menu: menu |
2477 |
icon: defaultIcon |
|
2478 |
) |
|
2479 |
component: |
|
2480 |
(SpecCollection |
|
2481 |
collection: ( |
|
2482 |
(MenuPanelSpec |
|
2483 |
name: 'menuToolbarView' |
|
2484 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
3546 | 2485 |
style: (FontDescription helvetica medium roman 10 #'iso10646-1' nil nil) |
2486 |
uuid: 'ea3a98c6-1e4a-11b2-83b1-485b39758412' |
|
3195 | 2487 |
menu: menuToolbar |
2488 |
showSeparatingLines: true |
|
2489 |
) |
|
2490 |
(VariableHorizontalPanelSpec |
|
2491 |
name: 'mainPanel' |
|
2492 |
layout: (LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0) |
|
3546 | 2493 |
uuid: 'ea3a9eca-1e4a-11b2-83b1-485b39758412' |
3195 | 2494 |
snapMode: both |
2495 |
barLevel: 0 |
|
2496 |
component: |
|
2497 |
(SpecCollection |
|
2498 |
collection: ( |
|
2499 |
(ViewSpec |
|
2500 |
name: 'leftView' |
|
3546 | 2501 |
uuid: 'ea3aa3d4-1e4a-11b2-83b1-485b39758412' |
3195 | 2502 |
level: 1 |
2503 |
component: |
|
2504 |
(SpecCollection |
|
2505 |
collection: ( |
|
2506 |
(VariableVerticalPanelSpec |
|
2507 |
name: 'verticalPanel' |
|
2508 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
3546 | 2509 |
uuid: 'ea3aa672-1e4a-11b2-83b1-485b39758412' |
3195 | 2510 |
level: 0 |
2511 |
snapMode: both |
|
2512 |
component: |
|
2513 |
(SpecCollection |
|
2514 |
collection: ( |
|
2515 |
(ViewSpec |
|
3404 | 2516 |
name: 'ColorAnCropBox' |
3546 | 2517 |
uuid: 'ea3aa992-1e4a-11b2-83b1-485b39758412' |
3195 | 2518 |
component: |
2519 |
(SpecCollection |
|
2520 |
collection: ( |
|
3413 | 2521 |
(TabViewSpec |
2522 |
name: 'TabHeader1' |
|
2523 |
layout: (LayoutFrame 0 0 0 0 0 1 36 0) |
|
3546 | 2524 |
uuid: 'ea3aab9a-1e4a-11b2-83b1-485b39758412' |
3413 | 2525 |
model: colorCropTabSelectionIndexHolder |
2526 |
menu: colorCropTabLabelList |
|
2527 |
useIndex: true |
|
2528 |
translateLabel: true |
|
2529 |
) |
|
2530 |
(ViewSpec |
|
2531 |
name: 'ColorBox' |
|
2532 |
layout: (LayoutFrame 0 0 36 0 0 1 0 1) |
|
3546 | 2533 |
uuid: 'ea3ab0ae-1e4a-11b2-83b1-485b39758412' |
3413 | 2534 |
visibilityChannel: colorBoxVisibleHolder |
2535 |
component: |
|
2536 |
(SpecCollection |
|
2537 |
collection: ( |
|
2538 |
(MenuPanelSpec |
|
2539 |
name: 'MouseButtonColorToolBar' |
|
2540 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 24 0) |
|
3546 | 2541 |
uuid: 'ea3ab2d4-1e4a-11b2-83b1-485b39758412' |
3413 | 2542 |
level: 0 |
2543 |
menu: menuMouseButtonColors |
|
2544 |
) |
|
3487 | 2545 |
(LabelSpec |
2546 |
label: 'Label' |
|
2547 |
name: 'Label1' |
|
2548 |
layout: (LayoutFrame -160 1 0 0 -104 1 22 0) |
|
3546 | 2549 |
activeHelpKey: drawingAlpha |
2550 |
uuid: 'ea3ab590-1e4a-11b2-83b1-485b39758412' |
|
2551 |
visibilityChannel: alphaVisibleHolder |
|
3487 | 2552 |
translateLabel: true |
2553 |
labelChannel: alphaText |
|
2554 |
) |
|
2555 |
(InputFieldSpec |
|
2556 |
name: 'EntryField1' |
|
2557 |
layout: (LayoutFrame -106 1 2 0 -56 1 22 0) |
|
3546 | 2558 |
activeHelpKey: drawingAlpha |
2559 |
uuid: 'ea3aba90-1e4a-11b2-83b1-485b39758412' |
|
2560 |
visibilityChannel: alphaVisibleHolder |
|
2561 |
model: alphaHolder |
|
2562 |
type: numberInRange |
|
3487 | 2563 |
acceptOnReturn: true |
2564 |
acceptOnTab: true |
|
3546 | 2565 |
numChars: 3 |
2566 |
minValue: 0 |
|
2567 |
maxValue: 100 |
|
3487 | 2568 |
acceptOnPointerLeave: true |
2569 |
) |
|
3421 | 2570 |
(ViewSpec |
2571 |
name: 'Box1' |
|
2572 |
layout: (LayoutFrame -40 1.0 4 0 -26 1.0 18 0) |
|
2573 |
activeHelpKey: drawingColor1 |
|
3546 | 2574 |
uuid: 'ea3ac1c0-1e4a-11b2-83b1-485b39758412' |
3421 | 2575 |
level: -1 |
2576 |
backgroundChannel: drawingColor1Holder |
|
2577 |
) |
|
2578 |
(ViewSpec |
|
2579 |
name: 'Box2' |
|
2580 |
layout: (LayoutFrame -25 1.0 4 0 -11 1.0 18 0) |
|
2581 |
activeHelpKey: drawingColor2 |
|
3546 | 2582 |
uuid: 'ea3ac418-1e4a-11b2-83b1-485b39758412' |
3421 | 2583 |
level: -1 |
2584 |
backgroundChannel: drawingColor2Holder |
|
2585 |
) |
|
3413 | 2586 |
(DataSetSpec |
2587 |
name: 'colorDataSetView' |
|
2588 |
layout: (LayoutFrame 0 0.0 26 0.0 0 1.0 0 1.0) |
|
2589 |
activeHelpKey: colorMapTable |
|
3546 | 2590 |
style: (FontDescription helvetica medium roman 10 #'iso10646-1' nil nil) |
2591 |
uuid: 'ea3ac652-1e4a-11b2-83b1-485b39758412' |
|
3413 | 2592 |
model: selectedColors |
3475 | 2593 |
menu: colorMapMenuHolder |
3413 | 2594 |
hasHorizontalScrollBar: true |
2595 |
hasVerticalScrollBar: true |
|
2596 |
miniScrollerHorizontal: true |
|
2597 |
miniScrollerVertical: true |
|
2598 |
dataList: listOfColors |
|
2599 |
has3Dseparators: true |
|
2600 |
doubleClickSelector: doubleClickOnColor: |
|
2601 |
columnHolder: colorTableColumns |
|
2602 |
multipleSelectOk: true |
|
2603 |
verticalSpacing: 1 |
|
2604 |
columnAdaptor: colorColumnAdaptor |
|
2605 |
) |
|
2606 |
) |
|
2607 |
||
2608 |
) |
|
2609 |
) |
|
2610 |
(ViewSpec |
|
2611 |
name: 'FloodFillBox' |
|
2612 |
layout: (LayoutFrame 0 0 36 0 0 1 0 1) |
|
3546 | 2613 |
uuid: 'ea3acfda-1e4a-11b2-83b1-485b39758412' |
3413 | 2614 |
visibilityChannel: floodFillBoxVisibleHolder |
2615 |
component: |
|
2616 |
(SpecCollection |
|
2617 |
collection: ( |
|
2618 |
(UISubSpecification |
|
2619 |
name: 'SubSpecification2' |
|
2620 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
3546 | 2621 |
uuid: 'ea3ad21e-1e4a-11b2-83b1-485b39758412' |
3413 | 2622 |
minorKey: floodFillToleranceSpec |
2623 |
) |
|
2624 |
) |
|
2625 |
||
2626 |
) |
|
2627 |
) |
|
3400 | 2628 |
(ViewSpec |
2629 |
name: 'CropBox' |
|
3413 | 2630 |
layout: (LayoutFrame 0 0 36 0 0 1 0 1) |
3546 | 2631 |
uuid: 'ea3ad552-1e4a-11b2-83b1-485b39758412' |
3400 | 2632 |
visibilityChannel: cropBoxVisibleHolder |
2633 |
component: |
|
2634 |
(SpecCollection |
|
2635 |
collection: ( |
|
2636 |
(UISubSpecification |
|
2637 |
name: 'SubSpecification1' |
|
2638 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
3546 | 2639 |
uuid: 'ea3ad76e-1e4a-11b2-83b1-485b39758412' |
3413 | 2640 |
minorKey: cropSpec |
3400 | 2641 |
) |
2642 |
) |
|
2643 |
||
2644 |
) |
|
2645 |
) |
|
3195 | 2646 |
) |
2647 |
||
2648 |
) |
|
1558 | 2649 |
) |
3195 | 2650 |
(ArbitraryComponentSpec |
2651 |
name: 'imagePreView' |
|
2652 |
activeHelpKey: previewView |
|
3546 | 2653 |
uuid: 'ea3ad9a8-1e4a-11b2-83b1-485b39758412' |
3195 | 2654 |
menu: previewMenu |
2655 |
hasHorizontalScrollBar: true |
|
2656 |
hasVerticalScrollBar: true |
|
2657 |
miniScrollerHorizontal: false |
|
2658 |
miniScrollerVertical: false |
|
2659 |
hasBorder: false |
|
2660 |
component: ImageView |
|
2661 |
) |
|
2662 |
) |
|
2663 |
||
2664 |
) |
|
2665 |
handles: (Any 0.5 1.0) |
|
1558 | 2666 |
) |
3195 | 2667 |
) |
2668 |
||
2669 |
) |
|
2670 |
) |
|
2671 |
(ViewSpec |
|
2672 |
name: 'rightView' |
|
3546 | 2673 |
uuid: 'ea3ade8a-1e4a-11b2-83b1-485b39758412' |
3195 | 2674 |
component: |
2675 |
(SpecCollection |
|
2676 |
collection: ( |
|
2677 |
(MenuPanelSpec |
|
2678 |
name: 'ToolBar1' |
|
2679 |
layout: (LayoutFrame 0 0 0 0.0 28 0 0 1.0) |
|
3546 | 2680 |
uuid: 'ea3ae0b0-1e4a-11b2-83b1-485b39758412' |
3195 | 2681 |
level: 1 |
2682 |
menu: toolsMenuToolbar |
|
2683 |
verticalLayout: true |
|
2684 |
centerItems: true |
|
2685 |
textDefault: true |
|
2686 |
) |
|
2687 |
(ViewSpec |
|
2688 |
name: 'editingView' |
|
2689 |
layout: (LayoutFrame 28 0.0 0 0.0 0 1.0 0 1.0) |
|
3546 | 2690 |
uuid: 'ea3ae3bc-1e4a-11b2-83b1-485b39758412' |
3195 | 2691 |
level: 1 |
2692 |
component: |
|
2693 |
(SpecCollection |
|
2694 |
collection: ( |
|
2695 |
(ArbitraryComponentSpec |
|
2696 |
name: 'imageEditView' |
|
2697 |
layout: (LayoutFrame 2 0.0 2 0.0 -2 1.0 -24 1.0) |
|
3546 | 2698 |
uuid: 'ea3ae5ec-1e4a-11b2-83b1-485b39758412' |
3195 | 2699 |
hasHorizontalScrollBar: true |
2700 |
hasVerticalScrollBar: true |
|
2701 |
hasBorder: false |
|
2702 |
component: ImageEditView |
|
2703 |
) |
|
2704 |
(LabelSpec |
|
2705 |
name: 'coordLabel' |
|
2706 |
layout: (LayoutFrame 2 0.0 -22 1 -83 1.0 0 1.0) |
|
3546 | 2707 |
uuid: 'ea3ae8da-1e4a-11b2-83b1-485b39758412' |
3195 | 2708 |
level: -1 |
2709 |
translateLabel: true |
|
2710 |
labelChannel: imageInfoHolder |
|
2711 |
resizeForLabel: false |
|
2712 |
adjust: left |
|
1637 | 2713 |
) |
3195 | 2714 |
(ArrowButtonSpec |
2715 |
name: 'magnifyDownButton' |
|
2716 |
layout: (LayoutFrame -80 1 -22 1 -58 1 0 1) |
|
2717 |
activeHelpKey: magnifyImageDown |
|
3546 | 2718 |
uuid: 'ea3aebd2-1e4a-11b2-83b1-485b39758412' |
3195 | 2719 |
translateLabel: true |
2720 |
model: doMagnifyDown |
|
2721 |
enableChannel: imageIsLoadedHolder |
|
2722 |
isTriggerOnDown: true |
|
3479 | 2723 |
autoRepeat: true |
3195 | 2724 |
direction: left |
2725 |
) |
|
2726 |
(ArrowButtonSpec |
|
2727 |
name: 'magnifyUpButton' |
|
2728 |
layout: (LayoutFrame -24 1 -22 1 -2 1 0 1) |
|
2729 |
activeHelpKey: magnifyImageUp |
|
3546 | 2730 |
uuid: 'ea3af26c-1e4a-11b2-83b1-485b39758412' |
3195 | 2731 |
translateLabel: true |
2732 |
model: doMagnifyUp |
|
2733 |
enableChannel: imageIsLoadedHolder |
|
2734 |
isTriggerOnDown: true |
|
3479 | 2735 |
autoRepeat: true |
3195 | 2736 |
direction: right |
2737 |
) |
|
2738 |
(InputFieldSpec |
|
2739 |
name: 'magnificationInputField' |
|
2740 |
layout: (LayoutFrame -57 1 -22 1 -26 1 0 1) |
|
2741 |
activeHelpKey: magnificationNumber |
|
3546 | 2742 |
uuid: 'ea3af62c-1e4a-11b2-83b1-485b39758412' |
3195 | 2743 |
enableChannel: imageIsLoadedHolder |
2744 |
model: magnificationHolder |
|
2745 |
type: numberInRange |
|
2746 |
acceptOnReturn: true |
|
2747 |
acceptOnTab: true |
|
2748 |
numChars: 2 |
|
2749 |
minValue: 1 |
|
2750 |
maxValue: 99 |
|
2751 |
acceptOnPointerLeave: true |
|
2752 |
) |
|
2753 |
) |
|
2754 |
||
2755 |
) |
|
1558 | 2756 |
) |
3195 | 2757 |
) |
2758 |
||
2759 |
) |
|
1558 | 2760 |
) |
3195 | 2761 |
) |
2762 |
||
2763 |
) |
|
3443 | 2764 |
handles: (Any 0.47999999999999998 1.0) |
1558 | 2765 |
) |
3195 | 2766 |
(UISubSpecification |
2767 |
name: 'infoBarSubSpec' |
|
2768 |
layout: (LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0) |
|
3546 | 2769 |
uuid: 'ea3afaf0-1e4a-11b2-83b1-485b39758412' |
3195 | 2770 |
majorKey: ToolApplicationModel |
2771 |
minorKey: windowSpecForInfoBar |
|
2772 |
) |
|
2773 |
) |
|
2774 |
||
2775 |
) |
|
2776 |
) |
|
519 | 2777 |
! ! |
2778 |
||
2779 |
!ImageEditor class methodsFor:'menu specs'! |
|
2780 |
||
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2781 |
colorMapMenu |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2782 |
"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
|
2783 |
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
|
2784 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2785 |
"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
|
2786 |
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
|
2787 |
|
3592 | 2788 |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2789 |
" |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2790 |
MenuEditor new openOnClass:ImageEditor andSelector:#colorMapMenu |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2791 |
(Menu new fromLiteralArrayEncoding:(ImageEditor colorMapMenu)) startUp |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2792 |
" |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2793 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2794 |
<resource: #menu> |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2795 |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2796 |
^ |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2797 |
#(Menu |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2798 |
( |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2799 |
(MenuItem |
3475 | 2800 |
enabled: canAddColorToColormapHolder |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2801 |
label: 'Add Color' |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2802 |
itemValue: addColorToColormap |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2803 |
) |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2804 |
(MenuItem |
3475 | 2805 |
enabled: canAddColorToColormapHolder |
3496 | 2806 |
label: 'Add & Paste Color' |
2807 |
itemValue: addPastedColorToColormap |
|
2808 |
) |
|
2809 |
(MenuItem |
|
2810 |
enabled: canAddColorToColormapHolder |
|
2539 | 2811 |
label: 'Pick and Add Color...' |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2812 |
itemValue: pickAndAddColorToColormap |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2813 |
) |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2814 |
(MenuItem |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2815 |
label: '-' |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2816 |
) |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2817 |
(MenuItem |
3475 | 2818 |
enabled: hasColormapAndSingleColorSelectedHolder |
1852 | 2819 |
label: 'Cut Color' |
2820 |
itemValue: cutColorFromColormap |
|
2821 |
isVisible: false |
|
2822 |
) |
|
2823 |
(MenuItem |
|
3195 | 2824 |
enabled: hasSingleColorSelectedHolder |
1852 | 2825 |
label: 'Copy Color' |
2826 |
itemValue: copyColorFromColormap |
|
2841 | 2827 |
shortcutKey: Copy |
1852 | 2828 |
) |
2829 |
(MenuItem |
|
3475 | 2830 |
enabled: hasColormapAndSingleWritableColorSelectedHolder |
2539 | 2831 |
label: 'Pick and Paste Color...' |
1933 | 2832 |
itemValue: pickAndPasteColor |
1852 | 2833 |
) |
2834 |
(MenuItem |
|
3475 | 2835 |
enabled: canChangeColorInColormapHolder |
1852 | 2836 |
label: 'Paste Color' |
2837 |
itemValue: pasteColorIntoColormap |
|
2841 | 2838 |
shortcutKey: Paste |
1852 | 2839 |
) |
2840 |
(MenuItem |
|
2841 |
label: '-' |
|
2842 |
) |
|
2843 |
(MenuItem |
|
3475 | 2844 |
enabled: hasColormapAndSingleWritableColorSelectedHolder |
2539 | 2845 |
label: 'Edit Color...' |
1931 | 2846 |
itemValue: editSelectedColor |
3592 | 2847 |
) |
2848 |
(MenuItem |
|
2849 |
enabled: hasColormapAndColorSelected |
|
2850 |
label: 'Make Gray' |
|
2851 |
itemValue: makeSelectedColorGray |
|
2852 |
) |
|
2853 |
(MenuItem |
|
2854 |
enabled: hasColormapAndSingleWritableColorSelectedHolder |
|
2855 |
label: 'Color Shift...' |
|
2856 |
itemValue: makeSelectedColorShifted |
|
2857 |
) |
|
2858 |
(MenuItem |
|
2859 |
label: '-' |
|
2860 |
) |
|
2861 |
(MenuItem |
|
2862 |
enabled: hasColormapAndColorSelected |
|
2863 |
label: 'Slightly Brighter' |
|
2864 |
itemValue: makeSelectedColorSlightlyBrighter |
|
2865 |
) |
|
2866 |
(MenuItem |
|
2867 |
enabled: hasColormapAndColorSelected |
|
2868 |
label: 'Slightly Darker' |
|
2869 |
itemValue: makeSelectedColorSlightlyDarker |
|
1931 | 2870 |
) |
2871 |
(MenuItem |
|
3553 | 2872 |
enabled: hasColormapAndColorSelected |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2873 |
label: 'Brighter' |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2874 |
itemValue: makeSelectedColorBrighter |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2875 |
) |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2876 |
(MenuItem |
3553 | 2877 |
enabled: hasColormapAndColorSelected |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2878 |
label: 'Darker' |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2879 |
itemValue: makeSelectedColorDarker |
3195 | 2880 |
) |
2881 |
(MenuItem |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2882 |
label: '-' |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2883 |
) |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2884 |
(MenuItem |
3195 | 2885 |
enabled: hasSingleColorSelectedHolder |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2886 |
label: 'Inspect Color' |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2887 |
itemValue: inspectColor |
2651 | 2888 |
) |
2889 |
(MenuItem |
|
3475 | 2890 |
enabled: imageHasColormapHolder |
2651 | 2891 |
label: 'Inspect Colormap' |
2892 |
itemValue: inspectColormap |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2893 |
) |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2894 |
) |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2895 |
nil |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
2896 |
nil |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2897 |
) |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2898 |
! |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
2899 |
|
400 | 2900 |
menu |
737 | 2901 |
"This resource specification was automatically generated |
2902 |
by the MenuEditor of ST/X." |
|
400 | 2903 |
|
737 | 2904 |
"Do not manually edit this!! If it is corrupted, |
2905 |
the MenuEditor may not be able to read the specification." |
|
400 | 2906 |
|
2907 |
" |
|
2908 |
MenuEditor new openOnClass:ImageEditor andSelector:#menu |
|
2909 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menu)) startUp |
|
2910 |
" |
|
2911 |
||
2912 |
<resource: #menu> |
|
2913 |
||
1124 | 2914 |
^ |
1882 | 2915 |
#(Menu |
2916 |
( |
|
2917 |
(MenuItem |
|
2918 |
label: '&File' |
|
2919 |
translateLabel: true |
|
2196 | 2920 |
submenuChannel: menuFile |
2585 | 2921 |
"/ keepLinkedMenu: true |
1124 | 2922 |
) |
1882 | 2923 |
(MenuItem |
2924 |
label: 'Edit' |
|
2925 |
translateLabel: true |
|
2196 | 2926 |
submenuChannel: menuEdit |
2585 | 2927 |
"/ keepLinkedMenu: true |
1124 | 2928 |
) |
1882 | 2929 |
(MenuItem |
2930 |
label: 'Mode' |
|
2931 |
translateLabel: true |
|
2932 |
submenuChannel: modeMenu |
|
3374 | 2933 |
isVisible: modeMenuVisible |
1637 | 2934 |
) |
1882 | 2935 |
(MenuItem |
3497 | 2936 |
label: 'Image' |
1882 | 2937 |
translateLabel: true |
2585 | 2938 |
submenuChannel: menuColors |
1124 | 2939 |
) |
1882 | 2940 |
(MenuItem |
2941 |
label: 'Settings' |
|
2942 |
translateLabel: true |
|
2585 | 2943 |
submenuChannel: menuSettings |
1124 | 2944 |
) |
1882 | 2945 |
(MenuItem |
2946 |
label: 'History' |
|
2947 |
translateLabel: true |
|
1975 | 2948 |
isVisible: isStandAlone |
1882 | 2949 |
submenuChannel: menuHistory |
1124 | 2950 |
) |
1882 | 2951 |
(MenuItem |
2136
bb10485fa455
support '?' as help (for now: controlled by resources)
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
2952 |
label: 'MENU_Help' |
1882 | 2953 |
translateLabel: true |
2125 | 2954 |
startGroup: conditionalRight |
1882 | 2955 |
submenuChannel: menuHelp |
1124 | 2956 |
) |
2957 |
) |
|
2958 |
nil |
|
2959 |
nil |
|
400 | 2960 |
) |
3497 | 2961 |
|
2962 |
"Modified: / 23-10-2017 / 10:39:43 / cg" |
|
400 | 2963 |
! |
2964 |
||
2585 | 2965 |
menuColors |
2966 |
"This resource specification was automatically generated |
|
2967 |
by the MenuEditor of ST/X." |
|
2968 |
||
2969 |
"Do not manually edit this!! If it is corrupted, |
|
2970 |
the MenuEditor may not be able to read the specification." |
|
2971 |
||
3476 | 2972 |
|
2585 | 2973 |
" |
2974 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuColors |
|
2975 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuColors)) startUp |
|
2976 |
" |
|
2977 |
||
2978 |
<resource: #menu> |
|
2979 |
||
2980 |
^ |
|
2981 |
#(Menu |
|
2982 |
( |
|
2983 |
(MenuItem |
|
3666 | 2984 |
enabled: imageIsLoadedHolder |
2585 | 2985 |
label: 'Depth' |
2986 |
submenu: |
|
2987 |
(Menu |
|
2988 |
( |
|
2989 |
(MenuItem |
|
2990 |
activeHelpKey: colorMap1 |
|
3476 | 2991 |
enabled: imageIsLoadedAndNotReadonlyHolder |
2585 | 2992 |
label: '1-Plane' |
2993 |
itemValue: colorMapMode: |
|
2994 |
argument: depth1 |
|
2995 |
choice: colorMapMode |
|
2996 |
choiceValue: depth1 |
|
2997 |
) |
|
2998 |
(MenuItem |
|
2999 |
activeHelpKey: colorMap1M |
|
3476 | 3000 |
enabled: imageIsLoadedAndNotReadonlyHolder |
2585 | 3001 |
label: '1-Plane + Mask' |
3002 |
itemValue: colorMapMode: |
|
3003 |
argument: masked1 |
|
3004 |
choice: colorMapMode |
|
3005 |
choiceValue: masked1 |
|
3006 |
) |
|
3007 |
(MenuItem |
|
3008 |
label: '-' |
|
3009 |
) |
|
3010 |
(MenuItem |
|
3011 |
activeHelpKey: colorMap2 |
|
3476 | 3012 |
enabled: imageIsLoadedAndNotReadonlyHolder |
2585 | 3013 |
label: '2-Plane' |
3014 |
itemValue: colorMapMode: |
|
3015 |
argument: depth2 |
|
3016 |
choice: colorMapMode |
|
3017 |
choiceValue: depth2 |
|
3018 |
) |
|
3019 |
(MenuItem |
|
3020 |
activeHelpKey: colorMap2M |
|
3476 | 3021 |
enabled: imageIsLoadedAndNotReadonlyHolder |
2585 | 3022 |
label: '2-Plane + Mask' |
3023 |
itemValue: colorMapMode: |
|
3024 |
argument: masked2 |
|
3025 |
choice: colorMapMode |
|
3026 |
choiceValue: masked2 |
|
3027 |
) |
|
3028 |
(MenuItem |
|
3029 |
label: '-' |
|
3030 |
) |
|
3031 |
(MenuItem |
|
3032 |
activeHelpKey: colorMap4 |
|
3476 | 3033 |
enabled: imageIsLoadedAndNotReadonlyHolder |
2585 | 3034 |
label: '4-Plane' |
3035 |
itemValue: colorMapMode: |
|
3036 |
argument: depth4 |
|
3037 |
choice: colorMapMode |
|
3038 |
choiceValue: depth4 |
|
3039 |
) |
|
3040 |
(MenuItem |
|
3041 |
activeHelpKey: colorMap4M |
|
3476 | 3042 |
enabled: imageIsLoadedAndNotReadonlyHolder |
2585 | 3043 |
label: '4-Plane + Mask' |
3044 |
itemValue: colorMapMode: |
|
3045 |
argument: masked4 |
|
3046 |
choice: colorMapMode |
|
3047 |
choiceValue: masked4 |
|
3048 |
) |
|
3049 |
(MenuItem |
|
3050 |
label: '-' |
|
3051 |
) |
|
3052 |
(MenuItem |
|
3053 |
activeHelpKey: colorMap8 |
|
3476 | 3054 |
enabled: imageIsLoadedAndNotReadonlyHolder |
2585 | 3055 |
label: '8-Plane' |
3056 |
itemValue: colorMapMode: |
|
3057 |
argument: depth8 |
|
3058 |
choice: colorMapMode |
|
3059 |
choiceValue: depth8 |
|
3060 |
) |
|
3061 |
(MenuItem |
|
3062 |
activeHelpKey: colorMap8M |
|
3476 | 3063 |
enabled: imageIsLoadedAndNotReadonlyHolder |
2585 | 3064 |
label: '8-Plane + Mask' |
3065 |
itemValue: colorMapMode: |
|
3066 |
argument: masked8 |
|
3067 |
choice: colorMapMode |
|
3068 |
choiceValue: masked8 |
|
3069 |
) |
|
3070 |
(MenuItem |
|
3071 |
label: '-' |
|
3072 |
) |
|
3073 |
(MenuItem |
|
3074 |
activeHelpKey: colorMap16 |
|
3476 | 3075 |
enabled: imageIsLoadedAndNotReadonlyHolder |
2585 | 3076 |
label: '16-Plane' |
3077 |
itemValue: colorMapMode: |
|
3078 |
argument: depth16 |
|
3079 |
choice: colorMapMode |
|
3080 |
choiceValue: depth16 |
|
3081 |
) |
|
3082 |
(MenuItem |
|
3083 |
activeHelpKey: colorMap16M |
|
3476 | 3084 |
enabled: imageIsLoadedAndNotReadonlyHolder |
2585 | 3085 |
label: '16-Plane + Mask' |
3086 |
itemValue: colorMapMode: |
|
3087 |
argument: masked16 |
|
3088 |
choice: colorMapMode |
|
3089 |
choiceValue: masked16 |
|
3090 |
) |
|
3091 |
(MenuItem |
|
3092 |
label: '-' |
|
3093 |
) |
|
3094 |
(MenuItem |
|
3095 |
activeHelpKey: colorMap24 |
|
3476 | 3096 |
enabled: imageIsLoadedAndNotReadonlyHolder |
2585 | 3097 |
label: '24-Plane' |
3098 |
itemValue: colorMapMode: |
|
3099 |
argument: depth24 |
|
3100 |
choice: colorMapMode |
|
3101 |
choiceValue: depth24 |
|
3102 |
) |
|
3103 |
(MenuItem |
|
3104 |
activeHelpKey: colorMap24M |
|
3476 | 3105 |
enabled: imageIsLoadedAndNotReadonlyHolder |
2585 | 3106 |
label: '24-Plane + Mask' |
3107 |
itemValue: colorMapMode: |
|
3108 |
argument: masked24 |
|
3109 |
choice: colorMapMode |
|
3110 |
choiceValue: masked24 |
|
3111 |
) |
|
3112 |
(MenuItem |
|
3113 |
label: '-' |
|
3114 |
) |
|
3115 |
(MenuItem |
|
3116 |
activeHelpKey: colorMap32 |
|
3476 | 3117 |
enabled: imageIsLoadedAndNotReadonlyHolder |
2585 | 3118 |
label: '32-Plane (rgba)' |
3119 |
itemValue: colorMapMode: |
|
3120 |
argument: depth32 |
|
3121 |
choice: colorMapMode |
|
3122 |
choiceValue: depth32 |
|
3123 |
) |
|
3124 |
) |
|
3125 |
nil |
|
3126 |
nil |
|
3127 |
) |
|
3128 |
) |
|
3129 |
(MenuItem |
|
3405 | 3130 |
enabled: imageIsLoadedAndNotReadonlyHolder |
2585 | 3131 |
label: 'ColorMap' |
3132 |
submenu: |
|
3133 |
(Menu |
|
3134 |
( |
|
3135 |
(MenuItem |
|
3136 |
activeHelpKey: compressColormap |
|
2792 | 3137 |
enabled: hasColormapHolder |
2585 | 3138 |
label: 'Compress Colormap' |
2826 | 3139 |
itemValue: #'menu_compressColorMap' |
2585 | 3140 |
) |
3141 |
(MenuItem |
|
2792 | 3142 |
enabled: hasColormapHolder |
2585 | 3143 |
label: 'Sort Colormap' |
2826 | 3144 |
itemValue: #'menu_sortColorMap' |
2585 | 3145 |
) |
3146 |
(MenuItem |
|
3147 |
label: 'Reduce Number of Colors by Rounding...' |
|
3148 |
itemValue: reduceNumberOfColors2 |
|
3149 |
) |
|
3150 |
(MenuItem |
|
3151 |
label: 'Reduce Number of Colors by Masking Bits...' |
|
3152 |
itemValue: reduceNumberOfColors |
|
2652 | 3153 |
) |
2585 | 3154 |
) |
3155 |
nil |
|
3156 |
nil |
|
3157 |
) |
|
3158 |
) |
|
3159 |
(MenuItem |
|
3405 | 3160 |
enabled: imageIsLoadedAndNotReadonlyHolder |
2585 | 3161 |
label: 'Process' |
3162 |
submenu: |
|
3163 |
(Menu |
|
3164 |
( |
|
3165 |
(MenuItem |
|
3476 | 3166 |
label: 'Negative' |
3167 |
itemValue: makeNegative |
|
2585 | 3168 |
) |
3169 |
(MenuItem |
|
3476 | 3170 |
label: 'Invert Pixel Bits' |
3171 |
itemValue: makeInvertedBits |
|
3598 | 3172 |
) |
3173 |
(MenuItem |
|
3174 |
label: 'Exchange Red-Green' |
|
3175 |
itemValue: exchangeRedGreenChannels |
|
3176 |
) |
|
3177 |
(MenuItem |
|
3178 |
label: 'Exchange Red-Blue' |
|
3179 |
itemValue: exchangeRedBlueChannels |
|
3180 |
) |
|
3181 |
(MenuItem |
|
3182 |
label: 'Exchange Green-Blue' |
|
3183 |
itemValue: exchangeGreenBlueChannels |
|
3458 | 3184 |
) |
3185 |
(MenuItem |
|
3186 |
label: '-' |
|
3187 |
) |
|
3188 |
(MenuItem |
|
2826 | 3189 |
enabled: allowedToChangeImageDimensionAndDepth |
2585 | 3190 |
label: 'Make dithered 8Bit Palette' |
3191 |
itemValue: makeDitheredPaletteImage |
|
3192 |
isVisible: false |
|
3193 |
) |
|
3194 |
(MenuItem |
|
3458 | 3195 |
label: 'Dither to Depth...' |
3196 |
itemValue: ditherToDepth |
|
3197 |
) |
|
3198 |
(MenuItem |
|
3471 | 3199 |
label: 'Threshold to Depth...' |
3200 |
itemValue: thresholdToDepth |
|
3476 | 3201 |
) |
3202 |
(MenuItem |
|
3203 |
label: '-' |
|
3204 |
) |
|
3205 |
(MenuItem |
|
3206 |
label: 'Make Monochrome...' |
|
3207 |
itemValue: makeMonochromeImage |
|
3208 |
) |
|
3209 |
(MenuItem |
|
3210 |
label: 'Make GrayScale (same Depth)' |
|
3211 |
itemValue: makeGrayScaleImage |
|
3471 | 3212 |
) |
3213 |
(MenuItem |
|
3460 | 3214 |
label: 'Make GrayScale with Depth (Dither)...' |
3215 |
itemValue: ditherGrayToDepth |
|
3216 |
) |
|
3217 |
(MenuItem |
|
3218 |
label: 'Make GrayScale with Depth (Threshold)...' |
|
3219 |
itemValue: thresholdGrayToDepth |
|
2826 | 3220 |
) |
3221 |
(MenuItem |
|
3497 | 3222 |
label: 'Make GrayScale with N Gray Colors (Dither)...' |
3223 |
itemValue: ditherToNumberOfGrayColors |
|
3224 |
) |
|
3225 |
(MenuItem |
|
3226 |
label: 'Make GrayScale with N Gray Colors (Threshold)...' |
|
3227 |
itemValue: thresholdToNumberOfGrayColors |
|
3228 |
) |
|
3229 |
(MenuItem |
|
2826 | 3230 |
label: '-' |
3231 |
) |
|
3232 |
(MenuItem |
|
3233 |
label: 'Make Slightly Brighter' |
|
3234 |
itemValue: makeSlightlyBrighter |
|
3476 | 3235 |
) |
3236 |
(MenuItem |
|
3237 |
label: 'Make Brighter' |
|
3238 |
itemValue: makeBrighter |
|
2826 | 3239 |
) |
3240 |
(MenuItem |
|
3241 |
label: 'Make Slightly Darker' |
|
3242 |
itemValue: makeSlightlyDarker |
|
2585 | 3243 |
) |
3244 |
(MenuItem |
|
3245 |
label: 'Make Darker' |
|
3246 |
itemValue: makeDarker |
|
3247 |
) |
|
3248 |
(MenuItem |
|
3249 |
label: '-' |
|
3250 |
) |
|
3251 |
(MenuItem |
|
3252 |
label: 'Change HLS...' |
|
3253 |
itemValue: changeHLS |
|
3254 |
) |
|
3255 |
(MenuItem |
|
3256 |
label: 'Colorize...' |
|
3257 |
itemValue: colorize |
|
3476 | 3258 |
) |
3259 |
(MenuItem |
|
3260 |
enabled: imageIsLoadedHolder |
|
3261 |
label: 'Brighten' |
|
3262 |
itemValue: doBrightenImage |
|
3263 |
) |
|
3264 |
(MenuItem |
|
3265 |
enabled: imageIsLoadedHolder |
|
3266 |
label: 'Darken' |
|
3267 |
itemValue: doDarkenImage |
|
2585 | 3268 |
) |
3269 |
) |
|
3270 |
nil |
|
3271 |
nil |
|
3272 |
) |
|
3273 |
) |
|
3274 |
(MenuItem |
|
3405 | 3275 |
enabled: imageIsLoadedAndNotReadonlyHolder |
2585 | 3276 |
label: 'Mask' |
3277 |
submenu: |
|
3278 |
(Menu |
|
3279 |
( |
|
3280 |
(MenuItem |
|
3281 |
activeHelpKey: copyMask |
|
3282 |
enabled: hasMask |
|
3283 |
label: 'Copy Mask' |
|
2826 | 3284 |
itemValue: #'menu_copyMask' |
2585 | 3285 |
) |
3286 |
(MenuItem |
|
3287 |
activeHelpKey: pasteMask |
|
3288 |
enabled: hasMask |
|
3289 |
label: 'Paste Mask' |
|
2826 | 3290 |
itemValue: #'menu_pasteMask' |
2585 | 3291 |
) |
3292 |
(MenuItem |
|
3293 |
enabled: hasMask |
|
3294 |
label: 'Clear Masked Pixels' |
|
2826 | 3295 |
itemValue: #'menu_clearMaskedPixels' |
2652 | 3296 |
) |
3297 |
(MenuItem |
|
3298 |
enabled: hasMask |
|
2653 | 3299 |
label: 'Clear Colormap Entry for Masked Pixels' |
2826 | 3300 |
itemValue: #'menu_clearColormapEntry0AndMaskedPixels' |
2585 | 3301 |
) |
3302 |
) |
|
3303 |
nil |
|
3304 |
nil |
|
3305 |
) |
|
3306 |
) |
|
3307 |
) |
|
3308 |
nil |
|
3309 |
nil |
|
3310 |
) |
|
3666 | 3311 |
|
3312 |
"Modified: / 19-05-2019 / 11:46:50 / Claus Gittinger" |
|
2585 | 3313 |
! |
3314 |
||
2196 | 3315 |
menuEdit |
3316 |
"This resource specification was automatically generated |
|
3317 |
by the MenuEditor of ST/X." |
|
3497 | 3318 |
|
2196 | 3319 |
"Do not manually edit this!! If it is corrupted, |
3320 |
the MenuEditor may not be able to read the specification." |
|
3497 | 3321 |
|
3322 |
||
2196 | 3323 |
" |
3324 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuEdit |
|
3497 | 3325 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuEdit)) startUp |
3326 |
" |
|
3327 |
||
3328 |
<resource: #menu> |
|
3329 |
||
3330 |
^ |
|
3331 |
#(Menu |
|
3332 |
( |
|
3333 |
(MenuItem |
|
3334 |
activeHelpKey: editUndo |
|
3335 |
enabled: canUndoHolder |
|
3336 |
label: 'Undo' |
|
3337 |
itemValue: doUndo |
|
3338 |
) |
|
3339 |
(MenuItem |
|
3340 |
label: '-' |
|
3341 |
) |
|
3342 |
(MenuItem |
|
3343 |
enabled: imageIsLoadedHolder |
|
3344 |
label: 'Copy to Clipboard' |
|
3345 |
itemValue: doCopyImageToClipboard |
|
3346 |
) |
|
3347 |
(MenuItem |
|
3348 |
label: '-' |
|
3349 |
) |
|
3350 |
(MenuItem |
|
3351 |
activeHelpKey: editResize |
|
3352 |
enabled: imageIsLoadedAndAllowedToChangeImageDimensionAndDepth |
|
3353 |
label: 'Resize...' |
|
3354 |
itemValue: doResizeImage |
|
3355 |
) |
|
3356 |
(MenuItem |
|
3357 |
activeHelpKey: editMagnifyImage |
|
3358 |
enabled: imageIsLoadedAndAllowedToChangeImageDimensionAndDepth |
|
3359 |
label: 'Magnify...' |
|
3360 |
itemValue: doMagnifyImage |
|
3361 |
) |
|
3362 |
(MenuItem |
|
3363 |
activeHelpKey: editMagnifyImage |
|
3364 |
enabled: imageIsLoadedAndAllowedToChangeImageDimensionAndDepth |
|
3365 |
label: 'Magnify By...' |
|
3366 |
itemValue: doMagnifyImageBy |
|
3367 |
) |
|
3368 |
(MenuItem |
|
3369 |
activeHelpKey: editRotate |
|
3370 |
enabled: imageIsLoadedAndAllowedToChangeImageDimensionAndDepth |
|
3371 |
label: 'Rotate...' |
|
3372 |
itemValue: doRotateImage |
|
3373 |
) |
|
3374 |
(MenuItem |
|
3375 |
activeHelpKey: edit3DProjection |
|
3376 |
enabled: imageIsLoadedAndAllowedToChangeImageDimensionAndDepth |
|
3377 |
label: '3D Projection...' |
|
3378 |
itemValue: do3DProjection |
|
3379 |
) |
|
3380 |
(MenuItem |
|
3381 |
enabled: imageIsLoadedAndAllowedToFlipHolder |
|
3382 |
label: 'Flip' |
|
3383 |
submenu: |
|
3384 |
(Menu |
|
3385 |
( |
|
3386 |
(MenuItem |
|
3387 |
activeHelpKey: editFlipVertical |
|
3388 |
enabled: imageIsLoadedAndNotReadonlyHolder |
|
3389 |
label: 'Flip - Vertical' |
|
3390 |
itemValue: doFlipVertical |
|
3391 |
labelImage: (ResourceRetriever ImageEditor flipVerticalIcon 'Flip - Vertical') |
|
3392 |
) |
|
3393 |
(MenuItem |
|
3394 |
activeHelpKey: editFlipHorizontal |
|
3395 |
enabled: imageIsLoadedAndNotReadonlyHolder |
|
3396 |
label: 'Flip - Horizontal' |
|
3397 |
itemValue: doFlipHorizontal |
|
3398 |
labelImage: (ResourceRetriever ImageEditor flipHorizontalIcon 'Flip - Horizontal') |
|
3399 |
) |
|
3400 |
) |
|
3401 |
nil |
|
3402 |
nil |
|
3403 |
) |
|
3404 |
) |
|
3405 |
(MenuItem |
|
3406 |
label: '-' |
|
3407 |
) |
|
3408 |
(MenuItem |
|
3409 |
enabled: imageIsLoadedAndAllowedToChangeImageDimension |
|
3410 |
label: 'Crop' |
|
3411 |
submenu: |
|
3412 |
(Menu |
|
3413 |
( |
|
3414 |
(MenuItem |
|
3415 |
activeHelpKey: cropManual |
|
3416 |
label: 'Manual...' |
|
3417 |
itemValue: doCropManual |
|
3418 |
) |
|
3419 |
(MenuItem |
|
3420 |
label: '-' |
|
3421 |
isVisible: false |
|
3422 |
) |
|
3423 |
(MenuItem |
|
3424 |
activeHelpKey: autoCropAll |
|
3425 |
label: 'All' |
|
3426 |
itemValue: autoCropAll |
|
3427 |
) |
|
3428 |
(MenuItem |
|
3429 |
label: '-' |
|
3430 |
) |
|
3431 |
(MenuItem |
|
3432 |
activeHelpKey: autoCropLeft |
|
3433 |
label: 'Left' |
|
3434 |
itemValue: autoCropLeft |
|
3435 |
) |
|
3436 |
(MenuItem |
|
3437 |
activeHelpKey: autoCropRight |
|
3438 |
label: 'Right' |
|
3439 |
itemValue: autoCropRight |
|
3440 |
) |
|
3441 |
(MenuItem |
|
3442 |
activeHelpKey: autoCropTop |
|
3443 |
label: 'Top' |
|
3444 |
itemValue: autoCropTop |
|
3445 |
) |
|
3446 |
(MenuItem |
|
3447 |
activeHelpKey: autoCropBottom |
|
3448 |
label: 'Bottom' |
|
3449 |
itemValue: autoCropBottom |
|
3450 |
) |
|
3451 |
) |
|
3452 |
nil |
|
3453 |
nil |
|
3454 |
) |
|
3455 |
) |
|
3456 |
(MenuItem |
|
3457 |
activeHelpKey: uncropManual |
|
3458 |
enabled: imageIsLoadedAndAllowedToChangeImageDimensionAndDepth |
|
3459 |
label: 'Uncrop (Add Border)...' |
|
3460 |
itemValue: doUnCropManual |
|
3461 |
) |
|
3462 |
(MenuItem |
|
3463 |
activeHelpKey: shiftManual |
|
3464 |
enabled: imageIsLoadedAndAllowedToChangeImageDimension |
|
3465 |
label: 'Shift...' |
|
3466 |
itemValue: doShiftManual |
|
3467 |
) |
|
3468 |
(MenuItem |
|
3469 |
label: '-' |
|
3470 |
) |
|
3471 |
(MenuItem |
|
3472 |
activeHelpKey: fileEditMask |
|
3473 |
enabled: hasMaskHolder |
|
3474 |
label: 'Edit Mask' |
|
3475 |
itemValue: doEditMask |
|
3476 |
) |
|
3477 |
(MenuItem |
|
3478 |
enabled: imageIsLoadedAndNotReadonlyHolder |
|
3479 |
label: 'Text...' |
|
3480 |
itemValue: doInsertTextFromUser |
|
3481 |
) |
|
3482 |
(MenuItem |
|
3483 |
label: '-' |
|
3484 |
) |
|
3485 |
(MenuItem |
|
3486 |
enabled: imageIsLoadedHolder |
|
3487 |
label: 'Animation Sequence' |
|
3488 |
submenu: |
|
3489 |
(Menu |
|
3490 |
( |
|
3491 |
(MenuItem |
|
3492 |
enabled: imageHasNextImageHolder |
|
3493 |
label: 'Next in Sequence' |
|
3494 |
itemValue: nextImageInSequence |
|
3495 |
) |
|
3496 |
(MenuItem |
|
3497 |
enabled: imageHasPreviousImageHolder |
|
3498 |
label: 'Previous in Sequence' |
|
3499 |
itemValue: previousImageInSequence |
|
3500 |
) |
|
3501 |
(MenuItem |
|
3502 |
label: '-' |
|
3503 |
) |
|
3504 |
(MenuItem |
|
3505 |
enabled: imageHasImageSequenceHolder |
|
3506 |
label: 'Edit each from Sequence' |
|
3507 |
itemValue: editEachImageFromSequence |
|
3508 |
) |
|
3509 |
) |
|
3510 |
nil |
|
3511 |
nil |
|
3512 |
) |
|
3513 |
) |
|
3514 |
) |
|
3515 |
nil |
|
3516 |
nil |
|
3517 |
) |
|
2196 | 3518 |
! |
3519 |
||
3520 |
menuFile |
|
3521 |
"This resource specification was automatically generated |
|
3522 |
by the MenuEditor of ST/X." |
|
3523 |
||
3524 |
"Do not manually edit this!! If it is corrupted, |
|
3525 |
the MenuEditor may not be able to read the specification." |
|
3526 |
||
3022 | 3527 |
|
2196 | 3528 |
" |
3529 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuFile |
|
3530 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuFile)) startUp |
|
3531 |
" |
|
3532 |
||
3533 |
<resource: #menu> |
|
3534 |
||
3535 |
^ |
|
3536 |
#(Menu |
|
3537 |
( |
|
3538 |
(MenuItem |
|
3539 |
activeHelpKey: fileNewImageEditor |
|
3540 |
label: 'New ImageEditor' |
|
3541 |
itemValue: doNewImageEditor |
|
3542 |
) |
|
3543 |
(MenuItem |
|
2876 | 3544 |
label: '-' |
3545 |
) |
|
3546 |
(MenuItem |
|
2196 | 3547 |
activeHelpKey: fileNewImage |
3548 |
label: 'New...' |
|
3549 |
itemValue: doNewImage |
|
3550 |
) |
|
3551 |
(MenuItem |
|
3200 | 3552 |
activeHelpKey: fileNewImageFromClipboard |
2196 | 3553 |
label: 'New from ClipBoard' |
3554 |
itemValue: doNewImageFromClipboard |
|
3555 |
) |
|
3556 |
(MenuItem |
|
3200 | 3557 |
activeHelpKey: fileNewMaskFromClipboard |
3558 |
label: 'Mask from ClipBoard' |
|
3559 |
itemValue: doNewMaskFromClipboard |
|
3560 |
) |
|
3561 |
(MenuItem |
|
2196 | 3562 |
label: '-' |
3563 |
) |
|
3564 |
(MenuItem |
|
3565 |
activeHelpKey: fileLoadFromClass |
|
3566 |
label: 'Load...' |
|
3567 |
itemValue: doLoadFromClass |
|
3374 | 3568 |
isVisible: methodSaveAndLoadMenuItemsVisible |
2196 | 3569 |
) |
3570 |
(MenuItem |
|
3571 |
activeHelpKey: fileLoadFromFile |
|
3572 |
label: 'Load from File...' |
|
3573 |
itemValue: doLoadFromFile |
|
3574 |
) |
|
3575 |
(MenuItem |
|
2796 | 3576 |
activeHelpKey: fileLoadFromURL |
3577 |
label: 'Load from URL...' |
|
3578 |
itemValue: doLoadFromURL |
|
3579 |
) |
|
3580 |
(MenuItem |
|
2707
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
3581 |
label: 'Grab' |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
3582 |
submenu: |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
3583 |
(Menu |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
3584 |
( |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
3585 |
(MenuItem |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
3586 |
activeHelpKey: fileGrabImageFromScreen |
2717 | 3587 |
label: 'Grab from Screen Area...' |
2707
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
3588 |
itemValue: grabScreenImage |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
3589 |
) |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
3590 |
(MenuItem |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
3591 |
activeHelpKey: fileGrabImageFromScreen |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
3592 |
enabled: hasLastGrabScreenArea |
2711 | 3593 |
label: 'Grab again from same Screen Area' |
2707
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
3594 |
itemValue: grabScreenImageFromLastArea |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
3595 |
) |
2771 | 3596 |
(MenuItem |
3597 |
label: '-' |
|
3598 |
) |
|
3599 |
(MenuItem |
|
3600 |
activeHelpKey: fileGrabImageFromWindow |
|
3601 |
label: 'Grab from Window...' |
|
3602 |
itemValue: grabWindowImage |
|
3603 |
) |
|
3422 | 3604 |
(MenuItem |
3605 |
activeHelpKey: fileGrabFullSreenImage |
|
3606 |
label: 'Grab from whole Screen' |
|
3607 |
itemValue: grabFullScreenImage |
|
3608 |
) |
|
2707
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
3609 |
) |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
3610 |
nil |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
3611 |
nil |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
3612 |
) |
2701
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
3613 |
) |
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
3614 |
(MenuItem |
2196 | 3615 |
label: '-' |
3616 |
) |
|
3617 |
(MenuItem |
|
3618 |
activeHelpKey: fileSaveMethod |
|
3619 |
enabled: imageIsLoadedAndClassDefined |
|
3620 |
label: 'Save' |
|
3621 |
itemValue: doSaveMethod |
|
3374 | 3622 |
isVisible: methodSaveAndLoadMenuItemsVisible |
2196 | 3623 |
) |
3624 |
(MenuItem |
|
3625 |
activeHelpKey: fileSaveMethodAs |
|
2792 | 3626 |
enabled: imageIsLoadedHolder |
2196 | 3627 |
label: 'Save As...' |
3628 |
itemValue: doSaveMethodAs |
|
3374 | 3629 |
isVisible: methodSaveAndLoadMenuItemsVisible |
2196 | 3630 |
) |
3631 |
(MenuItem |
|
3632 |
activeHelpKey: fileSaveAs |
|
2792 | 3633 |
enabled: imageIsLoadedHolder |
2196 | 3634 |
label: 'Save to File...' |
3635 |
itemValue: doSaveImageFileAs |
|
3636 |
) |
|
3637 |
(MenuItem |
|
3638 |
activeHelpKey: fileSaveMaskAs |
|
3411 | 3639 |
enabled: hasMaskHolder |
2196 | 3640 |
label: 'Save Mask to File...' |
3641 |
itemValue: doSaveImageMaskFileAs |
|
3642 |
) |
|
3643 |
(MenuItem |
|
3644 |
activeHelpKey: fileSaveButtonImageAs |
|
2792 | 3645 |
enabled: imageIsLoadedHolder |
2196 | 3646 |
label: 'Save as Button to File...' |
3647 |
itemValue: doSaveButtonImageToFileAs |
|
3648 |
) |
|
3649 |
(MenuItem |
|
3650 |
label: '-' |
|
3651 |
) |
|
3652 |
(MenuItem |
|
3653 |
activeHelpKey: filePrint |
|
2792 | 3654 |
enabled: imageIsLoadedHolder |
2196 | 3655 |
label: 'Print' |
3656 |
itemValue: doPrint |
|
3657 |
) |
|
3658 |
(MenuItem |
|
3659 |
label: '-' |
|
3660 |
isVisible: isStandAlone |
|
3661 |
) |
|
3662 |
(MenuItem |
|
3663 |
activeHelpKey: fileBrowseClass |
|
2792 | 3664 |
enabled: hasClassDefinedHolder |
2196 | 3665 |
label: 'Browse Class' |
3666 |
itemValue: doBrowseClass |
|
3667 |
isVisible: isStandAlone |
|
3668 |
) |
|
3669 |
(MenuItem |
|
2792 | 3670 |
enabled: imageIsLoadedHolder |
2196 | 3671 |
label: 'Inspect Image' |
3672 |
itemValue: doInspectImage |
|
3673 |
isVisible: isStandAlone |
|
3674 |
) |
|
3675 |
(MenuItem |
|
2585 | 3676 |
activeHelpKey: fileShowStoreString |
2792 | 3677 |
enabled: imageIsLoadedHolder |
2585 | 3678 |
label: 'Show storeString' |
3679 |
itemValue: doShowStoreString |
|
3022 | 3680 |
) |
3681 |
(MenuItem |
|
3682 |
activeHelpKey: fileShowStoreString |
|
3683 |
enabled: imageIsLoadedHolder |
|
3684 |
label: 'Show Pixel Array Literal String' |
|
3685 |
itemValue: doShowPixelArrayLiteralString |
|
2585 | 3686 |
) |
3687 |
(MenuItem |
|
2196 | 3688 |
label: '-' |
3689 |
isVisible: isStandAlone |
|
3690 |
) |
|
3691 |
(MenuItem |
|
3692 |
activeHelpKey: fileExit |
|
3693 |
label: 'Exit' |
|
3694 |
itemValue: closeRequest |
|
3695 |
isVisible: isStandAlone |
|
3696 |
) |
|
3697 |
) |
|
3698 |
nil |
|
3699 |
nil |
|
3700 |
) |
|
3411 | 3701 |
|
3422 | 3702 |
"Modified: / 25-02-2017 / 12:40:30 / cg" |
2196 | 3703 |
! |
3704 |
||
679 | 3705 |
menuMouseButtonColors |
737 | 3706 |
"This resource specification was automatically generated |
3707 |
by the MenuEditor of ST/X." |
|
679 | 3708 |
|
737 | 3709 |
"Do not manually edit this!! If it is corrupted, |
3710 |
the MenuEditor may not be able to read the specification." |
|
679 | 3711 |
|
3712 |
" |
|
3713 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuMouseButtonColors |
|
3714 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuMouseButtonColors)) startUp |
|
3715 |
" |
|
3716 |
||
3717 |
<resource: #menu> |
|
3718 |
||
3719 |
^ |
|
3720 |
||
3721 |
#(#Menu |
|
3722 |
||
3723 |
#( |
|
3724 |
#(#MenuItem |
|
3725 |
#label: 'Left Mouse Button' |
|
3726 |
#nameKey: #leftMouseKeyButton |
|
3727 |
#activeHelpKey: #mouseKeyColorMode |
|
2792 | 3728 |
#enabled: #imageIsLoadedHolder |
679 | 3729 |
#labelImage: #(#ResourceRetriever nil #leftMouseKeyIcon) |
975 | 3730 |
#choice: #mouseKeyColorMode |
3731 |
#choiceValue: 1 |
|
679 | 3732 |
) |
3733 |
#(#MenuItem |
|
3734 |
#label: 'Right Mouse Button' |
|
3735 |
#nameKey: #rightMouseKeyButton |
|
3736 |
#activeHelpKey: #mouseKeyColorMode |
|
2792 | 3737 |
#enabled: #imageIsLoadedHolder |
679 | 3738 |
#labelImage: #(#ResourceRetriever nil #rightMouseKeyIcon) |
975 | 3739 |
#choice: #mouseKeyColorMode |
3740 |
#choiceValue: 2 |
|
679 | 3741 |
) |
3742 |
) nil |
|
3743 |
nil |
|
3744 |
) |
|
2792 | 3745 |
|
3746 |
"Modified: / 04-07-2010 / 10:17:37 / cg" |
|
679 | 3747 |
! |
3748 |
||
2585 | 3749 |
menuSettings |
3750 |
"This resource specification was automatically generated |
|
3751 |
by the MenuEditor of ST/X." |
|
3752 |
||
3753 |
"Do not manually edit this!! If it is corrupted, |
|
3754 |
the MenuEditor may not be able to read the specification." |
|
3755 |
||
2881 | 3756 |
|
2585 | 3757 |
" |
3758 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuSettings |
|
3759 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuSettings)) startUp |
|
3760 |
" |
|
3761 |
||
3762 |
<resource: #menu> |
|
3763 |
||
3764 |
^ |
|
3765 |
#(Menu |
|
3766 |
( |
|
3767 |
(MenuItem |
|
3768 |
activeHelpKey: settingsGridMagnification |
|
3769 |
label: 'Grid Magnification Limit...' |
|
3770 |
itemValue: doChangeGridMagnification |
|
3771 |
translateLabel: true |
|
3772 |
) |
|
3773 |
(MenuItem |
|
3774 |
label: 'Pen' |
|
3775 |
translateLabel: true |
|
3776 |
submenu: |
|
3777 |
(Menu |
|
3778 |
( |
|
3779 |
(MenuItem |
|
3780 |
label: '1' |
|
3781 |
translateLabel: true |
|
2881 | 3782 |
choice: penWidthHolder |
3783 |
choiceValue: 1 |
|
2585 | 3784 |
) |
3785 |
(MenuItem |
|
3786 |
label: '5' |
|
3787 |
translateLabel: true |
|
2881 | 3788 |
choice: penWidthHolder |
3789 |
choiceValue: 5 |
|
2585 | 3790 |
) |
3791 |
(MenuItem |
|
3792 |
label: '10' |
|
3793 |
translateLabel: true |
|
2881 | 3794 |
choice: penWidthHolder |
3795 |
choiceValue: 10 |
|
2585 | 3796 |
) |
3797 |
) |
|
3798 |
nil |
|
3799 |
nil |
|
3800 |
) |
|
3801 |
) |
|
3802 |
(MenuItem |
|
3803 |
label: 'Spray' |
|
3804 |
translateLabel: true |
|
3805 |
submenu: |
|
3806 |
(Menu |
|
3807 |
( |
|
3808 |
(MenuItem |
|
3809 |
label: '4' |
|
3810 |
translateLabel: true |
|
2881 | 3811 |
choice: spraySpotHolder |
3812 |
choiceValue: 4 |
|
2585 | 3813 |
) |
3814 |
(MenuItem |
|
3815 |
label: '8' |
|
3816 |
translateLabel: true |
|
2881 | 3817 |
choice: spraySpotHolder |
3818 |
choiceValue: 8 |
|
2585 | 3819 |
) |
3820 |
(MenuItem |
|
3821 |
label: '16' |
|
3822 |
translateLabel: true |
|
2881 | 3823 |
choice: spraySpotHolder |
3824 |
choiceValue: 16 |
|
2585 | 3825 |
) |
3826 |
(MenuItem |
|
3827 |
label: '32' |
|
3828 |
translateLabel: true |
|
2881 | 3829 |
choice: spraySpotHolder |
3830 |
choiceValue: 32 |
|
2585 | 3831 |
) |
3832 |
) |
|
3833 |
nil |
|
3834 |
nil |
|
3835 |
) |
|
3836 |
) |
|
3837 |
) |
|
3838 |
nil |
|
3839 |
nil |
|
3840 |
) |
|
3841 |
! |
|
3842 |
||
400 | 3843 |
menuToolbar |
737 | 3844 |
"This resource specification was automatically generated |
3845 |
by the MenuEditor of ST/X." |
|
400 | 3846 |
|
737 | 3847 |
"Do not manually edit this!! If it is corrupted, |
3848 |
the MenuEditor may not be able to read the specification." |
|
400 | 3849 |
|
2876 | 3850 |
|
400 | 3851 |
" |
3852 |
MenuEditor new openOnClass:ImageEditor andSelector:#menuToolbar |
|
3853 |
(Menu new fromLiteralArrayEncoding:(ImageEditor menuToolbar)) startUp |
|
3854 |
" |
|
3855 |
||
3856 |
<resource: #menu> |
|
3857 |
||
1196 | 3858 |
^ |
1820 | 3859 |
#(Menu |
3860 |
( |
|
3861 |
(MenuItem |
|
3862 |
activeHelpKey: fileNewImage |
|
3863 |
label: 'newImage' |
|
3864 |
itemValue: doNewImage |
|
3865 |
isButton: true |
|
1883 | 3866 |
labelImage: (ResourceRetriever ToolbarIconLibrary newImageIcon) |
1196 | 3867 |
) |
1820 | 3868 |
(MenuItem |
2876 | 3869 |
activeHelpKey: fileGrabImageFromScreen |
3870 |
label: 'grabScreenImage' |
|
3871 |
itemValue: grabScreenImage |
|
3872 |
isButton: true |
|
2877 | 3873 |
labelImage: (ResourceRetriever ToolbarIconLibrary snapshot24x24Icon) |
2876 | 3874 |
) |
3875 |
(MenuItem |
|
1949 | 3876 |
label: '-' |
3877 |
) |
|
3878 |
(MenuItem |
|
1970 | 3879 |
activeHelpKey: fileLoadFromClass |
3880 |
label: 'loadFromClass' |
|
3881 |
itemValue: doLoadFromClass |
|
3882 |
isButton: true |
|
3374 | 3883 |
isVisible: isStandAloneAndMethodSaveAndLoadMenuItemsVisible |
1970 | 3884 |
submenuChannel: menuHistory |
3885 |
labelImage: (ResourceRetriever XPToolbarIconLibrary loadImageFromMethodIcon) |
|
3886 |
keepLinkedMenu: true |
|
3887 |
) |
|
3888 |
(MenuItem |
|
2567 | 3889 |
activeHelpKey: fileSaveMethodAs |
2792 | 3890 |
enabled: imageIsLoadedHolder |
2567 | 3891 |
label: 'fileSaveMethodAs' |
1970 | 3892 |
itemValue: doSaveMethodAs |
3893 |
isButton: true |
|
3374 | 3894 |
isVisible: isStandAloneAndMethodSaveAndLoadMenuItemsVisible |
1970 | 3895 |
labelImage: (ResourceRetriever XPToolbarIconLibrary saveImageAsMethodAsIcon) |
3896 |
) |
|
3897 |
(MenuItem |
|
3898 |
activeHelpKey: fileSaveMethod |
|
2792 | 3899 |
enabled: imageIsLoadedHolder |
1970 | 3900 |
label: 'saveAsMethod' |
3901 |
itemValue: doSaveMethod |
|
3902 |
isButton: true |
|
3374 | 3903 |
isVisible: isNotStandAloneAndMethodSaveAndLoadMenuItemsVisible |
2590 | 3904 |
labelImage: (ResourceRetriever ToolbarIconLibrary saveImageAsMethodIcon) |
1970 | 3905 |
) |
3906 |
(MenuItem |
|
3907 |
label: '-' |
|
3374 | 3908 |
isVisible: methodSaveAndLoadMenuItemsVisible |
1970 | 3909 |
) |
3910 |
(MenuItem |
|
1820 | 3911 |
activeHelpKey: fileLoadFromFile |
3912 |
label: 'loadFromFile' |
|
3913 |
itemValue: doLoadFromFile |
|
3914 |
isButton: true |
|
1884 | 3915 |
labelImage: (ResourceRetriever ToolbarIconLibrary loadImageFromFileIcon) |
1820 | 3916 |
) |
3917 |
(MenuItem |
|
3425 | 3918 |
activeHelpKey: fileSave |
3919 |
enabled: imageIsLoadedHolder |
|
3920 |
label: 'save' |
|
3921 |
itemValue: doSaveImageFile |
|
3922 |
isButton: true |
|
3923 |
isVisible: saveButtonInToolbarVisibleHolder |
|
3924 |
labelImage: (ResourceRetriever ToolbarIconLibrary saveImageIcon) |
|
3925 |
) |
|
3926 |
(MenuItem |
|
1820 | 3927 |
activeHelpKey: fileSaveAs |
2792 | 3928 |
enabled: imageIsLoadedHolder |
1820 | 3929 |
label: 'saveAsFile' |
3930 |
itemValue: doSaveImageFileAs |
|
3931 |
isButton: true |
|
1885 | 3932 |
labelImage: (ResourceRetriever ToolbarIconLibrary saveImageToFileAsIcon) |
1820 | 3933 |
) |
3934 |
(MenuItem |
|
1949 | 3935 |
label: '-' |
1196 | 3936 |
) |
1820 | 3937 |
(MenuItem |
3938 |
activeHelpKey: editUndo |
|
1987 | 3939 |
enabled: canUndoHolder |
1820 | 3940 |
label: 'Undo' |
3941 |
itemValue: doUndo |
|
3942 |
isButton: true |
|
1883 | 3943 |
labelImage: (ResourceRetriever ToolbarIconLibrary undoIcon) |
1196 | 3944 |
) |
2812 | 3945 |
(MenuItem |
3946 |
label: '-' |
|
3947 |
isVisible: imageHasImageSequenceHolder |
|
3948 |
) |
|
3949 |
(MenuItem |
|
3950 |
activeHelpKey: previousImageInSequence |
|
3951 |
enabled: imageHasPreviousImageHolder |
|
3952 |
label: 'Previous Image' |
|
3953 |
itemValue: previousImageInSequence |
|
3954 |
isVisible: imageHasImageSequenceHolder |
|
3955 |
labelImage: (ResourceRetriever ToolbarIconLibrary leftArrow24x24Icon) |
|
3956 |
) |
|
3957 |
(MenuItem |
|
3958 |
activeHelpKey: nextImageInSequence |
|
3959 |
enabled: imageHasNextImageHolder |
|
3960 |
label: 'Next Image' |
|
3961 |
itemValue: nextImageInSequence |
|
3962 |
isVisible: imageHasImageSequenceHolder |
|
3963 |
labelImage: (ResourceRetriever ToolbarIconLibrary rightArrow24x24Icon) |
|
3964 |
) |
|
1637 | 3965 |
) |
3966 |
nil |
|
3967 |
nil |
|
3968 |
) |
|
3425 | 3969 |
|
3970 |
"Modified: / 26-02-2017 / 23:03:40 / cg" |
|
1637 | 3971 |
! |
3972 |
||
3973 |
modeMenu |
|
3974 |
"This resource specification was automatically generated |
|
3975 |
by the MenuEditor of ST/X." |
|
3976 |
||
3977 |
"Do not manually edit this!! If it is corrupted, |
|
3978 |
the MenuEditor may not be able to read the specification." |
|
3979 |
||
3405 | 3980 |
|
1637 | 3981 |
" |
3982 |
MenuEditor new openOnClass:ImageEditor andSelector:#modeMenu |
|
3983 |
(Menu new fromLiteralArrayEncoding:(ImageEditor modeMenu)) startUp |
|
3984 |
" |
|
3985 |
||
3986 |
<resource: #menu> |
|
3987 |
||
3988 |
^ |
|
2592 | 3989 |
#(Menu |
3990 |
( |
|
3991 |
(MenuItem |
|
3992 |
activeHelpKey: drawModePoint |
|
2792 | 3993 |
enabled: imageIsLoadedHolder |
2592 | 3994 |
label: 'Point' |
3995 |
labelImage: (ResourceRetriever ImageEditor pointIcon 'Point') |
|
3996 |
choice: editMode |
|
3997 |
choiceValue: point |
|
3998 |
) |
|
3999 |
(MenuItem |
|
3405 | 4000 |
label: '-' |
4001 |
) |
|
4002 |
(MenuItem |
|
2592 | 4003 |
activeHelpKey: drawModePoint |
2792 | 4004 |
enabled: imageIsLoadedHolder |
2592 | 4005 |
label: 'Spray' |
4006 |
labelImage: (ResourceRetriever ImageEditor sprayIcon 'Spray') |
|
4007 |
choice: editMode |
|
4008 |
choiceValue: spray |
|
1196 | 4009 |
) |
2592 | 4010 |
(MenuItem |
3191 | 4011 |
activeHelpKey: drawModeSmooth |
4012 |
enabled: imageIsLoadedHolder |
|
4013 |
label: 'Smooth' |
|
4014 |
labelImage: (ResourceRetriever ImageEditor smoothIcon 'Smooth') |
|
4015 |
choice: editMode |
|
4016 |
choiceValue: smooth |
|
4017 |
) |
|
4018 |
(MenuItem |
|
3405 | 4019 |
label: '-' |
4020 |
) |
|
4021 |
(MenuItem |
|
2592 | 4022 |
activeHelpKey: drawModeBox |
2792 | 4023 |
enabled: imageIsLoadedHolder |
2592 | 4024 |
label: 'Rect' |
4025 |
labelImage: (ResourceRetriever ImageEditor rectIcon 'Rect') |
|
4026 |
choice: editMode |
|
4027 |
choiceValue: box |
|
1196 | 4028 |
) |
2592 | 4029 |
(MenuItem |
4030 |
activeHelpKey: drawModeFilledBox |
|
2792 | 4031 |
enabled: imageIsLoadedHolder |
2592 | 4032 |
label: 'Filled Rectangle' |
4033 |
labelImage: (ResourceRetriever ImageEditor fillRectIcon 'Filled Rectangle') |
|
4034 |
choice: editMode |
|
4035 |
choiceValue: filledBox |
|
1196 | 4036 |
) |
2592 | 4037 |
(MenuItem |
3405 | 4038 |
activeHelpKey: drawModeCircle |
2792 | 4039 |
enabled: imageIsLoadedHolder |
2592 | 4040 |
label: 'Circle' |
4041 |
labelImage: (ResourceRetriever ImageEditor circleIcon 'Circle') |
|
4042 |
choice: editMode |
|
4043 |
choiceValue: circle |
|
1196 | 4044 |
) |
2592 | 4045 |
(MenuItem |
3405 | 4046 |
activeHelpKey: drawModeFilledCircle |
4047 |
enabled: imageIsLoadedHolder |
|
4048 |
label: 'Filled Circle' |
|
4049 |
labelImage: (ResourceRetriever ImageEditor fillCircleIcon 'Filled Circle') |
|
4050 |
choice: editMode |
|
4051 |
choiceValue: filledCircle |
|
4052 |
) |
|
4053 |
(MenuItem |
|
2592 | 4054 |
activeHelpKey: drawModeFill |
2792 | 4055 |
enabled: imageIsLoadedHolder |
2592 | 4056 |
label: 'Fill' |
4057 |
labelImage: (ResourceRetriever ImageEditor fillIcon 'Fill') |
|
4058 |
choice: editMode |
|
4059 |
choiceValue: fill |
|
1196 | 4060 |
) |
2592 | 4061 |
(MenuItem |
3418 | 4062 |
enabled: imageIsLoadedHolder |
4063 |
label: 'Gradient Fill' |
|
4064 |
isVisible: false |
|
4065 |
submenu: |
|
4066 |
(Menu |
|
4067 |
( |
|
4068 |
(MenuItem |
|
4069 |
activeHelpKey: drawModeFill |
|
4070 |
enabled: imageIsLoadedHolder |
|
4071 |
label: 'Horizontal' |
|
4072 |
labelImage: (ResourceRetriever ImageEditor fillHorizontalGradientRectIcon 'Horizontal') |
|
4073 |
choice: editMode |
|
4074 |
choiceValue: fillHorizontalGradient |
|
4075 |
) |
|
4076 |
(MenuItem |
|
4077 |
activeHelpKey: drawModeFill |
|
4078 |
enabled: imageIsLoadedHolder |
|
4079 |
label: 'Vertical' |
|
4080 |
labelImage: (ResourceRetriever ImageEditor fillVerticalGradientRectIcon 'Vertical') |
|
4081 |
choice: editMode |
|
4082 |
choiceValue: fillVerticalGradient |
|
4083 |
) |
|
4084 |
(MenuItem |
|
4085 |
activeHelpKey: drawModeFill |
|
4086 |
enabled: imageIsLoadedHolder |
|
3421 | 4087 |
isVisible: false |
3418 | 4088 |
label: 'Diagonal' |
4089 |
labelImage: (ResourceRetriever ImageEditor fillDiagonalGradientRectIcon 'Diagonal') |
|
4090 |
choice: editMode |
|
4091 |
choiceValue: fillDiagonalGradient |
|
4092 |
) |
|
4093 |
) |
|
4094 |
nil |
|
4095 |
nil |
|
4096 |
) |
|
4097 |
) |
|
4098 |
(MenuItem |
|
3405 | 4099 |
label: '-' |
4100 |
) |
|
4101 |
(MenuItem |
|
4102 |
activeHelpKey: drawModeMaskOutsideRectangle |
|
4103 |
enabled: imageHasMaskAndIsNotReadOnlyHolder |
|
4104 |
label: 'Mask Outside Rectangle' |
|
4105 |
labelImage: (ResourceRetriever ImageEditor maskOutsideRectangleIcon 'Mask Outside Rectangle') |
|
4106 |
choice: editMode |
|
4107 |
choiceValue: maskOutsideRect |
|
4108 |
) |
|
4109 |
(MenuItem |
|
4110 |
activeHelpKey: drawModeMaskOutsideCircle |
|
4111 |
enabled: imageHasMaskAndIsNotReadOnlyHolder |
|
4112 |
label: 'Mask Outside Circle' |
|
4113 |
labelImage: (ResourceRetriever ImageEditor maskOutsideCircleIcon 'Mask Outside Circle') |
|
4114 |
choice: editMode |
|
4115 |
choiceValue: maskOutsideCircle |
|
4116 |
) |
|
4117 |
(MenuItem |
|
4118 |
label: '-' |
|
4119 |
) |
|
4120 |
(MenuItem |
|
2592 | 4121 |
activeHelpKey: drawModeCopy |
2792 | 4122 |
enabled: imageIsLoadedHolder |
2592 | 4123 |
label: 'Copy' |
4124 |
labelImage: (ResourceRetriever ImageEditor copyIcon 'Copy') |
|
4125 |
choice: editMode |
|
4126 |
choiceValue: copy |
|
4127 |
) |
|
4128 |
(MenuItem |
|
3512 | 4129 |
activeHelpKey: drawModePasteWithMask |
4130 |
enabled: imageIsLoadedHolder |
|
4131 |
label: 'Paste with Mask' |
|
4132 |
labelImage: (ResourceRetriever ImageEditor pasteWithMaskIcon 'Paste with Mask') |
|
4133 |
choice: editMode |
|
4134 |
choiceValue: pasteWithMask |
|
4135 |
) |
|
4136 |
(MenuItem |
|
2592 | 4137 |
activeHelpKey: drawModePaste |
2792 | 4138 |
enabled: imageIsLoadedHolder |
3512 | 4139 |
label: 'Paste Over' |
3561 | 4140 |
labelImage: (ResourceRetriever ImageEditor pasteIcon 'Paste Over') |
2592 | 4141 |
choice: editMode |
4142 |
choiceValue: paste |
|
1196 | 4143 |
) |
2592 | 4144 |
(MenuItem |
3561 | 4145 |
activeHelpKey: drawModePasteMasked |
4146 |
enabled: imageIsLoadedHolder |
|
4147 |
label: 'Paste Masked' |
|
4148 |
labelImage: (ResourceRetriever ImageEditor pasteIcon 'Paste Masked') |
|
4149 |
choice: editMode |
|
4150 |
choiceValue: pasteMasked |
|
4151 |
) |
|
4152 |
(MenuItem |
|
2592 | 4153 |
activeHelpKey: drawModePasteUnder |
2792 | 4154 |
enabled: imageIsLoadedHolder |
2592 | 4155 |
label: 'Paste Under' |
4156 |
labelImage: (ResourceRetriever ImageEditor pasteUnderIcon 'Paste Under') |
|
4157 |
choice: editMode |
|
4158 |
choiceValue: pasteUnder |
|
1196 | 4159 |
) |
2592 | 4160 |
(MenuItem |
3405 | 4161 |
label: '-' |
4162 |
) |
|
4163 |
(MenuItem |
|
2592 | 4164 |
activeHelpKey: drawModeSpecial |
2792 | 4165 |
enabled: imageIsLoadedHolder |
2592 | 4166 |
label: 'Special' |
3419 | 4167 |
labelImage: (ResourceRetriever ImageEditor specialRectangleIcon 'Special') |
2592 | 4168 |
choice: editMode |
4169 |
choiceValue: specialOperation |
|
1411 | 4170 |
) |
1196 | 4171 |
) |
4172 |
nil |
|
4173 |
nil |
|
400 | 4174 |
) |
3419 | 4175 |
|
3512 | 4176 |
"Modified: / 07-12-2017 / 15:30:46 / cg" |
3561 | 4177 |
"Modified: / 27-05-2018 / 10:41:20 / Claus Gittinger" |
1558 | 4178 |
! |
4179 |
||
4180 |
previewMenu |
|
4181 |
"This resource specification was automatically generated |
|
4182 |
by the MenuEditor of ST/X." |
|
4183 |
||
4184 |
"Do not manually edit this!! If it is corrupted, |
|
4185 |
the MenuEditor may not be able to read the specification." |
|
4186 |
||
3489 | 4187 |
|
1558 | 4188 |
" |
4189 |
MenuEditor new openOnClass:ImageEditor andSelector:#previewMenu |
|
4190 |
(Menu new fromLiteralArrayEncoding:(ImageEditor previewMenu)) startUp |
|
4191 |
" |
|
4192 |
||
4193 |
<resource: #menu> |
|
4194 |
||
4195 |
^ |
|
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4196 |
#(Menu |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4197 |
( |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4198 |
(MenuItem |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4199 |
label: 'TileMode' |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4200 |
indication: tileModeHolder |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4201 |
) |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4202 |
(MenuItem |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4203 |
label: '-' |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4204 |
) |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4205 |
(MenuItem |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4206 |
label: 'Background Color' |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4207 |
submenu: |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4208 |
(Menu |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4209 |
( |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4210 |
(MenuItem |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4211 |
label: 'Gray' |
2792 | 4212 |
choice: previewBackgroundColorHolder |
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4213 |
) |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4214 |
(MenuItem |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4215 |
label: 'Black' |
2792 | 4216 |
choice: previewBackgroundColorHolder |
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4217 |
choiceValue: black |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4218 |
) |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4219 |
(MenuItem |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4220 |
label: 'White' |
2792 | 4221 |
choice: previewBackgroundColorHolder |
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4222 |
choiceValue: white |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4223 |
) |
1774 | 4224 |
(MenuItem |
4225 |
label: '-' |
|
4226 |
) |
|
4227 |
(MenuItem |
|
4228 |
label: 'Red' |
|
2792 | 4229 |
choice: previewBackgroundColorHolder |
1774 | 4230 |
choiceValue: red |
4231 |
) |
|
4232 |
(MenuItem |
|
4233 |
label: 'Green' |
|
2792 | 4234 |
choice: previewBackgroundColorHolder |
1774 | 4235 |
choiceValue: green |
4236 |
) |
|
4237 |
(MenuItem |
|
4238 |
label: 'Blue' |
|
2792 | 4239 |
choice: previewBackgroundColorHolder |
1774 | 4240 |
choiceValue: blue |
4241 |
) |
|
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4242 |
) |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4243 |
nil |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4244 |
nil |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
4245 |
) |
1558 | 4246 |
) |
3489 | 4247 |
(MenuItem |
4248 |
label: '-' |
|
4249 |
) |
|
4250 |
(MenuItem |
|
4251 |
label: 'Magnification' |
|
4252 |
submenu: |
|
4253 |
(Menu |
|
4254 |
( |
|
4255 |
(MenuItem |
|
4256 |
label: '0.1' |
|
4257 |
choice: previewMagnificationHolder |
|
4258 |
choiceValue: 0.1 |
|
4259 |
) |
|
4260 |
(MenuItem |
|
4261 |
label: '0.25' |
|
4262 |
choice: previewMagnificationHolder |
|
4263 |
choiceValue: 0.25 |
|
4264 |
) |
|
4265 |
(MenuItem |
|
4266 |
label: '0.5' |
|
4267 |
choice: previewMagnificationHolder |
|
4268 |
choiceValue: 0.5 |
|
4269 |
) |
|
4270 |
(MenuItem |
|
4271 |
label: '1' |
|
4272 |
choice: previewMagnificationHolder |
|
4273 |
choiceValue: 1 |
|
4274 |
) |
|
4275 |
(MenuItem |
|
4276 |
label: '2' |
|
4277 |
choice: previewMagnificationHolder |
|
4278 |
choiceValue: 2 |
|
4279 |
) |
|
4280 |
(MenuItem |
|
4281 |
label: '4' |
|
4282 |
choice: previewMagnificationHolder |
|
4283 |
choiceValue: 4 |
|
4284 |
) |
|
4285 |
(MenuItem |
|
4286 |
label: '-' |
|
4287 |
) |
|
4288 |
(MenuItem |
|
4289 |
label: 'Choose...' |
|
4290 |
itemValue: changePreviewImageMagnification |
|
4291 |
) |
|
4292 |
) |
|
4293 |
nil |
|
4294 |
nil |
|
4295 |
) |
|
4296 |
) |
|
1558 | 4297 |
) |
4298 |
nil |
|
4299 |
nil |
|
4300 |
) |
|
2792 | 4301 |
|
3489 | 4302 |
"Modified: / 10-09-2017 / 14:54:41 / cg" |
1637 | 4303 |
! |
4304 |
||
4305 |
toolsMenuToolbar |
|
4306 |
"This resource specification was automatically generated |
|
4307 |
by the MenuEditor of ST/X." |
|
4308 |
||
4309 |
"Do not manually edit this!! If it is corrupted, |
|
4310 |
the MenuEditor may not be able to read the specification." |
|
4311 |
||
2881 | 4312 |
|
1637 | 4313 |
" |
4314 |
MenuEditor new openOnClass:ImageEditor andSelector:#toolsMenuToolbar |
|
4315 |
(Menu new fromLiteralArrayEncoding:(ImageEditor toolsMenuToolbar)) startUp |
|
4316 |
" |
|
4317 |
||
4318 |
<resource: #menu> |
|
4319 |
||
4320 |
^ |
|
2881 | 4321 |
#(Menu |
4322 |
( |
|
4323 |
(MenuItem |
|
4324 |
activeHelpKey: drawModePoint |
|
3404 | 4325 |
enabled: canDrawPointsHolder |
2881 | 4326 |
label: 'Point' |
4327 |
translateLabel: true |
|
4328 |
isButton: true |
|
4329 |
labelImage: (ResourceRetriever ImageEditor pointIcon) |
|
4330 |
choice: editMode |
|
4331 |
choiceValue: point |
|
1637 | 4332 |
) |
2881 | 4333 |
(MenuItem |
4334 |
activeHelpKey: drawModeSpray |
|
3404 | 4335 |
enabled: canSprayHolder |
2881 | 4336 |
label: 'Spray' |
4337 |
translateLabel: true |
|
4338 |
isButton: true |
|
4339 |
labelImage: (ResourceRetriever ImageEditor sprayIcon) |
|
4340 |
choice: editMode |
|
4341 |
choiceValue: spray |
|
2375 | 4342 |
) |
2881 | 4343 |
(MenuItem |
4344 |
activeHelpKey: drawModeBox |
|
3404 | 4345 |
enabled: canDrawRectsHolder |
2881 | 4346 |
label: 'Rect' |
4347 |
translateLabel: true |
|
4348 |
isButton: true |
|
4349 |
labelImage: (ResourceRetriever ImageEditor rectIcon) |
|
4350 |
choice: editMode |
|
4351 |
choiceValue: box |
|
1637 | 4352 |
) |
2881 | 4353 |
(MenuItem |
4354 |
activeHelpKey: drawModeFilledBox |
|
3404 | 4355 |
enabled: canFillRectsHolder |
2881 | 4356 |
label: 'FillRect' |
4357 |
translateLabel: true |
|
4358 |
isButton: true |
|
4359 |
labelImage: (ResourceRetriever ImageEditor fillRectIcon) |
|
4360 |
choice: editMode |
|
4361 |
choiceValue: filledBox |
|
1637 | 4362 |
) |
2881 | 4363 |
(MenuItem |
4364 |
activeHelpKey: drawModeCircle |
|
3404 | 4365 |
enabled: canDrawCirclesHolder |
2881 | 4366 |
label: 'Circle' |
4367 |
translateLabel: true |
|
4368 |
isButton: true |
|
4369 |
labelImage: (ResourceRetriever ImageEditor circleIcon) |
|
4370 |
choice: editMode |
|
4371 |
choiceValue: circle |
|
2375 | 4372 |
) |
2881 | 4373 |
(MenuItem |
4374 |
activeHelpKey: drawModeFill |
|
3404 | 4375 |
enabled: canFloodFillHolder |
2881 | 4376 |
label: 'Fill' |
4377 |
translateLabel: true |
|
4378 |
isButton: true |
|
4379 |
labelImage: (ResourceRetriever ImageEditor fillIcon) |
|
4380 |
choice: editMode |
|
4381 |
choiceValue: fill |
|
1637 | 4382 |
) |
2881 | 4383 |
(MenuItem |
4384 |
activeHelpKey: drawModeCopy |
|
4385 |
enabled: imageIsLoadedHolder |
|
4386 |
label: 'Copy' |
|
4387 |
translateLabel: true |
|
4388 |
isButton: true |
|
4389 |
labelImage: (ResourceRetriever ImageEditor copyIcon) |
|
4390 |
choice: editMode |
|
4391 |
choiceValue: copy |
|
1637 | 4392 |
) |
2881 | 4393 |
(MenuItem |
4394 |
activeHelpKey: drawModePasteWithMask |
|
3377 | 4395 |
enabled: imageIsLoadedAndNotReadonlyHolder |
2881 | 4396 |
label: 'Paste With Mask' |
4397 |
translateLabel: true |
|
4398 |
isButton: true |
|
4399 |
labelImage: (ResourceRetriever ImageEditor pasteWithMaskIcon) |
|
4400 |
choice: editMode |
|
4401 |
choiceValue: pasteWithMask |
|
1637 | 4402 |
) |
2881 | 4403 |
(MenuItem |
4404 |
activeHelpKey: drawModePaste |
|
3377 | 4405 |
enabled: imageIsLoadedAndNotReadonlyHolder |
3561 | 4406 |
label: 'Paste Over' |
2881 | 4407 |
translateLabel: true |
4408 |
isButton: true |
|
4409 |
labelImage: (ResourceRetriever ImageEditor pasteIcon) |
|
4410 |
choice: editMode |
|
4411 |
choiceValue: paste |
|
1637 | 4412 |
) |
2881 | 4413 |
(MenuItem |
3561 | 4414 |
activeHelpKey: drawModePasteMasked |
4415 |
enabled: imageIsLoadedAndNotReadonlyHolder |
|
4416 |
label: 'Paste Masked' |
|
4417 |
translateLabel: true |
|
4418 |
isButton: true |
|
4419 |
labelImage: (ResourceRetriever ImageEditor pasteMaskedIcon) |
|
4420 |
choice: editMode |
|
4421 |
choiceValue: pasteMasked |
|
4422 |
) |
|
4423 |
(MenuItem |
|
2881 | 4424 |
activeHelpKey: drawModePasteUnder |
3377 | 4425 |
enabled: imageIsLoadedAndNotReadonlyHolder |
2881 | 4426 |
label: 'Paste Under' |
4427 |
translateLabel: true |
|
4428 |
isButton: true |
|
4429 |
labelImage: (ResourceRetriever ImageEditor pasteUnderIcon) |
|
4430 |
choice: editMode |
|
4431 |
choiceValue: pasteUnder |
|
1637 | 4432 |
) |
2881 | 4433 |
(MenuItem |
3464 | 4434 |
activeHelpKey: drawModeCropSubImage |
4435 |
enabled: imageIsLoadedHolder |
|
4436 |
label: 'Crop SubImage' |
|
4437 |
translateLabel: true |
|
4438 |
isButton: true |
|
4439 |
labelImage: (ResourceRetriever ImageEditor cropSubImageIcon) |
|
4440 |
choice: editMode |
|
4441 |
choiceValue: cropSubImage |
|
4442 |
) |
|
4443 |
(MenuItem |
|
2881 | 4444 |
activeHelpKey: drawModeSpecial |
4445 |
enabled: imageIsLoadedHolder |
|
4446 |
label: 'Special' |
|
4447 |
translateLabel: true |
|
4448 |
isButton: true |
|
3419 | 4449 |
labelImage: (ResourceRetriever ImageEditor specialRectangleIcon) |
2881 | 4450 |
choice: editMode |
4451 |
choiceValue: specialOperation |
|
1637 | 4452 |
) |
4453 |
) |
|
4454 |
nil |
|
4455 |
nil |
|
4456 |
) |
|
3404 | 4457 |
|
3464 | 4458 |
"Modified: / 24-08-2017 / 20:53:02 / cg" |
3561 | 4459 |
"Modified: / 27-05-2018 / 10:45:31 / Claus Gittinger" |
400 | 4460 |
! ! |
4461 |
||
1842
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4462 |
!ImageEditor class methodsFor:'tableColumns specs'! |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4463 |
|
1900 | 4464 |
colorTableColumns |
1842
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4465 |
"This resource specification was automatically generated |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4466 |
by the DataSetBuilder of ST/X." |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4467 |
|
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4468 |
"Do not manually edit this!! If it is corrupted, |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4469 |
the DataSetBuilder may not be able to read the specification." |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4470 |
|
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4471 |
" |
1975 | 4472 |
DataSetBuilder new openOnClass:ImageEditor andSelector:#colorTableColumns |
1842
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4473 |
" |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4474 |
|
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4475 |
<resource: #tableColumns> |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4476 |
|
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4477 |
^#( |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4478 |
(DataSetColumnSpec |
2174 | 4479 |
activeHelpKey: '' |
1842
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4480 |
labelButtonType: Button |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4481 |
rendererType: rowSelector |
2712 | 4482 |
backgroundSelector: theColorItself: |
4483 |
selectedBackgroundSelector: theColorItself: |
|
1842
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4484 |
isResizeable: false |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4485 |
) |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4486 |
(DataSetColumnSpec |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4487 |
label: 'R' |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4488 |
labelAlignment: left |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4489 |
labelButtonType: Button |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4490 |
columnAlignment: right |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4491 |
editorType: InputField |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4492 |
type: number |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4493 |
model: redFromColor: |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4494 |
writeSelector: redAtColor:put: |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4495 |
selectSelector: canSelectRedInColor: |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4496 |
) |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4497 |
(DataSetColumnSpec |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4498 |
label: 'G' |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4499 |
labelAlignment: left |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4500 |
labelButtonType: Button |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4501 |
columnAlignment: right |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4502 |
editorType: InputField |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4503 |
type: number |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4504 |
model: greenFromColor: |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4505 |
writeSelector: greenAtColor:put: |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4506 |
selectSelector: canSelectGreenInColor: |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4507 |
) |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4508 |
(DataSetColumnSpec |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4509 |
label: 'B' |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4510 |
labelAlignment: left |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4511 |
labelButtonType: Button |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4512 |
columnAlignment: right |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4513 |
editorType: InputField |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4514 |
type: number |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4515 |
model: blueFromColor: |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4516 |
writeSelector: blueAtColor:put: |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4517 |
selectSelector: canSelectBlueInColor: |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4518 |
) |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4519 |
) |
2174 | 4520 |
|
4521 |
"Modified: / 22-07-2007 / 13:21:57 / cg" |
|
1842
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4522 |
! ! |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
4523 |
|
400 | 4524 |
!ImageEditor methodsFor:'accessing'! |
4525 |
||
4526 |
image |
|
767 | 4527 |
"returns the current editing image" |
400 | 4528 |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4529 |
^ imageEditView image |
400 | 4530 |
! |
4531 |
||
4532 |
postOpenAction: anAction |
|
767 | 4533 |
"sets an action which is evaluated after opening" |
400 | 4534 |
|
4535 |
postOpenAction := anAction |
|
1381 | 4536 |
! |
4537 |
||
4538 |
resourceClass:aClass |
|
4539 |
imageEditView resourceClass:aClass |
|
3375 | 4540 |
! |
4541 |
||
3379 | 4542 |
savedFile |
4543 |
"if user did a save to file, return the filename. |
|
4544 |
Otherwise, this returns nil" |
|
4545 |
||
4546 |
^ savedFile |
|
4547 |
! |
|
4548 |
||
3375 | 4549 |
savedImage |
4550 |
"if user did a save, return what was saved last. |
|
4551 |
Otherwise, this returns nil" |
|
4552 |
||
4553 |
^ savedImage |
|
400 | 4554 |
! ! |
4555 |
||
2767 | 4556 |
!ImageEditor methodsFor:'accessing-behavior'! |
4557 |
||
3405 | 4558 |
allowedToChangeImageDimension |
4559 |
"used to edit an existing image's contents only (Expecco)" |
|
4560 |
||
4561 |
^ self allowedToChangeImageDimensionAndDepth |
|
4562 |
||
4563 |
"Created: / 16-02-2017 / 01:59:21 / cg" |
|
4564 |
! |
|
4565 |
||
2767 | 4566 |
allowedToChangeImageDimensionAndDepth |
4567 |
"used to edit an existing image's contents only (Expecco)" |
|
4568 |
||
3378 | 4569 |
self readOnly ifTrue:[^ false]. |
2767 | 4570 |
^ allowedToChangeImageDimensionAndDepth ? true |
4571 |
! |
|
4572 |
||
4573 |
allowedToChangeImageDimensionAndDepth:aBoolean |
|
4574 |
"used to edit an existing image's contents only (Expecco)" |
|
4575 |
||
4576 |
allowedToChangeImageDimensionAndDepth := aBoolean |
|
4577 |
! ! |
|
4578 |
||
1398 | 4579 |
!ImageEditor methodsFor:'accessing-views'! |
400 | 4580 |
|
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
4581 |
colorDataSetView |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
4582 |
"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
|
4583 |
|
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1583
diff
changeset
|
4584 |
^(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
|
4585 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
4586 |
"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
|
4587 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
4588 |
|
487 | 4589 |
coordLabel |
767 | 4590 |
"returns the view the coord label" |
487 | 4591 |
|
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1583
diff
changeset
|
4592 |
^self componentAt: #coordLabel |
487 | 4593 |
! |
4594 |
||
400 | 4595 |
imageEditView |
3376 | 4596 |
"returns the editor view of the image" |
400 | 4597 |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4598 |
imageEditView isNil ifTrue:[ |
1597
b670ad8c30e1
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
1583
diff
changeset
|
4599 |
imageEditView := (self componentAt: #imageEditView) scrolledView. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4600 |
imageEditView addDependent:self. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4601 |
]. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
4602 |
^ imageEditView |
1345 | 4603 |
|
4604 |
"Modified: / 10.2.2000 / 23:19:20 / cg" |
|
400 | 4605 |
! |
4606 |
||
4607 |
imagePreView |
|
767 | 4608 |
"returns the preview of the image" |
400 | 4609 |
|
2339
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4610 |
|imagePreViewSubViews| |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4611 |
|
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4612 |
imagePreViewSubViews := (self componentAt: #imagePreView) subViews. |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4613 |
|
2043 | 4614 |
"subViews is an empty array at closing image Editor" |
2339
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4615 |
imagePreViewSubViews isEmptyOrNil ifTrue:[ |
2043 | 4616 |
^ nil |
4617 |
]. |
|
4618 |
||
2339
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
4619 |
^ imagePreViewSubViews first |
475 | 4620 |
! ! |
4621 |
||
3413 | 4622 |
!ImageEditor methodsFor:'actions'! |
4623 |
||
4624 |
applyCropAction |
|
4625 |
self cropLeft:(self cropLeftAmount value) right:(self cropRightAmount value) |
|
4626 |
top:(self cropTopAmount value) bottom:(self cropBottomAmount value) |
|
4627 |
||
4628 |
"Created: / 17-02-2017 / 14:34:35 / cg" |
|
4629 |
"Modified: / 19-02-2017 / 15:11:41 / cg" |
|
4630 |
! |
|
4631 |
||
4632 |
cropBottomNow |
|
4633 |
self cropLeft:0 right:0 top:0 bottom:(self cropBottomAmount value) |
|
4634 |
||
4635 |
"Created: / 19-02-2017 / 15:07:36 / cg" |
|
4636 |
! |
|
4637 |
||
4638 |
cropLeft:left right:right top:top bottom:bottom |
|
4639 |
|img| |
|
4640 |
||
4641 |
img := imageEditView image. |
|
4642 |
img isNil ifTrue:[^ self]. |
|
4643 |
||
4644 |
true "firstChange" ifTrue:[ |
|
4645 |
imageEditView makeUndo. |
|
4646 |
"/ firstChange := false. |
|
4647 |
]. |
|
4648 |
imageEditView |
|
4649 |
makeSubImageX:left y:top |
|
4650 |
width:(img width - left - right) |
|
4651 |
height:(img height - top - bottom). |
|
4652 |
||
4653 |
self updateImagePreView. |
|
4654 |
self updateInfoLabel |
|
4655 |
||
4656 |
"Created: / 19-02-2017 / 15:07:58 / cg" |
|
4657 |
! |
|
4658 |
||
4659 |
cropLeftNow |
|
4660 |
self cropLeft:(self cropLeftAmount value) right:0 top:0 bottom:0 |
|
4661 |
||
4662 |
"Created: / 19-02-2017 / 15:08:06 / cg" |
|
4663 |
! |
|
4664 |
||
4665 |
cropRightNow |
|
4666 |
self cropLeft:0 right:(self cropRightAmount value) top:0 bottom:0 |
|
4667 |
||
4668 |
"Created: / 19-02-2017 / 15:08:12 / cg" |
|
4669 |
! |
|
4670 |
||
4671 |
cropTopNow |
|
4672 |
self cropLeft:0 right:0 top:(self cropTopAmount value) bottom:0 |
|
4673 |
||
4674 |
"Created: / 19-02-2017 / 15:08:29 / cg" |
|
4675 |
! ! |
|
4676 |
||
400 | 4677 |
!ImageEditor methodsFor:'aspects'! |
4678 |
||
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
4679 |
activityInfoHolder |
1987 | 4680 |
^ self infoLabelHolder |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
4681 |
|
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
4682 |
"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
|
4683 |
! |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
4684 |
|
3487 | 4685 |
alphaHolder |
4686 |
|holder| |
|
4687 |
||
4688 |
(holder := builder bindingAt:#alphaHolder) isNil ifTrue:[ |
|
4689 |
builder aspectAt:#alphaHolder put:(holder := 100 asValue). |
|
4690 |
holder onChangeEvaluate:[ imageEditView drawingAlpha:holder value ]. |
|
4691 |
]. |
|
4692 |
^ holder |
|
4693 |
||
4694 |
"Created: / 05-09-2017 / 00:38:14 / cg" |
|
3488 | 4695 |
"Modified: / 05-09-2017 / 10:47:01 / cg" |
3487 | 4696 |
! |
4697 |
||
4698 |
alphaText |
|
4699 |
^ 'alpha:' |
|
4700 |
||
4701 |
"Created: / 05-09-2017 / 00:32:55 / cg" |
|
4702 |
! |
|
4703 |
||
4704 |
alphaVisibleHolder |
|
3650 | 4705 |
^ builder booleanValueAspectFor:#alphaVisibleHolder |
3487 | 4706 |
|
4707 |
"Created: / 05-09-2017 / 00:35:36 / cg" |
|
3650 | 4708 |
"Modified: / 09-03-2019 / 21:10:52 / Claus Gittinger" |
3487 | 4709 |
! |
4710 |
||
3475 | 4711 |
canAddColorToColormap |
4712 |
|img| |
|
4713 |
||
4714 |
img := self image. |
|
4715 |
img isNil ifTrue:[^ false]. |
|
4716 |
img photometric == #blackIs0 ifTrue:[^ false]. |
|
4717 |
img photometric == #whiteIs0 ifTrue:[^ false]. |
|
4718 |
^ true |
|
4719 |
||
4720 |
"Created: / 31-08-2017 / 18:32:27 / cg" |
|
4721 |
! |
|
4722 |
||
4723 |
canAddColorToColormapHolder |
|
4724 |
^ [self canAddColorToColormap] |
|
4725 |
||
4726 |
"Created: / 31-08-2017 / 18:32:40 / cg" |
|
4727 |
! |
|
4728 |
||
4729 |
canChangeColorInColormap |
|
4730 |
|img| |
|
4731 |
||
4732 |
img := self image. |
|
4733 |
img isNil ifTrue:[^ false]. |
|
4734 |
img photometric == #palette ifFalse:[^ false]. |
|
4735 |
^ true |
|
4736 |
||
4737 |
"Created: / 31-08-2017 / 18:34:12 / cg" |
|
4738 |
! |
|
4739 |
||
4740 |
canChangeColorInColormapHolder |
|
4741 |
^ [self canChangeColorInColormap] |
|
4742 |
||
4743 |
"Created: / 31-08-2017 / 18:34:18 / cg" |
|
4744 |
! |
|
4745 |
||
3378 | 4746 |
canResizeImage |
4747 |
^ self imageIsLoadedAndNotReadonlyHolder |
|
4748 |
! |
|
4749 |
||
3393 | 4750 |
colorBoxVisibleHolder |
3653 | 4751 |
^ builder valueAspectFor:#colorBoxVisibleHolder initialValue:true |
3393 | 4752 |
|
4753 |
"Created: / 03-02-2017 / 11:20:21 / cg" |
|
3653 | 4754 |
"Modified: / 09-03-2019 / 22:18:00 / Claus Gittinger" |
3393 | 4755 |
! |
4756 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
4757 |
colorColumnAdaptor |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
4758 |
^ self |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
4759 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
4760 |
"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
|
4761 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
4762 |
|
3413 | 4763 |
colorCropTabLabelList |
4764 |
^ resources array:(self colorCropTabSpecList collect:#first) |
|
4765 |
||
4766 |
"Created: / 19-02-2017 / 14:58:25 / cg" |
|
4767 |
! |
|
4768 |
||
4769 |
colorCropTabSelectionIndexHolder |
|
4770 |
|holder| |
|
4771 |
||
4772 |
(holder := builder bindingAt:#colorCropTabSelectionIndexHolder) isNil ifTrue:[ |
|
3415 | 4773 |
builder aspectAt:#colorCropTabSelectionIndexHolder put:(holder := self defaultEditTabIndex asValue). |
3413 | 4774 |
holder onChangeSend:#colorCropTabSelectionIndexChanged to:self. |
4775 |
]. |
|
4776 |
^ holder |
|
4777 |
||
4778 |
"Created: / 19-02-2017 / 14:59:11 / cg" |
|
3415 | 4779 |
"Modified: / 19-02-2017 / 23:33:39 / cg" |
3413 | 4780 |
! |
4781 |
||
4782 |
colorCropTabSpecList |
|
4783 |
^ #( |
|
4784 |
('Colors' colors) |
|
4785 |
('Crop' crop) |
|
4786 |
('Fill' fill) |
|
4787 |
) |
|
4788 |
||
4789 |
"Created: / 19-02-2017 / 15:34:33 / cg" |
|
4790 |
! |
|
4791 |
||
4792 |
colorCropTabSymbolList |
|
4793 |
^ self colorCropTabSpecList collect:#second |
|
4794 |
||
4795 |
"Created: / 19-02-2017 / 15:34:54 / cg" |
|
4796 |
! |
|
4797 |
||
4798 |
cropBottomAmount |
|
4799 |
^ builder valueAspectFor:'cropBottomAmount' initialValue:1 |
|
4800 |
||
4801 |
"Created: / 19-02-2017 / 15:09:09 / cg" |
|
4802 |
! |
|
4803 |
||
3393 | 4804 |
cropBoxIsDialog |
3413 | 4805 |
^ false |
3393 | 4806 |
|
4807 |
"Created: / 03-02-2017 / 11:23:50 / cg" |
|
3413 | 4808 |
"Modified: / 19-02-2017 / 15:24:07 / cg" |
3393 | 4809 |
! |
4810 |
||
3408 | 4811 |
cropBoxIsNotDialog |
4812 |
^ self cropBoxIsDialog not |
|
4813 |
||
4814 |
"Created: / 17-02-2017 / 14:38:04 / cg" |
|
4815 |
! |
|
4816 |
||
3393 | 4817 |
cropBoxVisibleHolder |
3650 | 4818 |
^ builder booleanValueAspectFor:#cropBoxVisibleHolder |
3393 | 4819 |
|
4820 |
"Created: / 03-02-2017 / 11:20:13 / cg" |
|
3650 | 4821 |
"Modified: / 09-03-2019 / 21:11:00 / Claus Gittinger" |
3393 | 4822 |
! |
4823 |
||
3413 | 4824 |
cropLeftAmount |
4825 |
^ builder valueAspectFor:'cropLeftAmount' initialValue:1 |
|
4826 |
||
4827 |
"Created: / 19-02-2017 / 15:09:23 / cg" |
|
4828 |
! |
|
4829 |
||
4830 |
cropRightAmount |
|
4831 |
^ builder valueAspectFor:'cropRightAmount' initialValue:1 |
|
4832 |
||
4833 |
"Created: / 19-02-2017 / 15:09:29 / cg" |
|
4834 |
! |
|
4835 |
||
4836 |
cropTopAmount |
|
4837 |
^ builder valueAspectFor:'cropTopAmount' initialValue:1 |
|
4838 |
||
4839 |
"Created: / 19-02-2017 / 15:09:35 / cg" |
|
4840 |
! |
|
4841 |
||
3415 | 4842 |
defaultEditTabIndex |
4843 |
"the default tab to show in the color/crop/fill tablist" |
|
4844 |
||
4845 |
^ 1 |
|
4846 |
||
4847 |
"Created: / 19-02-2017 / 23:34:12 / cg" |
|
4848 |
! |
|
4849 |
||
3421 | 4850 |
drawingColor1Holder |
4851 |
"returns a valueHolder for the current selected mouse-button-1 color" |
|
4852 |
||
4853 |
|holder| |
|
4854 |
||
4855 |
(holder := builder bindingAt:#drawingColor1Holder) isNil ifTrue:[ |
|
4856 |
builder aspectAt:#drawingColor1Holder put:(holder := IndirectValue new) |
|
4857 |
]. |
|
4858 |
^ holder |
|
4859 |
||
4860 |
"Created: / 23-02-2017 / 10:18:25 / cg" |
|
4861 |
! |
|
4862 |
||
4863 |
drawingColor2Holder |
|
4864 |
"returns a valueHolder for the current selected mouse-button-2 color" |
|
4865 |
||
4866 |
|holder| |
|
4867 |
||
4868 |
(holder := builder bindingAt:#drawingColor2Holder) isNil ifTrue:[ |
|
4869 |
builder aspectAt:#drawingColor2Holder put:(holder := IndirectValue new) |
|
4870 |
]. |
|
4871 |
^ holder |
|
4872 |
||
4873 |
"Created: / 23-02-2017 / 10:18:33 / cg" |
|
4874 |
! |
|
4875 |
||
3413 | 4876 |
floodFillBoxVisibleHolder |
3650 | 4877 |
^ builder booleanValueAspectFor:#floodFillBoxVisibleHolder |
3413 | 4878 |
|
4879 |
"Created: / 19-02-2017 / 15:28:40 / cg" |
|
3650 | 4880 |
"Modified: / 09-03-2019 / 21:11:11 / Claus Gittinger" |
3413 | 4881 |
! |
4882 |
||
3408 | 4883 |
floodFillMaxHueError |
4884 |
|holder| |
|
4885 |
||
4886 |
(holder := builder bindingAt:#floodFillMaxHueError) isNil ifTrue:[ |
|
4887 |
builder aspectAt:#floodFillMaxHueError put:(holder := 0 asValue). |
|
4888 |
holder onChangeEvaluate:[ imageEditView floodFillMaxHueError:holder value ]. |
|
4889 |
]. |
|
4890 |
^ holder |
|
4891 |
||
4892 |
"Created: / 17-02-2017 / 15:19:17 / cg" |
|
4893 |
! |
|
4894 |
||
4895 |
floodFillMaxLightError |
|
4896 |
|holder| |
|
4897 |
||
4898 |
(holder := builder bindingAt:#floodFillMaxLightError) isNil ifTrue:[ |
|
4899 |
builder aspectAt:#floodFillMaxLightError put:(holder := 0 asValue). |
|
4900 |
holder onChangeEvaluate:[ imageEditView floodFillMaxLightError:holder value ]. |
|
4901 |
]. |
|
4902 |
^ holder |
|
4903 |
||
4904 |
"Created: / 17-02-2017 / 15:19:11 / cg" |
|
4905 |
! |
|
4906 |
||
2792 | 4907 |
hasClassAndSelectorDefinedHolder |
1054 | 4908 |
^ [ |
1965
1d2b7893ae89
some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents:
1962
diff
changeset
|
4909 |
|cls| |
1d2b7893ae89
some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents:
1962
diff
changeset
|
4910 |
|
1d2b7893ae89
some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents:
1962
diff
changeset
|
4911 |
(cls := imageEditView resourceClass) notNil |
1d2b7893ae89
some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents:
1962
diff
changeset
|
4912 |
and:[imageEditView resourceSelector notNil] |
1054 | 4913 |
] |
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
4914 |
|
2792 | 4915 |
"Created: / 04-07-2010 / 10:11:10 / cg" |
4916 |
! |
|
4917 |
||
4918 |
hasClassDefinedHolder |
|
1054 | 4919 |
^ [ |
1965
1d2b7893ae89
some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents:
1962
diff
changeset
|
4920 |
imageEditView resourceClass notNil |
1054 | 4921 |
] |
933
f090206aadff
disable some menu items if no class/selector is defined
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
4922 |
|
2792 | 4923 |
"Created: / 04-07-2010 / 10:11:47 / cg" |
4924 |
! |
|
4925 |
||
4926 |
hasColorSelectedHolder |
|
3195 | 4927 |
^ [ self selectedColors value notEmptyOrNil "self selectedColorIndexOrNil notNil" ] |
2792 | 4928 |
|
4929 |
"Created: / 04-07-2010 / 10:12:22 / cg" |
|
2651 | 4930 |
! |
4931 |
||
1008 | 4932 |
hasColormap |
3475 | 4933 |
"true if a colormap is shown (might be a drwing map, not the real map)" |
4934 |
||
3421 | 4935 |
|img| |
4936 |
||
4937 |
^ (img := self image) notNil |
|
3598 | 4938 |
and:[img colorMap notNil |
4939 |
or:[ drawingColormap notNil |
|
4940 |
or:[ self listOfColors notEmptyOrNil ]]] |
|
2792 | 4941 |
|
4942 |
"Created: / 30-09-1998 / 23:53:55 / cg" |
|
3421 | 4943 |
"Modified: / 23-02-2017 / 09:57:45 / cg" |
3475 | 4944 |
"Modified (comment): / 31-08-2017 / 18:36:08 / cg" |
1008 | 4945 |
! |
4946 |
||
2651 | 4947 |
hasColormapAndColorSelected |
3476 | 4948 |
^ [ self hasColormap and:[self hasColorSelectedHolder value]] |
4949 |
||
4950 |
"Modified: / 31-08-2017 / 14:08:20 / cg" |
|
2792 | 4951 |
! |
4952 |
||
3195 | 4953 |
hasColormapAndSingleColorSelected |
3475 | 4954 |
^ self hasColormapHolder value and:[self hasSingleColorSelectedHolder value] |
4955 |
||
4956 |
"Modified: / 31-08-2017 / 18:44:49 / cg" |
|
4957 |
! |
|
4958 |
||
4959 |
hasColormapAndSingleColorSelectedHolder |
|
4960 |
^ [ self hasColormapAndSingleColorSelected value ] |
|
4961 |
||
4962 |
"Created: / 31-08-2017 / 18:44:36 / cg" |
|
4963 |
! |
|
4964 |
||
4965 |
hasColormapAndSingleWritableColorSelectedHolder |
|
3553 | 4966 |
^ [ self hasColormapAndSingleColorSelected |
4967 |
and:[self canChangeColorInColormap ]] |
|
3475 | 4968 |
|
4969 |
"Created: / 31-08-2017 / 18:42:46 / cg" |
|
3195 | 4970 |
! |
4971 |
||
2792 | 4972 |
hasColormapHolder |
3475 | 4973 |
"true if a colormap is shown (might be a drwing map, not the real map)" |
4974 |
||
2792 | 4975 |
^ [self hasColormap] |
4976 |
||
4977 |
"Created: / 04-07-2010 / 10:13:05 / cg" |
|
3475 | 4978 |
"Modified (comment): / 31-08-2017 / 18:36:47 / cg" |
2792 | 4979 |
! |
4980 |
||
3195 | 4981 |
hasSingleColorSelectedHolder |
4982 |
^ [ self selectedColors value size == 1 "self selectedColorIndexOrNil notNil" ] |
|
4983 |
||
4984 |
"Created: / 04-07-2010 / 10:12:22 / cg" |
|
4985 |
! |
|
4986 |
||
3496 | 4987 |
hasWritableColorSelectedHolder |
4988 |
^ [ self hasSingleColorSelectedHolder value and:[self canChangeColorInColormap ]] |
|
4989 |
||
4990 |
"Created: / 08-10-2017 / 14:45:11 / cg" |
|
4991 |
! |
|
4992 |
||
3475 | 4993 |
imageHasColormap |
4994 |
"true if a colormap is shown (might be a drwing map, not the real map)" |
|
4995 |
||
4996 |
|img| |
|
4997 |
||
4998 |
^ (img := self image) notNil |
|
4999 |
and:[img colorMap notNil ] |
|
5000 |
||
5001 |
"Created: / 31-08-2017 / 18:36:25 / cg" |
|
5002 |
! |
|
5003 |
||
5004 |
imageHasColormapHolder |
|
5005 |
^ [self imageHasColormap] |
|
5006 |
||
5007 |
"Created: / 31-08-2017 / 18:36:42 / cg" |
|
5008 |
! |
|
5009 |
||
2812 | 5010 |
imageHasImageSequence |
3080 | 5011 |
|img| |
5012 |
||
5013 |
^ (img := self image) notNil and:[img imageSequence notNil] |
|
2812 | 5014 |
|
5015 |
"Created: / 21-10-2010 / 14:35:45 / cg" |
|
5016 |
! |
|
5017 |
||
5018 |
imageHasImageSequenceHolder |
|
5019 |
|holder| |
|
5020 |
||
5021 |
(holder := builder bindingAt:#imageHasImageSequenceHolder) isNil ifTrue:[ |
|
5022 |
builder aspectAt:#imageHasImageSequenceHolder put:(holder := false asValue). |
|
5023 |
holder value:(self imageHasImageSequence). |
|
5024 |
]. |
|
5025 |
^ holder |
|
5026 |
||
5027 |
"Modified: / 21-10-2010 / 14:36:57 / cg" |
|
5028 |
! |
|
5029 |
||
3405 | 5030 |
imageHasMaskAndIsNotReadOnlyHolder |
5031 |
"returns whether an image is loaded and editable as value holder" |
|
5032 |
||
5033 |
^ BlockValue |
|
5034 |
with:[:loaded | loaded and:[ self image mask notNil and:[self readOnly not] ]] |
|
5035 |
argument:(self imageIsLoadedHolder) |
|
5036 |
||
5037 |
"Created: / 16-02-2017 / 12:17:25 / cg" |
|
5038 |
! |
|
5039 |
||
2812 | 5040 |
imageHasNextImage |
5041 |
^ self imageHasImageSequence and:[ (imageSeqNr ? 1) < self image imageSequence size ] |
|
5042 |
||
5043 |
"Created: / 21-10-2010 / 14:37:10 / cg" |
|
5044 |
! |
|
5045 |
||
2792 | 5046 |
imageHasNextImageHolder |
2812 | 5047 |
|holder| |
5048 |
||
5049 |
(holder := builder bindingAt:#imageHasNextImageHolder) isNil ifTrue:[ |
|
5050 |
builder aspectAt:#imageHasNextImageHolder put:(holder := false asValue). |
|
5051 |
holder value:(self imageHasNextImage). |
|
5052 |
]. |
|
5053 |
^ holder |
|
5054 |
||
5055 |
"Modified: / 21-10-2010 / 14:37:40 / cg" |
|
5056 |
! |
|
5057 |
||
5058 |
imageHasPreviousImage |
|
5059 |
^ self imageHasImageSequence and:[ (imageSeqNr ? 1) > 1 ] |
|
5060 |
||
5061 |
"Created: / 21-10-2010 / 14:37:21 / cg" |
|
5062 |
! |
|
5063 |
||
5064 |
imageHasPreviousImageHolder |
|
5065 |
|holder| |
|
5066 |
||
5067 |
(holder := builder bindingAt:#imageHasPreviousImageHolder) isNil ifTrue:[ |
|
5068 |
builder aspectAt:#imageHasPreviousImageHolder put:(holder := false asValue). |
|
5069 |
holder value:(self imageHasPreviousImage). |
|
5070 |
]. |
|
5071 |
^ holder |
|
5072 |
||
5073 |
"Modified: / 21-10-2010 / 14:37:48 / cg" |
|
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
5074 |
! |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
5075 |
|
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
5076 |
imageInfoHolder |
3653 | 5077 |
^ builder valueAspectFor:#imageInfoHolder initialValue:'' |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
5078 |
|
2792 | 5079 |
"Modified: / 04-07-2010 / 10:15:14 / cg" |
3653 | 5080 |
"Modified: / 09-03-2019 / 22:18:11 / Claus Gittinger" |
400 | 5081 |
! |
5082 |
||
5083 |
listOfColors |
|
1896 | 5084 |
"returns the list of colors" |
5085 |
||
5086 |
|list| |
|
5087 |
||
5088 |
(list := builder bindingAt:#listOfColors) isNil ifTrue:[ |
|
5089 |
builder aspectAt:#listOfColors put:(list := List new). |
|
5090 |
list addDependent:self. |
|
400 | 5091 |
]. |
1896 | 5092 |
^ list |
400 | 5093 |
! |
5094 |
||
1987 | 5095 |
magnificationHolder |
5096 |
"returns current magnification of the image as an AspectAdaptor" |
|
5097 |
||
5098 |
|holder| |
|
5099 |
(holder := builder bindingAt:#valueOfMagnification) isNil ifTrue:[ |
|
5100 |
builder aspectAt:#valueOfMagnification put:( |
|
5101 |
holder := AspectAdaptor new subject:self; forAspect:#magnification) |
|
5102 |
]. |
|
5103 |
^ holder |
|
5104 |
! |
|
5105 |
||
2881 | 5106 |
penWidthHolder |
5107 |
|holder| |
|
5108 |
||
5109 |
(holder := builder bindingAt:#penWidthHolder) isNil ifTrue:[ |
|
5110 |
builder aspectAt:#penWidthHolder put:(holder := imageEditView penWidth asValue). |
|
5111 |
holder onChangeSend:#penWidthHolderChanged to:self. |
|
5112 |
]. |
|
5113 |
^ holder |
|
5114 |
||
5115 |
"Created: / 15-02-2012 / 22:30:58 / cg" |
|
5116 |
! |
|
5117 |
||
2792 | 5118 |
previewBackgroundColorHolder |
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
5119 |
|holder| |
2792 | 5120 |
|
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
5121 |
(holder := builder bindingAt:#previewBackgroundColor) isNil ifTrue:[ |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
5122 |
builder aspectAt:#previewBackgroundColor put:(holder := nil asValue). |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
5123 |
holder addDependent:self. |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
5124 |
]. |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
5125 |
^ holder |
2792 | 5126 |
|
5127 |
"Created: / 04-07-2010 / 10:19:34 / cg" |
|
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
5128 |
! |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
5129 |
|
3489 | 5130 |
previewMagnificationHolder |
5131 |
|holder| |
|
5132 |
||
5133 |
(holder := builder bindingAt:#previewMagnificationHolder) isNil ifTrue:[ |
|
5134 |
builder aspectAt:#previewMagnificationHolder put:(holder := 1 asValue). |
|
5135 |
holder addDependent:self. |
|
5136 |
]. |
|
5137 |
^ holder |
|
5138 |
||
5139 |
"Created: / 10-09-2017 / 14:10:07 / cg" |
|
5140 |
! |
|
5141 |
||
3377 | 5142 |
readOnly |
5143 |
^ false |
|
5144 |
! |
|
5145 |
||
3425 | 5146 |
saveButtonInToolbarVisibleHolder |
5147 |
^ false |
|
5148 |
||
5149 |
"Created: / 26-02-2017 / 22:58:41 / cg" |
|
5150 |
! |
|
5151 |
||
3195 | 5152 |
selectedColors |
5153 |
"returns a valueHolder for the current set of selected colors." |
|
5154 |
||
5155 |
|holder| |
|
5156 |
||
5157 |
(holder := builder bindingAt:#selectedColors) isNil ifTrue:[ |
|
5158 |
builder aspectAt:#selectedColors put:(holder := nil asValue). |
|
5159 |
holder onChangeSend:#selectedColorsChanged to:self. |
|
5160 |
]. |
|
5161 |
^ holder |
|
5162 |
! |
|
5163 |
||
400 | 5164 |
selectionOfColor |
1682 | 5165 |
"returns a valueHolder for the current selection of the edit color. |
5166 |
Here, an AspectAdaptor which accesses selectedColorIndex is returned." |
|
400 | 5167 |
|
5168 |
|holder| |
|
1682 | 5169 |
|
400 | 5170 |
(holder := builder bindingAt:#selectionOfColor) isNil ifTrue:[ |
5171 |
builder aspectAt:#selectionOfColor put:( |
|
1682 | 5172 |
holder := AspectAdaptor new subject:self; forAspect:#selectedColorIndex ). |
400 | 5173 |
]. |
5174 |
^ holder |
|
5175 |
! |
|
5176 |
||
2881 | 5177 |
spraySpotHolder |
5178 |
|holder| |
|
5179 |
||
5180 |
(holder := builder bindingAt:#spraySpotHolder) isNil ifTrue:[ |
|
5181 |
builder aspectAt:#spraySpotHolder put:(holder := imageEditView spraySpot asValue). |
|
5182 |
holder onChangeSend:#spraySpotHolderChanged to:self. |
|
5183 |
]. |
|
5184 |
^ holder |
|
5185 |
||
5186 |
"Created: / 15-02-2012 / 22:36:38 / cg" |
|
5187 |
! |
|
5188 |
||
1558 | 5189 |
tileModeHolder |
5190 |
|holder| |
|
2812 | 5191 |
|
1558 | 5192 |
(holder := builder bindingAt:#tileModeHolder) isNil ifTrue:[ |
5193 |
builder aspectAt:#tileModeHolder put:(holder := false asValue). |
|
5194 |
holder addDependent:self. |
|
5195 |
]. |
|
5196 |
^ holder |
|
2812 | 5197 |
|
5198 |
"Modified: / 21-10-2010 / 14:35:24 / cg" |
|
1558 | 5199 |
! |
5200 |
||
400 | 5201 |
valueOfMagnification |
2308 | 5202 |
<resource: #obsolete> |
767 | 5203 |
"returns current magnification of the image as an AspectAdaptor" |
400 | 5204 |
|
1987 | 5205 |
self obsoleteMethodWarning:'stupid method name - use #magnificationHolder'. |
5206 |
^ self magnificationHolder |
|
400 | 5207 |
! ! |
5208 |
||
767 | 5209 |
!ImageEditor methodsFor:'change & update'! |
5210 |
||
3489 | 5211 |
changePreviewImageMagnification |
5212 |
|mag| |
|
5213 |
||
5214 |
mag := Dialog request:'Magnification?' initialAnswer:self imagePreView magnificationFactor. |
|
5215 |
mag isEmptyOrNil ifTrue:[^ self]. |
|
5216 |
mag := Number readFrom:mag onError:nil. |
|
5217 |
mag isNil ifTrue:[^ self]. |
|
5218 |
||
5219 |
self previewMagnificationHolder value:mag |
|
5220 |
||
5221 |
"Created: / 10-09-2017 / 14:52:52 / cg" |
|
5222 |
! |
|
5223 |
||
3413 | 5224 |
colorCropTabSelectionIndexChanged |
5225 |
|selIndex sym| |
|
5226 |
||
5227 |
selIndex := self colorCropTabSelectionIndexHolder value. |
|
5228 |
sym := self colorCropTabSymbolList at:selIndex. |
|
5229 |
||
5230 |
self colorBoxVisibleHolder value:(sym == #colors). |
|
5231 |
self cropBoxVisibleHolder value:(sym == #crop). |
|
5232 |
self floodFillBoxVisibleHolder value:(sym == #fill). |
|
5233 |
||
5234 |
"Created: / 19-02-2017 / 15:01:05 / cg" |
|
3443 | 5235 |
"Modified: / 21-04-2017 / 16:05:51 / cg" |
3413 | 5236 |
! |
5237 |
||
3433 | 5238 |
colorMapModeFromImage:anImage |
5239 |
"retrieves the colorMapMode for an image" |
|
5240 |
||
5241 |
|image colorMapModeKey| |
|
5242 |
||
5243 |
image := self image. |
|
5244 |
image isNil ifTrue:[^ nil ]. |
|
5245 |
||
5246 |
image mask notNil ifTrue: [ |
|
5247 |
colorMapModeKey := 'masked'. |
|
5248 |
] ifFalse:[ |
|
5249 |
colorMapModeKey := 'depth'. |
|
5250 |
]. |
|
5251 |
colorMapModeKey := (colorMapModeKey , image depth printString) asSymbol. |
|
5252 |
^ colorMapModeKey |
|
5253 |
||
5254 |
"Created: / 06-04-2017 / 13:19:19 / cg" |
|
5255 |
! |
|
5256 |
||
767 | 5257 |
findColorMapMode |
899 | 5258 |
"finds the colorMapMode for a new image" |
767 | 5259 |
|
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5260 |
|image newListOfColors colorMapModeKey drawColor1 drawColor2 someOrAllUsedColors| |
1054 | 5261 |
|
5262 |
image := self image. |
|
3433 | 5263 |
(colorMapModeKey := self colorMapModeFromImage:image) isNil ifTrue:[^ self]. |
5264 |
||
1967 | 5265 |
self colorMapMode setValue:colorMapModeKey. |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5266 |
|
3359 | 5267 |
image photometric == #palette ifTrue:[ |
5268 |
image colorMap isNil ifTrue:[ |
|
5269 |
image depth > 16 ifTrue:[ |
|
5270 |
image photometric:#rgb |
|
5271 |
]. |
|
5272 |
]. |
|
5273 |
]. |
|
1928 | 5274 |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5275 |
image depth > 12 ifTrue:[ |
2447 | 5276 |
newListOfColors := OrderedCollection new. |
2870 | 5277 |
(image depth > 16 or:[image colorMap isEmptyOrNil]) ifTrue:[ |
1927 | 5278 |
someOrAllUsedColors := image usedColorsMax:10000. |
2054 | 5279 |
someOrAllUsedColors notNil ifTrue:[ |
5280 |
someOrAllUsedColors := someOrAllUsedColors asArray. |
|
5281 |
someOrAllUsedColors sort:self sortBlockForColors. |
|
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5282 |
newListOfColors addAll:someOrAllUsedColors. |
2054 | 5283 |
"/ listOfColors add:Color black; add:Color white. |
3317 | 5284 |
]. |
5285 |
image mask notNil ifTrue:[ |
|
5286 |
newListOfColors := (Array with:(Color noColor)),newListOfColors. |
|
5287 |
]. |
|
1904 | 5288 |
] ifFalse:[ |
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5289 |
newListOfColors addAll:(image colorMap). |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5290 |
]. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5291 |
] ifFalse:[ |
2447 | 5292 |
newListOfColors := OrderedCollection withAll:(self listOfColors). |
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5293 |
newListOfColors isEmpty ifTrue:[ |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5294 |
self colorMapMode: colorMapMode value. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5295 |
image := self image. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5296 |
]. |
3317 | 5297 |
"/ image mask notNil ifTrue:[ |
5298 |
"/ newListOfColors := (Array with:(Color noColor)),newListOfColors. |
|
5299 |
"/ ]. |
|
2054 | 5300 |
]. |
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5301 |
newListOfColors notEmptyOrNil ifTrue:[ |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5302 |
drawColor1 := newListOfColors at:1. |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5303 |
drawColor2 := newListOfColors at:2 ifAbsent:drawColor1. |
2054 | 5304 |
|
3487 | 5305 |
self hasTransparentColorInColorList ifTrue: [ |
3367 | 5306 |
(newListOfColors includes:(Color colorId:0)) ifFalse:[ |
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5307 |
newListOfColors addFirst:(Color colorId:0). |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5308 |
drawColor1 := newListOfColors at:2. |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5309 |
drawColor2 := newListOfColors at:3 ifAbsent:drawColor1. |
2054 | 5310 |
] |
5311 |
]. |
|
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5312 |
"/ imageEditView drawingColors:(Array with: drawColor1 with: drawColor2). |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5313 |
"/ self selectionOfColor |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5314 |
"/ setValue: 0; |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5315 |
"/ value: (listOfColors indexOf: imageEditView selectedColor). |
767 | 5316 |
]. |
2447 | 5317 |
self listOfColors asOrderedCollection ~= newListOfColors ifTrue:[ |
5318 |
self listOfColors contents:newListOfColors. |
|
5319 |
]. |
|
2870 | 5320 |
|
3487 | 5321 |
"Modified: / 05-09-2017 / 09:03:31 / cg" |
767 | 5322 |
! |
5323 |
||
3195 | 5324 |
selectedColorsChanged |
3408 | 5325 |
|colorIndices selectedIndex| |
5326 |
||
5327 |
(colorIndices := self selectedColors value) size == 1 ifTrue:[ |
|
5328 |
"/ a single color selected |
|
5329 |
selectedIndex := colorIndices first |
|
5330 |
]. |
|
5331 |
self selectionOfColor value:selectedIndex |
|
5332 |
||
5333 |
"Modified: / 17-02-2017 / 14:40:33 / cg" |
|
3195 | 5334 |
! |
5335 |
||
942 | 5336 |
update:something with:aParameter from:changedObject |
3405 | 5337 |
|clrIndex image imagePreView clr changedColor cMap| |
5338 |
||
5339 |
image := self image. |
|
2042 | 5340 |
imagePreView := self imagePreView. |
1558 | 5341 |
|
5342 |
changedObject == self tileModeHolder ifTrue:[ |
|
3546 | 5343 |
image isNil ifTrue:[ |
5344 |
^ self |
|
5345 |
]. |
|
5346 |
imagePreView |
|
3405 | 5347 |
tileMode:(changedObject value) tileOffset:(image extent); |
3546 | 5348 |
clear; |
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
5349 |
invalidate. |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
5350 |
^ self |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
5351 |
]. |
3546 | 5352 |
|
2792 | 5353 |
changedObject == self previewBackgroundColorHolder ifTrue:[ |
3546 | 5354 |
clr := changedObject value isNil |
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
5355 |
ifTrue:[imageEditView viewBackground] |
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
5356 |
ifFalse:[Color perform:changedObject value]. |
3546 | 5357 |
imagePreView |
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
5358 |
viewBackground:clr; |
3493 | 5359 |
clear; |
1764
7e9b804fd2d9
changeable preview background (to see effect of transpaent pixels)
Claus Gittinger <cg@exept.de>
parents:
1762
diff
changeset
|
5360 |
invalidate. |
1558 | 5361 |
^ self |
5362 |
]. |
|
3489 | 5363 |
changedObject == self previewMagnificationHolder ifTrue:[ |
3546 | 5364 |
imagePreView |
3489 | 5365 |
magnificationFactor:(self previewMagnificationHolder value); |
3546 | 5366 |
clear; |
3493 | 5367 |
invalidate. |
3546 | 5368 |
^ self |
5369 |
]. |
|
5370 |
||
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5371 |
changedObject == self listOfColors ifTrue:[ |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5372 |
something == #at: ifTrue:[ |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5373 |
"/ colormap entry changed at aParameter |
960 | 5374 |
|
5375 |
clrIndex := aParameter. |
|
3487 | 5376 |
(self hasTransparentColorInColorList) ifTrue:[ |
960 | 5377 |
clrIndex := clrIndex - 1. |
5378 |
]. |
|
1928 | 5379 |
changedColor := changedObject at:aParameter. |
3405 | 5380 |
cMap := image colorMap. |
3407 | 5381 |
(cMap notNil and:[cMap isFixedPalette not]) ifTrue:[ |
3405 | 5382 |
image colorMap at:clrIndex put:changedColor. |
1928 | 5383 |
self colorMapChanged. |
3430 | 5384 |
] ifFalse:[ |
5385 |
drawingColormap notNil ifTrue:[ |
|
5386 |
drawingColormap size < clrIndex ifTrue:[ |
|
5387 |
|newDrawingColormap| |
|
3546 | 5388 |
|
3430 | 5389 |
newDrawingColormap := drawingColormap species new:clrIndex. |
5390 |
newDrawingColormap replaceFrom:1 with:drawingColormap. |
|
5391 |
drawingColormap := newDrawingColormap. |
|
3546 | 5392 |
]. |
3430 | 5393 |
drawingColormap at:clrIndex put:changedColor. |
5394 |
]. |
|
3546 | 5395 |
]. |
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5396 |
^ self |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5397 |
]. |
1896 | 5398 |
^ self |
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5399 |
]. |
1124 | 5400 |
|
5401 |
changedObject == imageEditView undoImages ifTrue:[ |
|
1987 | 5402 |
self canUndoHolder value:(changedObject notEmpty). |
3546 | 5403 |
^ self |
1124 | 5404 |
]. |
5405 |
||
1345 | 5406 |
changedObject == imageEditView ifTrue:[ |
5407 |
something == #imageColors ifTrue:[ |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5408 |
self updateListOfColorsAndColormapMode. |
3546 | 5409 |
^ self |
1345 | 5410 |
]. |
5411 |
something == #image ifTrue:[ |
|
2812 | 5412 |
self updateAfterImageChange. |
3405 | 5413 |
imagePreView image:image scroll:false. |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5414 |
self updateListOfColorsAndColormapMode. |
1558 | 5415 |
self tileModeHolder value ifTrue:[ |
3405 | 5416 |
imagePreView tileMode:true tileOffset:(image extent). |
1558 | 5417 |
]. |
3460 | 5418 |
self updateInfoLabel. |
3546 | 5419 |
^ self |
1345 | 5420 |
]. |
5421 |
something == #subImageIn ifTrue:[ |
|
3405 | 5422 |
imagePreView image ~~ image ifTrue:[ |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
5423 |
self error:'internal error' mayProceed:true. |
1406 | 5424 |
]. |
1558 | 5425 |
self tileModeHolder value ifTrue:[ |
2042 | 5426 |
imagePreView invalidate. |
1558 | 5427 |
] ifFalse:[ |
2042 | 5428 |
imagePreView invalidate:aParameter. |
1558 | 5429 |
]. |
3546 | 5430 |
^ self |
1345 | 5431 |
]. |
1491
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
5432 |
something == #selectedColor ifTrue:[ |
1842
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
5433 |
(aParameter isNil or:[aParameter = (Color colorId:0)]) ifTrue:[ |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
5434 |
"/ no color/mask */ |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
5435 |
"/ self halt. |
3487 | 5436 |
clrIndex := self hasTransparentColorInColorList ifTrue:[1] ifFalse:[0]. |
1842
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
5437 |
] ifFalse:[ |
f04fe34d10ac
do not cover selected color (by arrow-image) in colorMap-DSV
Claus Gittinger <cg@exept.de>
parents:
1820
diff
changeset
|
5438 |
clrIndex := self listOfColors indexOf:aParameter. |
1491
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
5439 |
]. |
3195 | 5440 |
self selectedColors value:{clrIndex}. "/ selectionOfColor value:clrIndex. |
3546 | 5441 |
^ self |
1491
4249a6a1b252
pick with SHIFT-click in the mag-view
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
5442 |
]. |
3546 | 5443 |
^ self |
1345 | 5444 |
]. |
5445 |
||
1880 | 5446 |
changedObject == imageEditView modifiedHolder ifTrue:[ |
5447 |
"/ self halt:'to be implemented'. |
|
5448 |
^ self |
|
5449 |
]. |
|
5450 |
||
1345 | 5451 |
changedObject == imageEditView image ifTrue:[ |
2042 | 5452 |
"/ self halt:'to be implemented'. |
2812 | 5453 |
self updateAfterImageChange. |
3546 | 5454 |
^ self |
1345 | 5455 |
]. |
5456 |
||
942 | 5457 |
super update:something with:aParameter from:changedObject |
5458 |
||
3493 | 5459 |
"Modified: / 13-09-2017 / 18:01:26 / cg" |
2812 | 5460 |
! |
5461 |
||
5462 |
updateAfterImageChange |
|
5463 |
|img| |
|
5464 |
||
5465 |
(img := self image) notNil ifTrue:[ |
|
5466 |
img := img onDevice:device. |
|
5467 |
self updateColorsFromImage:img. |
|
5468 |
self findColorMapMode. |
|
5469 |
self updateLabelsAndHistory. |
|
5470 |
||
5471 |
imageSeqNr isNil ifTrue:[ |
|
5472 |
imageSeqNr := 1 |
|
5473 |
]. |
|
5474 |
self imageHasImageSequenceHolder value:(self imageHasImageSequence). |
|
5475 |
self imageHasNextImageHolder value:(self imageHasNextImage). |
|
5476 |
self imageHasPreviousImageHolder value:(self imageHasPreviousImage). |
|
3561 | 5477 |
self alphaVisibleHolder value:(img hasAlphaChannel). |
2812 | 5478 |
] ifFalse:[ |
5479 |
self updateForNoImage |
|
3561 | 5480 |
]. |
5481 |
self window label:(self constructWindowTitle). |
|
2812 | 5482 |
|
3487 | 5483 |
"Modified: / 05-09-2017 / 00:44:10 / cg" |
3561 | 5484 |
"Modified: / 27-05-2018 / 11:32:01 / Claus Gittinger" |
942 | 5485 |
! |
5486 |
||
1900 | 5487 |
updateColorsFromImage:image |
3475 | 5488 |
|colors depth| |
5489 |
||
5490 |
depth := image depth. |
|
5491 |
||
5492 |
depth > 16 ifTrue:[ |
|
5493 |
colors := #() "/ too many - will only show the one's which are explicitly added. |
|
5494 |
] ifFalse:[ |
|
5495 |
((image photometric == #blackIs0) |
|
5496 |
or:[ image photometric == #whiteIs0 ]) ifTrue:[ |
|
5497 |
depth <= 8 ifTrue:[ |
|
5498 |
colors := 1 to:(1 << depth) collect:[:i | image colorFromValue:i-1] |
|
5499 |
]. |
|
2870 | 5500 |
]. |
3475 | 5501 |
colors isNil ifTrue:[ |
5502 |
colors := image colorMap. |
|
5503 |
colors isNil ifTrue:[ |
|
5504 |
Error handle:[:ex | |
|
5505 |
colors := OrderedCollection new. |
|
5506 |
] do:[ |
|
5507 |
colors := image usedColors asSet. |
|
5508 |
]. |
|
5509 |
]. |
|
5510 |
]. |
|
5511 |
]. |
|
1904 | 5512 |
self listOfColors contents:(colors asOrderedCollection). |
2870 | 5513 |
|
3475 | 5514 |
"Modified: / 31-08-2017 / 18:54:53 / cg" |
1900 | 5515 |
! |
5516 |
||
1054 | 5517 |
updateForNoImage |
767 | 5518 |
"updates channels and view, if image is loaded" |
5519 |
||
2792 | 5520 |
self imageIsLoadedHolder value: false. |
767 | 5521 |
self listOfColors removeAll. |
2812 | 5522 |
self imagePreView image: nil. |
5523 |
self imageHasImageSequenceHolder value:false. |
|
3487 | 5524 |
self alphaVisibleHolder value:false. |
5525 |
||
5526 |
"Modified: / 05-09-2017 / 00:44:20 / cg" |
|
3561 | 5527 |
"Modified: / 27-05-2018 / 11:32:06 / Claus Gittinger" |
767 | 5528 |
! |
5529 |
||
5530 |
updateLabelsAndHistory |
|
5531 |
"updates labels and history, if something has changed" |
|
5532 |
||
3476 | 5533 |
|image rsrcClass rsrcSelector imgFile| |
1910 | 5534 |
|
5535 |
image := self image. |
|
5536 |
||
2792 | 5537 |
self imageIsLoadedHolder value: image notNil. |
1910 | 5538 |
image isNil ifTrue: [^nil]. |
767 | 5539 |
|
5540 |
self updateInfoLabel. |
|
5541 |
||
3476 | 5542 |
((rsrcClass := imageEditView resourceClass) notNil |
5543 |
and:[ (rsrcSelector := imageEditView resourceSelector) notNil ]) ifTrue:[ |
|
5544 |
self addHistoryEntryForClass:rsrcClass selector:rsrcSelector. |
|
5545 |
] ifFalse:[ |
|
5546 |
(imgFile := image fileName) notNil ifTrue: [ |
|
5547 |
self addHistoryEntryForFile:imgFile. |
|
5548 |
]. |
|
5549 |
]. |
|
5550 |
||
5551 |
"Modified: / 01-09-2017 / 10:10:12 / cg" |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5552 |
! |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5553 |
|
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5554 |
updateListOfColorsAndColormapMode |
3487 | 5555 |
|listOfColors selectedColor colorMap image| |
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5556 |
|
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5557 |
selectedColor := self selectedColorOrNil. |
3487 | 5558 |
listOfColors := self listOfColors. |
5559 |
||
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5560 |
image := self image. |
1975 | 5561 |
image isNil ifTrue:[ |
3487 | 5562 |
listOfColors removeAll. |
1975 | 5563 |
] ifFalse:[ |
5564 |
colorMap := image colorMap. |
|
2447 | 5565 |
colorMap notNil ifTrue:[ |
5566 |
(colorMap size <= 4096) ifTrue:[ |
|
3487 | 5567 |
(image mask notNil or:[image hasAlphaChannel]) ifTrue:[ |
2447 | 5568 |
colorMap := (Array with:(Color noColor)),colorMap. |
5569 |
]. |
|
3487 | 5570 |
listOfColors contents:colorMap. |
2447 | 5571 |
] ifFalse:[ |
3487 | 5572 |
listOfColors removeAll. |
2447 | 5573 |
colorMap isFixedPalette ifTrue:[ |
5574 |
image colorMap:nil. |
|
5575 |
image photometric:#rgb. |
|
5576 |
image samplesPerPixel:3. |
|
5577 |
||
5578 |
image bitsPerSample:(Array |
|
5579 |
with:(colorMap bitsRed) |
|
5580 |
with:(colorMap bitsGreen) |
|
5581 |
with:(colorMap bitsBlue)). |
|
5582 |
]. |
|
5583 |
] |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5584 |
]. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5585 |
]. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
5586 |
self findColorMapMode. |
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5587 |
selectedColor notNil ifTrue:[ |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5588 |
self selectColor:selectedColor. |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
5589 |
]. |
3487 | 5590 |
|
5591 |
"Modified: / 05-09-2017 / 08:25:14 / cg" |
|
767 | 5592 |
! ! |
5593 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5594 |
!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
|
5595 |
|
1951 | 5596 |
atColor:anOldColor put:newColor |
1952 | 5597 |
"a color changed to a new color" |
5598 |
||
1930 | 5599 |
|index list oldColor image newImage oldSel| |
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
5600 |
|
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
5601 |
list := self listOfColors. |
1951 | 5602 |
index := list identityIndexOf:anOldColor. |
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
5603 |
|
1930 | 5604 |
oldSel := self selectionOfColor value. |
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
5605 |
index ~~ 0 ifTrue:[ |
1928 | 5606 |
oldColor := list at:index. |
5607 |
list at:index put:newColor |
|
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
5608 |
] ifFalse:[ |
1740
5c0b60e76676
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1734
diff
changeset
|
5609 |
self error:'internal error' mayProceed:true. |
1928 | 5610 |
list add:newColor |
5611 |
]. |
|
5612 |
||
5613 |
image := self image. |
|
5614 |
(image colorMap isNil |
|
5615 |
and:[drawingColormap isNil]) ifTrue:[ |
|
5616 |
oldColor notNil ifTrue:[ |
|
5617 |
imageEditView makeUndo. |
|
5618 |
newImage := image copy. |
|
5619 |
newImage |
|
5620 |
colorsFromX:0 y:0 toX:(image width-1) y:(image height-1) |
|
5621 |
do:[:x :y :clr | |
|
5622 |
|newClr| |
|
5623 |
||
1951 | 5624 |
newClr := (clr = oldColor) ifTrue:[newColor] ifFalse:[clr]. |
1928 | 5625 |
newImage colorAtX:x y:y put:newClr |
5626 |
]. |
|
5627 |
imageEditView image:newImage. |
|
5628 |
imageEditView setModified. |
|
5629 |
self updateImage. |
|
5630 |
self updateImagePreView. |
|
1930 | 5631 |
|
3195 | 5632 |
self selectedColors value:{oldSel}. |
1930 | 5633 |
imageEditView selectedColorIndex:oldSel. |
5634 |
imageEditView selectedColor:(self listOfColors at:oldSel). |
|
1928 | 5635 |
] |
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
5636 |
]. |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
5637 |
! |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
5638 |
|
942 | 5639 |
blueAtColor:aColor put:newBlue |
5640 |
"helper used to return a new row element, when blue is changed" |
|
5641 |
||
5642 |
|byte| |
|
5643 |
||
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
5644 |
aColor isNil ifTrue:[^ self]. "/ mask cannot be changed |
942 | 5645 |
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
|
5646 |
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
|
5647 |
|
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
5648 |
self atColor:aColor |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
5649 |
put:(Color redByte:(aColor redByte) greenByte:(aColor greenByte) blueByte:byte). |
942 | 5650 |
! |
5651 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5652 |
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
|
5653 |
"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
|
5654 |
|
930 | 5655 |
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
|
5656 |
^ 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
|
5657 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5658 |
"Created: / 26.7.1998 / 12:30:35 / cg" |
930 | 5659 |
"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
|
5660 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5661 |
|
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5662 |
canSelectBlueInColor:aColor |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5663 |
^ aColor blueByte notNil |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5664 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5665 |
"Created: / 7.8.1998 / 22:50:34 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5666 |
"Modified: / 7.8.1998 / 22:52:57 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5667 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5668 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5669 |
canSelectGreenInColor:aColor |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5670 |
^ aColor greenByte notNil |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5671 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5672 |
"Created: / 7.8.1998 / 22:50:22 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5673 |
"Modified: / 7.8.1998 / 22:52:46 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5674 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5675 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5676 |
canSelectRedInColor:aColor |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5677 |
^ aColor redByte notNil |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5678 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5679 |
"Created: / 7.8.1998 / 22:50:00 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5680 |
"Modified: / 7.8.1998 / 22:51:03 / cg" |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5681 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
5682 |
|
942 | 5683 |
greenAtColor:aColor put:newGreen |
5684 |
"helper used to return a new row element, when green is changed" |
|
5685 |
||
5686 |
|byte| |
|
5687 |
||
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
5688 |
aColor isNil ifTrue:[^ self]. "/ mask cannot be changed |
942 | 5689 |
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
|
5690 |
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
|
5691 |
|
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
5692 |
self atColor:aColor |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
5693 |
put:(Color redByte:(aColor redByte) greenByte:byte blueByte:(aColor blueByte)). |
942 | 5694 |
! |
5695 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5696 |
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
|
5697 |
"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
|
5698 |
|
930 | 5699 |
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
|
5700 |
^ 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
|
5701 |
|
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5702 |
"Created: / 26.7.1998 / 12:30:29 / cg" |
930 | 5703 |
"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
|
5704 |
! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5705 |
|
942 | 5706 |
redAtColor:aColor put:newRed |
5707 |
"helper used to return a new row element, when red is changed" |
|
5708 |
||
5709 |
|byte| |
|
5710 |
||
1611
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
5711 |
aColor isNil ifTrue:[^ self]. "/ mask cannot be changed |
942 | 5712 |
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
|
5713 |
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
|
5714 |
|
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
5715 |
self atColor:aColor |
2f23751929d6
behavior of dataset changed if a write operation is invoked by a column adaptor
ca
parents:
1603
diff
changeset
|
5716 |
put:(Color redByte:byte greenByte:(aColor greenByte) blueByte:(aColor blueByte)). |
942 | 5717 |
! |
5718 |
||
915
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5719 |
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
|
5720 |
"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
|
5721 |
|
930 | 5722 |
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
|
5723 |
^ 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
|
5724 |
|
930 | 5725 |
"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
|
5726 |
! |
49ad9f552d64
oops - fixed bg-color access in dataset
Claus Gittinger <cg@exept.de>
parents:
1446
diff
changeset
|
5727 |
|
2712 | 5728 |
theColorItself:aColor |
5729 |
"an accessor for the table-column" |
|
5730 |
||
1449
49ad9f552d64
oops - fixed bg-color access in dataset
Claus Gittinger <cg@exept.de>
parents:
1446
diff
changeset
|
5731 |
^ 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
|
5732 |
! ! |
99f8e19aab3a
better use a columnAdaptor to fetch r/g/b values from a color.
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
5733 |
|
2663 | 5734 |
!ImageEditor methodsFor:'defaults'! |
5735 |
||
5736 |
aboutIcon |
|
5737 |
^ self class defaultIcon |
|
5738 |
! ! |
|
5739 |
||
2339
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5740 |
!ImageEditor methodsFor:'drag & drop'! |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5741 |
|
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5742 |
canDropObjects:aCollectionOfDropObjects in:aWidget |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5743 |
^ (aCollectionOfDropObjects size == 1) |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5744 |
and:[ aCollectionOfDropObjects |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5745 |
contains:[:dropObject | dropObject isFileObject]] |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5746 |
! |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5747 |
|
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5748 |
dropObjects:aCollectionOfDropObjects in:aWidget at:position |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5749 |
|dropObject| |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5750 |
|
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5751 |
dropObject := aCollectionOfDropObjects first. |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5752 |
dropObject isFileObject ifTrue:[ |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5753 |
self loadFromFile:dropObject asFilename. |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5754 |
] |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5755 |
! ! |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5756 |
|
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5757 |
!ImageEditor methodsFor:'event handling'! |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5758 |
|
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5759 |
processEvent:anEvent |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5760 |
"Return true, if I have eaten the event" |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5761 |
|
2945 | 5762 |
<resource: #keyboard (#Paste #Copy )> |
5763 |
||
2841 | 5764 |
|view focusView p transformation| |
5765 |
||
5766 |
view := anEvent view. |
|
5767 |
view notNil ifTrue:[ |
|
3405 | 5768 |
|
2841 | 5769 |
view == self imagePreView ifTrue:[ |
5770 |
((anEvent isButtonPressEvent and:[ anEvent button == 1 ]) |
|
5771 |
or:[ anEvent isButtonMotionEvent and:[ anEvent hasButton1 ]]) ifTrue:[ |
|
3489 | 5772 |
p := anEvent x @ anEvent y. |
2841 | 5773 |
(transformation := view transformation) notNil ifTrue:[ |
5774 |
p := transformation applyInverseTo:p. |
|
5775 |
]. |
|
3489 | 5776 |
p := p / self previewMagnificationHolder value. |
2841 | 5777 |
self imageEditView scrollToMakeVisible:p. |
5778 |
^ true. |
|
2546 | 5779 |
]. |
2841 | 5780 |
]. |
5781 |
||
5782 |
anEvent isKeyPressEvent ifTrue:[ |
|
5783 |
focusView := view windowGroup focusView ? view. |
|
5784 |
(focusView isComponentOf:(builder componentAt:#colorDataSetView)) ifTrue:[ |
|
5785 |
anEvent key == #Paste ifTrue:[ |
|
5786 |
self pasteColorIntoColormap. |
|
5787 |
^ true. |
|
5788 |
]. |
|
5789 |
anEvent key == #Copy ifTrue:[ |
|
5790 |
self copyColorFromColormap. |
|
5791 |
^ true. |
|
5792 |
]. |
|
5793 |
]. |
|
2339
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5794 |
]. |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5795 |
]. |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5796 |
^ false. |
2841 | 5797 |
|
3489 | 5798 |
"Modified: / 10-09-2017 / 16:40:13 / cg" |
2339
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5799 |
! ! |
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5800 |
|
672 | 5801 |
!ImageEditor methodsFor:'help'! |
5802 |
||
3561 | 5803 |
constructWindowTitle |
5804 |
|resourceClass resourceSelector img| |
|
5805 |
||
5806 |
resourceClass := imageEditView resourceClass. |
|
5807 |
resourceClass notNil ifTrue:[ |
|
5808 |
resourceSelector := imageEditView resourceSelector. |
|
5809 |
resourceSelector notNil ifTrue:[ |
|
5810 |
^ resources |
|
5811 |
string:(self modified |
|
3740 | 5812 |
ifTrue:['ImageEditor (modified): %1 » %2'] |
5813 |
ifFalse:['ImageEditor: %1 » %2']) |
|
3561 | 5814 |
with:resourceClass name |
5815 |
with:resourceSelector |
|
5816 |
]. |
|
5817 |
]. |
|
5818 |
||
5819 |
(img := imageEditView image) notNil ifTrue:[ |
|
5820 |
img fileName notNil ifTrue:[ |
|
5821 |
^ resources |
|
5822 |
string:(self modified |
|
5823 |
ifTrue:['ImageEditor (modified): %1'] |
|
5824 |
ifFalse:['ImageEditor: %1']) |
|
5825 |
with:(img fileName asFilename baseName). |
|
5826 |
]. |
|
5827 |
^ resources string:'ImageEditor: some image.' |
|
5828 |
]. |
|
5829 |
^ resources string:'ImageEditor: << no image >>.' |
|
5830 |
||
5831 |
"Created: / 27-05-2018 / 11:31:20 / Claus Gittinger" |
|
5832 |
! |
|
5833 |
||
672 | 5834 |
defaultInfoLabel |
1969
f1763f6f4500
stripped down menu, if in browser
Claus Gittinger <cg@exept.de>
parents:
1967
diff
changeset
|
5835 |
"returns the text shown in the info label, when the mouse is NOT over |
f1763f6f4500
stripped down menu, if in browser
Claus Gittinger <cg@exept.de>
parents:
1967
diff
changeset
|
5836 |
some widget with a help text." |
672 | 5837 |
|
3465 | 5838 |
|resourceClass resourceSelector img| |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
5839 |
|
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
5840 |
resourceClass := imageEditView resourceClass. |
1965
1d2b7893ae89
some code cleanup (resourceClass was actually its name)
Claus Gittinger <cg@exept.de>
parents:
1962
diff
changeset
|
5841 |
resourceClass notNil ifTrue:[ |
1969
f1763f6f4500
stripped down menu, if in browser
Claus Gittinger <cg@exept.de>
parents:
1967
diff
changeset
|
5842 |
resourceSelector := imageEditView resourceSelector. |
1966 | 5843 |
resourceSelector notNil ifTrue:[ |
3469 | 5844 |
^ resources |
5845 |
string:(self modified |
|
3740 | 5846 |
ifTrue:['Image (modified) from: %1 » %2'] |
5847 |
ifFalse:['Image from: %1 » %2']) |
|
3469 | 5848 |
with:resourceClass name |
5849 |
with:resourceSelector |
|
1966 | 5850 |
]. |
672 | 5851 |
]. |
3465 | 5852 |
|
5853 |
(img := imageEditView image) notNil ifTrue:[ |
|
5854 |
img fileName notNil ifTrue:[ |
|
3469 | 5855 |
^ resources |
5856 |
string:(self modified |
|
5857 |
ifTrue:['Image (modified) from: %1'] |
|
5858 |
ifFalse:['Image from: %1']) |
|
5859 |
with:(img fileName asFilename baseName). |
|
3465 | 5860 |
]. |
5861 |
]. |
|
3380 | 5862 |
^ resources string:'No class and selector defined.' |
3465 | 5863 |
|
3469 | 5864 |
"Modified: / 29-08-2017 / 19:47:25 / cg" |
674 | 5865 |
! |
5866 |
||
702 | 5867 |
openDocumentation |
767 | 5868 |
"opens the documentation file of the Image Editor" |
674 | 5869 |
|
763 | 5870 |
self openHTMLDocument: 'tools/uipainter/ImageEditor.html' |
5871 |
||
672 | 5872 |
! ! |
5873 |
||
767 | 5874 |
!ImageEditor methodsFor:'loading'! |
5875 |
||
1975 | 5876 |
loadFromClass:aClass andSelector:aSelector |
5877 |
"loads an image from the method specified by class and selector" |
|
5878 |
||
5879 |
self assert:(aClass isNil or:[aClass isClass]). |
|
5880 |
||
2932
7f305ee14e98
changed: #loadFromClass:andSelector:
Claus Gittinger <cg@exept.de>
parents:
2893
diff
changeset
|
5881 |
(aClass isNil or:[aSelector isNil]) ifTrue:[ |
1975 | 5882 |
imageEditView resourceClass:aClass. |
5883 |
imageEditView resourceSelector:aSelector. |
|
1969
f1763f6f4500
stripped down menu, if in browser
Claus Gittinger <cg@exept.de>
parents:
1967
diff
changeset
|
5884 |
imageEditView image:nil. |
2006
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
5885 |
self clearModified. |
1966 | 5886 |
^ self. |
5887 |
]. |
|
5888 |
||
1975 | 5889 |
(imageEditView loadFromClass:aClass andSelector:aSelector) notNil ifTrue:[ |
1966 | 5890 |
self updateAfterImageChange. |
2006
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
5891 |
self clearModified. |
1966 | 5892 |
] |
1975 | 5893 |
|
3405 | 5894 |
"Modified: / 16-03-1999 / 21:44:41 / cg" |
5895 |
"Modified (comment): / 16-02-2017 / 10:22:51 / cg" |
|
1966 | 5896 |
! |
5897 |
||
2339
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
5898 |
loadFromFile:aFileName |
767 | 5899 |
"loads an image from aFileName and sets up color map list and other info labels" |
5900 |
||
980
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
5901 |
self withCursor:Cursor wait do:[ |
bd21079f40e1
show waitCursor while loading from file.
Claus Gittinger <cg@exept.de>
parents:
976
diff
changeset
|
5902 |
(imageEditView loadFromFile: aFileName) notNil ifTrue:[ |
1966 | 5903 |
self updateAfterImageChange |
767 | 5904 |
] |
5905 |
] |
|
960 | 5906 |
|
1057 | 5907 |
"Modified: / 16.3.1999 / 21:44:26 / cg" |
767 | 5908 |
! |
5909 |
||
960 | 5910 |
loadFromImage:anImage |
767 | 5911 |
"loads an image from anImage and sets up color map list and other info labels" |
5912 |
||
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
5913 |
|img| |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
5914 |
|
1057 | 5915 |
anImage notNil ifTrue:[ |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
5916 |
img := anImage onDevice:device. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
5917 |
]. |
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
5918 |
|
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
5919 |
imageEditView image:img. |
1799
e605f0af928a
clear modified flag when an image is loaded
Claus Gittinger <cg@exept.de>
parents:
1796
diff
changeset
|
5920 |
imageEditView clearModified. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
5921 |
|
1966 | 5922 |
self updateAfterImageChange. |
3405 | 5923 |
|
5924 |
"Modified: / 16-03-1999 / 21:43:56 / cg" |
|
5925 |
"Modified (comment): / 16-02-2017 / 10:21:47 / cg" |
|
767 | 5926 |
! |
5927 |
||
1975 | 5928 |
loadFromOrPrepareForClass: aClass andSelector: aSelector |
767 | 5929 |
"loads an image by evaluating aMessage; |
5930 |
if no image could extract from aMessage; do set the class and the selector from |
|
5931 |
the aMessage for a saving at the end of editing" |
|
5932 |
||
1975 | 5933 |
(imageEditView loadFromClass:aClass andSelector:aSelector) notNil ifTrue: [ |
1900 | 5934 |
self updateColorsFromImage:self image. |
767 | 5935 |
self findColorMapMode. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
5936 |
] ifFalse: [ |
1975 | 5937 |
imageEditView resourceClass: aClass. |
5938 |
imageEditView resourceSelector:aSelector. |
|
767 | 5939 |
]. |
5940 |
self updateLabelsAndHistory. |
|
1057 | 5941 |
|
5942 |
"Modified: / 16.3.1999 / 21:45:07 / cg" |
|
767 | 5943 |
! ! |
5944 |
||
3404 | 5945 |
!ImageEditor methodsFor:'menu aspects'! |
5946 |
||
5947 |
canDrawCirclesHolder |
|
5948 |
^ self imageIsLoadedAndNotReadonlyHolder |
|
5949 |
||
5950 |
"Created: / 16-02-2017 / 01:41:31 / cg" |
|
5951 |
! |
|
5952 |
||
5953 |
canDrawPointsHolder |
|
5954 |
^ self imageIsLoadedAndNotReadonlyHolder |
|
5955 |
||
5956 |
"Created: / 16-02-2017 / 01:39:37 / cg" |
|
5957 |
! |
|
5958 |
||
5959 |
canDrawRectsHolder |
|
5960 |
^ self imageIsLoadedAndNotReadonlyHolder |
|
5961 |
||
5962 |
"Created: / 16-02-2017 / 01:40:17 / cg" |
|
5963 |
! |
|
5964 |
||
3435 | 5965 |
canFillCircleHolder |
5966 |
^ self imageIsLoadedAndNotReadonlyHolder |
|
5967 |
||
5968 |
"Created: / 10-04-2017 / 08:46:00 / cg" |
|
5969 |
! |
|
5970 |
||
3404 | 5971 |
canFillRectsHolder |
5972 |
^ self imageIsLoadedAndNotReadonlyHolder |
|
5973 |
||
5974 |
"Created: / 16-02-2017 / 01:40:21 / cg" |
|
5975 |
! |
|
5976 |
||
5977 |
canFloodFillHolder |
|
5978 |
^ self imageIsLoadedAndNotReadonlyHolder |
|
5979 |
||
5980 |
"Created: / 16-02-2017 / 01:41:33 / cg" |
|
5981 |
! |
|
5982 |
||
5983 |
canSprayHolder |
|
5984 |
^ self imageIsLoadedAndNotReadonlyHolder |
|
5985 |
||
5986 |
"Created: / 16-02-2017 / 01:44:47 / cg" |
|
3405 | 5987 |
! |
5988 |
||
3475 | 5989 |
colorMapMenuHolder |
5990 |
^ [ self class colorMapMenu ] |
|
5991 |
||
5992 |
"Created: / 31-08-2017 / 18:47:17 / cg" |
|
5993 |
! |
|
5994 |
||
3413 | 5995 |
imageIsLoadedAndAllowedToChangeImageDimension |
5996 |
"returns whether an image is loaded as value holder" |
|
5997 |
||
5998 |
^ [ |
|
5999 |
self imageIsLoadedHolder value |
|
6000 |
and:[ self allowedToChangeImageDimension ] |
|
6001 |
] |
|
6002 |
||
6003 |
"Created: / 16-02-2017 / 01:58:41 / cg" |
|
6004 |
! |
|
6005 |
||
6006 |
imageIsLoadedAndAllowedToChangeImageDimensionAndDepth |
|
6007 |
"returns whether an image is loaded as value holder" |
|
6008 |
||
6009 |
^ [ |
|
6010 |
self imageIsLoadedHolder value |
|
6011 |
and:[ self allowedToChangeImageDimensionAndDepth ] |
|
6012 |
] |
|
6013 |
||
6014 |
"Modified: / 04-07-2010 / 10:15:43 / cg" |
|
6015 |
! |
|
6016 |
||
3405 | 6017 |
imageIsLoadedAndAllowedToFlipHolder |
6018 |
^ self imageIsLoadedAndNotReadonlyHolder |
|
6019 |
||
6020 |
"Created: / 16-02-2017 / 01:57:02 / cg" |
|
3413 | 6021 |
! |
6022 |
||
6023 |
imageIsLoadedAndClassDefined |
|
6024 |
"returns whether an image is loaded as value holder" |
|
6025 |
||
6026 |
^ [self hasClassAndSelectorDefinedHolder value |
|
6027 |
and:[self imageIsLoadedHolder value]] |
|
6028 |
||
6029 |
"Created: / 31-07-1998 / 02:04:18 / cg" |
|
6030 |
"Modified: / 04-07-2010 / 10:15:48 / cg" |
|
6031 |
! |
|
6032 |
||
6033 |
imageIsLoadedAndNotReadonlyHolder |
|
6034 |
"returns whether an image is loaded and editable as value holder" |
|
6035 |
||
6036 |
^ BlockValue |
|
6037 |
with:[:loaded | loaded and:[ self readOnly not ]] |
|
6038 |
argument:(self imageIsLoadedHolder) |
|
6039 |
||
6040 |
"Modified: / 16-02-2017 / 12:11:31 / cg" |
|
6041 |
! |
|
6042 |
||
6043 |
imageIsLoadedHolder |
|
6044 |
"returns whether an image is loaded as value holder" |
|
6045 |
||
3650 | 6046 |
^ builder booleanValueAspectFor:#imageIsLoadedHolder |
3413 | 6047 |
|
6048 |
"Created: / 04-07-2010 / 10:15:38 / cg" |
|
3650 | 6049 |
"Modified: / 09-03-2019 / 21:11:20 / Claus Gittinger" |
3404 | 6050 |
! ! |
6051 |
||
3374 | 6052 |
!ImageEditor methodsFor:'menu item visibility'! |
6053 |
||
6054 |
isNotStandAloneAndMethodSaveAndLoadMenuItemsVisible |
|
6055 |
^ self isNotStandAlone and:[ self methodSaveAndLoadMenuItemsVisible ] |
|
6056 |
! |
|
6057 |
||
6058 |
isStandAloneAndMethodSaveAndLoadMenuItemsVisible |
|
6059 |
^ self isStandAlone and:[ self methodSaveAndLoadMenuItemsVisible ] |
|
6060 |
! |
|
6061 |
||
6062 |
methodSaveAndLoadMenuItemsVisible |
|
6063 |
^ true |
|
6064 |
! |
|
6065 |
||
6066 |
modeMenuVisible |
|
6067 |
^ true |
|
6068 |
! ! |
|
6069 |
||
400 | 6070 |
!ImageEditor methodsFor:'menu modes'! |
6071 |
||
975 | 6072 |
colorMapMode |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6073 |
"returns the colorMapMode" |
400 | 6074 |
|
975 | 6075 |
colorMapMode isNil ifTrue: [colorMapMode := '' asValue]. |
400 | 6076 |
|
975 | 6077 |
^colorMapMode |
400 | 6078 |
! |
6079 |
||
975 | 6080 |
editMode |
6081 |
"returns editMode" |
|
400 | 6082 |
|
1054 | 6083 |
editMode isNil ifTrue: [ |
975 | 6084 |
editMode := #point asValue. |
1329 | 6085 |
editMode onChangeEvaluate:[imageEditView editMode:(editMode value)] |
975 | 6086 |
]. |
6087 |
||
6088 |
^editMode |
|
400 | 6089 |
! |
6090 |
||
975 | 6091 |
mouseKeyColorMode |
6092 |
"returns mouseKeyColorMode" |
|
400 | 6093 |
|
1345 | 6094 |
mouseKeyColorMode isNil ifTrue:[ |
975 | 6095 |
mouseKeyColorMode := 1 asValue. |
1345 | 6096 |
mouseKeyColorMode onChangeEvaluate: [ |
6097 |
imageEditView mouseKeyColorMode:mouseKeyColorMode value. |
|
3195 | 6098 |
self selectedColors value:{ self listOfColors indexOf:imageEditView selectedColor }. |
1345 | 6099 |
] |
956 | 6100 |
]. |
400 | 6101 |
|
975 | 6102 |
^mouseKeyColorMode |
1345 | 6103 |
|
6104 |
"Modified: / 10.2.2000 / 23:16:42 / cg" |
|
400 | 6105 |
! ! |
6106 |
||
1558 | 6107 |
!ImageEditor methodsFor:'private'! |
6108 |
||
3460 | 6109 |
askForDepthThenDo:aBlock |
6110 |
|oldDepth suggestion depth| |
|
6111 |
||
6112 |
oldDepth := self image depth. |
|
3471 | 6113 |
|
6114 |
suggestion := LastDepth notNil ifTrue:[ |
|
6115 |
LastDepth |
|
6116 |
] ifFalse:[ |
|
6117 |
oldDepth > 8 |
|
6118 |
ifTrue:[8] |
|
6119 |
ifFalse:[(oldDepth // 2 - 1) nextPowerOf2] |
|
6120 |
]. |
|
3460 | 6121 |
|
6122 |
depth := Dialog request:'New depth ?' initialAnswer:suggestion asString. |
|
6123 |
depth isEmptyOrNil ifTrue:[^ self]. |
|
6124 |
||
6125 |
depth := Number readFrom:depth onError:nil. |
|
6126 |
depth isNil ifTrue:[^ self]. |
|
6127 |
||
3471 | 6128 |
LastDepth := depth. |
3460 | 6129 |
aBlock value:depth |
6130 |
||
6131 |
"Created: / 24-08-2017 / 17:05:39 / cg" |
|
3471 | 6132 |
"Modified: / 30-08-2017 / 01:22:36 / cg" |
3460 | 6133 |
! |
6134 |
||
1975 | 6135 |
checkModified |
6136 |
imageEditView modified value ifTrue:[ |
|
6137 |
(Dialog |
|
6138 |
confirm:(resources string:'Image was not saved. Proceed anyway ?') |
|
6139 |
yesLabel:(resources string:'Proceed') |
|
6140 |
noLabel:(resources string:'Cancel') |
|
6141 |
initialAnswer:false |
|
6142 |
) ifFalse: [^false]. |
|
6143 |
||
6144 |
imageEditView clearModified. |
|
6145 |
]. |
|
6146 |
^ true |
|
6147 |
||
6148 |
"Modified: / 29.7.1998 / 18:55:24 / cg" |
|
6149 |
! |
|
6150 |
||
3379 | 6151 |
clearModifiedAndRememberImageSaved |
6152 |
"called after a save-to-xxx operation" |
|
3375 | 6153 |
|
6154 |
self clearModified. |
|
6155 |
savedImage := self image. |
|
6156 |
! |
|
6157 |
||
3379 | 6158 |
clearModifiedAndRememberImageSavedAsFile:file |
6159 |
"called after a save-to-file operation" |
|
6160 |
||
6161 |
self clearModifiedAndRememberImageSaved. |
|
6162 |
savedFile := file. |
|
6163 |
! |
|
6164 |
||
1960 | 6165 |
pointFromString:aString |
6166 |
|p s x y| |
|
6167 |
||
6168 |
p := Object readFromString:aString onError:nil. |
|
1962 | 6169 |
p isPoint ifTrue:[^ p]. |
1960 | 6170 |
|
6171 |
s := aString readStream. |
|
6172 |
x := Number readFrom:s onError:nil. |
|
6173 |
x notNil ifTrue:[ |
|
6174 |
s skipSeparators. |
|
1962 | 6175 |
[s atEnd not and:[s peek isDigit not]] whileTrue:[s next]. |
1960 | 6176 |
y := Number readFrom:s onError:nil. |
1961 | 6177 |
^ x @ (y ? x) |
1960 | 6178 |
]. |
1962 | 6179 |
^ nil |
1960 | 6180 |
! |
6181 |
||
1939 | 6182 |
sortBlockForColors |
3195 | 6183 |
^ self sortBlockForColorsByHLS. |
6184 |
"/ ^ self sortBlockForColorsByRGB |
|
6185 |
! |
|
6186 |
||
6187 |
sortBlockForColorsByHLS |
|
6188 |
^ [:a :b | |
|
6189 |
|h1 h2 s1 s2 l1 l2| |
|
6190 |
||
6191 |
h1 := a hue ? 0. |
|
6192 |
h2 := b hue ? 0. |
|
6193 |
(h1 between: h2-30 and:h2+30) ifTrue:[ |
|
6194 |
l1 := a light. |
|
6195 |
l2 := b light. |
|
6196 |
l1 = l2 ifTrue:[ |
|
6197 |
a saturation < b saturation |
|
6198 |
] ifFalse:[ |
|
6199 |
l1 < l2 |
|
6200 |
]. |
|
6201 |
"/ s1 := a saturation. |
|
6202 |
"/ s2 := b saturation. |
|
6203 |
"/ s1 = s2 ifTrue:[ |
|
6204 |
"/ a light < b light |
|
6205 |
"/ ] ifFalse:[ |
|
6206 |
"/ s1 < s2 |
|
6207 |
"/ ] |
|
6208 |
] ifFalse:[ |
|
6209 |
h1 < h2 |
|
6210 |
] |
|
6211 |
] |
|
6212 |
! |
|
6213 |
||
6214 |
sortBlockForColorsByRGB |
|
1939 | 6215 |
^ [:a :b | |
6216 |
a redByte == b redByte ifTrue:[ |
|
6217 |
a greenByte == b greenByte ifTrue:[ |
|
6218 |
a blueByte < b blueByte |
|
6219 |
] ifFalse:[ |
|
6220 |
a greenByte < b greenByte |
|
6221 |
] |
|
6222 |
] ifFalse:[ |
|
6223 |
a redByte < b redByte |
|
6224 |
] |
|
6225 |
] |
|
6226 |
! |
|
6227 |
||
1598 | 6228 |
updateImage |
6229 |
|img| |
|
6230 |
||
6231 |
img := imageEditView image. |
|
6232 |
imageEditView image:img. |
|
6233 |
self fetchImageData. |
|
3405 | 6234 |
self imageIsLoadedHolder changed. |
6235 |
||
6236 |
"Modified: / 16-02-2017 / 12:18:08 / cg" |
|
1598 | 6237 |
! |
6238 |
||
1558 | 6239 |
updateImagePreView |
6240 |
self tileModeHolder value ifTrue:[ |
|
6241 |
self imagePreView tileMode:true tileOffset:(self image extent). |
|
1923
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
6242 |
]. |
3253 | 6243 |
self imagePreView |
6244 |
setImage:(self image) scroll:false invalidate:false; "/ true. |
|
6245 |
invalidate. |
|
1558 | 6246 |
! ! |
6247 |
||
535 | 6248 |
!ImageEditor methodsFor:'queries'! |
6249 |
||
3487 | 6250 |
hasAlphaChannel |
6251 |
|img| |
|
6252 |
||
6253 |
img := self image. |
|
6254 |
img isNil ifTrue:[^ false]. |
|
6255 |
^ img hasAlphaChannel |
|
6256 |
||
6257 |
"Created: / 05-09-2017 / 08:29:23 / cg" |
|
6258 |
! |
|
6259 |
||
2707
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
6260 |
hasLastGrabScreenArea |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
6261 |
^ [ lastGrabbedScreenArea notNil ] |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
6262 |
! |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
6263 |
|
960 | 6264 |
hasMask |
3487 | 6265 |
|img| |
6266 |
||
6267 |
img := self image. |
|
6268 |
img isNil ifTrue:[^ false]. |
|
6269 |
img mask isNil ifTrue:[^ false]. |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6270 |
^ colorMapMode value notNil and:[colorMapMode value startsWith:'mask'] |
960 | 6271 |
|
3411 | 6272 |
"Created: / 18-08-1998 / 17:17:38 / cg" |
3487 | 6273 |
"Modified: / 05-09-2017 / 08:28:44 / cg" |
3411 | 6274 |
! |
6275 |
||
6276 |
hasMaskHolder |
|
6277 |
^ [ self hasMask ] |
|
6278 |
||
6279 |
"Created: / 18-02-2017 / 00:41:19 / cg" |
|
960 | 6280 |
! |
6281 |
||
3487 | 6282 |
hasTransparentColorInColorList |
6283 |
^ self hasMask or:[self hasAlphaChannel] |
|
6284 |
||
6285 |
"Created: / 05-09-2017 / 09:03:24 / cg" |
|
6286 |
! |
|
6287 |
||
1975 | 6288 |
modified |
3416 | 6289 |
"true if the image was modified" |
6290 |
||
1975 | 6291 |
^ imageEditView modified |
3416 | 6292 |
|
6293 |
"Modified (comment): / 20-02-2017 / 16:23:32 / cg" |
|
1975 | 6294 |
! |
6295 |
||
2006
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
6296 |
modified:aBoolean |
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
6297 |
super modified:aBoolean. |
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
6298 |
imageEditView modified:aBoolean |
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
6299 |
! |
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
6300 |
|
535 | 6301 |
preferredExtent |
767 | 6302 |
"returns the preferred extent" |
535 | 6303 |
|
3443 | 6304 |
^ super preferredExtent max: ((Screen current width//3)@(Screen current height//3.5)) |
6305 |
||
6306 |
"Modified (format): / 13-04-2017 / 09:52:25 / cg" |
|
535 | 6307 |
! ! |
6308 |
||
400 | 6309 |
!ImageEditor methodsFor:'selection'! |
6310 |
||
6311 |
magnification |
|
767 | 6312 |
"returns the magnification of the image" |
400 | 6313 |
|
911 | 6314 |
self imageEditView isNil ifTrue: [^1]. |
6315 |
^imageEditView magnification x |
|
400 | 6316 |
! |
6317 |
||
6318 |
magnification: aValue |
|
767 | 6319 |
"sets the magnification of the image" |
400 | 6320 |
|
905 | 6321 |
|magnification| |
6322 |
magnification := (aValue ? 1) asPoint. |
|
911 | 6323 |
(magnification = imageEditView magnification or: [magnification = (0@0)]) ifTrue: [^nil]. |
6324 |
imageEditView magnification: magnification |
|
400 | 6325 |
! |
6326 |
||
6327 |
selectedColorIndex |
|
767 | 6328 |
"returns the index of the selected color" |
400 | 6329 |
|
6330 |
^selectedColorIndex |
|
6331 |
! |
|
6332 |
||
6333 |
selectedColorIndex: anIndex |
|
767 | 6334 |
"sets the index of the selected color" |
400 | 6335 |
|
1054 | 6336 |
|clr pixel| |
6337 |
||
6338 |
selectedColorIndex := anIndex. |
|
2447 | 6339 |
anIndex isNil ifTrue:[^ self]. |
3393 | 6340 |
|
1054 | 6341 |
clr := self listOfColors at:anIndex ifAbsent:nil. |
6342 |
clr isNil ifTrue:[^ self]. |
|
6343 |
||
1075 | 6344 |
pixel := anIndex - 1. |
1054 | 6345 |
(self listOfColors at:1) = Color noColor ifTrue:[ |
6346 |
anIndex == 1 ifTrue:[ |
|
6347 |
pixel := nil. "/ mask |
|
6348 |
] ifFalse:[ |
|
1075 | 6349 |
pixel := pixel - 1 |
1054 | 6350 |
] |
6351 |
]. |
|
3409 | 6352 |
imageEditView selectedColor:clr. |
1054 | 6353 |
imageEditView selectedColorIndex:pixel. |
3409 | 6354 |
|
6355 |
"Modified: / 17-02-2017 / 16:29:09 / cg" |
|
400 | 6356 |
! ! |
6357 |
||
1716 | 6358 |
!ImageEditor methodsFor:'startup & release'! |
400 | 6359 |
|
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
6360 |
closeDownViews |
1644 | 6361 |
builder notNil ifTrue:[ |
6362 |
DefaultRelativeSizes := |
|
6363 |
Array |
|
1998 | 6364 |
with:(builder componentAt:#mainPanel) relativeCorners |
1644 | 6365 |
with:(builder componentAt:#verticalPanel) relativeCorners. |
6366 |
]. |
|
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
6367 |
super closeDownViews |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
6368 |
! |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
6369 |
|
400 | 6370 |
closeRequest |
2016 | 6371 |
"asks for permission before closing" |
6372 |
||
6373 |
imageEditView checkModified ifTrue:[ |
|
6374 |
super closeRequest |
|
6375 |
] |
|
400 | 6376 |
! |
6377 |
||
1980 | 6378 |
commonPostBuild |
1975 | 6379 |
imageEditView undoImages addDependent:self. |
6380 |
imageEditView imageInfoHolder:(self imageInfoHolder). |
|
6381 |
imageEditView activityInfoHolder:(self activityInfoHolder). |
|
6382 |
||
6383 |
imageEditView clickInfoCallBack:[:button :point | |
|
6384 |
|mouseButtonColorToolBar| |
|
3170 | 6385 |
button <= 2 ifTrue:[ |
6386 |
mouseButtonColorToolBar := self componentAt:#MouseButtonColorToolBar. |
|
6387 |
(mouseButtonColorToolBar itemAt:button) toggleIndication. |
|
6388 |
mouseButtonColorToolBar do: [:i| i updateIndicators]. |
|
6389 |
]. |
|
1975 | 6390 |
]. |
6391 |
||
6392 |
imageEditView addDependent:self. |
|
6393 |
imageEditView modifiedHolder addDependent:self. |
|
6394 |
||
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
6395 |
DefaultRelativeSizes notNil ifTrue:[ |
1998 | 6396 |
(builder componentAt:#mainPanel) relativeCorners:DefaultRelativeSizes first. |
1980 | 6397 |
(builder componentAt:#verticalPanel) relativeCorners:DefaultRelativeSizes second. |
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
6398 |
]. |
1995 | 6399 |
|
1996 | 6400 |
"/ using masters infoHolder ? |
3543 | 6401 |
self useAlienInfoLabel ifTrue:[ |
1998 | 6402 |
(builder componentAt:#mainPanel) layout bottomOffset:0. |
1995 | 6403 |
(builder componentAt:#infoBarSubSpec) beInvisible |
6404 |
] |
|
3535 | 6405 |
|
6406 |
"Modified: / 20-02-2018 / 13:05:30 / stefan" |
|
1640
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
6407 |
! |
87ce36f48fbc
remember previous relative sizes and
Claus Gittinger <cg@exept.de>
parents:
1639
diff
changeset
|
6408 |
|
1980 | 6409 |
open |
3487 | 6410 |
"after opening, gets the imageEditView" |
1980 | 6411 |
|
6412 |
super open. |
|
6413 |
||
6414 |
imageEditView := (self componentAt: #imageEditView) subViews first. |
|
3487 | 6415 |
|
6416 |
"Modified (comment): / 05-09-2017 / 10:39:45 / cg" |
|
1980 | 6417 |
! |
6418 |
||
400 | 6419 |
postOpenWith:aBuilder |
767 | 6420 |
"after opening, sets the masterApplication of the imageEditView to self; |
6421 |
evaluate the postOpenAction" |
|
400 | 6422 |
|
1921 | 6423 |
postOpenAction value. |
400 | 6424 |
|
1250 | 6425 |
super postOpenWith:aBuilder. |
6426 |
||
6427 |
aBuilder keyboardProcessor menuBar:nil. |
|
2339
a06d19fe7b32
click on preview to scroll editView;
Claus Gittinger <cg@exept.de>
parents:
2308
diff
changeset
|
6428 |
self windowGroup addPreEventHook:self. |
3415 | 6429 |
self colorCropTabSelectionIndexChanged. |
6430 |
||
3421 | 6431 |
self drawingColor1Holder valueHolder:(imageEditView drawingColorHolders at:1). |
6432 |
self drawingColor2Holder valueHolder:(imageEditView drawingColorHolders at:2). |
|
3487 | 6433 |
imageEditView drawingAlpha:(self alphaHolder value). |
3561 | 6434 |
self updateAfterImageChange. |
3487 | 6435 |
|
6436 |
"Modified (format): / 05-09-2017 / 10:40:10 / cg" |
|
3561 | 6437 |
"Modified: / 27-05-2018 / 11:20:57 / Claus Gittinger" |
400 | 6438 |
! ! |
6439 |
||
1715 | 6440 |
!ImageEditor methodsFor:'user actions-colormap'! |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
6441 |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
6442 |
addColorToColormap |
3476 | 6443 |
"undoable: add black (a new color) to the map" |
6444 |
||
6445 |
self addColorToColormap:(Color black) undoable:true |
|
6446 |
||
6447 |
"Modified: / 31-08-2017 / 14:30:32 / cg" |
|
1682 | 6448 |
! |
6449 |
||
6450 |
addColorToColormap:newColor |
|
3476 | 6451 |
"undoable |
6452 |
when editing a palette image, the new color is added to the image's colorMap |
|
3405 | 6453 |
(unless it is full). |
3476 | 6454 |
When editing a true-color image, it is added to my own list-of-colors, |
3405 | 6455 |
which only holds drawing colors, but is not the colormap's image" |
6456 |
||
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
6457 |
|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
|
6458 |
|
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
6459 |
img := self image. |
1499
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
6460 |
img isNil ifTrue:[ |
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
6461 |
self warn:'No Image.'. |
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
6462 |
^ self |
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
6463 |
]. |
0c57ab09156b
about menu items moved into the Help-menu
Claus Gittinger <cg@exept.de>
parents:
1496
diff
changeset
|
6464 |
|
1054 | 6465 |
depth := img depth. |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
6466 |
cMap := img colorMap. |
3393 | 6467 |
(cMap isNil or:[cMap isMappedPalette or:[cMap isFixedPalette]]) ifTrue:[ |
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
6468 |
drawingColormap isNil ifTrue:[ |
1916 | 6469 |
self information:(resources stringWithCRs:'Image has no colormap.\The shown colorMap is for drawing only.'). |
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
6470 |
drawingColormap := OrderedCollection new. |
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
6471 |
]. |
1682 | 6472 |
drawingColormap add:newColor. |
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
6473 |
self listOfColors contents:drawingColormap. |
3195 | 6474 |
self selectedColors value:{drawingColormap size}. |
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
6475 |
"/ self warn:'Image has no colormap.\Change colorMap mode first.' withCRs. |
1054 | 6476 |
^ self |
6477 |
]. |
|
6478 |
||
3405 | 6479 |
(cMap size == (1 bitShift:depth)) ifTrue:[ |
1054 | 6480 |
depth >= 8 ifTrue:[ |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
6481 |
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
|
6482 |
^ self |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
6483 |
]. |
1916 | 6484 |
(self confirm:(resources stringWithCRs:'No space for more colors in colormap.\Change depth ?')) |
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
6485 |
ifFalse:[ |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
6486 |
^ self |
1057 | 6487 |
]. |
6488 |
||
6489 |
imageEditView makeUndo. |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6490 |
img mask notNil ifTrue:[ |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6491 |
newMode := 'masked' , (depth*2) printString. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6492 |
] ifFalse:[ |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6493 |
newMode := 'depth' , (depth*2) printString. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
6494 |
]. |
1057 | 6495 |
self colorMapMode:newMode. |
6496 |
] ifFalse:[ |
|
6497 |
imageEditView makeUndo. |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
6498 |
]. |
1054 | 6499 |
|
6500 |
cMap := cMap asArray. |
|
1643
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
6501 |
listOfColors := self listOfColors. |
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
6502 |
oldCListSize := listOfColors size. |
1054 | 6503 |
|
1682 | 6504 |
newColorMap := cMap copyWith:newColor. |
1054 | 6505 |
|
6506 |
newImage := img species new |
|
3405 | 6507 |
width:(img width) height:(img height) depth:depth |
1054 | 6508 |
fromArray:img bits. |
6509 |
||
6510 |
newImage colorMap:newColorMap. |
|
6511 |
newImage fileName:img fileName. |
|
6512 |
newImage mask:(img mask copy). |
|
6513 |
||
6514 |
(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
|
6515 |
listOfColors contents: newImage colorMap. |
1054 | 6516 |
self findColorMapMode. |
6517 |
"/ 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
|
6518 |
listOfColors size > (oldCListSize + 1) ifTrue:[ |
91b7ea254a3b
some changes to support drawing into 24-bit images
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
6519 |
listOfColors removeLast |
1054 | 6520 |
]. |
3195 | 6521 |
self selectedColors value:{listOfColors size}. |
1054 | 6522 |
self updateLabelsAndHistory. |
6523 |
] |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
6524 |
|
3393 | 6525 |
"Created: / 12-03-1999 / 00:20:28 / cg" |
3405 | 6526 |
"Modified: / 16-02-2017 / 10:17:25 / cg" |
3476 | 6527 |
"Modified (comment): / 31-08-2017 / 14:28:11 / cg" |
6528 |
! |
|
6529 |
||
6530 |
addColorToColormap:newColor undoable:undoable |
|
6531 |
"when editing a palette image, the new color is added to the image's colorMap |
|
6532 |
(unless it is full). |
|
6533 |
When editing a true-color image, it is added to my own list-of-colors, |
|
6534 |
which only holds drawing colors, but is not the colormap's image" |
|
6535 |
||
6536 |
|depth img cMap newColorMap newImage oldCListSize newMode listOfColors| |
|
6537 |
||
6538 |
img := self image. |
|
6539 |
img isNil ifTrue:[ |
|
6540 |
self warn:'No Image.'. |
|
6541 |
^ self |
|
6542 |
]. |
|
6543 |
||
6544 |
depth := img depth. |
|
6545 |
cMap := img colorMap. |
|
3496 | 6546 |
|
6547 |
(cMap notNil and:[cMap isMappedPalette or:[cMap isArray]]) ifTrue:[ |
|
6548 |
] ifFalse:[ |
|
6549 |
(cMap isNil or:[cMap isFixedPalette]) ifTrue:[ |
|
6550 |
drawingColormap isNil ifTrue:[ |
|
6551 |
self information:(resources stringWithCRs:'Image has no colormap.\The shown colorMap is for drawing only.'). |
|
6552 |
drawingColormap := OrderedCollection new. |
|
6553 |
]. |
|
6554 |
drawingColormap add:newColor. |
|
6555 |
self listOfColors contents:drawingColormap. |
|
6556 |
self selectedColors value:{drawingColormap size}. |
|
6557 |
"/ self warn:'Image has no colormap.\Change colorMap mode first.' withCRs. |
|
6558 |
^ self |
|
3476 | 6559 |
]. |
3496 | 6560 |
]. |
6561 |
||
3476 | 6562 |
(cMap size == (1 bitShift:depth)) ifTrue:[ |
6563 |
depth >= 8 ifTrue:[ |
|
6564 |
self warn:'No space for more colors in colormap.'. |
|
6565 |
^ self |
|
6566 |
]. |
|
6567 |
(self confirm:(resources stringWithCRs:'No space for more colors in colormap.\Change depth ?')) |
|
6568 |
ifFalse:[ |
|
6569 |
^ self |
|
6570 |
]. |
|
6571 |
||
6572 |
undoable ifTrue:[ imageEditView makeUndo ]. |
|
6573 |
img mask notNil ifTrue:[ |
|
6574 |
newMode := 'masked' , (depth*2) printString. |
|
6575 |
] ifFalse:[ |
|
6576 |
newMode := 'depth' , (depth*2) printString. |
|
6577 |
]. |
|
6578 |
self colorMapMode:newMode. |
|
6579 |
] ifFalse:[ |
|
6580 |
undoable ifTrue:[ imageEditView makeUndo ]. |
|
6581 |
]. |
|
6582 |
||
6583 |
cMap := cMap asArray. |
|
6584 |
listOfColors := self listOfColors. |
|
6585 |
oldCListSize := listOfColors size. |
|
6586 |
||
6587 |
newColorMap := cMap copyWith:newColor. |
|
6588 |
||
6589 |
newImage := img species new |
|
6590 |
width:(img width) height:(img height) depth:depth |
|
6591 |
fromArray:img bits. |
|
6592 |
||
6593 |
newImage colorMap:newColorMap. |
|
6594 |
newImage fileName:img fileName. |
|
6595 |
newImage mask:(img mask copy). |
|
6596 |
||
6597 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
6598 |
listOfColors contents: newImage colorMap. |
|
6599 |
self findColorMapMode. |
|
6600 |
"/ mhmh - somehow, we get two colors added ... (sigh findColorMapMode adds another one ...) |
|
6601 |
listOfColors size > (oldCListSize + 1) ifTrue:[ |
|
6602 |
listOfColors removeLast |
|
6603 |
]. |
|
6604 |
self selectedColors value:{listOfColors size}. |
|
6605 |
self updateLabelsAndHistory. |
|
6606 |
] |
|
6607 |
||
6608 |
"Created: / 31-08-2017 / 14:30:01 / cg" |
|
3496 | 6609 |
"Modified: / 08-10-2017 / 09:15:10 / cg" |
6610 |
! |
|
6611 |
||
6612 |
addPastedColorToColormap |
|
6613 |
"undoable: add the color in the clipboard to the map" |
|
6614 |
||
6615 |
|clipBoardColor| |
|
6616 |
||
6617 |
(clipBoardColor := self clipBoardColor) isNil ifTrue:[ |
|
6618 |
^ self |
|
6619 |
]. |
|
6620 |
self addColorToColormap:clipBoardColor undoable:true |
|
6621 |
||
6622 |
"Created: / 08-10-2017 / 09:04:23 / cg" |
|
1053
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
6623 |
! |
31097504a15a
fixed startup (modal box in calling thread, instead of
Claus Gittinger <cg@exept.de>
parents:
1047
diff
changeset
|
6624 |
|
1650 | 6625 |
changeHLS |
3468 | 6626 |
"interactive Hue/Light/Saturation editing with thumbWheels" |
1650 | 6627 |
|
3562 | 6628 |
|bindings hueShiftHolder lightFactorHolder saturationFactorHolder originalColormap firstChange acceptChannel |
3468 | 6629 |
shiftAction originalAvgColor avgColorHolder avgColor shiftedColor shiftProcess readySema |
2438 | 6630 |
originalPixels p previewImage previewImageHolder originalPreviewColormap originalPreviewPixels |
6631 |
anyChange | |
|
1652 | 6632 |
|
2438 | 6633 |
avgColorHolder := nil asValue. |
6634 |
previewImageHolder := nil asValue. |
|
6635 |
||
3468 | 6636 |
"/ |
6637 |
"/ compute the averageColor in the background (while building dialog and asking user) |
|
6638 |
"/ |
|
1652 | 6639 |
readySema := Semaphore new. |
6640 |
[ |
|
1923
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
6641 |
|image| |
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
6642 |
|
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
6643 |
image := imageEditView image. |
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
6644 |
originalColormap := image colorMap copy. |
2438 | 6645 |
originalPixels := image bits. |
6646 |
||
6647 |
previewImage := self image magnifiedPreservingRatioTo:100@100. |
|
3468 | 6648 |
|
6649 |
avgColor := originalAvgColor := previewImage "image" averageColor. |
|
6650 |
avgColorHolder value:avgColor. |
|
6651 |
||
2438 | 6652 |
previewImageHolder value: previewImage. |
6653 |
originalPreviewColormap := previewImage colorMap copy. |
|
6654 |
originalPreviewPixels := previewImage bits. |
|
6655 |
||
1652 | 6656 |
readySema signal. |
6657 |
] forkAt:7. |
|
1649 | 6658 |
|
6659 |
acceptChannel := TriggerValue new. |
|
6660 |
||
6661 |
firstChange := true. |
|
2438 | 6662 |
anyChange := false. |
1649 | 6663 |
|
1651 | 6664 |
shiftedColor := [:clr :hShift :lFactor :sFactor | |
6665 |
Color |
|
6666 |
hue:((clr hue) ? 0 + hShift) |
|
3562 | 6667 |
light:(((clr light * (lFactor)) min:100) max:0) |
6668 |
saturation:(((clr saturation * (sFactor)) min:100) max:0)]. |
|
1652 | 6669 |
|
1649 | 6670 |
shiftAction := |
6671 |
[ |
|
1650 | 6672 |
|hShift lFactor sFactor| |
6673 |
||
3740 | 6674 |
"/ commented, because this leads to a recursion error |
6675 |
"/ (holders accept - send shiftAction again - ...) |
|
6676 |
"/ acceptChannel value:true. |
|
1649 | 6677 |
|
6678 |
firstChange ifTrue:[ |
|
6679 |
imageEditView makeUndo. |
|
6680 |
firstChange := false. |
|
2438 | 6681 |
anyChange := true. |
1649 | 6682 |
]. |
1652 | 6683 |
readySema notNil ifTrue:[readySema wait. readySema := nil]. |
1650 | 6684 |
|
3562 | 6685 |
hShift := hueShiftHolder value. |
6686 |
lFactor := lightFactorHolder value. |
|
6687 |
sFactor := saturationFactorHolder value. |
|
1650 | 6688 |
|
3468 | 6689 |
avgColorHolder value:(shiftedColor value:originalAvgColor value:hShift value:lFactor value:sFactor). |
1652 | 6690 |
|
2438 | 6691 |
previewImage |
6692 |
colorMap:originalPreviewColormap copy; |
|
6693 |
bits:originalPreviewPixels copy; |
|
6694 |
release; |
|
6695 |
colorMapProcessing:[:clr | shiftedColor value:clr value:hShift value:lFactor value:sFactor]. |
|
6696 |
previewImageHolder value:nil; value:previewImage. |
|
6697 |
||
1652 | 6698 |
shiftProcess notNil ifTrue:[ |
6699 |
shiftProcess terminate. |
|
6700 |
shiftProcess waitUntilTerminated. |
|
6701 |
shiftProcess := nil. |
|
6702 |
]. |
|
6703 |
shiftProcess := |
|
6704 |
[ |
|
6705 |
[ |
|
1656 | 6706 |
imageEditView image |
6707 |
colorMap:originalColormap copy; |
|
1923
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
6708 |
bits:originalPixels copy; |
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
6709 |
release; |
1656 | 6710 |
colorMapProcessing:[:clr | shiftedColor value:clr value:hShift value:lFactor value:sFactor]. |
1652 | 6711 |
self updateImage. |
6712 |
self updateInfoLabel. |
|
1923
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
6713 |
self updateImagePreView. |
1652 | 6714 |
] ensure:[ shiftProcess := nil ]. |
6715 |
] forkAt:7. |
|
1649 | 6716 |
]. |
6717 |
||
6718 |
bindings := IdentityDictionary new. |
|
3562 | 6719 |
bindings at:#hueShiftHolder put:(hueShiftHolder := 0 asValue). |
6720 |
hueShiftHolder onChangeEvaluate:shiftAction. |
|
6721 |
||
6722 |
bindings at:#lightFactorHolder put:(lightFactorHolder := 1.0 asValue). |
|
6723 |
lightFactorHolder onChangeEvaluate:shiftAction. |
|
6724 |
||
6725 |
bindings at:#saturationFactorHolder put:(saturationFactorHolder := 1.0 asValue). |
|
6726 |
saturationFactorHolder onChangeEvaluate:shiftAction. |
|
1650 | 6727 |
|
1649 | 6728 |
bindings at:#acceptChannel put:acceptChannel. |
1652 | 6729 |
bindings at:#hlsColor put:avgColorHolder. |
2438 | 6730 |
bindings at:#previewImageHolder put:previewImageHolder. |
1650 | 6731 |
|
3562 | 6732 |
bindings at:#resetHueShift put:[hueShiftHolder value:0]. |
6733 |
bindings at:#resetLightFactor put:[lightFactorHolder value:1.0]. |
|
6734 |
bindings at:#resetSaturationFactor put:[saturationFactorHolder value:1.0]. |
|
3740 | 6735 |
|
6736 |
[ |
|
1650 | 6737 |
(self openDialogInterface:#changeHLSDialogSpec withBindings:bindings) |
1649 | 6738 |
ifFalse:[ |
2438 | 6739 |
anyChange ifTrue:[ |
1649 | 6740 |
imageEditView undo |
6741 |
] |
|
6742 |
]. |
|
3740 | 6743 |
] ensure:[self halt]. |
1923
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
6744 |
|
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
6745 |
(p := shiftProcess) notNil ifTrue:[ |
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
6746 |
p waitUntilTerminated. |
b73340bcc215
changeHLS fixed dfor depth24-images;
Claus Gittinger <cg@exept.de>
parents:
1922
diff
changeset
|
6747 |
]. |
2438 | 6748 |
|
6749 |
anyChange ifTrue:[ |
|
6750 |
self updateImage. |
|
6751 |
self updateImagePreView. |
|
6752 |
]. |
|
3468 | 6753 |
|
6754 |
"Modified: / 28-08-2017 / 13:05:35 / cg" |
|
3580 | 6755 |
"Modified: / 28-07-2018 / 10:35:37 / Claus Gittinger" |
1649 | 6756 |
! |
6757 |
||
3195 | 6758 |
changeHLSOfColors:colorsToShift |
6759 |
"interactive Hue/Light/Saturation editing" |
|
6760 |
||
6761 |
|bindings hueShift lightValue saturationValue originalColormap firstChange acceptChannel |
|
6762 |
shiftAction avgColorHolder avgColor shiftedColor shiftProcess readySema |
|
6763 |
originalPixels p previewImage previewImageHolder originalPreviewColormap originalPreviewPixels |
|
6764 |
anyChange | |
|
6765 |
||
6766 |
avgColorHolder := nil asValue. |
|
6767 |
previewImageHolder := nil asValue. |
|
6768 |
||
3468 | 6769 |
"/ |
6770 |
"/ compute the averageColor in the background (while building dialog and asking user) |
|
6771 |
"/ |
|
3195 | 6772 |
readySema := Semaphore new. |
6773 |
[ |
|
6774 |
|image red green blue| |
|
6775 |
||
6776 |
image := imageEditView image. |
|
6777 |
originalColormap := image colorMap copy. |
|
6778 |
originalPixels := image bits. |
|
3635 | 6779 |
colorsToShift size > 0 ifTrue:[ |
6780 |
red := (colorsToShift collect:[:clr | clr red]) average. |
|
6781 |
green := (colorsToShift collect:[:clr | clr green]) average. |
|
6782 |
blue := (colorsToShift collect:[:clr | clr blue]) average. |
|
6783 |
avgColor := Color red:red green:green blue:blue. |
|
6784 |
]. |
|
3195 | 6785 |
avgColorHolder value:avgColor. |
6786 |
||
6787 |
previewImage := self image magnifiedPreservingRatioTo:100@100. |
|
6788 |
previewImageHolder value: previewImage. |
|
6789 |
originalPreviewColormap := previewImage colorMap copy. |
|
6790 |
originalPreviewPixels := previewImage bits. |
|
6791 |
||
6792 |
readySema signal. |
|
6793 |
] forkAt:7. |
|
6794 |
||
6795 |
acceptChannel := TriggerValue new. |
|
6796 |
||
6797 |
firstChange := true. |
|
6798 |
anyChange := false. |
|
6799 |
||
6800 |
shiftedColor := [:clr :hShift :lFactor :sFactor | |
|
6801 |
Color |
|
6802 |
hue:((clr hue) ? 0 + hShift) |
|
3468 | 6803 |
light:((clr light * lFactor) min:100) |
6804 |
saturation:((clr saturation * sFactor) min:100)]. |
|
3195 | 6805 |
|
6806 |
shiftAction := |
|
6807 |
[ |
|
6808 |
|hShift lFactor sFactor| |
|
6809 |
||
6810 |
acceptChannel value:true. |
|
6811 |
||
6812 |
firstChange ifTrue:[ |
|
6813 |
imageEditView makeUndo. |
|
6814 |
firstChange := false. |
|
6815 |
anyChange := true. |
|
6816 |
]. |
|
6817 |
readySema notNil ifTrue:[readySema wait. readySema := nil]. |
|
6818 |
||
6819 |
hShift := hueShift value. |
|
6820 |
lFactor := lightValue value. |
|
6821 |
sFactor := saturationValue value. |
|
6822 |
||
6823 |
avgColorHolder value:(shiftedColor value:avgColor value:hShift value:lFactor value:sFactor). |
|
6824 |
||
6825 |
previewImage |
|
6826 |
colorMap:originalPreviewColormap copy; |
|
6827 |
bits:originalPreviewPixels copy; |
|
6828 |
release; |
|
6829 |
colorMapProcessing:[:clr | |
|
6830 |
(colorsToShift includes:clr) ifTrue:[ |
|
6831 |
shiftedColor value:clr value:hShift value:lFactor value:sFactor. |
|
6832 |
] ifFalse:[ |
|
6833 |
clr |
|
6834 |
] |
|
6835 |
]. |
|
6836 |
previewImageHolder value:nil; value:previewImage. |
|
6837 |
||
6838 |
shiftProcess notNil ifTrue:[ |
|
6839 |
shiftProcess terminate. |
|
6840 |
shiftProcess waitUntilTerminated. |
|
6841 |
shiftProcess := nil. |
|
6842 |
]. |
|
6843 |
||
6844 |
shiftProcess := |
|
6845 |
[ |
|
6846 |
[ |
|
6847 |
imageEditView image |
|
6848 |
colorMap:originalColormap copy; |
|
6849 |
bits:originalPixels copy; |
|
6850 |
release; |
|
6851 |
colorMapProcessing:[:clr | |
|
6852 |
(colorsToShift includes:clr) ifTrue:[ |
|
6853 |
shiftedColor value:clr value:hShift value:lFactor value:sFactor. |
|
6854 |
] ifFalse:[ |
|
6855 |
clr |
|
6856 |
] |
|
6857 |
]. |
|
6858 |
self updateImage. |
|
6859 |
self updateInfoLabel. |
|
6860 |
self updateImagePreView. |
|
6861 |
] ensure:[ shiftProcess := nil ]. |
|
6862 |
] forkAt:7. |
|
6863 |
]. |
|
6864 |
||
6865 |
bindings := IdentityDictionary new. |
|
6866 |
bindings at:#hueShiftAmount put:(hueShift := 0 asValue). |
|
6867 |
hueShift onChangeEvaluate:shiftAction. |
|
6868 |
||
3635 | 6869 |
bindings at:#lightAmount put:(lightValue := 1.0 asValue). |
3195 | 6870 |
lightValue onChangeEvaluate:shiftAction. |
6871 |
||
3635 | 6872 |
bindings at:#saturationAmount put:(saturationValue := 1.0 asValue). |
3195 | 6873 |
saturationValue onChangeEvaluate:shiftAction. |
6874 |
||
6875 |
bindings at:#acceptChannel put:acceptChannel. |
|
6876 |
bindings at:#hlsColor put:avgColorHolder. |
|
6877 |
bindings at:#previewImageHolder put:previewImageHolder. |
|
6878 |
||
3635 | 6879 |
bindings at:#resetHueShift put:[ hueShift value: 0 ]. |
6880 |
bindings at:#resetLightFactor put:[ lightValue value: 1.0 ]. |
|
6881 |
bindings at:#resetSaturationFactor put:[ saturationValue value: 1.0 ]. |
|
6882 |
||
3195 | 6883 |
(self openDialogInterface:#changeHLSDialogSpec withBindings:bindings) |
6884 |
ifFalse:[ |
|
6885 |
anyChange ifTrue:[ |
|
6886 |
imageEditView undo |
|
6887 |
] |
|
6888 |
]. |
|
6889 |
||
6890 |
(p := shiftProcess) notNil ifTrue:[ |
|
6891 |
p waitUntilTerminated. |
|
6892 |
]. |
|
6893 |
||
6894 |
anyChange ifTrue:[ |
|
6895 |
self updateImage. |
|
6896 |
self updateImagePreView. |
|
6897 |
]. |
|
3468 | 6898 |
|
6899 |
"Modified (comment): / 28-08-2017 / 13:04:44 / cg" |
|
3635 | 6900 |
"Modified: / 14-01-2019 / 14:52:50 / Claus Gittinger" |
3195 | 6901 |
! |
6902 |
||
2652 | 6903 |
clearColormapEntry0AndMaskedPixels |
6904 |
"ensure that there is a colorMap entry with 0/0/0 at position |
|
6905 |
0 and then clear all masked pixels (to pixelValue 0). |
|
6906 |
This is required for windows icons to be really transparent" |
|
6907 |
||
6908 |
|index colorMap| |
|
6909 |
||
3476 | 6910 |
self nonUndoableCompressColorMap. |
6911 |
||
2652 | 6912 |
colorMap := self image colorMap. |
6913 |
(colorMap includes:(Color black)) ifFalse:[ |
|
3476 | 6914 |
self addColorToColormap:(Color black) undoable:false. |
2652 | 6915 |
colorMap := self image colorMap. |
6916 |
]. |
|
6917 |
index := colorMap indexOf:(Color black). |
|
6918 |
index == 1 ifFalse:[ |
|
3476 | 6919 |
self nonUndoableSortColorMapWith:self sortBlockForColorsByRGB. |
2652 | 6920 |
colorMap := self image colorMap. |
6921 |
]. |
|
3476 | 6922 |
self nonUndoableClearMaskedPixels |
6923 |
||
6924 |
"Modified: / 31-08-2017 / 14:30:28 / cg" |
|
2652 | 6925 |
! |
6926 |
||
1403 | 6927 |
clearMaskedPixels |
6928 |
"clear all masked pixels (to pixelValue 0)" |
|
6929 |
||
2652 | 6930 |
|newImage| |
6931 |
||
6932 |
newImage := self image clearMaskedPixels. |
|
6933 |
0 to:newImage height - 1 do:[:y | |
|
6934 |
0 to:newImage width - 1 do:[:x | |
|
6935 |
(newImage maskAtX:x y:y) == 0 ifTrue:[ |
|
6936 |
newImage pixelAtX:x y:y put:0 |
|
1460 | 6937 |
] |
1403 | 6938 |
] |
2652 | 6939 |
]. |
6940 |
||
6941 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
6942 |
self fetchImageData. |
|
1403 | 6943 |
] |
6944 |
! |
|
6945 |
||
3496 | 6946 |
clipBoardColor |
6947 |
"return the color in the clipboard, or nil, if there is none. |
|
6948 |
If there is none, beep (if user's settings allow it)" |
|
6949 |
||
6950 |
|clr| |
|
6951 |
||
6952 |
clr := imageEditView getClipboardObject. |
|
6953 |
clr isColor ifFalse:[ |
|
3526 | 6954 |
self beepInEditor. |
3496 | 6955 |
^ nil |
6956 |
]. |
|
6957 |
^ clr |
|
6958 |
||
6959 |
"Created: / 08-10-2017 / 09:02:14 / cg" |
|
6960 |
! |
|
6961 |
||
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
6962 |
colorMapChanged |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
6963 |
|img| |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
6964 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
6965 |
img := self image. |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
6966 |
img release. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
6967 |
|
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
6968 |
self imageEditView invalidate. |
960 | 6969 |
self imagePreView invalidate. |
6970 |
||
6971 |
"/ (imageEditView image:img) notNil ifTrue:[ |
|
6972 |
"/ self updateLabelsAndHistory. |
|
6973 |
"/ self imagePreView image:img |
|
6974 |
"/ ] |
|
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
6975 |
|
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
6976 |
"Created: / 7.8.1998 / 22:26:10 / cg" |
960 | 6977 |
"Modified: / 18.8.1998 / 17:08:55 / cg" |
945
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
6978 |
! |
cb689f3971ab
allow editing of color values;
Claus Gittinger <cg@exept.de>
parents:
942
diff
changeset
|
6979 |
|
975 | 6980 |
colorMapMode:aMode |
3405 | 6981 |
"calculates a new color map for the image from aMode. |
6982 |
This might involve the computation of a colormap |
|
6983 |
(if depth is smaller)" |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
6984 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
6985 |
|depth numColors newColorMap newImage |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
6986 |
oldImage image newColors realColorMap oldFileName |
1008 | 6987 |
usedColors useNearest usageCounts tmpBits tmpMap quest |
6988 |
prevMode maskThreshold maskImage| |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
6989 |
|
3433 | 6990 |
oldImage := self image. |
6991 |
||
6992 |
"/ rubbish; the mode is already changed |
|
6993 |
"/ prevMode := colorMapMode value. |
|
6994 |
prevMode := self colorMapModeFromImage:oldImage. |
|
6995 |
prevMode == aMode ifTrue:[^ self]. |
|
6996 |
||
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
6997 |
self withExecuteCursorDo:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
6998 |
newColorMap := self class listOfColorMaps at:aMode. |
3230 | 6999 |
(aMode == #depth32 or:[aMode == #masked32]) ifTrue:[ |
2572 | 7000 |
depth := 32. |
7001 |
] ifFalse:[ |
|
3230 | 7002 |
(aMode == #depth24 or:[aMode == #masked24]) ifTrue:[ |
7003 |
depth := 24. |
|
7004 |
] ifFalse:[ |
|
3370 | 7005 |
(aMode == #depth16 or:[aMode == #masked16]) ifTrue:[ |
7006 |
depth := 16. |
|
7007 |
] ifFalse:[ |
|
7008 |
depth := (newColorMap size log:2) asInteger. |
|
7009 |
]. |
|
3230 | 7010 |
]. |
2572 | 7011 |
]. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7012 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7013 |
useNearest := false. |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
7014 |
depth == 1 ifTrue:[ |
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
7015 |
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
|
7016 |
] ifFalse:[ |
1008 | 7017 |
prevMode isNil ifTrue:[ |
7018 |
quest := 'Compute colormap (or use standard)' |
|
7019 |
] ifFalse:[ |
|
7020 |
quest := 'Keep colormap (or use standard)' |
|
7021 |
] |
|
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
7022 |
]. |
3433 | 7023 |
|
7024 |
"/ currently always true!! |
|
1008 | 7025 |
((prevMode = aMode) |
3405 | 7026 |
or:[depth > oldImage depth |
7027 |
or:[true "self confirm:(resources string:quest)"]] |
|
7028 |
) ifTrue:[ |
|
1937 | 7029 |
(newColorMap isOrderedCollection or:[newColorMap isFixedPalette not]) ifTrue:[ |
1935 | 7030 |
|
7031 |
"/ keep the colormap |
|
3355 | 7032 |
"/ newColorMap atAllPut:Color black. |
1935 | 7033 |
depth > oldImage depth ifTrue:[ |
7034 |
"/ easy - simply copy the part |
|
7035 |
numColors := 1 bitShift:oldImage depth. |
|
7036 |
0 to:numColors-1 do:[:pixel | |
|
7037 |
newColorMap at:(pixel+1) put:(oldImage colorFromValue:pixel) |
|
1008 | 7038 |
]. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7039 |
] ifFalse:[ |
1935 | 7040 |
"/ see if all used color fit the new colormap |
7041 |
usedColors := oldImage usedColorsMax:(1 bitShift:depth). |
|
7042 |
(usedColors notNil and:[usedColors size > (1 bitShift:depth)]) ifTrue:[ |
|
7043 |
usedColors := oldImage realUsedColors |
|
7044 |
]. |
|
7045 |
(usedColors notNil and:[usedColors size <= (1 bitShift:depth)]) ifTrue:[ |
|
7046 |
"/ yea - just install them |
|
7047 |
usedColors asArray keysAndValuesDo:[:idx :clr | |
|
7048 |
newColorMap at:idx put:clr |
|
7049 |
]. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7050 |
] ifFalse:[ |
1935 | 7051 |
"/ copy over those that are most often used. |
7052 |
oldImage depth < 8 ifTrue:[ |
|
7053 |
tmpBits := ByteArray uninitializedNew:(oldImage width*oldImage height). |
|
7054 |
oldImage bits |
|
7055 |
expandPixels:(oldImage depth) |
|
7056 |
width:oldImage width |
|
7057 |
height:oldImage height |
|
7058 |
into:tmpBits |
|
7059 |
mapping:nil. |
|
986 | 7060 |
] ifFalse:[ |
1935 | 7061 |
oldImage depth == 8 ifTrue:[ |
7062 |
tmpBits := oldImage bits |
|
7063 |
] ifFalse:[ |
|
7064 |
colorMapMode value:prevMode. |
|
7065 |
self findColorMapMode. |
|
3586 | 7066 |
self warn:'Too many used colors (%1) in image.\\You should choose one of:\\- convert the image to gray\- reduce the number of colors\- dither to depth\- choose another depth' |
7067 |
with: oldImage realUsedColors size. |
|
1935 | 7068 |
^ self |
7069 |
"/ (self confirm:('Too many used colors in image (', oldImage usedColors size printString , ').\\Dither ?' withCRs)) |
|
7070 |
"/ ifFalse:[. |
|
7071 |
"/ ^ self |
|
7072 |
"/ ]. |
|
7073 |
"/ self image: (Image newForDepth:depth) fromImage:oldImage. |
|
7074 |
"/ ^ self. |
|
7075 |
] |
|
7076 |
]. |
|
7077 |
usageCounts := tmpBits usageCounts. |
|
7078 |
tmpMap := Array new:usageCounts size. |
|
7079 |
oldImage colorMap asArray keysAndValuesDo:[:i :clr | |
|
7080 |
tmpMap at:i put:clr |
|
7081 |
]. |
|
7082 |
usageCounts sort:[:a :b | a > b] with:tmpMap. |
|
7083 |
||
7084 |
1 to:(1 bitShift:depth) do:[:idx | |
|
7085 |
newColorMap at:idx put:(tmpMap at:idx) |
|
7086 |
]. |
|
7087 |
||
7088 |
useNearest := Dialog |
|
7089 |
confirmWithCancel:(resources |
|
7090 |
stringWithCRs:'Image requires %1 colors.\ColorMap has only space for %2\\Use nearest (or map to first color) ?' |
|
7091 |
with:usedColors size |
|
7092 |
with:(1 bitShift:depth)) |
|
7093 |
labels:(resources array:#('Cancel' 'First' 'Nearest')). |
|
7094 |
useNearest isNil ifTrue:[ |
|
1124 | 7095 |
colorMapMode value:prevMode. |
1935 | 7096 |
^ self "/ cancel |
7097 |
]. |
|
7098 |
] |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7099 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7100 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7101 |
] ifFalse:[ |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7102 |
"/ standard colormap |
921
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
7103 |
usedColors := oldImage usedColors. |
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
7104 |
(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
|
7105 |
useNearest := Dialog |
928
89bd2304da33
cleaned up imageEitViews interface to my infoPanel
Claus Gittinger <cg@exept.de>
parents:
927
diff
changeset
|
7106 |
confirmWithCancel:(resources |
1916 | 7107 |
stringWithCRs:'Not all colors are present in the new colormap.\\Map missing ones to nearest (or map to first color) ?' |
7108 |
) |
|
3505 | 7109 |
labels:(resources array:#('Cancel' 'First' 'Nearest')). |
921
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
7110 |
useNearest isNil ifTrue:[ |
1542 | 7111 |
colorMapMode value:prevMode. |
921
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
7112 |
^ self "/ cancel |
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
7113 |
]. |
a5aca21ea803
also allow nearest-color mode for standard colormap.
Claus Gittinger <cg@exept.de>
parents:
920
diff
changeset
|
7114 |
]. |
3356 | 7115 |
newColorMap := oldImage colorMap. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7116 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7117 |
|
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7118 |
imageEditView makeUndo. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7119 |
|
2260 | 7120 |
newImage := Image newForDepth:depth. |
1424
d7367ae7f85e
fixed conversion of 3-3-2 8-bit truecolor images
Claus Gittinger <cg@exept.de>
parents:
1411
diff
changeset
|
7121 |
newImage depth:depth. |
3230 | 7122 |
depth >= 16 ifTrue:[ |
3405 | 7123 |
newImage colorMap:nil. |
3230 | 7124 |
depth == 32 ifTrue:[ |
3405 | 7125 |
newImage samplesPerPixel:4; photometric:#rgba. |
3230 | 7126 |
] ifFalse:[ |
3405 | 7127 |
newImage samplesPerPixel:3; photometric:#rgb. |
3230 | 7128 |
]. |
3405 | 7129 |
]. |
7130 |
"/ newImage photometric:oldImage photometric. |
|
2260 | 7131 |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7132 |
oldFileName := oldImage fileName. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7133 |
|
1008 | 7134 |
Image imageErrorSignal handle:[:ex| |
3227 | 7135 |
"/ arrive here only if not all colors can be represented; |
7136 |
"/ then do a more expensive nearest color search |
|
1008 | 7137 |
Color colorErrorSignal handle:[:ex| |
1542 | 7138 |
colorMapMode value:prevMode. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7139 |
imageEditView undo. |
3586 | 7140 |
^ self warn:('Conversion failed !!') |
1008 | 7141 |
] do:[ |
1393 | 7142 |
newImage := Image newForDepth:depth. |
3103 | 7143 |
newImage |
7144 |
width:oldImage width height:oldImage height depth:depth; |
|
7145 |
colorMap:newColorMap; |
|
7146 |
photometric:#palette; |
|
7147 |
bits:(ByteArray new:(newImage bytesPerRow * newImage height)); |
|
7148 |
mask:oldImage mask. |
|
2260 | 7149 |
|
3227 | 7150 |
oldImage |
7151 |
colorsFromX:0 y:0 |
|
7152 |
toX:(oldImage width-1) y:(oldImage height-1) |
|
7153 |
do:[:x :y :clr | |
|
7154 |
|newColor| |
|
7155 |
||
7156 |
(newColorMap includes:clr) |
|
7157 |
ifTrue: [newColor := clr] |
|
7158 |
ifFalse: [ |
|
7159 |
newColor := clr nearestIn:newColorMap. |
|
7160 |
useNearest ifFalse:[ |
|
7161 |
(newColor deltaFrom:clr) > 0.5 ifTrue:[ |
|
7162 |
newColor := oldImage colorFromValue:0 |
|
7163 |
] |
|
1008 | 7164 |
] |
3227 | 7165 |
]. |
7166 |
newImage colorAtX:x y:y put:newColor. |
|
7167 |
]. |
|
7168 |
||
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7169 |
image := newImage |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7170 |
]. |
1008 | 7171 |
] do:[ |
3461 | 7172 |
|newPhotometric| |
7173 |
||
7174 |
depth == 32 ifTrue:[ |
|
7175 |
newPhotometric := #rgba. |
|
7176 |
] ifFalse:[ |
|
7177 |
(newColorMap notNil and:[newColorMap isOrderedCollection or:[newColorMap isFixedPalette not]]) ifTrue:[ |
|
7178 |
newPhotometric := #palette |
|
7179 |
] |
|
7180 |
]. |
|
7181 |
image := newImage fromImage:oldImage photometric:newPhotometric. |
|
7182 |
"/ -- nope; keep the newly determined photometric. image photometric:oldImage photometric. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7183 |
]. |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7184 |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
7185 |
(aMode asString startsWith:'mask') ifTrue:[ |
1008 | 7186 |
image mask isNil ifTrue:[ |
3436 | 7187 |
(oldImage depth == 32 and:[ oldImage photometric == #rgba ]) ifTrue:[ |
7188 |
maskImage := ImageMask fromAlphaInImage:oldImage |
|
7189 |
] ifFalse:[ |
|
7190 |
false "(Dialog confirm:'Generate mask from black ?' default:false)" ifTrue:[ |
|
7191 |
maskThreshold := 0.1. |
|
7192 |
maskImage := Depth1Image fromImage:(image asThresholdMonochromeImage:maskThreshold). |
|
7193 |
] ifFalse:[ |
|
7194 |
maskImage := ImageMask extent:image extent. |
|
7195 |
maskImage bits:(ByteArray |
|
7196 |
new:(maskImage bytesPerRow * maskImage height) |
|
7197 |
withAll:16rFF). |
|
7198 |
]. |
|
1008 | 7199 |
]. |
7200 |
image mask:maskImage. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7201 |
]. |
1008 | 7202 |
] ifFalse:[ |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7203 |
image mask: nil. |
3317 | 7204 |
oldImage mask notNil ifTrue:[ |
7205 |
newImage depth == 32 ifTrue:[ |
|
7206 |
newImage computeAlphaValuesFromMask:oldImage mask |
|
7207 |
]. |
|
7208 |
]. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7209 |
]. |
1935 | 7210 |
|
1937 | 7211 |
(newColorMap isOrderedCollection or:[newColorMap isFixedPalette not]) ifTrue:[ |
1935 | 7212 |
realColorMap := OrderedCollection new. |
7213 |
image realColorMap do:[:clr| |
|
7214 |
(realColorMap includes: clr) ifFalse: [realColorMap add: clr] |
|
7215 |
]. |
|
7216 |
newColors := realColorMap copyFrom: 1 to: (newColorMap size min: realColorMap size). |
|
7217 |
newColorMap do:[:clr| |
|
7218 |
((newColors size < newColorMap size) and: [(newColors includes: clr) not]) |
|
7219 |
ifTrue:[ |
|
7220 |
newColors add: clr |
|
7221 |
] |
|
7222 |
]. |
|
7223 |
image colorMap: newColors. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7224 |
]. |
1446 | 7225 |
image fileName: oldFileName. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7226 |
|
1054 | 7227 |
(imageEditView image: image) notNil ifTrue:[ |
1446 | 7228 |
self fetchImageData. |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7229 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7230 |
] |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7231 |
|
3506 | 7232 |
"Modified: / 28-11-2017 / 16:39:03 / cg" |
3586 | 7233 |
"Modified: / 09-08-2018 / 15:59:31 / Claus Gittinger" |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7234 |
! |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7235 |
|
2192 | 7236 |
colorize |
7237 |
"interactive Hue editing" |
|
7238 |
||
7239 |
|bindings hueShift lightValue saturationValue originalColormap firstChange acceptChannel |
|
7240 |
shiftAction avgColorHolder avgColor shiftedColor shiftProcess readySema |
|
7241 |
originalPixels p| |
|
7242 |
||
7243 |
"/ compute the averageColor in the background (while asking user) |
|
7244 |
readySema := Semaphore new. |
|
7245 |
[ |
|
7246 |
|image| |
|
7247 |
||
7248 |
image := imageEditView image. |
|
7249 |
originalColormap := image colorMap copy. |
|
7250 |
avgColor := image averageColor. |
|
7251 |
originalPixels := image bits. |
|
7252 |
readySema signal. |
|
7253 |
] forkAt:7. |
|
7254 |
||
7255 |
acceptChannel := TriggerValue new. |
|
7256 |
avgColorHolder := avgColor asValue. |
|
7257 |
||
7258 |
firstChange := true. |
|
7259 |
||
7260 |
shiftedColor := [:clr :hShift :lFactor :sFactor | |
|
7261 |
Color |
|
7262 |
hue:((clr hue) ? 0 + hShift) |
|
3173 | 7263 |
light:((clr light * lFactor / 100) min:100) |
7264 |
saturation:(((clr saturation max:20) * sFactor / 100) min:100)]. |
|
2192 | 7265 |
|
7266 |
||
7267 |
shiftAction := |
|
7268 |
[ |
|
7269 |
|hShift lFactor sFactor| |
|
7270 |
||
7271 |
acceptChannel value:true. |
|
7272 |
||
7273 |
firstChange ifTrue:[ |
|
7274 |
imageEditView makeUndo. |
|
7275 |
firstChange := false. |
|
7276 |
]. |
|
7277 |
readySema notNil ifTrue:[readySema wait. readySema := nil]. |
|
7278 |
||
7279 |
hShift := hueShift value. |
|
7280 |
lFactor := lightValue value. |
|
7281 |
sFactor := saturationValue value. |
|
7282 |
||
7283 |
avgColorHolder value:(shiftedColor value:avgColor value:hShift value:lFactor value:sFactor). |
|
7284 |
||
7285 |
shiftProcess notNil ifTrue:[ |
|
7286 |
shiftProcess terminate. |
|
7287 |
shiftProcess waitUntilTerminated. |
|
7288 |
shiftProcess := nil. |
|
7289 |
]. |
|
7290 |
shiftProcess := |
|
7291 |
[ |
|
7292 |
[ |
|
7293 |
imageEditView image |
|
7294 |
colorMap:originalColormap copy; |
|
7295 |
bits:originalPixels copy; |
|
7296 |
release; |
|
7297 |
colorMapProcessing:[:clr | shiftedColor value:clr value:hShift value:lFactor value:sFactor]. |
|
7298 |
self updateImage. |
|
7299 |
self updateInfoLabel. |
|
7300 |
self updateImagePreView. |
|
7301 |
] ensure:[ shiftProcess := nil ]. |
|
7302 |
] forkAt:7. |
|
7303 |
]. |
|
7304 |
||
7305 |
bindings := IdentityDictionary new. |
|
7306 |
bindings at:#hueShiftAmount put:(hueShift := 0 asValue). |
|
7307 |
hueShift onChangeEvaluate:shiftAction. |
|
7308 |
||
7309 |
bindings at:#lightAmount put:(lightValue := 100 asValue). |
|
7310 |
lightValue onChangeEvaluate:shiftAction. |
|
7311 |
||
7312 |
bindings at:#saturationAmount put:(saturationValue := 100 asValue). |
|
7313 |
saturationValue onChangeEvaluate:shiftAction. |
|
7314 |
||
7315 |
bindings at:#acceptChannel put:acceptChannel. |
|
7316 |
bindings at:#hlsColor put:avgColorHolder. |
|
7317 |
||
7318 |
(self openDialogInterface:#changeHLSDialogSpec withBindings:bindings) |
|
7319 |
ifFalse:[ |
|
7320 |
firstChange ~~ true ifTrue:[ |
|
7321 |
imageEditView undo |
|
7322 |
] |
|
7323 |
]. |
|
7324 |
||
7325 |
(p := shiftProcess) notNil ifTrue:[ |
|
7326 |
p waitUntilTerminated. |
|
7327 |
]. |
|
7328 |
self updateImage. |
|
7329 |
self updateImagePreView. |
|
7330 |
||
7331 |
"Created: / 01-11-2007 / 23:27:37 / cg" |
|
7332 |
! |
|
7333 |
||
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7334 |
compressColorMap |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7335 |
"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
|
7336 |
|
2893 | 7337 |
|newImage| |
7338 |
||
7339 |
newImage := self image. |
|
7340 |
newImage compressColorMap. |
|
2652 | 7341 |
|
7342 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
7343 |
self fetchImageData. |
|
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
7344 |
] |
1008 | 7345 |
! |
7346 |
||
1852 | 7347 |
copyColorFromColormap |
1871 | 7348 |
imageEditView setClipboardObject:(self selectedColorOrNil) |
1852 | 7349 |
! |
7350 |
||
2174 | 7351 |
doubleClickOnColor:aColorIndex |
7352 |
self editSelectedColor. |
|
7353 |
||
7354 |
"Created: / 22-07-2007 / 13:14:37 / cg" |
|
7355 |
! |
|
7356 |
||
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
7357 |
editSelectedColor |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
7358 |
self processSelectedColorWith:[:clr | |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
7359 |
|editor| |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
7360 |
|
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
7361 |
editor := ColorEditDialog new. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
7362 |
editor color:clr. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
7363 |
editor open. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
7364 |
editor accepted ifFalse:[ |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
7365 |
AbortOperationRequest raise. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
7366 |
]. |
3180 | 7367 |
editor color |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
7368 |
] |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
7369 |
! |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
7370 |
|
1446 | 7371 |
fetchImageData |
1460 | 7372 |
|image| |
7373 |
||
7374 |
(image := imageEditView image) notNil ifTrue:[ |
|
7375 |
self findColorMapMode. |
|
7376 |
self updateLabelsAndHistory. |
|
3463 | 7377 |
self updateInfoLabel. |
1460 | 7378 |
] |
3463 | 7379 |
|
7380 |
"Modified: / 24-08-2017 / 18:20:37 / cg" |
|
1446 | 7381 |
! |
7382 |
||
1544 | 7383 |
inspectColor |
2573 | 7384 |
|clrIndex clr| |
7385 |
||
7386 |
self hasColormap ifFalse:[ |
|
7387 |
clr := self selectedColorOrNil |
|
7388 |
] ifTrue:[ |
|
7389 |
clrIndex := self selectedColorIndexOrNil. |
|
7390 |
clrIndex isNil ifTrue:[ |
|
7391 |
^ self |
|
7392 |
]. |
|
7393 |
clr := self image colorFromValue:clrIndex-1 |
|
1544 | 7394 |
]. |
2573 | 7395 |
clr inspect |
1544 | 7396 |
! |
7397 |
||
2651 | 7398 |
inspectColormap |
7399 |
self hasColormap ifTrue:[ |
|
7400 |
self image colorMap inspect |
|
7401 |
]. |
|
7402 |
! |
|
7403 |
||
1598 | 7404 |
makeBrighter |
3476 | 7405 |
self updateImageAfterDoing:#makeBrighter. |
7406 |
||
7407 |
"Modified: / 31-08-2017 / 12:16:30 / cg" |
|
1598 | 7408 |
! |
7409 |
||
7410 |
makeDarker |
|
3476 | 7411 |
self updateImageAfterDoing:#makeDarker. |
7412 |
||
7413 |
"Modified: / 31-08-2017 / 12:16:24 / cg" |
|
1598 | 7414 |
! |
7415 |
||
1926 | 7416 |
makeGrayScaleImage |
3476 | 7417 |
self updateImageAfterDoing:#makeGrayScaleImage. |
7418 |
||
7419 |
"Modified: / 31-08-2017 / 12:16:15 / cg" |
|
1436 | 7420 |
! |
7421 |
||
1446 | 7422 |
makeSelectedColorBrighter |
3195 | 7423 |
self processSelectedColorsWith:[:clr | clr lightened] |
1446 | 7424 |
! |
7425 |
||
7426 |
makeSelectedColorDarker |
|
3195 | 7427 |
self processSelectedColorsWith:[:clr | clr darkened] |
1446 | 7428 |
! |
7429 |
||
1884 | 7430 |
makeSelectedColorGray |
3195 | 7431 |
self processSelectedColorsWith:[:clr | Color brightness:(clr brightness)] |
7432 |
! |
|
7433 |
||
7434 |
makeSelectedColorShifted |
|
3476 | 7435 |
"shift the selected color (in the colormap) |
7436 |
using the hls/rgb shifting slider dialog" |
|
7437 |
||
7438 |
|cMap colors cmapOffset| |
|
3195 | 7439 |
|
7440 |
cMap := self image colorMap. |
|
3476 | 7441 |
|
7442 |
"/ if there is a mask, it is at position 1 in the table |
|
3487 | 7443 |
cmapOffset := self hasTransparentColorInColorList ifTrue:[1] ifFalse:[0]. |
3635 | 7444 |
colors := self selectedColors value |
7445 |
select:[:idx | idx > cmapOffset] |
|
7446 |
thenCollect:[:idx | cMap at:idx-cmapOffset]. |
|
3195 | 7447 |
self changeHLSOfColors:colors. |
3476 | 7448 |
|
3487 | 7449 |
"Modified: / 05-09-2017 / 09:03:47 / cg" |
3635 | 7450 |
"Modified: / 14-01-2019 / 14:46:51 / Claus Gittinger" |
1884 | 7451 |
! |
7452 |
||
3592 | 7453 |
makeSelectedColorSlightlyBrighter |
7454 |
self processSelectedColorsWith:[:clr | clr slightlyLightened] |
|
7455 |
! |
|
7456 |
||
7457 |
makeSelectedColorSlightlyDarker |
|
7458 |
self processSelectedColorsWith:[:clr | clr slightlyDarkened] |
|
7459 |
! |
|
7460 |
||
2826 | 7461 |
makeSlightlyBrighter |
3476 | 7462 |
self updateImageAfterDoing:#makeSlightlyBrighter. |
2826 | 7463 |
|
7464 |
"Created: / 24-11-2010 / 11:06:11 / cg" |
|
3476 | 7465 |
"Modified: / 31-08-2017 / 12:16:01 / cg" |
2826 | 7466 |
! |
7467 |
||
7468 |
makeSlightlyDarker |
|
3476 | 7469 |
self updateImageAfterDoing:#makeSlightlyDarker. |
2826 | 7470 |
|
7471 |
"Created: / 24-11-2010 / 11:06:23 / cg" |
|
3476 | 7472 |
"Modified: / 31-08-2017 / 12:15:55 / cg" |
2826 | 7473 |
! |
7474 |
||
2652 | 7475 |
menu_clearColormapEntry0AndMaskedPixels |
7476 |
"ensure that there is a colorMap entry with 0/0/0 at position |
|
7477 |
0 and then clear all masked pixels (to pixelValue 0)" |
|
7478 |
||
7479 |
imageEditView makeUndo. |
|
7480 |
self withExecuteCursorDo:[ |
|
3476 | 7481 |
self nonUndoableClearColormapEntry0AndMaskedPixels |
2652 | 7482 |
] |
3476 | 7483 |
|
7484 |
"Modified: / 31-08-2017 / 14:31:21 / cg" |
|
2652 | 7485 |
! |
7486 |
||
7487 |
menu_clearMaskedPixels |
|
7488 |
"clear all masked pixels (to pixelValue 0)" |
|
7489 |
||
7490 |
imageEditView makeUndo. |
|
7491 |
self withExecuteCursorDo:[ |
|
3476 | 7492 |
self nonUndoableClearMaskedPixels |
2652 | 7493 |
] |
3476 | 7494 |
|
7495 |
"Modified: / 31-08-2017 / 14:23:20 / cg" |
|
2652 | 7496 |
! |
7497 |
||
7498 |
menu_compressColorMap |
|
7499 |
"calculates a new color map for the image, using only used colors" |
|
7500 |
||
2893 | 7501 |
|depth oldImage usedColors colorMap| |
2652 | 7502 |
|
7503 |
oldImage := self image. |
|
7504 |
||
7505 |
oldImage photometric ~~ #palette ifTrue:[ |
|
7506 |
self information:'Compress colorMap: Only palette images have colormaps.'. |
|
1852 | 7507 |
^ self |
7508 |
]. |
|
2893 | 7509 |
depth := oldImage depth. |
3103 | 7510 |
colorMap := oldImage colorMap asArray. |
2652 | 7511 |
usedColors := oldImage realUsedColors. |
2893 | 7512 |
usedColors size == colorMap size ifTrue:[ |
2652 | 7513 |
self information:'Compress colorMap: Colormap already compressed - no compression.'. |
7514 |
^ self |
|
7515 |
]. |
|
7516 |
||
7517 |
imageEditView makeUndo. |
|
7518 |
self withExecuteCursorDo:[ |
|
3476 | 7519 |
self nonUndoableCompressColorMap |
1852 | 7520 |
] |
3476 | 7521 |
|
7522 |
"Modified: / 31-08-2017 / 14:22:19 / cg" |
|
1852 | 7523 |
! |
7524 |
||
2652 | 7525 |
menu_copyMask |
7526 |
|mask| |
|
7527 |
||
7528 |
mask := self image mask. |
|
7529 |
MaskClipboard := mask subImageIn: (0@0 extent:mask extent). |
|
7530 |
! |
|
7531 |
||
7532 |
menu_pasteMask |
|
3561 | 7533 |
"paste a mask from the clipboard" |
7534 |
||
1480 | 7535 |
|img mask| |
7536 |
||
7537 |
imageEditView makeUndo. |
|
7538 |
||
7539 |
img := self image. |
|
7540 |
mask := img mask. |
|
7541 |
||
7542 |
mask |
|
7543 |
copyFrom:MaskClipboard |
|
7544 |
x:0 y:0 |
|
7545 |
toX:0 y:0 |
|
7546 |
width:(mask width min:MaskClipboard width) |
|
7547 |
height:(mask height min:MaskClipboard height). |
|
7548 |
img mask:mask. |
|
7549 |
(imageEditView image:img copy) notNil ifTrue:[ |
|
7550 |
self fetchImageData. |
|
7551 |
] |
|
3561 | 7552 |
|
7553 |
"Modified (comment): / 27-05-2018 / 11:11:54 / Claus Gittinger" |
|
1480 | 7554 |
! |
7555 |
||
2652 | 7556 |
menu_sortColorMap |
7557 |
"calculates a new color map for the image, sorting colors" |
|
7558 |
||
7559 |
self menu_sortColorMapWith:self sortBlockForColors |
|
7560 |
! |
|
7561 |
||
7562 |
menu_sortColorMapWith:sortBlock |
|
7563 |
"calculates a new color map for the image, sorting colors" |
|
7564 |
||
7565 |
self image photometric ~~ #palette ifTrue:[ |
|
7566 |
self information:'Compress colorMap: Only palette images have colormaps.'. |
|
7567 |
^ self |
|
7568 |
]. |
|
7569 |
||
7570 |
imageEditView makeUndo. |
|
7571 |
self withExecuteCursorDo:[ |
|
3476 | 7572 |
self nonUndoableSortColorMapWith:sortBlock |
2652 | 7573 |
] |
7574 |
||
3476 | 7575 |
"Created: / 30-09-1998 / 23:51:23 / cg" |
7576 |
"Modified: / 31-08-2017 / 14:20:14 / cg" |
|
2652 | 7577 |
! |
7578 |
||
7579 |
pasteColorIntoColormap |
|
3496 | 7580 |
|clipBoardColor cmap| |
7581 |
||
7582 |
(clipBoardColor := self clipBoardColor) isNil ifTrue:[ |
|
2652 | 7583 |
^ self |
7584 |
]. |
|
7585 |
||
3393 | 7586 |
cmap := self image colorMap. |
7587 |
(cmap isNil or:[cmap isMappedPalette or:[cmap isFixedPalette]]) ifTrue:[ |
|
7588 |
drawingColormap isNil ifTrue:[ |
|
7589 |
drawingColormap := #() |
|
7590 |
]. |
|
3496 | 7591 |
drawingColormap := drawingColormap copyWith:clipBoardColor. |
3393 | 7592 |
self selectedColors value:drawingColormap size. |
7593 |
^ self. |
|
7594 |
]. |
|
7595 |
||
3496 | 7596 |
self processSelectedColorWith:[:clr | clipBoardColor] |
7597 |
||
7598 |
"Modified (format): / 08-10-2017 / 09:03:59 / cg" |
|
2652 | 7599 |
! |
7600 |
||
1682 | 7601 |
pickAndAddColorToColormap |
3476 | 7602 |
self addColorToColormap:(Color fromUser) undoable:true |
7603 |
||
7604 |
"Modified: / 31-08-2017 / 14:30:22 / cg" |
|
1682 | 7605 |
! |
7606 |
||
1933 | 7607 |
pickAndPasteColor |
7608 |
self pickColor. |
|
7609 |
self pasteColorIntoColormap. |
|
7610 |
! |
|
7611 |
||
1852 | 7612 |
pickColor |
1871 | 7613 |
imageEditView setClipboardObject:(Color fromUser) |
1852 | 7614 |
! |
7615 |
||
1682 | 7616 |
processSelectedColorWith:aBlock |
3195 | 7617 |
"undoable color processing: |
7618 |
the selected color will be replaced by the value of aBlock" |
|
7619 |
||
7620 |
self processSelectedColorsWith:aBlock. |
|
7621 |
! |
|
7622 |
||
7623 |
processSelectedColorsWith:aBlock |
|
3546 | 7624 |
"undoable color processing: |
7625 |
the selected colors will be replaced by the value of aBlock |
|
3195 | 7626 |
(which gets a color vector and must return a color vector)" |
7627 |
||
3546 | 7628 |
|img cMap modifiedColormap oldColors newImage selectedColorIndices newColors maskOffset processingSubset| |
3195 | 7629 |
|
7630 |
selectedColorIndices := self selectedColors value. |
|
7631 |
selectedColorIndices isEmptyOrNil ifTrue:[^ self]. |
|
1682 | 7632 |
|
7633 |
img := self image. |
|
3487 | 7634 |
self hasTransparentColorInColorList ifTrue:[ |
3281 | 7635 |
maskOffset := 1. |
3195 | 7636 |
] ifFalse:[ |
3281 | 7637 |
maskOffset := 0. |
3195 | 7638 |
]. |
3393 | 7639 |
cMap := img colorMap. |
3418 | 7640 |
(cMap isNil) ifTrue:[ |
3546 | 7641 |
oldColors := drawingColormap. |
7642 |
processingSubset := false. |
|
7643 |
] ifFalse:[ |
|
3561 | 7644 |
("cMap isMappedPalette or:["cMap isFixedPalette"]") ifTrue:[ |
3546 | 7645 |
oldColors := cMap asArray. |
7646 |
processingSubset := false. |
|
7647 |
] ifFalse:[ |
|
3635 | 7648 |
selectedColorIndices := selectedColorIndices select:[:idx | idx > maskOffset]. |
7649 |
selectedColorIndices isEmpty ifTrue:[ |
|
7650 |
Dialog warn:'Please select any non-mask color'. |
|
7651 |
^ self. |
|
7652 |
]. |
|
3418 | 7653 |
oldColors := selectedColorIndices collect:[:idx | cMap at:idx-maskOffset]. |
3546 | 7654 |
processingSubset := true. |
3418 | 7655 |
]. |
3393 | 7656 |
]. |
1682 | 7657 |
imageEditView makeUndo. |
7658 |
||
2992 | 7659 |
modifiedColormap := cMap asNewArray. |
3635 | 7660 |
(selectedColorIndices max - maskOffset) > modifiedColormap size ifTrue:[ |
3496 | 7661 |
|t| |
3546 | 7662 |
t := Array new:(selectedColorIndices max - maskOffset). |
3496 | 7663 |
t replaceFrom:1 with:modifiedColormap. |
7664 |
modifiedColormap := t. |
|
7665 |
]. |
|
3546 | 7666 |
|
3195 | 7667 |
newColors := oldColors collect:aBlock. |
3546 | 7668 |
processingSubset ifTrue:[ |
7669 |
selectedColorIndices with:newColors do:[:idx :newColor | |
|
7670 |
modifiedColormap at:idx-maskOffset put:newColor. |
|
7671 |
]. |
|
7672 |
] ifFalse:[ |
|
7673 |
selectedColorIndices do:[:idx | |
|
7674 |
modifiedColormap at:idx-maskOffset put:(newColors at:idx-maskOffset ifAbsent:[self halt.Color black]) |
|
7675 |
]. |
|
7676 |
]. |
|
1682 | 7677 |
|
7678 |
newImage := img species new |
|
7679 |
width:img width |
|
7680 |
height:img height |
|
1843 | 7681 |
depth:img depth |
1682 | 7682 |
fromArray:img bits. |
7683 |
||
3418 | 7684 |
(cMap isNil) ifTrue:[ |
3393 | 7685 |
"/ only a dummy... |
3546 | 7686 |
] ifFalse:[ |
7687 |
newImage colorMap:modifiedColormap. |
|
7688 |
newImage photometric:#palette. |
|
3393 | 7689 |
]. |
1682 | 7690 |
newImage fileName:img fileName. |
7691 |
newImage mask:(img mask copy). |
|
7692 |
||
7693 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
7694 |
self fetchImageData. |
|
7695 |
]. |
|
3195 | 7696 |
self selectedColors value:selectedColorIndices. |
3393 | 7697 |
|
3496 | 7698 |
"Modified: / 08-10-2017 / 09:20:13 / cg" |
3635 | 7699 |
"Modified: / 14-01-2019 / 14:56:49 / Claus Gittinger" |
1682 | 7700 |
! |
7701 |
||
1124 | 7702 |
reduceNumberOfColors |
3464 | 7703 |
"reduce by masking off r/g/b bits" |
7704 |
||
1727
8c626d784494
color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
7705 |
|s n anyChange img usedColors| |
1124 | 7706 |
|
2817 | 7707 |
s := Dialog request:'Number of color bits to strip (1-7) ?' initialAnswer:3. |
1435 | 7708 |
s size == 0 ifTrue:[^ self]. |
1934 | 7709 |
|
1124 | 7710 |
n := Integer readFrom:s onError:0. |
7711 |
(n between:1 and:7) ifFalse:[ |
|
7712 |
Dialog warn:'Image unchanged'. |
|
7713 |
^ self |
|
7714 |
]. |
|
7715 |
||
7716 |
self withExecuteCursorDo:[ |
|
7717 |
anyChange := imageEditView reduceColorResolutionBy:n. |
|
7718 |
anyChange ifFalse:[ |
|
7719 |
Dialog warn:'Image unchanged'. |
|
7720 |
] ifTrue:[ |
|
7721 |
img := imageEditView image. |
|
7722 |
imageEditView image:img. |
|
1446 | 7723 |
|
7724 |
self fetchImageData. |
|
1727
8c626d784494
color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
7725 |
usedColors := img usedColorsMax:10000. |
8c626d784494
color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
7726 |
usedColors size == 10000 ifTrue:[ |
8c626d784494
color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
7727 |
Dialog information:('>= ' , usedColors size printString , ' colors used.') |
8c626d784494
color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
7728 |
] ifFalse:[ |
8c626d784494
color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
7729 |
Dialog information:(usedColors size printString , ' colors used.') |
8c626d784494
color reduction algorithm fixed
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
7730 |
] |
1124 | 7731 |
] |
7732 |
]. |
|
2817 | 7733 |
|
7734 |
"Modified: / 29-10-2010 / 18:08:01 / cg" |
|
3464 | 7735 |
"Modified (comment): / 24-08-2017 / 20:50:28 / cg" |
1124 | 7736 |
! |
7737 |
||
1930 | 7738 |
reduceNumberOfColors2 |
3464 | 7739 |
"reduce by rounding r/g/b channel values" |
7740 |
||
1938 | 7741 |
|s rndR rndG rndB usedColors image newImage| |
7742 |
||
7743 |
s := Dialog request:'Rounding Interval red (2..) ?' initialAnswer:4. |
|
1934 | 7744 |
s size == 0 ifTrue:[^ self]. |
1938 | 7745 |
rndR := Integer readFrom:s onError:0. |
1939 | 7746 |
|
1938 | 7747 |
s := Dialog request:'Rounding Interval green (2..) ?' initialAnswer:2. |
7748 |
s size == 0 ifTrue:[^ self]. |
|
7749 |
rndG := Integer readFrom:s onError:0. |
|
1939 | 7750 |
|
1938 | 7751 |
s := Dialog request:'Rounding Interval blue (2..) ?' initialAnswer:10. |
7752 |
s size == 0 ifTrue:[^ self]. |
|
7753 |
rndB := Integer readFrom:s onError:0. |
|
1939 | 7754 |
|
7755 |
((rndR > 1) or:[(rndG > 1) or:[(rndB > 1)]]) ifFalse:[ |
|
1930 | 7756 |
Dialog warn:'Image unchanged'. |
7757 |
^ self |
|
7758 |
]. |
|
7759 |
||
7760 |
self withExecuteCursorDo:[ |
|
3463 | 7761 |
|reduceColor nUsed| |
3195 | 7762 |
|
7763 |
reduceColor := |
|
7764 |
[:clr | |
|
7765 |
|r g b nr ng nb| |
|
1934 | 7766 |
|
7767 |
r := clr redByte. |
|
7768 |
g := clr greenByte. |
|
7769 |
b := clr blueByte. |
|
1938 | 7770 |
nr := (r roundTo:rndR) min:255. |
7771 |
ng := (g roundTo:rndG) min:255. |
|
7772 |
nb := (b roundTo:rndB) min:255. |
|
1934 | 7773 |
|
3195 | 7774 |
Color redByte:nr greenByte:ng blueByte:nb. |
7775 |
]. |
|
7776 |
||
7777 |
image := self image. |
|
7778 |
"/ usedColors := image usedColorsMax:4096. |
|
7779 |
imageEditView makeUndo. |
|
7780 |
||
7781 |
newImage := image copy. |
|
7782 |
newImage photometric == #palette ifTrue:[ |
|
7783 |
newImage colorMap:(image colorMap collect:reduceColor). |
|
7784 |
] ifFalse:[ |
|
7785 |
image |
|
7786 |
colorsFromX:0 y:0 toX:(image width-1) y:(image height-1) |
|
7787 |
do:[:x :y :clr | |
|
7788 |
newImage colorAtX:x y:y put:(reduceColor value:clr) |
|
2260 | 7789 |
]. |
3195 | 7790 |
]. |
1934 | 7791 |
imageEditView image:newImage. |
7792 |
imageEditView setModified. |
|
7793 |
self updateImage. |
|
7794 |
self updateImagePreView. |
|
7795 |
||
7796 |
self fetchImageData. |
|
3463 | 7797 |
|
1934 | 7798 |
usedColors := newImage usedColorsMax:10000. |
3463 | 7799 |
nUsed := usedColors size. |
7800 |
nUsed == 10000 ifTrue:[ |
|
7801 |
Dialog information:('>= ' , nUsed printString , ' colors used.') |
|
1934 | 7802 |
] ifFalse:[ |
3463 | 7803 |
Dialog information:(nUsed printString , ' colors used.') |
1934 | 7804 |
] |
1930 | 7805 |
]. |
2054 | 7806 |
|
3463 | 7807 |
"Modified: / 24-08-2017 / 18:25:04 / cg" |
3464 | 7808 |
"Modified (comment): / 24-08-2017 / 20:50:14 / cg" |
1930 | 7809 |
! |
7810 |
||
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
7811 |
selectColor:aColor |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
7812 |
|idx img cMap| |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
7813 |
|
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
7814 |
aColor isNil ifTrue:[ |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
7815 |
idx := nil. |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
7816 |
] ifFalse:[ |
2791 | 7817 |
img := self image. |
7818 |
img notNil ifTrue: [ |
|
7819 |
aColor == Color noColor ifTrue:[ |
|
7820 |
(img mask notNil) ifTrue:[ |
|
7821 |
idx := 1. |
|
7822 |
] |
|
7823 |
] ifFalse:[ |
|
2447 | 7824 |
(cMap := self listOfColors) notNil ifTrue:[ |
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
7825 |
idx := cMap indexOf:aColor ifAbsent:nil. |
2447 | 7826 |
]. |
7827 |
idx isNil ifTrue:[ |
|
7828 |
"/ should not happen... |
|
7829 |
(cMap := img colorMap) notNil ifTrue:[ |
|
7830 |
idx := cMap indexOf:aColor ifAbsent:nil. |
|
7831 |
idx notNil ifTrue:[ |
|
7832 |
img mask notNil ifTrue:[ |
|
7833 |
idx := idx + 1. |
|
7834 |
]. |
|
7835 |
] |
|
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
7836 |
]. |
2447 | 7837 |
]. |
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
7838 |
]. |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
7839 |
]. |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
7840 |
]. |
3195 | 7841 |
self selectedColors value:{idx}. |
2790 | 7842 |
|
2791 | 7843 |
"Modified: / 02-07-2010 / 12:06:07 / cg" |
2446
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
7844 |
! |
862717a7ca0f
color selection when undoing
Claus Gittinger <cg@exept.de>
parents:
2438
diff
changeset
|
7845 |
|
1682 | 7846 |
selectedColorIndexOrNil |
2651 | 7847 |
|img clrIndex| |
1682 | 7848 |
|
7849 |
img := self image. |
|
7850 |
img isNil ifTrue:[ |
|
2764 | 7851 |
"/ self warn:'No Image.'. |
1682 | 7852 |
^ nil |
7853 |
]. |
|
7854 |
clrIndex := self selectionOfColor value. |
|
3487 | 7855 |
self hasTransparentColorInColorList ifTrue: [ |
2449
5ef668d71314
changed #selectedColorIndexOrNil
Claus Gittinger <cg@exept.de>
parents:
2447
diff
changeset
|
7856 |
(clrIndex isInteger and:[clrIndex > 1]) ifTrue:[ |
5ef668d71314
changed #selectedColorIndexOrNil
Claus Gittinger <cg@exept.de>
parents:
2447
diff
changeset
|
7857 |
^ clrIndex - 1 |
5ef668d71314
changed #selectedColorIndexOrNil
Claus Gittinger <cg@exept.de>
parents:
2447
diff
changeset
|
7858 |
]. |
5ef668d71314
changed #selectedColorIndexOrNil
Claus Gittinger <cg@exept.de>
parents:
2447
diff
changeset
|
7859 |
^ nil |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
7860 |
]. |
1682 | 7861 |
^ clrIndex |
3487 | 7862 |
|
7863 |
"Modified: / 05-09-2017 / 09:04:05 / cg" |
|
1682 | 7864 |
! |
7865 |
||
1852 | 7866 |
selectedColorOrNil |
2447 | 7867 |
|cmapIndex img cMap colorList| |
1896 | 7868 |
|
7869 |
cmapIndex := self selectedColorIndexOrNil. |
|
1900 | 7870 |
cmapIndex isNil ifTrue:[^ nil]. |
2556 | 7871 |
cmapIndex == 0 ifTrue:[^ nil]. |
1852 | 7872 |
|
7873 |
img := self image. |
|
7874 |
cMap := img colorMap. |
|
7875 |
cMap isNil ifTrue:[ |
|
2447 | 7876 |
"/ self warn:(resources stringWithCRs:'Image has no colormap.\Please change the colorMap mode first.'). |
7877 |
colorList := self listOfColors. |
|
7878 |
colorList notNil ifTrue:[ |
|
7879 |
^ colorList at:cmapIndex ifAbsent:nil |
|
7880 |
]. |
|
1900 | 7881 |
^ nil |
1852 | 7882 |
]. |
1896 | 7883 |
^ cMap at:cmapIndex. |
1852 | 7884 |
! |
7885 |
||
1008 | 7886 |
sortColorMap |
7887 |
"calculates a new color map for the image, sorting colors" |
|
7888 |
||
3476 | 7889 |
self nonUndoableSortColorMapWith:self sortBlockForColorsByRGB |
7890 |
||
7891 |
"Modified: / 31-08-2017 / 14:20:07 / cg" |
|
1939 | 7892 |
! |
7893 |
||
7894 |
sortColorMapWith:sortBlock |
|
3476 | 7895 |
"warning: not undoable |
7896 |
calculates a new color map for the image, sorting colors" |
|
7897 |
||
7898 |
|depth newColorMap newImage oldImage usedColors oldToNew oldBits newBits tmpBits |
|
7899 |
expectedSize w h| |
|
7900 |
||
7901 |
oldImage := self image. |
|
7902 |
depth := oldImage depth. |
|
7903 |
w := oldImage width. |
|
7904 |
h := oldImage height. |
|
7905 |
||
7906 |
usedColors := oldImage realColorMap. |
|
7907 |
||
7908 |
"/ translation table |
|
7909 |
oldToNew := ByteArray new:(1 bitShift:depth). |
|
7910 |
newColorMap := usedColors asArray. |
|
7911 |
newColorMap sort:sortBlock. |
|
7912 |
||
7913 |
oldImage colorMap asArray keysAndValuesDo:[:oldIdx :clr | |
|
7914 |
|newPixel| |
|
7915 |
||
7916 |
(usedColors includes:clr) ifTrue:[ |
|
7917 |
newPixel := newColorMap indexOf:clr. |
|
7918 |
oldToNew at:oldIdx put:newPixel-1. |
|
7919 |
] |
|
7920 |
]. |
|
7921 |
||
7922 |
oldBits := oldImage bits. |
|
7923 |
"/ sanity check... |
|
7924 |
expectedSize := ((w * h * depth + 7) // 8). |
|
7925 |
(oldBits size < expectedSize) ifTrue:[ |
|
7926 |
self halt:'incorrect pixeldata size'. |
|
7927 |
oldBits := (ByteArray new:expectedSize) replaceFrom:1 with:oldBits; yourself. |
|
7928 |
]. |
|
7929 |
newBits := ByteArray new:(oldBits size). |
|
7930 |
depth ~~ 8 ifTrue:[ |
|
7931 |
||
7932 |
"/ expand/compress can only handle 8bits |
|
7933 |
tmpBits := ByteArray uninitializedNew:(w*h). |
|
7934 |
oldBits |
|
7935 |
expandPixels:depth |
|
7936 |
width:w height:h |
|
7937 |
into:tmpBits |
|
7938 |
mapping:oldToNew. |
|
7939 |
tmpBits |
|
7940 |
compressPixels:depth |
|
7941 |
width:w height:h |
|
7942 |
into:newBits |
|
7943 |
mapping:nil |
|
7944 |
] ifFalse:[ |
|
7945 |
oldBits |
|
7946 |
expandPixels:depth |
|
7947 |
width:w height:h |
|
7948 |
into:newBits |
|
7949 |
mapping:oldToNew. |
|
7950 |
]. |
|
7951 |
||
7952 |
newImage := oldImage species new |
|
7953 |
width:w height:h depth:depth |
|
7954 |
fromArray:newBits. |
|
7955 |
||
7956 |
newImage colorMap:newColorMap. |
|
7957 |
newImage fileName:oldImage fileName. |
|
7958 |
newImage mask:(oldImage mask copy). |
|
7959 |
||
7960 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
7961 |
self fetchImageData. |
|
7962 |
] |
|
7963 |
||
7964 |
"Modified: / 15-09-1998 / 17:53:32 / cg" |
|
7965 |
"Created: / 30-09-1998 / 23:51:23 / cg" |
|
7966 |
"Modified (comment): / 31-08-2017 / 14:19:21 / cg" |
|
7967 |
! |
|
7968 |
||
7969 |
updateImageAfterDoing:aBlockOrSelector |
|
7970 |
self withExecuteCursorDo:[ |
|
7971 |
aBlockOrSelector value:imageEditView. |
|
7972 |
self updateImage. |
|
7973 |
]. |
|
7974 |
||
7975 |
"Created: / 31-08-2017 / 12:14:39 / cg" |
|
7976 |
! ! |
|
7977 |
||
7978 |
!ImageEditor methodsFor:'user actions-colormap-basic'! |
|
7979 |
||
7980 |
nonUndoableClearColormapEntry0AndMaskedPixels |
|
7981 |
"ensure that there is a colorMap entry with 0/0/0 at position |
|
7982 |
0 and then clear all masked pixels (to pixelValue 0). |
|
7983 |
This is required for windows icons to be really transparent" |
|
7984 |
||
7985 |
|index colorMap| |
|
7986 |
||
7987 |
self nonUndoableCompressColorMap. |
|
7988 |
||
7989 |
colorMap := self image colorMap. |
|
7990 |
(colorMap includes:(Color black)) ifFalse:[ |
|
7991 |
self addColorToColormap:(Color black) undoable:false. |
|
7992 |
colorMap := self image colorMap. |
|
7993 |
]. |
|
7994 |
index := colorMap indexOf:(Color black). |
|
7995 |
index == 1 ifFalse:[ |
|
7996 |
self nonUndoableSortColorMapWith:self sortBlockForColorsByRGB. |
|
7997 |
colorMap := self image colorMap. |
|
7998 |
]. |
|
7999 |
self nonUndoableClearMaskedPixels |
|
8000 |
||
8001 |
"Created: / 31-08-2017 / 14:31:09 / cg" |
|
8002 |
! |
|
8003 |
||
8004 |
nonUndoableClearMaskedPixels |
|
8005 |
"clear all masked pixels (to pixelValue 0)" |
|
8006 |
||
8007 |
|newImage| |
|
8008 |
||
8009 |
newImage := self image clearMaskedPixels. |
|
8010 |
0 to:newImage height - 1 do:[:y | |
|
8011 |
0 to:newImage width - 1 do:[:x | |
|
8012 |
(newImage maskAtX:x y:y) == 0 ifTrue:[ |
|
8013 |
newImage pixelAtX:x y:y put:0 |
|
8014 |
] |
|
8015 |
] |
|
8016 |
]. |
|
8017 |
||
8018 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
8019 |
self fetchImageData. |
|
8020 |
] |
|
8021 |
||
8022 |
"Created: / 31-08-2017 / 14:22:58 / cg" |
|
8023 |
! |
|
8024 |
||
8025 |
nonUndoableCompressColorMap |
|
8026 |
"not undoable |
|
8027 |
calculates a new color map for the image, using only used colors" |
|
8028 |
||
8029 |
|newImage| |
|
8030 |
||
8031 |
newImage := self image. |
|
8032 |
newImage compressColorMap. |
|
8033 |
||
8034 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
8035 |
self fetchImageData. |
|
8036 |
] |
|
8037 |
||
8038 |
"Created: / 31-08-2017 / 14:21:51 / cg" |
|
8039 |
! |
|
8040 |
||
8041 |
nonUndoableSortColorMapWith:sortBlock |
|
8042 |
"not undoable |
|
8043 |
calculates a new color map for the image, sorting colors" |
|
1939 | 8044 |
|
3224 | 8045 |
|depth newColorMap newImage oldImage usedColors oldToNew oldBits newBits tmpBits |
8046 |
expectedSize w h| |
|
1008 | 8047 |
|
8048 |
oldImage := self image. |
|
8049 |
depth := oldImage depth. |
|
3224 | 8050 |
w := oldImage width. |
8051 |
h := oldImage height. |
|
1008 | 8052 |
|
2652 | 8053 |
usedColors := oldImage realColorMap. |
8054 |
||
8055 |
"/ translation table |
|
8056 |
oldToNew := ByteArray new:(1 bitShift:depth). |
|
8057 |
newColorMap := usedColors asArray. |
|
8058 |
newColorMap sort:sortBlock. |
|
8059 |
||
8060 |
oldImage colorMap asArray keysAndValuesDo:[:oldIdx :clr | |
|
8061 |
|newPixel| |
|
8062 |
||
8063 |
(usedColors includes:clr) ifTrue:[ |
|
8064 |
newPixel := newColorMap indexOf:clr. |
|
8065 |
oldToNew at:oldIdx put:newPixel-1. |
|
8066 |
] |
|
1008 | 8067 |
]. |
8068 |
||
2652 | 8069 |
oldBits := oldImage bits. |
3224 | 8070 |
"/ sanity check... |
8071 |
expectedSize := ((w * h * depth + 7) // 8). |
|
8072 |
(oldBits size < expectedSize) ifTrue:[ |
|
8073 |
self halt:'incorrect pixeldata size'. |
|
8074 |
oldBits := (ByteArray new:expectedSize) replaceFrom:1 with:oldBits; yourself. |
|
8075 |
]. |
|
2652 | 8076 |
newBits := ByteArray new:(oldBits size). |
8077 |
depth ~~ 8 ifTrue:[ |
|
3224 | 8078 |
|
2652 | 8079 |
"/ expand/compress can only handle 8bits |
3224 | 8080 |
tmpBits := ByteArray uninitializedNew:(w*h). |
2652 | 8081 |
oldBits |
8082 |
expandPixels:depth |
|
3224 | 8083 |
width:w height:h |
2652 | 8084 |
into:tmpBits |
8085 |
mapping:oldToNew. |
|
8086 |
tmpBits |
|
8087 |
compressPixels:depth |
|
3224 | 8088 |
width:w height:h |
2652 | 8089 |
into:newBits |
8090 |
mapping:nil |
|
8091 |
] ifFalse:[ |
|
8092 |
oldBits |
|
8093 |
expandPixels:depth |
|
3224 | 8094 |
width:w height:h |
2652 | 8095 |
into:newBits |
8096 |
mapping:oldToNew. |
|
8097 |
]. |
|
8098 |
||
8099 |
newImage := oldImage species new |
|
3224 | 8100 |
width:w height:h depth:depth |
2652 | 8101 |
fromArray:newBits. |
8102 |
||
8103 |
newImage colorMap:newColorMap. |
|
8104 |
newImage fileName:oldImage fileName. |
|
8105 |
newImage mask:(oldImage mask copy). |
|
8106 |
||
8107 |
(imageEditView image:newImage) notNil ifTrue:[ |
|
8108 |
self fetchImageData. |
|
1008 | 8109 |
] |
8110 |
||
3476 | 8111 |
"Created: / 31-08-2017 / 14:19:42 / cg" |
919
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
8112 |
! ! |
4e50c3164625
more options (preserving colorMap) when changing the colorMapMode;
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
8113 |
|
1715 | 8114 |
!ImageEditor methodsFor:'user actions-editing'! |
400 | 8115 |
|
3417 | 8116 |
autoCropAll |
8117 |
"find all borders and cut them off" |
|
8118 |
||
8119 |
imageEditView autoCropLeft:true right:true top:true bottom:true. |
|
8120 |
self updateInfoLabel |
|
8121 |
||
8122 |
"Created: / 20-02-2017 / 18:05:38 / cg" |
|
8123 |
! |
|
8124 |
||
8125 |
autoCropBottom |
|
8126 |
"find a bottom border and cut it off" |
|
8127 |
||
8128 |
imageEditView autoCropLeft:false right:false top:false bottom:true. |
|
8129 |
self updateInfoLabel |
|
8130 |
||
8131 |
"Created: / 20-02-2017 / 18:05:45 / cg" |
|
8132 |
! |
|
8133 |
||
8134 |
autoCropLeft |
|
8135 |
"find a left border and cut it off" |
|
8136 |
||
8137 |
imageEditView autoCropLeft:true right:false top:false bottom:false. |
|
8138 |
self updateInfoLabel |
|
8139 |
||
8140 |
"Created: / 20-02-2017 / 18:05:52 / cg" |
|
8141 |
! |
|
8142 |
||
8143 |
autoCropRight |
|
8144 |
"find a right border and cut it off" |
|
8145 |
||
8146 |
imageEditView autoCropLeft:false right:true top:false bottom:false. |
|
8147 |
self updateInfoLabel |
|
8148 |
||
8149 |
"Created: / 20-02-2017 / 18:04:20 / cg" |
|
8150 |
! |
|
8151 |
||
8152 |
autoCropTop |
|
8153 |
"find a top border and cut it off" |
|
8154 |
||
8155 |
imageEditView autoCropLeft:false right:false top:true bottom:false. |
|
8156 |
self updateInfoLabel |
|
8157 |
||
8158 |
"Created: / 20-02-2017 / 18:06:03 / cg" |
|
8159 |
! |
|
8160 |
||
3476 | 8161 |
ditherGrayToDepth |
8162 |
self askForDepthThenDo:[:depth | |
|
8163 |
self ditherGrayToDepth:depth |
|
8164 |
]. |
|
8165 |
||
8166 |
"Created: / 24-08-2017 / 17:49:42 / cg" |
|
8167 |
! |
|
8168 |
||
8169 |
ditherGrayToDepth:depth |
|
8170 |
self withExecuteCursorDo:[ |
|
3497 | 8171 |
|image newImage| |
8172 |
||
8173 |
image := self image. |
|
3476 | 8174 |
depth == 1 ifTrue:[ |
3497 | 8175 |
newImage := image asErrorDitheredMonochromeImage |
3476 | 8176 |
] ifFalse:[ |
3497 | 8177 |
newImage := image asGrayImageDepth:depth dither:#floydSteinberg. |
3476 | 8178 |
]. |
8179 |
imageEditView newImageWithUndo:newImage. |
|
8180 |
]. |
|
8181 |
||
8182 |
"Created: / 24-08-2017 / 17:51:07 / cg" |
|
3497 | 8183 |
"Modified: / 23-10-2017 / 10:58:18 / cg" |
3476 | 8184 |
! |
8185 |
||
8186 |
ditherToDepth |
|
8187 |
self askForDepthThenDo:[:depth | |
|
8188 |
self convertToDepth:depth dither:true |
|
8189 |
]. |
|
8190 |
||
8191 |
"Created: / 07-07-2006 / 13:22:10 / cg" |
|
8192 |
"Modified: / 30-08-2017 / 00:34:42 / cg" |
|
8193 |
! |
|
8194 |
||
3497 | 8195 |
ditherToNumberOfGrayColors |
8196 |
|oldDepth numGrayColors suggestion grayImage userInput grayColors| |
|
8197 |
||
8198 |
oldDepth := self image depth. |
|
8199 |
grayImage := self image asGrayImageDepth:8. |
|
8200 |
||
8201 |
suggestion := LastNumThresholdGrayColors notNil ifTrue:[ |
|
8202 |
LastNumThresholdGrayColors |
|
8203 |
] ifFalse:[ |
|
8204 |
oldDepth > 8 |
|
8205 |
ifTrue:[256] |
|
8206 |
ifFalse:[2 raisedTo:((oldDepth // 2 - 1) nextPowerOf2)] |
|
8207 |
]. |
|
8208 |
||
8209 |
Dialog modifyingBoxWith:[:box | |
|
8210 |
|preview slider update thresholdValue| |
|
8211 |
||
8212 |
thresholdValue := suggestion asValue. |
|
8213 |
||
8214 |
box enterField |
|
8215 |
converter:(PrintConverter new initForNumber); |
|
8216 |
model:thresholdValue. |
|
8217 |
||
8218 |
box verticalPanel extent:1.0 @ 300. |
|
8219 |
||
8220 |
box verticalPanel add:(slider := HorizontalSlider new start:2 stop:256 step:1). |
|
8221 |
slider model:thresholdValue. |
|
3690 | 8222 |
slider width:1.0; leftInset:4 rightInset:4. |
3497 | 8223 |
|
8224 |
box verticalPanel add:(preview := ImageView new). |
|
8225 |
preview extent:300 @300. |
|
8226 |
preview level:-1. |
|
8227 |
box verticalPanel horizontalLayout:#fitSpace. |
|
8228 |
||
8229 |
update := |
|
8230 |
[ |
|
8231 |
|numGrayColors depth s t tImage| |
|
8232 |
||
8233 |
numGrayColors := thresholdValue value clampBetween:2 and:256. |
|
8234 |
grayColors := Color grayColorVector:numGrayColors. |
|
8235 |
tImage := grayImage asDitheredImageUsing:grayColors depth:(grayImage depth). |
|
8236 |
||
8237 |
preview image:(tImage magnifiedPreservingRatioTo:preview extent). |
|
8238 |
]. |
|
8239 |
update value. |
|
8240 |
box enterField acceptOnLostFocus:true. |
|
8241 |
box enterField acceptOnLeave:true. |
|
8242 |
thresholdValue onChangeEvaluate:update. |
|
8243 |
||
8244 |
] do:[ |
|
8245 |
userInput := Dialog request:'Number of Gray Colors ?' initialAnswer:suggestion asString. |
|
8246 |
]. |
|
8247 |
userInput isEmptyOrNil ifTrue:[^ self]. |
|
8248 |
||
8249 |
||
8250 |
numGrayColors := Number readFrom:userInput onError:nil. |
|
8251 |
numGrayColors isNil ifTrue:[^ self]. |
|
8252 |
||
8253 |
grayColors := Color grayColorVector:numGrayColors. |
|
8254 |
imageEditView newImageWithUndo:(grayImage asDitheredImageUsing:grayColors depth:(grayImage depth)). |
|
8255 |
||
8256 |
"Created: / 23-10-2017 / 11:17:44 / cg" |
|
3690 | 8257 |
"Modified: / 16-07-2019 / 16:37:46 / Claus Gittinger" |
3497 | 8258 |
! |
8259 |
||
3476 | 8260 |
do3DProjection |
8261 |
"make a naive 3D projection; |
|
8262 |
can be used to create those typical marketing images as seen in web pages" |
|
8263 |
||
8264 |
|box dx1 dx2 image| |
|
8265 |
||
8266 |
image := imageEditView image. |
|
8267 |
||
8268 |
box := EnterBox new. |
|
8269 |
box title:(resources string:'dX1 (0 < dx < 0.5):'). |
|
8270 |
box okText:(resources string:'OK'). |
|
8271 |
box abortText:(resources string:'Cancel'). |
|
8272 |
box initialText:'0.1'. |
|
8273 |
box showAtPointer. |
|
8274 |
||
8275 |
(box accepted |
|
8276 |
and: [(dx1 := Number readFrom:(box contents) onError:nil) notNil]) |
|
8277 |
ifTrue:[ |
|
8278 |
box title:(resources string:'dX2 (0 < dx < 0.5):'). |
|
8279 |
box initialText:(dx1 printString). |
|
8280 |
box showAtPointer. |
|
8281 |
(box accepted |
|
8282 |
and: [(dx2 := Number readFrom:(box contents) onError:nil) notNil]) |
|
8283 |
ifTrue:[ |
|
8284 |
imageEditView threeDProjection:dx1 and:dx2. |
|
8285 |
] |
|
8286 |
]. |
|
8287 |
||
8288 |
self updateInfoLabel |
|
8289 |
||
8290 |
"Modified (comment): / 31-08-2017 / 13:58:03 / cg" |
|
8291 |
! |
|
8292 |
||
8293 |
doBrightenImage |
|
8294 |
imageEditView brightenImage. |
|
8295 |
self listOfColors removeAll. |
|
8296 |
self findColorMapMode. |
|
8297 |
"/ imageEditView removelastUndo |
|
8298 |
! |
|
8299 |
||
8300 |
doBrowseClass |
|
8301 |
"opens a System Browser on the resourceClass and the resourceSelector" |
|
8302 |
||
8303 |
|cls| |
|
8304 |
||
8305 |
cls := imageEditView resourceClass. |
|
8306 |
cls isNil ifTrue:[^ self warn:'No Class specified']. |
|
8307 |
||
8308 |
cls browserClass |
|
8309 |
openInClass:cls class |
|
8310 |
selector:(imageEditView resourceSelector) |
|
8311 |
||
8312 |
"Modified: / 31.7.1998 / 02:01:15 / cg" |
|
8313 |
! |
|
8314 |
||
8315 |
doCopyImageToClipboard |
|
8316 |
imageEditView copyImageToClipboard. |
|
8317 |
! |
|
8318 |
||
8319 |
doCropManual |
|
8320 |
"let user specify borders and cut them off" |
|
8321 |
||
8322 |
|bindings left top right bottom img firstChange cropAction acceptChannel| |
|
8323 |
||
8324 |
acceptChannel := TriggerValue new. |
|
8325 |
||
8326 |
firstChange := true. |
|
8327 |
||
8328 |
cropAction := |
|
8329 |
[:lV :rV :tV :bV | |l r t b| |
|
8330 |
acceptChannel value:true. |
|
8331 |
||
8332 |
l := lV value. |
|
8333 |
r := rV value. |
|
8334 |
t := tV value. |
|
8335 |
b := bV value. |
|
8336 |
(l + r + t + b) == 0 ifTrue:[ |
|
3526 | 8337 |
self window beepInEditor |
3476 | 8338 |
] ifFalse:[ |
8339 |
img := imageEditView image. |
|
8340 |
firstChange ifTrue:[ |
|
8341 |
imageEditView makeUndo. |
|
8342 |
firstChange := false. |
|
8343 |
]. |
|
8344 |
imageEditView |
|
8345 |
makeSubImageX:l y:t |
|
8346 |
width:(img width - l - r) |
|
8347 |
height:(img height - t - b). |
|
8348 |
||
8349 |
self updateImagePreView. |
|
8350 |
self updateInfoLabel |
|
8351 |
]. |
|
8352 |
]. |
|
8353 |
||
8354 |
bindings := IdentityDictionary new. |
|
8355 |
bindings at:#cropLeftAmount put:(left := 1 asValue). |
|
8356 |
bindings at:#cropRightAmount put:(right := 1 asValue). |
|
8357 |
bindings at:#cropTopAmount put:(top := 1 asValue). |
|
8358 |
bindings at:#cropBottomAmount put:(bottom := 1 asValue). |
|
8359 |
bindings at:#acceptChannel put:acceptChannel. |
|
8360 |
||
8361 |
bindings at:#cropLeftNow put:[ cropAction value:left value:0 value:0 value:0 ]. |
|
8362 |
bindings at:#cropRightNow put:[ cropAction value:0 value:right value:0 value:0 ]. |
|
8363 |
bindings at:#cropTopNow put:[ cropAction value:0 value:0 value:top value:0 ]. |
|
8364 |
bindings at:#cropBottomNow put:[ cropAction value:0 value:0 value:0 value:bottom ]. |
|
8365 |
||
8366 |
bindings at:#applyCropAction put:[ cropAction value:left value:right value:top value:bottom ]. |
|
8367 |
bindings at:#cropBoxIsDialog put:true. |
|
8368 |
||
8369 |
(self openDialogInterface:#cropSpec withBindings:bindings) |
|
8370 |
ifFalse:[ |
|
8371 |
firstChange ~~ true ifTrue:[ |
|
8372 |
imageEditView undo. |
|
8373 |
self updateImagePreView. |
|
8374 |
] |
|
8375 |
]. |
|
8376 |
||
8377 |
"Created: / 07-09-1998 / 18:16:07 / cg" |
|
8378 |
"Modified: / 19-02-2017 / 15:43:50 / cg" |
|
8379 |
! |
|
8380 |
||
8381 |
doDarkenImage |
|
8382 |
imageEditView darkenImage. |
|
8383 |
self listOfColors removeAll. |
|
8384 |
self findColorMapMode. |
|
8385 |
"/ imageEditView removelastUndo |
|
8386 |
! |
|
8387 |
||
8388 |
doEditMask |
|
8389 |
|mask| |
|
8390 |
||
8391 |
(mask := self image mask) notNil ifTrue:[ |
|
8392 |
mask edit |
|
8393 |
]. |
|
8394 |
||
8395 |
"Modified: / 18-02-2017 / 00:38:51 / cg" |
|
8396 |
! |
|
8397 |
||
8398 |
doFlipHorizontal |
|
8399 |
"flips horizontally current image" |
|
8400 |
||
8401 |
imageEditView flipHorizontal |
|
8402 |
! |
|
8403 |
||
8404 |
doFlipVertical |
|
8405 |
"flips vertically current image" |
|
8406 |
||
8407 |
imageEditView flipVertical |
|
8408 |
! |
|
8409 |
||
8410 |
doInsertTextFromUser |
|
8411 |
|text tempForm tempImage maskImage font w h paintColor| |
|
8412 |
||
8413 |
text := Dialog request:'Text to be inserted (placed as bitmap into clipboard for paste):'. |
|
8414 |
text isEmptyOrNil ifTrue:[^ self ]. |
|
8415 |
||
8416 |
font := Font family:'arial' size:20. |
|
8417 |
font := font onDevice:Screen current. |
|
8418 |
w := font widthOf:text. |
|
8419 |
h := font heightOf:text. |
|
8420 |
||
8421 |
tempForm := Form extent:(w@h) depth:1 onDevice:(Screen current). |
|
8422 |
tempForm clear. |
|
8423 |
tempForm font:font. |
|
8424 |
tempForm paint:(Color colorId:1). |
|
8425 |
tempForm displayString:text at:(0@font ascent). |
|
8426 |
||
8427 |
tempImage := tempForm asImage. |
|
8428 |
maskImage := tempForm asImage. |
|
8429 |
||
8430 |
paintColor := imageEditView selectedColor. |
|
8431 |
paintColor colorId == 0 ifTrue:[ |
|
8432 |
paintColor := Color black |
|
8433 |
]. |
|
8434 |
tempImage |
|
8435 |
photometric:#palette; |
|
8436 |
colorMap:(Array |
|
8437 |
with:Color white |
|
8438 |
with:paintColor); |
|
8439 |
mask:maskImage. |
|
8440 |
||
8441 |
ImageEditView copyImageToClipboard:tempImage. |
|
8442 |
self editMode value:#paste. |
|
8443 |
||
8444 |
"Modified: / 11-11-2007 / 12:32:55 / cg" |
|
8445 |
! |
|
8446 |
||
8447 |
doInspectImage |
|
8448 |
"opens a System Browser on the resourceClass and the resourceSelector" |
|
8449 |
||
8450 |
self image inspect |
|
8451 |
! |
|
8452 |
||
8453 |
doInvertedBitsImage |
|
8454 |
"inverts the pixels" |
|
8455 |
||
8456 |
self withExecuteCursorDo:[ |
|
8457 |
imageEditView makeInvertedBits. |
|
8458 |
self updateImage. |
|
8459 |
]. |
|
8460 |
"/ |
|
8461 |
"/ imageEditView negativeImage. |
|
8462 |
"/ self listOfColors removeAll. |
|
8463 |
"/ self findColorMapMode. |
|
8464 |
"/ "/ imageEditView removelastUndo |
|
8465 |
"/ |
|
8466 |
"/ |
|
8467 |
||
8468 |
"Created: / 31-08-2017 / 12:49:13 / cg" |
|
8469 |
! |
|
8470 |
||
8471 |
doMagnifyDown |
|
8472 |
"magnifies the current image one step down" |
|
8473 |
||
8474 |
|magHolder mag| |
|
8475 |
||
8476 |
magHolder := self magnificationHolder. |
|
8477 |
(mag := magHolder value) > 1 ifTrue: [ |
|
8478 |
magHolder value: mag - 1 |
|
8479 |
] |
|
8480 |
||
8481 |
"Modified: / 26.7.1998 / 20:24:08 / cg" |
|
8482 |
! |
|
8483 |
||
8484 |
doMagnifyImage |
|
8485 |
"magnifies the current image to a new size" |
|
8486 |
||
8487 |
|box newSize image antiAliased| |
|
8488 |
||
3550 | 8489 |
antiAliased := (LastMagnifySmoothing ? false) asValue. |
3476 | 8490 |
image := imageEditView image. |
8491 |
||
8492 |
box := EnterBox new. |
|
8493 |
box title:(resources string:'Images new size:'). |
|
8494 |
box okText:(resources string:'OK'). |
|
8495 |
box abortText:(resources string:'Cancel'). |
|
3550 | 8496 |
box initialText:(LastMagnifyTo ? image extent) printString. |
3476 | 8497 |
box verticalPanel add:(CheckBox label:(resources string:'Antialias/Smooth') model:antiAliased). |
8498 |
box showAtPointer. |
|
8499 |
||
8500 |
(box accepted |
|
8501 |
and: [(newSize := self pointFromString:(box contents)) notNil]) |
|
8502 |
ifTrue:[ |
|
8503 |
newSize isPoint ifFalse:[ |
|
8504 |
self warn:'Please enter the new size as ''x @ y''.'. |
|
8505 |
^ self. |
|
8506 |
]. |
|
3550 | 8507 |
LastMagnifyTo := newSize. |
8508 |
LastMagnifySmoothing := antiAliased value. |
|
3476 | 8509 |
antiAliased value ifTrue:[ |
8510 |
((newSize x < image width) or:[(newSize y < image height)]) ifTrue:[ |
|
8511 |
imageEditView magnifySmoothingTo:newSize. |
|
8512 |
] ifFalse:[ |
|
8513 |
imageEditView magnifyAntiAliasedImageTo:newSize. |
|
8514 |
]. |
|
8515 |
] ifFalse:[ |
|
8516 |
imageEditView magnifyImageTo:newSize. |
|
8517 |
]. |
|
8518 |
]. |
|
8519 |
||
8520 |
self updateInfoLabel |
|
8521 |
||
8522 |
"Modified: / 30-08-2017 / 15:46:02 / cg" |
|
8523 |
! |
|
8524 |
||
8525 |
doMagnifyImageBy |
|
8526 |
"magnifies the current image (by a scale)" |
|
8527 |
||
3550 | 8528 |
|oldSize newSize scaleString scale image smoothing| |
3476 | 8529 |
|
8530 |
image := imageEditView image. |
|
8531 |
oldSize := image extent. |
|
8532 |
||
3550 | 8533 |
smoothing := (LastMagnifySmoothing ? false) asValue. |
3476 | 8534 |
|
8535 |
Dialog modifyingBoxWith:[:box | |
|
3550 | 8536 |
box verticalPanel add:(CheckBox label:(resources string:'Antialias/Smooth') model:smoothing). |
3476 | 8537 |
"/ box verticalPanel add:(CheckBox label:(resources string:'Smoothing') model:smoothing). |
8538 |
] do:[ |
|
8539 |
scaleString := Dialog |
|
8540 |
request:(resources string:'Scale factor (<1 to shrink; >1 to magnify):') |
|
3550 | 8541 |
initialAnswer:(LastMagnifyBy ? 1) printString |
3476 | 8542 |
list:#('0.1' '0.25' '0.3' '0.5' '1.5' '2' '3' '4'). |
8543 |
]. |
|
8544 |
scaleString isNil ifTrue:[^ self]. |
|
8545 |
||
8546 |
scale := Object readFromString:scaleString onError:nil. |
|
8547 |
||
8548 |
scale notNil ifTrue:[ |
|
8549 |
scale isNumber ifFalse:[ |
|
8550 |
self warn:'please enter a scale factor (<1 to shrink; >1 to magnify).'. |
|
8551 |
^ self. |
|
8552 |
]. |
|
3550 | 8553 |
|
8554 |
LastMagnifyBy := scale. |
|
8555 |
LastMagnifySmoothing := smoothing value. |
|
8556 |
||
3476 | 8557 |
newSize := oldSize * scale. |
3550 | 8558 |
smoothing value ifTrue:[ |
3476 | 8559 |
scale < 1 ifTrue:[ |
8560 |
imageEditView magnifySmoothingBy:scale. |
|
8561 |
] ifFalse:[ |
|
8562 |
imageEditView magnifyAntiAliasedImageTo:newSize. |
|
8563 |
]. |
|
8564 |
] ifFalse:[ |
|
8565 |
imageEditView magnifyImageTo:newSize. |
|
8566 |
]. |
|
8567 |
]. |
|
8568 |
||
8569 |
self updateInfoLabel |
|
8570 |
||
8571 |
"Modified: / 30-08-2017 / 15:34:56 / cg" |
|
8572 |
! |
|
8573 |
||
8574 |
doMagnifyUp |
|
8575 |
"magnifies the current image one step up" |
|
8576 |
||
8577 |
|magHolder mag| |
|
8578 |
||
8579 |
magHolder := self magnificationHolder. |
|
8580 |
(mag := magHolder value) < 63 ifTrue: [ |
|
8581 |
magHolder value: mag + 1 |
|
8582 |
] |
|
8583 |
||
8584 |
"Modified: / 26.7.1998 / 20:23:52 / cg" |
|
8585 |
! |
|
8586 |
||
8587 |
doResizeImage |
|
8588 |
"resizes the current image" |
|
8589 |
||
8590 |
|box newSize image| |
|
8591 |
||
8592 |
image := imageEditView image. |
|
8593 |
||
8594 |
box := EnterBox new. |
|
8595 |
box title:(resources string:'Images new size:'). |
|
8596 |
box okText:(resources string:'OK'). |
|
8597 |
box abortText:(resources string:'Cancel'). |
|
8598 |
box initialText:image extent printString. |
|
8599 |
box showAtPointer. |
|
8600 |
(box accepted |
|
8601 |
and: [(newSize := self pointFromString:(box contents)) notNil]) |
|
8602 |
ifTrue:[ |
|
8603 |
imageEditView resizeImageTo:newSize. |
|
8604 |
]. |
|
8605 |
! |
|
8606 |
||
8607 |
doRotateImage |
|
8608 |
"rotates current image" |
|
8609 |
||
8610 |
|rotationString box rotation| |
|
8611 |
||
8612 |
rotationString := Dialog |
|
8613 |
request:(resources string:'Rotate by (degrees, clockwise):') |
|
8614 |
list:#( '-90' '90' '180' '45' '-45' '135' '-135' ) |
|
8615 |
initialAnswer:90. |
|
8616 |
rotationString isEmptyOrNil ifTrue:[^ self]. "/ canceled |
|
8617 |
rotation := Number readFrom:rotationString onError:[nil]. |
|
8618 |
rotation isNil ifTrue:[^ self]. |
|
8619 |
||
8620 |
"/ box := EnterBox new. |
|
8621 |
"/ box title:(resources string:'Rotate by (degrees, clockwise):'). |
|
8622 |
"/ box okText:(resources string:'OK'). |
|
8623 |
"/ box abortText:(resources string:'Cancel'). |
|
8624 |
"/ box initialText: '0'. |
|
8625 |
"/ box showAtPointer. |
|
8626 |
"/ (box accepted and: [(rotation := Number readFromString: box contents onError:nil) notNil]) |
|
8627 |
"/ ifFalse:[ ^ self ]. |
|
8628 |
||
8629 |
imageEditView rotateImageBy:rotation. |
|
8630 |
self updateInfoLabel. |
|
8631 |
||
8632 |
"Modified: / 18-03-2012 / 14:41:14 / cg" |
|
8633 |
"Modified (comment): / 24-08-2017 / 15:02:57 / cg" |
|
8634 |
! |
|
8635 |
||
8636 |
doShiftManual |
|
8637 |
"let user specify amount and shift" |
|
8638 |
||
8639 |
|bindings amount img firstChange shiftAction acceptChannel wrapHolder| |
|
8640 |
||
8641 |
acceptChannel := TriggerValue new. |
|
8642 |
wrapHolder := (lastShiftUsedWrap ? true) asValue. |
|
8643 |
||
8644 |
firstChange := true. |
|
8645 |
||
8646 |
shiftAction := |
|
8647 |
[:shiftH :shiftV | |
|
8648 |
acceptChannel value:true. |
|
8649 |
||
8650 |
img := imageEditView image. |
|
8651 |
firstChange ifTrue:[ |
|
8652 |
imageEditView makeUndo. |
|
8653 |
firstChange := false. |
|
8654 |
]. |
|
8655 |
imageEditView shiftImageHorizontal:(shiftH value) vertical:(shiftV value) wrap:(wrapHolder value). |
|
8656 |
self updateInfoLabel |
|
8657 |
]. |
|
8658 |
||
8659 |
bindings := IdentityDictionary new. |
|
8660 |
bindings at:#shiftAmount put:(amount := 1 asValue). |
|
8661 |
bindings at:#wrap put:wrapHolder. |
|
8662 |
bindings at:#acceptChannel put:acceptChannel. |
|
8663 |
||
8664 |
bindings at:#shiftLeftNow put:[ shiftAction value:(-1*amount value) value:0 ]. |
|
8665 |
bindings at:#shiftRightNow put:[ shiftAction value:amount value value:0 ]. |
|
8666 |
bindings at:#shiftUpNow put:[ shiftAction value:0 value:(-1*amount value) ]. |
|
8667 |
bindings at:#shiftDownNow put:[ shiftAction value:0 value:amount value ]. |
|
8668 |
||
8669 |
(self openDialogInterface:#shiftDialogSpec withBindings:bindings) |
|
8670 |
ifFalse:[ |
|
8671 |
firstChange ~~ true ifTrue:[ |
|
8672 |
imageEditView undo |
|
8673 |
] |
|
8674 |
]. |
|
8675 |
lastShiftUsedWrap := wrapHolder value. |
|
8676 |
||
8677 |
"Created: / 7.9.1998 / 18:16:07 / cg" |
|
8678 |
"Modified: / 7.9.1998 / 18:20:42 / cg" |
|
8679 |
! |
|
8680 |
||
8681 |
doUnCropManual |
|
8682 |
"let user specify borders and add them" |
|
8683 |
||
8684 |
|bindings leftAmount topAmount rightAmount bottomAmount img| |
|
8685 |
||
8686 |
bindings := IdentityDictionary new. |
|
8687 |
bindings at:#cropLeftAmount put:(leftAmount := 1 asValue). |
|
8688 |
bindings at:#cropRightAmount put:(rightAmount := 1 asValue). |
|
8689 |
bindings at:#cropTopAmount put:(topAmount := 1 asValue). |
|
8690 |
bindings at:#cropBottomAmount put:(bottomAmount := 1 asValue). |
|
8691 |
bindings at:#cropBoxIsDialog put:true. |
|
8692 |
||
8693 |
(self openDialogInterface:#uncropSpec withBindings:bindings) |
|
8694 |
ifTrue:[ |
|
8695 |
leftAmount := leftAmount value. |
|
8696 |
rightAmount := rightAmount value. |
|
8697 |
topAmount := topAmount value. |
|
8698 |
bottomAmount := bottomAmount value. |
|
8699 |
img := imageEditView image. |
|
8700 |
||
8701 |
imageEditView |
|
8702 |
makeBorderedImageX:leftAmount y:topAmount |
|
8703 |
width:(img width + leftAmount + rightAmount) |
|
8704 |
height:(img height + topAmount + bottomAmount). |
|
8705 |
self updateInfoLabel |
|
8706 |
]. |
|
8707 |
||
8708 |
"Created: / 07-09-1998 / 18:16:07 / cg" |
|
8709 |
"Modified: / 19-02-2017 / 15:31:00 / cg" |
|
8710 |
! |
|
8711 |
||
8712 |
doUndo |
|
8713 |
"reverses last edit action" |
|
8714 |
||
8715 |
imageEditView undo. |
|
8716 |
self updateImagePreView |
|
8717 |
! |
|
8718 |
||
8719 |
makeInverse |
|
8720 |
"inverts the pixels - for palettes, this leads to funny results" |
|
8721 |
||
8722 |
self updateImageAfterDoing:#makeInverse. |
|
8723 |
||
8724 |
"Modified: / 31-08-2017 / 12:16:07 / cg" |
|
8725 |
"Modified (comment): / 31-08-2017 / 13:51:28 / cg" |
|
8726 |
! |
|
8727 |
||
8728 |
makeMonochromeImage |
|
8729 |
"let user choose a threshold, then convert to monochrome" |
|
8730 |
||
8731 |
|image userInput thresholdBrighness| |
|
8732 |
||
8733 |
image := imageEditView image. |
|
8734 |
||
8735 |
Dialog modifyingBoxWith:[:box | |
|
8736 |
|preview slider update thresholdValue| |
|
8737 |
||
8738 |
thresholdValue := 0.5 asValue. |
|
8739 |
||
8740 |
box enterField |
|
8741 |
converter:(PrintConverter new initForNumber); |
|
8742 |
model:thresholdValue. |
|
8743 |
||
8744 |
box verticalPanel extent:1.0 @ 300. |
|
8745 |
||
8746 |
box verticalPanel add:(slider := HorizontalSlider new start:0 stop:1 step:0.05). |
|
8747 |
slider model:thresholdValue. |
|
3690 | 8748 |
slider width:1.0; leftInset:4 rightInset:4. |
3476 | 8749 |
|
8750 |
box verticalPanel add:(preview := ImageView new). |
|
8751 |
preview extent:300 @300. |
|
8752 |
preview level:-1. |
|
8753 |
box verticalPanel horizontalLayout:#fitSpace. |
|
8754 |
||
8755 |
update := |
|
8756 |
[ |
|
8757 |
|s t| |
|
8758 |
||
8759 |
t := thresholdValue value clampBetween:0 and:1. |
|
8760 |
preview image:((image asThresholdMonochromeImage:t) |
|
8761 |
magnifiedPreservingRatioTo:preview extent). |
|
8762 |
]. |
|
8763 |
update value. |
|
8764 |
box enterField acceptOnLostFocus:true. |
|
8765 |
box enterField acceptOnLeave:true. |
|
8766 |
thresholdValue onChangeEvaluate:update. |
|
8767 |
||
8768 |
] do:[ |
|
8769 |
userInput := Dialog request:'Threshold (0=black; 1=white) ?' initialAnswer:0.5. |
|
8770 |
]. |
|
8771 |
userInput isEmptyOrNil ifTrue:[^ self]. |
|
3497 | 8772 |
|
3476 | 8773 |
thresholdBrighness := Number readFrom:userInput onError:nil. |
8774 |
thresholdBrighness isNil ifTrue:[^ self]. |
|
8775 |
||
8776 |
thresholdBrighness := thresholdBrighness clampBetween:0 and:1. |
|
3478 | 8777 |
|
3476 | 8778 |
imageEditView newImageWithUndo:(image asThresholdMonochromeImage:thresholdBrighness) |
8779 |
||
8780 |
"Created: / 24-08-2017 / 15:26:44 / cg" |
|
8781 |
"Modified: / 24-08-2017 / 17:54:21 / cg" |
|
3497 | 8782 |
"Modified (format): / 23-10-2017 / 10:42:52 / cg" |
3690 | 8783 |
"Modified: / 16-07-2019 / 16:37:50 / Claus Gittinger" |
3476 | 8784 |
! |
8785 |
||
8786 |
makeNegative |
|
8787 |
"negates current image by negating the color map" |
|
8788 |
||
8789 |
self withExecuteCursorDo:[ |
|
3477 | 8790 |
imageEditView makeNegative. |
3476 | 8791 |
self updateImage. |
8792 |
]. |
|
8793 |
||
8794 |
"Created: / 31-08-2017 / 13:49:47 / cg" |
|
3477 | 8795 |
"Modified (comment): / 01-09-2017 / 10:27:37 / cg" |
3476 | 8796 |
! |
8797 |
||
8798 |
thresholdGrayToDepth |
|
8799 |
self askForDepthThenDo:[:depth | |
|
8800 |
self thresholdGrayToDepth:depth |
|
8801 |
]. |
|
8802 |
||
8803 |
"Created: / 24-08-2017 / 17:49:23 / cg" |
|
8804 |
! |
|
8805 |
||
8806 |
thresholdGrayToDepth:depth |
|
8807 |
self withExecuteCursorDo:[ |
|
8808 |
|newImage| |
|
8809 |
||
8810 |
newImage := self image asThresholdGrayImageDepth:depth. |
|
8811 |
imageEditView newImageWithUndo:newImage. |
|
8812 |
]. |
|
8813 |
||
8814 |
"Created: / 24-08-2017 / 17:49:30 / cg" |
|
8815 |
! |
|
8816 |
||
8817 |
thresholdToDepth |
|
8818 |
self askForDepthThenDo:[:depth | |
|
8819 |
self convertToDepth:depth dither:false |
|
8820 |
]. |
|
8821 |
||
8822 |
"Created: / 30-08-2017 / 00:31:33 / cg" |
|
3497 | 8823 |
! |
8824 |
||
8825 |
thresholdToNumberOfGrayColors |
|
8826 |
|oldDepth numGrayColors suggestion grayImage userInput grayColors| |
|
8827 |
||
8828 |
oldDepth := self image depth. |
|
8829 |
grayImage := self image asGrayImageDepth:8. |
|
8830 |
||
8831 |
suggestion := LastNumThresholdGrayColors notNil ifTrue:[ |
|
8832 |
LastNumThresholdGrayColors |
|
8833 |
] ifFalse:[ |
|
8834 |
oldDepth > 8 |
|
8835 |
ifTrue:[256] |
|
8836 |
ifFalse:[2 raisedTo:((oldDepth // 2 - 1) nextPowerOf2)] |
|
8837 |
]. |
|
8838 |
||
8839 |
Dialog modifyingBoxWith:[:box | |
|
8840 |
|preview slider update thresholdValue| |
|
8841 |
||
8842 |
thresholdValue := suggestion asValue. |
|
8843 |
||
8844 |
box enterField |
|
8845 |
converter:(PrintConverter new initForNumber); |
|
8846 |
model:thresholdValue. |
|
8847 |
||
8848 |
box verticalPanel extent:1.0 @ 300. |
|
8849 |
||
8850 |
box verticalPanel add:(slider := HorizontalSlider new start:2 stop:256 step:1). |
|
8851 |
slider model:thresholdValue. |
|
3690 | 8852 |
slider width:1.0; leftInset:4 rightInset:4. |
3497 | 8853 |
|
8854 |
box verticalPanel add:(preview := ImageView new). |
|
8855 |
preview extent:300 @300. |
|
8856 |
preview level:-1. |
|
8857 |
box verticalPanel horizontalLayout:#fitSpace. |
|
8858 |
||
8859 |
update := |
|
8860 |
[ |
|
8861 |
|numGrayColors depth s t tImage| |
|
8862 |
||
8863 |
numGrayColors := thresholdValue value clampBetween:2 and:256. |
|
8864 |
grayColors := Color grayColorVector:numGrayColors. |
|
8865 |
tImage := grayImage asNearestPaintImageDepth:(grayImage depth) colors:grayColors. |
|
8866 |
||
8867 |
preview image:(tImage magnifiedPreservingRatioTo:preview extent). |
|
8868 |
]. |
|
8869 |
update value. |
|
8870 |
box enterField acceptOnLostFocus:true. |
|
8871 |
box enterField acceptOnLeave:true. |
|
8872 |
thresholdValue onChangeEvaluate:update. |
|
8873 |
||
8874 |
] do:[ |
|
8875 |
userInput := Dialog request:'Number of Gray Colors ?' initialAnswer:suggestion asString. |
|
8876 |
]. |
|
8877 |
userInput isEmptyOrNil ifTrue:[^ self]. |
|
8878 |
||
8879 |
||
8880 |
numGrayColors := Number readFrom:userInput onError:nil. |
|
8881 |
numGrayColors isNil ifTrue:[^ self]. |
|
8882 |
||
8883 |
grayColors := Color grayColorVector:numGrayColors. |
|
8884 |
imageEditView newImageWithUndo:(grayImage asNearestPaintImageDepth:(grayImage depth) colors:grayColors). |
|
8885 |
||
8886 |
"Created: / 23-10-2017 / 10:55:15 / cg" |
|
3690 | 8887 |
"Modified: / 16-07-2019 / 16:37:54 / Claus Gittinger" |
3476 | 8888 |
! ! |
8889 |
||
8890 |
!ImageEditor methodsFor:'user actions-editing-colors'! |
|
8891 |
||
3471 | 8892 |
convertToDepth:depth dither:doDither |
8893 |
|answer labels values |
|
8894 |
ditherColors fixColors |
|
8895 |
nGrey greyColorsAlready moreColors d| |
|
8896 |
||
8897 |
"/ no colormap above 12 bits!! |
|
8898 |
depth > 12 ifTrue:[ |
|
8899 |
answer := #TrueColor. |
|
8900 |
] ifFalse:[ |
|
8901 |
doDither ifTrue:[ |
|
8902 |
(depth >= 8) ifTrue:[ |
|
8903 |
labels := #('Cancel' 'Use Browser Palette' 'Use Standard' 'Compute' 'TrueColor'). |
|
8904 |
values := #(nil UseBrowserPalette UseStandard Compute TrueColor). |
|
8905 |
] ifFalse:[ |
|
8906 |
depth == 1 ifTrue:[ |
|
8907 |
answer := #UseStandard |
|
8908 |
] ifFalse:[ |
|
8909 |
labels := #('Cancel' 'Use Standard' 'Compute' 'TrueColor'). |
|
8910 |
values := #(nil UseStandard Compute TrueColor). |
|
8911 |
]. |
|
8912 |
]. |
|
8913 |
] ifFalse:[ |
|
8914 |
(depth >= 8) ifTrue:[ |
|
8915 |
labels := #('Cancel' 'Use Browser Palette' 'Use Standard' 'TrueColor'). |
|
8916 |
values := #(nil UseBrowserPalette UseStandard TrueColor). |
|
8917 |
] ifFalse:[ |
|
8918 |
answer := #UseStandard |
|
8919 |
]. |
|
8920 |
]. |
|
8921 |
]. |
|
8922 |
||
8923 |
answer isNil ifTrue:[ |
|
8924 |
answer := OptionBox |
|
8925 |
request:'Compute a new (optimized) colormap\(Warning: this may take some time)\\or else use a standard colormap?' withCRs |
|
8926 |
label:(resources string:'Dither how') |
|
8927 |
image:(YesNoBox iconBitmap) |
|
8928 |
buttonLabels:(resources array:labels) |
|
8929 |
values:values |
|
8930 |
default:#UseStandard |
|
8931 |
onCancel:nil. |
|
8932 |
answer isNil ifTrue:[^ self]. |
|
8933 |
]. |
|
8934 |
||
8935 |
(answer == #Compute) ifTrue:[ |
|
8936 |
ditherColors := |
|
8937 |
Color |
|
8938 |
best:(1 bitShift:depth) |
|
8939 |
ditherColorsForImage:self image |
|
8940 |
] ifFalse:[ |
|
8941 |
(answer == #UseBrowserPalette) ifTrue:[ |
|
8942 |
ditherColors := Color colorCubeWithRed:6 green:6 blue:6. |
|
8943 |
] ifFalse:[ |
|
8944 |
answer == #TrueColor ifTrue:[ |
|
8945 |
depth == 6 ifTrue:[ |
|
8946 |
fixColors := FixedPalette |
|
8947 |
redShift:4 redMask:3 |
|
8948 |
greenShift:2 greenMask:3 |
|
8949 |
blueShift:0 blueMask:3 |
|
8950 |
]. |
|
8951 |
depth == 9 ifTrue:[ |
|
8952 |
fixColors := FixedPalette |
|
8953 |
redShift:6 redMask:7 |
|
8954 |
greenShift:3 greenMask:7 |
|
8955 |
blueShift:0 blueMask:7 |
|
8956 |
]. |
|
8957 |
depth == 12 ifTrue:[ |
|
8958 |
fixColors := FixedPalette |
|
8959 |
redShift:8 redMask:16r0F |
|
8960 |
greenShift:4 greenMask:16r0F |
|
8961 |
blueShift:0 blueMask:16r0F |
|
8962 |
]. |
|
8963 |
depth == 15 ifTrue:[ |
|
8964 |
fixColors := FixedPalette |
|
8965 |
redShift:10 redMask:16r1F |
|
8966 |
greenShift:5 greenMask:16r1F |
|
8967 |
blueShift:0 blueMask:16r1F |
|
8968 |
]. |
|
8969 |
depth == 16 ifTrue:[ |
|
8970 |
fixColors := FixedPalette |
|
8971 |
redShift:11 redMask:16r1F |
|
8972 |
greenShift:5 greenMask:16r3F |
|
8973 |
blueShift:0 blueMask:16r1F |
|
8974 |
]. |
|
8975 |
depth == 18 ifTrue:[ |
|
8976 |
fixColors := FixedPalette |
|
8977 |
redShift:12 redMask:16r3F |
|
8978 |
greenShift:6 greenMask:16r3F |
|
8979 |
blueShift:0 blueMask:16r3F |
|
8980 |
]. |
|
8981 |
] ifFalse:[ |
|
8982 |
depth == 1 ifTrue:[ |
|
8983 |
ditherColors := { Color black . Color white }. |
|
8984 |
]. |
|
8985 |
depth == 2 ifTrue:[ |
|
8986 |
ditherColors := { Color black . Color darkGray .Color lightGray . Color white }. |
|
8987 |
]. |
|
8988 |
depth = 3 ifTrue:[ |
|
8989 |
ditherColors := Color colorCubeWithRed:2 green:2 blue:2. |
|
8990 |
]. |
|
8991 |
depth = 4 ifTrue:[ |
|
8992 |
ditherColors := Color vgaColors. |
|
8993 |
]. |
|
8994 |
depth = 5 ifTrue:[ |
|
8995 |
ditherColors := Color colorCubeWithRed:3 green:4 blue:2. |
|
8996 |
]. |
|
8997 |
depth = 6 ifTrue:[ |
|
8998 |
ditherColors := Color colorCubeWithRed:4 green:4 blue:3. |
|
8999 |
]. |
|
9000 |
depth = 7 ifTrue:[ |
|
9001 |
ditherColors := Color colorCubeWithRed:5 green:5 blue:4. |
|
9002 |
]. |
|
9003 |
depth == 8 ifTrue:[ |
|
9004 |
ditherColors := Color standardDitherColorsForDepth8. |
|
9005 |
]. |
|
9006 |
depth == 9 ifTrue:[ |
|
9007 |
ditherColors := Color colorCubeWithRed:8 green:8 blue:8. |
|
9008 |
]. |
|
9009 |
ditherColors isNil ifTrue:[ |
|
9010 |
self error:'unsupported depth'. |
|
9011 |
]. |
|
9012 |
||
9013 |
"/ add as many gray colors as possible. |
|
9014 |
nGrey := (2 raisedTo:depth) - ditherColors size. |
|
9015 |
nGrey > 0 ifTrue:[ |
|
9016 |
nGrey := nGrey min:100. |
|
9017 |
greyColorsAlready := ditherColors select:[:clr | clr isGreyColor]. |
|
9018 |
d := 1 / nGrey. |
|
9019 |
moreColors := (1 to:nGrey-1) |
|
9020 |
collect:[:i | Color brightness:(d * i)] |
|
9021 |
thenReject:[:clr | greyColorsAlready includes:clr ]. |
|
9022 |
||
9023 |
ditherColors := ditherColors , moreColors. |
|
9024 |
]. |
|
9025 |
]. |
|
9026 |
]. |
|
9027 |
]. |
|
9028 |
||
9029 |
self withExecuteCursorDo:[ |
|
9030 |
|newImage| |
|
9031 |
||
9032 |
doDither ifTrue:[ |
|
9033 |
depth == 1 ifTrue:[ |
|
9034 |
newImage := self image asErrorDitheredMonochromeImage |
|
9035 |
] ifFalse:[ |
|
9036 |
answer == #TrueColor ifTrue:[ |
|
9037 |
newImage := self image asDitheredImageUsing:fixColors depth:depth. |
|
9038 |
] ifFalse:[ |
|
9039 |
newImage := self image asDitheredImageUsing:ditherColors depth:depth. |
|
9040 |
] |
|
9041 |
] |
|
9042 |
] ifFalse:[ |
|
9043 |
answer == #TrueColor ifTrue:[ |
|
9044 |
self halt. |
|
9045 |
] ifFalse:[ |
|
9046 |
newImage := self image asNearestPaintImageDepth:depth colors:ditherColors |
|
9047 |
]. |
|
9048 |
]. |
|
9049 |
imageEditView newImageWithUndo:newImage. |
|
9050 |
]. |
|
9051 |
||
9052 |
"Created: / 30-08-2017 / 00:33:55 / cg" |
|
9053 |
"Modified: / 30-08-2017 / 02:13:03 / cg" |
|
9054 |
! |
|
9055 |
||
3598 | 9056 |
exchangeGreenBlueChannels |
9057 |
self updateImageAfterDoing:#exchangeGreenBlueChannels. |
|
9058 |
||
9059 |
"Created: / 31-08-2017 / 13:51:10 / cg" |
|
9060 |
! |
|
9061 |
||
9062 |
exchangeRedBlueChannels |
|
9063 |
self updateImageAfterDoing:#exchangeRedBlueChannels. |
|
9064 |
||
9065 |
"Created: / 31-08-2017 / 13:51:10 / cg" |
|
9066 |
! |
|
9067 |
||
9068 |
exchangeRedGreenChannels |
|
9069 |
self updateImageAfterDoing:#exchangeRedGreenChannels. |
|
9070 |
||
9071 |
"Created: / 31-08-2017 / 13:51:10 / cg" |
|
9072 |
! |
|
9073 |
||
3476 | 9074 |
makeInvertedBits |
9075 |
"inverts the pixels - for palettes, this leads to funny results. |
|
9076 |
For others, this is the same as negating" |
|
9077 |
||
9078 |
self updateImageAfterDoing:#makeInvertedBits. |
|
9079 |
||
9080 |
"Created: / 31-08-2017 / 13:51:10 / cg" |
|
400 | 9081 |
! ! |
9082 |
||
2812 | 9083 |
!ImageEditor methodsFor:'user actions-image sequences'! |
9084 |
||
9085 |
editEachImageFromSequence |
|
9086 |
|seq| |
|
9087 |
||
9088 |
self checkModified ifFalse:[ ^ self ]. |
|
9089 |
||
9090 |
imageEditView releaseUndos. |
|
9091 |
||
9092 |
seq := self image imageSequence. |
|
9093 |
seq size > 10 ifTrue:[ |
|
9094 |
(Dialog confirm:(resources string:'Ok to open %1 image editor windows?' with:seq size)) |
|
9095 |
ifFalse:[^ self]. |
|
9096 |
]. |
|
9097 |
||
9098 |
seq do:[:eachFrame | |
|
9099 |
ImageEditor openOnImage:eachFrame image |
|
9100 |
]. |
|
9101 |
||
9102 |
"Modified: / 21-10-2010 / 15:01:25 / cg" |
|
9103 |
! |
|
9104 |
||
9105 |
gotoImageInSequence:index |
|
9106 |
"display the next image in the image sequence" |
|
9107 |
||
9108 |
|img seq frame listOfColors| |
|
9109 |
||
9110 |
imageEditView releaseUndos. |
|
9111 |
||
9112 |
seq := self image imageSequence. |
|
9113 |
||
9114 |
imageSeqNr := index. |
|
9115 |
frame := seq at:imageSeqNr. |
|
9116 |
imageEditView image:(frame image). |
|
9117 |
||
9118 |
(img := self image) notNil ifTrue:[ |
|
9119 |
listOfColors := self listOfColors. |
|
9120 |
img colorMap notNil ifTrue:[ |
|
9121 |
listOfColors contents:(img usedColors asSet asOrderedCollection). |
|
9122 |
] ifFalse:[ |
|
9123 |
listOfColors removeAll. |
|
9124 |
]. |
|
9125 |
self findColorMapMode. |
|
9126 |
self updateLabelsAndHistory. |
|
9127 |
img := img onDevice:device. |
|
9128 |
imageEditView image:img. |
|
9129 |
] ifFalse:[ |
|
9130 |
self updateForNoImage |
|
9131 |
]. |
|
9132 |
||
9133 |
"Created: / 21-10-2010 / 14:22:11 / cg" |
|
9134 |
! |
|
9135 |
||
9136 |
nextImageInSequence |
|
9137 |
"display the next image in the image sequence" |
|
9138 |
||
9139 |
|seq index| |
|
9140 |
||
9141 |
seq := self image imageSequence. |
|
9142 |
(index := imageSeqNr) isNil ifTrue:[ |
|
9143 |
index := 1. |
|
9144 |
]. |
|
9145 |
index := index + 1. |
|
9146 |
index > seq size ifTrue:[ |
|
9147 |
self information:'Back to first image in sequence'. |
|
9148 |
index := 1. |
|
9149 |
]. |
|
9150 |
self gotoImageInSequence:index. |
|
9151 |
||
9152 |
"Modified: / 21-10-2010 / 14:24:11 / cg" |
|
9153 |
! |
|
9154 |
||
9155 |
previousImageInSequence |
|
9156 |
"display the previous image in the image sequence" |
|
9157 |
||
9158 |
|seq index| |
|
9159 |
||
9160 |
seq := self image imageSequence. |
|
9161 |
(index := imageSeqNr) isNil ifTrue:[ |
|
9162 |
index := 1. |
|
9163 |
]. |
|
9164 |
index := index - 1. |
|
9165 |
index < 1 ifTrue:[ |
|
9166 |
self information:'Wrap to last image in sequence'. |
|
9167 |
index := seq size. |
|
9168 |
]. |
|
9169 |
self gotoImageInSequence:index. |
|
9170 |
||
9171 |
"Created: / 21-10-2010 / 14:25:03 / cg" |
|
9172 |
! ! |
|
9173 |
||
1715 | 9174 |
!ImageEditor methodsFor:'user actions-loading'! |
400 | 9175 |
|
767 | 9176 |
doLoadFromClass |
9177 |
"opens a dialog for loading an image from class and a (resource-) selector" |
|
400 | 9178 |
|
1122 | 9179 |
|img| |
9180 |
||
1975 | 9181 |
self checkModified ifFalse:[ ^ self ]. |
9182 |
||
1054 | 9183 |
(imageEditView loadFromClass) notNil ifTrue:[ |
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
9184 |
imageSeqNr := nil. |
1122 | 9185 |
(img := self image) notNil ifTrue: [ |
1900 | 9186 |
self updateColorsFromImage:img. |
574 | 9187 |
self findColorMapMode. |
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
9188 |
self updateLabelsAndHistory. |
1054 | 9189 |
] ifFalse: [ |
9190 |
self updateForNoImage |
|
1376
ce3cf26e201e
change & updates fixed (monochrome bitmaps)
Claus Gittinger <cg@exept.de>
parents:
1353
diff
changeset
|
9191 |
]. |
449 | 9192 |
] |
400 | 9193 |
! |
9194 |
||
767 | 9195 |
doLoadFromFile |
9196 |
"opens a dialog for loading an image from a file" |
|
400 | 9197 |
|
2820 | 9198 |
|img file filters title| |
1353 | 9199 |
|
1975 | 9200 |
self checkModified ifFalse:[ ^ self ]. |
9201 |
||
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
9202 |
imageSeqNr := nil. |
1353 | 9203 |
img := self image. |
9204 |
img notNil ifTrue: [ |
|
9205 |
file := img fileName |
|
9206 |
]. |
|
9207 |
||
3405 | 9208 |
title := (resources string:'Load Image from File:'). |
2820 | 9209 |
|
3066
a8e197ceebed
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
3050
diff
changeset
|
9210 |
(UserPreferences current useNativeFileDialog |
3100 | 9211 |
and:[Screen current isWindowsPlatform]) ifTrue:[ |
2820 | 9212 |
self withWaitCursorDo:[ |
3623 | 9213 |
file isNil ifTrue:[ |
9214 |
file := LastDirectory. |
|
9215 |
file notNil ifTrue:[ |
|
9216 |
file := file asFilename / 'image.png'. |
|
9217 |
]. |
|
9218 |
]. |
|
9219 |
||
3066
a8e197ceebed
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
3050
diff
changeset
|
9220 |
file := Screen current |
3623 | 9221 |
nativeFileDialogWithTitle:title |
9222 |
defaultFilename:file |
|
9223 |
owningTopView:self window topView |
|
9224 |
filter:{ |
|
9225 |
{(resources string:'Image Files'). '*.tif;*.png;*.gif;*.bmp;*.jpg'}. |
|
9226 |
{(resources string:'All Files'). '*.*'} |
|
9227 |
} |
|
9228 |
filterIndex:nil |
|
3624 | 9229 |
trueForSave:false |
3625 | 9230 |
trueForMultiSelect:false |
3624 | 9231 |
trueForPromptOverwrite:false. |
2820 | 9232 |
]. |
9233 |
] ifFalse:[ |
|
9234 |
filters := FileSelectionBrowser loadImageFileNameFilters. |
|
9235 |
file notNil ifTrue:[ |
|
9236 |
file := FileSelectionBrowser |
|
9237 |
request:title |
|
9238 |
fileName:file |
|
9239 |
withFileFilters:filters. |
|
9240 |
] ifFalse:[ |
|
9241 |
file := FileSelectionBrowser |
|
9242 |
request:title |
|
9243 |
inDirectory:LastDirectory |
|
9244 |
withFileFilters:filters. |
|
9245 |
]. |
|
1353 | 9246 |
]. |
2820 | 9247 |
|
1353 | 9248 |
file notNil ifTrue:[ |
9249 |
LastDirectory := file asFilename directoryName. |
|
9250 |
self loadFromFile:file |
|
9251 |
] |
|
2820 | 9252 |
|
3405 | 9253 |
"Modified: / 16-02-2017 / 10:53:41 / cg" |
3625 | 9254 |
"Modified: / 25-10-2018 / 10:55:54 / sr" |
400 | 9255 |
! |
9256 |
||
2796 | 9257 |
doLoadFromURL |
9258 |
"opens a dialog for loading an image from a URL" |
|
9259 |
||
2866 | 9260 |
|tempFile url response| |
2796 | 9261 |
|
9262 |
self checkModified ifFalse:[ ^ self ]. |
|
9263 |
||
9264 |
url := Dialog |
|
3405 | 9265 |
request:(resources string:'Load Image from URL:') |
2796 | 9266 |
initialAnswer:LastURL. |
9267 |
||
9268 |
url notEmptyOrNil ifTrue:[ |
|
3050 | 9269 |
HTTPInterface isNil ifTrue:[ Smalltalk loadPackage:'stx:goodies/communication']. |
9270 |
||
2796 | 9271 |
LastURL := url. |
3027 | 9272 |
tempFile := FileStream newTemporary close fileName. |
2866 | 9273 |
self withWaitCursorDo:[ |
3492 | 9274 |
|newURL| |
9275 |
||
2866 | 9276 |
response := HTTPInterface get:url destinationFile:tempFile. |
3492 | 9277 |
response isMovedResponse ifTrue:[ |
9278 |
newURL := response location. |
|
9279 |
newURL ~= url ifTrue:[ |
|
9280 |
response := HTTPInterface get:newURL destinationFile:tempFile. |
|
9281 |
]. |
|
9282 |
]. |
|
2866 | 9283 |
]. |
9284 |
response isErrorResponse ifTrue:[ |
|
9285 |
Dialog warn:(resources string:'Could not load image ("%1")' with:response responseText). |
|
9286 |
] ifFalse:[ |
|
9287 |
self loadFromFile:tempFile. |
|
9288 |
]. |
|
3552 | 9289 |
tempFile remove |
2796 | 9290 |
] |
9291 |
||
9292 |
"Created: / 20-09-2010 / 11:30:59 / cg" |
|
3492 | 9293 |
"Modified: / 13-09-2017 / 17:00:28 / cg" |
2796 | 9294 |
! |
9295 |
||
767 | 9296 |
doNewImage |
9297 |
"opens a dialog with choices of size and color map for creating a new image" |
|
400 | 9298 |
|
3494 | 9299 |
|dialogAspects width height cMapString cMapMode cMap imageClass image szString defaultSize ext depth| |
1975 | 9300 |
|
9301 |
self checkModified ifFalse:[ ^ self ]. |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9302 |
|
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9303 |
defaultSize := (self class listOfDefaultSizes includes:'32x32') |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9304 |
ifTrue:['32x32'] |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9305 |
ifFalse:[self class listOfDefaultSizes first]. |
767 | 9306 |
|
1975 | 9307 |
dialogAspects := IdentityDictionary new |
767 | 9308 |
at:#listOfSizes put: self class listOfDefaultSizes asValue; |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9309 |
at:#listOfColorMaps put: self class namesOfColorMaps values asSortedCollection asValue; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9310 |
at:#selectionOfSize put: (LastSizeString ? defaultSize) asValue; |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9311 |
at:#selectionOfColorMap put: (LastColormapMode ? self class namesOfColorMaps values asSortedCollection first) asValue; |
400 | 9312 |
yourself. |
9313 |
||
1975 | 9314 |
(self openDialogInterface:#dialogSpecForNewImage withBindings:dialogAspects) |
1383 | 9315 |
ifTrue:[ |
1975 | 9316 |
szString := (dialogAspects at:#selectionOfSize) value. |
1960 | 9317 |
ext := self pointFromString:szString. |
1962 | 9318 |
ext isNil ifTrue:[ |
9319 |
width := height := 32 |
|
9320 |
] ifFalse:[ |
|
9321 |
width := ext x. |
|
9322 |
height := ext y. |
|
9323 |
]. |
|
1960 | 9324 |
"/ width := "128 min: "(Integer readFromString: (szString upTo: $x) onError:[32]). |
9325 |
"/ height := "128 min: " (Integer readFromString: (szString copy reverse upTo: $x) reverse onError:[32]). |
|
400 | 9326 |
|
1975 | 9327 |
cMapString := (dialogAspects at:#selectionOfColorMap) value. |
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9328 |
cMapMode := self class namesOfColorMaps keyAtEqualValue:cMapString. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9329 |
cMap := self class listOfColorMaps at:cMapMode. |
3494 | 9330 |
depth := (cMapMode startsWith:'depth') |
9331 |
ifTrue:[ Integer readFrom:(cMapMode copyFrom:'depth' size + 1) ] |
|
9332 |
ifFalse:[ |
|
9333 |
(cMapMode startsWith:'masked') |
|
9334 |
ifTrue:[ Integer readFrom:(cMapMode copyFrom:'masked' size + 1) ] |
|
9335 |
ifFalse:[ cMap size highBit-1 ]]. |
|
9336 |
imageClass := Image implementorForDepth:depth. |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9337 |
image := imageClass width: width height: height. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9338 |
image bits:(ByteArray new:(image bytesPerRow*height)). |
400 | 9339 |
|
1637 | 9340 |
LastSizeString := szString. |
9341 |
LastColormapMode := cMapString. |
|
9342 |
||
3494 | 9343 |
(cMapMode startsWith:'mask') ifTrue:[ |
3125
9d5624af77ab
Sending of Image>>#clearMaskedPixels moved to Image >> #asFormOnDevice:
Stefan Vogel <sv@exept.de>
parents:
3122
diff
changeset
|
9344 |
image mask: (ImageMask width: width height: height depth: 1 fromArray: (ByteArray new: width*height)). |
400 | 9345 |
]. |
3494 | 9346 |
depth == 32 ifTrue:[ |
9347 |
image photometric:#rgba |
|
9348 |
] ifFalse:[ |
|
9349 |
image colorMap: cMap. |
|
9350 |
]. |
|
1847
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9351 |
(imageEditView image: image) notNil ifTrue:[ |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9352 |
self updateListOfColorsAndColormapMode. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9353 |
self updateLabelsAndHistory. |
d7e8ec4f3696
partial support for depth>8 images;
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9354 |
]. |
400 | 9355 |
image fillRectangleX:0 y:0 width:width height:height with:Color white. |
767 | 9356 |
] |
3494 | 9357 |
|
9358 |
"Modified: / 13-09-2017 / 23:57:52 / cg" |
|
929 | 9359 |
! |
9360 |
||
2058 | 9361 |
doNewImageEditor |
9362 |
"opens a new image editor" |
|
9363 |
||
9364 |
ImageEditor open |
|
9365 |
||
9366 |
"Created: / 17-08-2006 / 09:03:14 / cg" |
|
9367 |
! |
|
9368 |
||
1682 | 9369 |
doNewImageFromClipboard |
9370 |
|image| |
|
9371 |
||
1975 | 9372 |
self checkModified ifFalse:[ ^ self ]. |
9373 |
||
3496 | 9374 |
image := imageEditView clipBoardImage. |
3164 | 9375 |
image isImageOrForm ifFalse:[ |
9376 |
image := Image readFrom:(image asString) onError:nil. |
|
9377 |
image isNil ifTrue:[ |
|
9378 |
Dialog warn:'Clipboard does not contain an image I can use/understand'. |
|
9379 |
^ self. |
|
9380 |
]. |
|
9381 |
]. |
|
3496 | 9382 |
|
1975 | 9383 |
imageEditView image:image. |
9384 |
||
9385 |
image notNil ifTrue:[ |
|
1900 | 9386 |
self updateColorsFromImage:image. |
1682 | 9387 |
self findColorMapMode. |
9388 |
self updateLabelsAndHistory. |
|
9389 |
] |
|
3496 | 9390 |
|
9391 |
"Modified (format): / 08-10-2017 / 08:58:03 / cg" |
|
1682 | 9392 |
! |
9393 |
||
3200 | 9394 |
doNewMaskFromClipboard |
9395 |
|mask image newImage| |
|
9396 |
||
9397 |
self checkModified ifFalse:[ ^ self ]. |
|
9398 |
||
3496 | 9399 |
mask := imageEditView clipBoardImage. |
3200 | 9400 |
mask isImageOrForm ifFalse:[ |
9401 |
mask := Image readFrom:(mask asString) onError:nil. |
|
9402 |
mask isNil ifTrue:[ |
|
9403 |
Dialog warn:'Clipboard does not contain an image I can use/understand'. |
|
9404 |
^ self. |
|
9405 |
]. |
|
9406 |
]. |
|
3496 | 9407 |
|
3200 | 9408 |
(image:= imageEditView image) isNil ifTrue:[ |
9409 |
image := mask. |
|
9410 |
]. |
|
9411 |
mask extent ~= image extent ifTrue:[ |
|
9412 |
mask := imageEditView resizedImage:mask to:image extent. |
|
9413 |
]. |
|
9414 |
newImage := image copy. |
|
9415 |
newImage mask:mask. |
|
9416 |
imageEditView newImageWithUndo:newImage. |
|
9417 |
self updateAfterImageChange. |
|
3405 | 9418 |
|
3496 | 9419 |
"Modified (format): / 08-10-2017 / 08:57:58 / cg" |
3200 | 9420 |
! |
9421 |
||
3422 | 9422 |
grabFullScreenImage |
9423 |
"grab all for editing" |
|
9424 |
||
9425 |
self grabScreenImageUsing:[ |
|
9426 |
Image fromScreen |
|
9427 |
]. |
|
9428 |
||
9429 |
"Created: / 25-02-2017 / 12:41:29 / cg" |
|
9430 |
! |
|
9431 |
||
929 | 9432 |
grabScreenImage |
3422 | 9433 |
"let user choose an area and grab that area for editing" |
929 | 9434 |
|
2707
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
9435 |
self grabScreenImageUsing:[ |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
9436 |
|r| |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
9437 |
|
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
9438 |
[Screen current leftButtonPressed] whileTrue:[Delay waitForSeconds:0.05]. |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
9439 |
r := Rectangle fromUser. |
2708 | 9440 |
(r width == 0 or:[r height == 0]) ifTrue:[ |
9441 |
nil |
|
9442 |
] ifFalse:[ |
|
9443 |
lastGrabbedScreenArea := r. |
|
9444 |
Image fromScreen:r |
|
9445 |
] |
|
2707
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
9446 |
]. |
3422 | 9447 |
|
9448 |
"Modified (comment): / 25-02-2017 / 12:41:00 / cg" |
|
2707
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
9449 |
! |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
9450 |
|
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
9451 |
grabScreenImageFromLastArea |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
9452 |
"grab again from the previous area for editing" |
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
9453 |
|
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
9454 |
self grabScreenImageUsing:[ |
2708 | 9455 |
Image fromScreen:lastGrabbedScreenArea |
2707
6610854318eb
remember last grabbed screen area
Claus Gittinger <cg@exept.de>
parents:
2704
diff
changeset
|
9456 |
]. |
2701
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
9457 |
! |
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
9458 |
|
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
9459 |
grabScreenImageUsing:aBlock |
3422 | 9460 |
"let user choose an area and grab that area for editing" |
2701
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
9461 |
|
1975 | 9462 |
self checkModified ifFalse:[ ^ self ]. |
9463 |
||
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
9464 |
Processor |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
9465 |
addTimedBlock:[ |
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
9466 |
|image d8image img| |
929 | 9467 |
|
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
9468 |
imageSeqNr := nil. |
2701
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
9469 |
image := aBlock value. |
2708 | 9470 |
image notNil ifTrue:[ |
1121 | 9471 |
image depth > 8 ifTrue:[ |
2420
14678b9fea60
grabScreenImage - do not convert to 8bit; leave as is initially
Claus Gittinger <cg@exept.de>
parents:
2375
diff
changeset
|
9472 |
false ifTrue:[ |
1687
f4543a556b89
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
1682
diff
changeset
|
9473 |
Error handle:[:ex | |sig| |
2996 | 9474 |
(sig := ex creator) == HaltInterrupt ifTrue:[ex reject]. |
1122 | 9475 |
sig == Signal noHandlerSignal ifTrue:[ex reject]. |
1121 | 9476 |
|
9477 |
self warn:'Could not convert to depth8 image (too many colors)'. |
|
9478 |
d8image := nil. |
|
9479 |
] do:[ |
|
2420
14678b9fea60
grabScreenImage - do not convert to 8bit; leave as is initially
Claus Gittinger <cg@exept.de>
parents:
2375
diff
changeset
|
9480 |
d8image := Depth8Image fromImage:image photometric:#palette. |
1121 | 9481 |
]. |
9482 |
d8image notNil ifTrue:[ |
|
9483 |
image := d8image |
|
9484 |
] |
|
2420
14678b9fea60
grabScreenImage - do not convert to 8bit; leave as is initially
Claus Gittinger <cg@exept.de>
parents:
2375
diff
changeset
|
9485 |
]. |
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
9486 |
]. |
1121 | 9487 |
(imageEditView image:image) notNil ifTrue:[ |
9488 |
self listOfColors contents:(image colorMap). |
|
9489 |
self findColorMapMode. |
|
9490 |
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
|
9491 |
] |
1121 | 9492 |
] |
9493 |
] |
|
990
4303f0064410
delay a second before grabbing screen image (to allow for redraws to happen)
Claus Gittinger <cg@exept.de>
parents:
986
diff
changeset
|
9494 |
afterSeconds:1 |
929 | 9495 |
|
3422 | 9496 |
"Created: / 29-07-1998 / 21:24:42 / cg" |
9497 |
"Modified: / 16-11-2001 / 16:21:19 / cg" |
|
9498 |
"Modified (comment): / 25-02-2017 / 12:41:06 / cg" |
|
1380
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
9499 |
! |
9787c42843c2
allow display and extract from image sequences (gif anims)
Claus Gittinger <cg@exept.de>
parents:
1377
diff
changeset
|
9500 |
|
2701
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
9501 |
grabWindowImage |
3422 | 9502 |
"let user choose a window and grab its area for editing" |
2701
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
9503 |
|
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
9504 |
self grabScreenImageUsing:[ |
3188 | 9505 |
|v topView| |
2701
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
9506 |
|
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
9507 |
(v := Screen current viewFromUser) notNil ifTrue:[ |
3188 | 9508 |
topView := v topView. |
9509 |
topView raise; makeFullyVisible. |
|
2704 | 9510 |
Delay waitForSeconds:0.5. "/ give view a chance to redraw itself. |
3188 | 9511 |
Image fromView:topView |
2701
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
9512 |
]. |
5abe05ebb370
added: grabWindowImage (menu)
Claus Gittinger <cg@exept.de>
parents:
2663
diff
changeset
|
9513 |
]. |
3422 | 9514 |
|
9515 |
"Modified (comment): / 25-02-2017 / 12:41:20 / cg" |
|
400 | 9516 |
! ! |
9517 |
||
1715 | 9518 |
!ImageEditor methodsFor:'user actions-saving'! |
400 | 9519 |
|
767 | 9520 |
doPrint |
9521 |
"prints current image on the current printer" |
|
400 | 9522 |
|
1734 | 9523 |
self withWaitCursorDo:[ |
9524 |
imageEditView print |
|
9525 |
] |
|
400 | 9526 |
! |
9527 |
||
1613 | 9528 |
doSaveButtonImageToFileAs |
3375 | 9529 |
"opens a dialog for saving current image to a file. |
9530 |
Saved as a button image (i.e. with a frame around)" |
|
1613 | 9531 |
|
9532 |
imageEditView saveButtonImageToFileAs. |
|
9533 |
self updateLabelsAndHistory. |
|
9534 |
! |
|
9535 |
||
767 | 9536 |
doSaveImageFile |
9537 |
"saves current image to current file" |
|
400 | 9538 |
|
1481 | 9539 |
imageEditView save. |
3379 | 9540 |
self clearModifiedAndRememberImageSaved. |
400 | 9541 |
! |
9542 |
||
767 | 9543 |
doSaveImageFileAs |
1922 | 9544 |
"opens a dialog for saving an image to a file" |
9545 |
||
9546 |
|img file filters| |
|
9547 |
||
9548 |
img := self image. |
|
9549 |
img notNil ifTrue: [ |
|
9550 |
file := img fileName |
|
9551 |
]. |
|
3426 | 9552 |
|
2595 | 9553 |
filters := FileSelectionBrowser saveImageFileNameFilters. |
1922 | 9554 |
|
3066
a8e197ceebed
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
3050
diff
changeset
|
9555 |
(UserPreferences current useNativeFileDialog |
3100 | 9556 |
and:[Screen current isWindowsPlatform]) ifTrue:[ |
2820 | 9557 |
self withWaitCursorDo:[ |
3623 | 9558 |
file isNil ifTrue:[ |
9559 |
file := LastDirectory. |
|
9560 |
file notNil ifTrue:[ |
|
9561 |
file := file asFilename / 'image.png'. |
|
9562 |
]. |
|
9563 |
]. |
|
9564 |
||
3066
a8e197ceebed
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
3050
diff
changeset
|
9565 |
file := Screen current |
3623 | 9566 |
nativeFileDialogWithTitle:(resources string:'Save Image in File') |
9567 |
defaultFilename:file |
|
9568 |
owningTopView:self window topView |
|
9569 |
filter:{ |
|
9570 |
{(resources string:'Image Files'). '*.tif;*.png;*.gif;*.bmp'}. |
|
9571 |
{(resources string:'All Files'). '*.*'} |
|
9572 |
} |
|
9573 |
filterIndex:nil |
|
3625 | 9574 |
trueForSave:true |
9575 |
trueForMultiSelect:false |
|
3624 | 9576 |
trueForPromptOverwrite:true. |
2807 | 9577 |
]. |
3425 | 9578 |
] ifFalse:[ |
9579 |
img fileName isNil ifTrue:[ |
|
9580 |
LastDirectory notNil ifTrue:[ |
|
3426 | 9581 |
file isNil ifTrue:[ |
9582 |
file := 'image.png'. |
|
9583 |
]. |
|
3425 | 9584 |
file := LastDirectory asFilename construct:(file asFilename baseName). |
9585 |
]. |
|
9586 |
]. |
|
2820 | 9587 |
(FileSelectionBrowser isNil or:[DirectoryView isNil]) ifTrue:[ |
9588 |
file notNil ifTrue:[ |
|
9589 |
file := Dialog requestFileName:'Save Image To' |
|
9590 |
default:file |
|
9591 |
pattern:(filters first). |
|
9592 |
] ifFalse:[ |
|
9593 |
file := Dialog |
|
9594 |
requestFileName:'Save Image To' |
|
9595 |
default:'image.png' |
|
9596 |
pattern:(filters first) |
|
9597 |
fromDirectory:LastDirectory. |
|
9598 |
]. |
|
2807 | 9599 |
] ifFalse:[ |
2820 | 9600 |
file notNil ifTrue:[ |
9601 |
file := FileSelectionBrowser |
|
9602 |
request:'Save Image To' |
|
9603 |
fileName:file |
|
9604 |
withFileFilters:filters. |
|
9605 |
] ifFalse:[ |
|
9606 |
file := FileSelectionBrowser |
|
3405 | 9607 |
request:'Save Image in File:' |
2820 | 9608 |
inDirectory:LastDirectory |
9609 |
withFileFilters:filters. |
|
9610 |
]. |
|
2807 | 9611 |
]. |
1922 | 9612 |
]. |
9613 |
file notNil ifTrue:[ |
|
9614 |
imageEditView saveImageFileAs:file. |
|
9615 |
LastDirectory := file asFilename directoryName. |
|
9616 |
self updateLabelsAndHistory. |
|
3379 | 9617 |
self clearModifiedAndRememberImageSavedAsFile:file. |
1922 | 9618 |
] |
2807 | 9619 |
|
3426 | 9620 |
"Modified: / 27-02-2017 / 01:26:05 / cg" |
3625 | 9621 |
"Modified: / 25-10-2018 / 10:56:01 / sr" |
400 | 9622 |
! |
9623 |
||
767 | 9624 |
doSaveImageMaskFileAs |
9625 |
"opens a dialog for saving mask of current image to a file" |
|
400 | 9626 |
|
1481 | 9627 |
imageEditView saveImageMaskFileAs. |
400 | 9628 |
! |
9629 |
||
767 | 9630 |
doSaveMethod |
1975 | 9631 |
"saves the image in current class and selector" |
9632 |
||
9633 |
imageEditView saveMethod ifTrue:[ |
|
2006
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
9634 |
self updateLabelsAndHistory. |
3379 | 9635 |
self clearModifiedAndRememberImageSaved. |
400 | 9636 |
] |
9637 |
! |
|
9638 |
||
767 | 9639 |
doSaveMethodAs |
9640 |
"opens a dialog for saving current image on a class and a selector" |
|
400 | 9641 |
|
1975 | 9642 |
imageEditView saveMethodAs ifTrue:[ |
2006
ae6fe65e9f33
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
1998
diff
changeset
|
9643 |
self updateLabelsAndHistory. |
3379 | 9644 |
self clearModifiedAndRememberImageSaved. |
400 | 9645 |
] |
1309
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
9646 |
! |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
9647 |
|
3022 | 9648 |
doShowPixelArrayLiteralString |
9649 |
"opens a dialog showing a literal array-like storeString |
|
9650 |
(sometimes useful to embed an image into source code)" |
|
9651 |
||
9652 |
|img| |
|
9653 |
||
9654 |
img := imageEditView image. |
|
9655 |
TextBox openOn:img bits storeString |
|
9656 |
! |
|
9657 |
||
1309
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
9658 |
doShowStoreString |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
9659 |
"opens a dialog showing the storeString |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
9660 |
(sometimes useful to embed an image into source code)" |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
9661 |
|
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
9662 |
|img| |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
9663 |
|
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
9664 |
img := imageEditView image. |
0a45ef81b47e
added showStoreString menu function
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
9665 |
TextBox openOn:img storeString |
1975 | 9666 |
! |
9667 |
||
9668 |
save |
|
9669 |
"saves current image on current class and selector" |
|
9670 |
||
9671 |
self doSaveMethod |
|
400 | 9672 |
! ! |
9673 |
||
1715 | 9674 |
!ImageEditor methodsFor:'user actions-settings'! |
1353 | 9675 |
|
9676 |
doChangeGridMagnification |
|
9677 |
"change grid magnification" |
|
9678 |
||
9679 |
|box oldGridLimit newGridLimit| |
|
9680 |
||
9681 |
oldGridLimit := imageEditView class gridMagnificationLimit asPoint. |
|
9682 |
||
9683 |
box := EnterBox new. |
|
9684 |
box title:(resources string:'Grid Magnification Limit:'). |
|
9685 |
box okText:(resources string:'OK'). |
|
9686 |
box abortText:(resources string:'Cancel'). |
|
9687 |
box initialText:(oldGridLimit x printString). |
|
9688 |
box showAtPointer. |
|
9689 |
||
9690 |
(box accepted |
|
9691 |
and: [(newGridLimit := Number readFromString:(box contents) onError:[2]) notNil] |
|
9692 |
) ifTrue:[ |
|
9693 |
newGridLimit := (99 min: (2 max:newGridLimit)) asPoint. |
|
9694 |
imageEditView class gridMagnificationLimit:newGridLimit. |
|
9695 |
imageEditView invalidate |
|
9696 |
] |
|
9697 |
||
2192 | 9698 |
! |
9699 |
||
9700 |
penWidth:n |
|
9701 |
imageEditView penWidth:n |
|
9702 |
||
9703 |
"Created: / 01-11-2007 / 23:47:48 / cg" |
|
2375 | 9704 |
! |
9705 |
||
2881 | 9706 |
penWidthHolderChanged |
9707 |
imageEditView penWidth:(self penWidthHolder value) |
|
9708 |
||
9709 |
"Created: / 15-02-2012 / 22:32:00 / cg" |
|
9710 |
! |
|
9711 |
||
2375 | 9712 |
spraySpot:n |
9713 |
imageEditView spraySpot:n |
|
9714 |
||
9715 |
"Created: / 01-11-2007 / 23:47:48 / cg" |
|
2881 | 9716 |
! |
9717 |
||
9718 |
spraySpotHolderChanged |
|
9719 |
imageEditView spraySpot:(self spraySpotHolder value) |
|
9720 |
||
9721 |
"Created: / 15-02-2012 / 22:37:08 / cg" |
|
1353 | 9722 |
! ! |
9723 |
||
400 | 9724 |
!ImageEditor class methodsFor:'documentation'! |
9725 |
||
9726 |
version |
|
9727 |
^ '$Header$' |
|
2590 | 9728 |
! |
9729 |
||
9730 |
version_CVS |
|
9731 |
^ '$Header$' |
|
400 | 9732 |
! ! |
2945 | 9733 |