# HG changeset patch # User Claus Gittinger # Date 1539257290 -7200 # Node ID 76dd8e2f2fd8e3f44b8e25e64f234cce3299e189 # Parent 755b9b3a06b8fb28c9defe1417b60037910e2df2 #FEATURE by cg class: ImageEditor added: #exchangeGreenBlueChannels #exchangeRedBlueChannels #exchangeRedGreenChannels comment/format in: #hasColormap class: ImageEditor class changed: #menuColors diff -r 755b9b3a06b8 -r 76dd8e2f2fd8 ImageEditor.st --- a/ImageEditor.st Wed Oct 10 20:56:51 2018 +0200 +++ b/ImageEditor.st Thu Oct 11 13:28:10 2018 +0200 @@ -1,3 +1,5 @@ +"{ Encoding: utf8 }" + " COPYRIGHT (c) 1997-1998 by eXept Software AG All Rights Reserved @@ -3176,7 +3178,18 @@ (MenuItem label: 'Invert Pixel Bits' itemValue: makeInvertedBits - isVisible: hasColormap + ) + (MenuItem + label: 'Exchange Red-Green' + itemValue: exchangeRedGreenChannels + ) + (MenuItem + label: 'Exchange Red-Blue' + itemValue: exchangeRedBlueChannels + ) + (MenuItem + label: 'Exchange Green-Blue' + itemValue: exchangeGreenBlueChannels ) (MenuItem label: '-' @@ -3304,8 +3317,6 @@ nil nil ) - - "Modified: / 23-10-2017 / 11:18:58 / cg" ! menuEdit @@ -4947,7 +4958,9 @@ |img| ^ (img := self image) notNil - and:[img colorMap notNil or:[ drawingColormap notNil or:[ self listOfColors notEmptyOrNil ]]] + and:[img colorMap notNil + or:[ drawingColormap notNil + or:[ self listOfColors notEmptyOrNil ]]] "Created: / 30-09-1998 / 23:53:55 / cg" "Modified: / 23-02-2017 / 09:57:45 / cg" @@ -5823,8 +5836,8 @@ resourceSelector notNil ifTrue:[ ^ resources string:(self modified - ifTrue:['ImageEditor (modified): %1 » %2'] - ifFalse:['ImageEditor: %1 » %2']) + ifTrue:['ImageEditor (modified): %1 » %2'] + ifFalse:['ImageEditor: %1 » %2']) with:resourceClass name with:resourceSelector ]. @@ -5857,8 +5870,8 @@ resourceSelector notNil ifTrue:[ ^ resources string:(self modified - ifTrue:['Image (modified) from: %1 » %2'] - ifFalse:['Image from: %1 » %2']) + ifTrue:['Image (modified) from: %1 » %2'] + ifFalse:['Image from: %1 » %2']) with:resourceClass name with:resourceSelector ]. @@ -9049,6 +9062,24 @@ "Modified: / 30-08-2017 / 02:13:03 / cg" ! +exchangeGreenBlueChannels + self updateImageAfterDoing:#exchangeGreenBlueChannels. + + "Created: / 31-08-2017 / 13:51:10 / cg" +! + +exchangeRedBlueChannels + self updateImageAfterDoing:#exchangeRedBlueChannels. + + "Created: / 31-08-2017 / 13:51:10 / cg" +! + +exchangeRedGreenChannels + self updateImageAfterDoing:#exchangeRedGreenChannels. + + "Created: / 31-08-2017 / 13:51:10 / cg" +! + makeInvertedBits "inverts the pixels - for palettes, this leads to funny results. For others, this is the same as negating"