#REFACTORING by cg draft
authorClaus Gittinger <cg@exept.de>
Thu, 24 Aug 2017 22:41:37 +0200
changeset 3464 9e3d52c9cca3
parent 3463 7f00ae87ae6c
child 3465 510f01b982de
#REFACTORING by cg class: ImageEditor comment/format in: #reduceNumberOfColors #reduceNumberOfColors2 class: ImageEditor class changed: #cropSubImageIcon #toolsMenuToolbar
ImageEditor.st
--- a/ImageEditor.st	Thu Aug 24 18:25:21 2017 +0200
+++ b/ImageEditor.st	Thu Aug 24 22:41:37 2017 +0200
@@ -722,7 +722,7 @@
         constantNamed:'ImageEditor class cropSubImageIcon'
         ifAbsentPut:[(Depth2Image width:14 height:14) bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@J**@@BUU @@%UX@@IUV@@BUU @@%UX@@J**@@@@@@@@@@@@@@@@@@b')
             colorMapFromArray:#[0 0 0 255 255 255 127 127 127 0 255 0]
-            mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'??2@AH@D OR_=I?4''?R_9K?$/>R?9K0D @S??@@a'); yourself); yourself]
+            mask:((ImageMask width:14 height:14) bits:(ByteArray fromPackedString:'??2@AH@D.@R?9K?$''>R_9I?$''?R_=HA4 @S??@@a'); yourself); yourself]
 !
 
 darkerIcon
@@ -4266,6 +4266,16 @@
             choiceValue: pasteUnder
           )
          (MenuItem
+            activeHelpKey: drawModeCropSubImage 
+            enabled: imageIsLoadedHolder
+            label: 'Crop SubImage'
+            translateLabel: true
+            isButton: true
+            labelImage: (ResourceRetriever ImageEditor cropSubImageIcon)
+            choice: editMode
+            choiceValue: cropSubImage
+          )
+         (MenuItem
             activeHelpKey: drawModeSpecial
             enabled: imageIsLoadedHolder
             label: 'Special'
@@ -4280,7 +4290,7 @@
         nil
       )
 
-    "Modified: / 22-02-2017 / 20:38:55 / cg"
+    "Modified: / 24-08-2017 / 20:53:02 / cg"
 ! !
 
 !ImageEditor class methodsFor:'tableColumns specs'!
@@ -7161,6 +7171,8 @@
 !
 
 reduceNumberOfColors
+    "reduce by masking off r/g/b bits"
+
     |s n anyChange img usedColors|
 
     s := Dialog request:'Number of color bits to strip (1-7) ?' initialAnswer:3.
@@ -7191,9 +7203,12 @@
     ].
 
     "Modified: / 29-10-2010 / 18:08:01 / cg"
+    "Modified (comment): / 24-08-2017 / 20:50:28 / cg"
 !
 
 reduceNumberOfColors2
+    "reduce by rounding r/g/b channel values"
+    
     |s rndR rndG rndB usedColors image newImage|
 
     s := Dialog request:'Rounding Interval red (2..) ?' initialAnswer:4.
@@ -7261,6 +7276,7 @@
     ].
 
     "Modified: / 24-08-2017 / 18:25:04 / cg"
+    "Modified (comment): / 24-08-2017 / 20:50:14 / cg"
 !
 
 selectColor:aColor