equal
deleted
inserted
replaced
769 #label: 'Rotate...' |
769 #label: 'Rotate...' |
770 #translateLabel: true |
770 #translateLabel: true |
771 #value: #doRotateImage |
771 #value: #doRotateImage |
772 #activeHelpKey: #editRotate |
772 #activeHelpKey: #editRotate |
773 ) |
773 ) |
774 #(#MenuItem |
|
775 #label: '-' |
|
776 ) |
|
777 #(#MenuItem |
|
778 #label: 'Negative' |
|
779 #translateLabel: true |
|
780 #value: #doNegativeImage |
|
781 #activeHelpKey: #editNegate |
|
782 ) |
|
783 ) nil |
774 ) nil |
784 nil |
775 nil |
785 ) |
776 ) |
786 ) |
777 ) |
787 #(#MenuItem |
778 #(#MenuItem |
886 #submenuChannel: #menuHelp |
877 #submenuChannel: #menuHelp |
887 ) |
878 ) |
888 ) nil |
879 ) nil |
889 nil |
880 nil |
890 ) |
881 ) |
891 |
|
892 "Modified: / 20.5.1998 / 04:07:41 / cg" |
|
893 ! |
882 ! |
894 |
883 |
895 menuMouseButtonColors |
884 menuMouseButtonColors |
896 "This resource specification was automatically generated |
885 "This resource specification was automatically generated |
897 by the MenuEditor of ST/X." |
886 by the MenuEditor of ST/X." |
1294 colorMapMode: aMode value: aValue |
1283 colorMapMode: aMode value: aValue |
1295 "calculates a new color map for the image from aMode" |
1284 "calculates a new color map for the image from aMode" |
1296 |
1285 |
1297 |depth newColorMap newImage image newColors realColorMap oldFileName| |
1286 |depth newColorMap newImage image newColors realColorMap oldFileName| |
1298 |
1287 |
|
1288 self imageEditView makeUndo. |
|
1289 |
1299 newColorMap := self class listOfColorMaps at: aMode. |
1290 newColorMap := self class listOfColorMaps at: aMode. |
1300 depth := (newColorMap size log: 2) asInteger. |
1291 depth := (newColorMap size log: 2) asInteger. |
1301 newImage := (Image implementorForDepth: depth) new. |
1292 newImage := (Image implementorForDepth: depth) new. |
1302 oldFileName := self image fileName. |
1293 oldFileName := self image fileName. |
|
1294 |
1303 Object errorSignal handle: |
1295 Object errorSignal handle: |
1304 [:ex| |
1296 [:ex| |
1305 Object errorSignal handle: |
1297 Object errorSignal handle: |
1306 [:ex| |
1298 [:ex| |
1307 ^self warn: 'Convertation failed!!' |
1299 ^self warn: 'Convertation failed!!' |
1319 ] |
1311 ] |
1320 do: |
1312 do: |
1321 [ |
1313 [ |
1322 image := newImage fromImage: self image |
1314 image := newImage fromImage: self image |
1323 ]. |
1315 ]. |
|
1316 |
1324 (String fromString: aMode) reverse readStream nextWord reverse = 'mask' |
1317 (String fromString: aMode) reverse readStream nextWord reverse = 'mask' |
1325 ifTrue: |
1318 ifTrue: |
1326 [ |
1319 [ |
1327 image mask isNil |
1320 image mask isNil |
1328 ifTrue: |
1321 ifTrue: |
1345 ((newColors size < newColorMap size) and: [(newColors includes: clr) not]) |
1338 ((newColors size < newColorMap size) and: [(newColors includes: clr) not]) |
1346 ifTrue: |
1339 ifTrue: |
1347 [ |
1340 [ |
1348 newColors add: clr |
1341 newColors add: clr |
1349 ] |
1342 ] |
1350 ]. |
1343 ]. |
1351 image colorMap: newColors. |
1344 image colorMap: newColors. |
1352 colorMapMode := aMode. |
1345 colorMapMode := aMode. |
1353 (self imageEditView image: image) notNil |
1346 (self imageEditView image: image) notNil |
1354 ifTrue: |
1347 ifTrue: |
1355 [ |
1348 [ |
1356 self image fileName: oldFileName. |
1349 self image fileName: oldFileName. |
1357 self listOfColors contents: image colorMap. |
1350 self listOfColors contents: image colorMap. |
1505 doNegativeImage |
1498 doNegativeImage |
1506 "negates current image by negating the color map" |
1499 "negates current image by negating the color map" |
1507 |
1500 |
1508 self imageEditView negativeImage. |
1501 self imageEditView negativeImage. |
1509 self listOfColors removeAll. |
1502 self listOfColors removeAll. |
1510 self findColorMapMode |
1503 self findColorMapMode. |
|
1504 self imageEditView undoImages removeLast |
1511 ! |
1505 ! |
1512 |
1506 |
1513 doResizeImage |
1507 doResizeImage |
1514 "resizes current image" |
1508 "resizes current image" |
1515 |
1509 |