#REFACTORING by cg
class: Image
added:
#virtualAntiAliasedAlongXvertical:horizontal:form:color:xRun:yRun:colorDictionary:blendStart:
#virtualAntiAliasedAlongYhorizontal:vertical:form:color:xRun:yRun:colorDictionary:blendStart:
removed:
#vitualAntiAliasedAlongXvertical:horizontal:form:color:xRun:yRun:colorDictionary:blendStart:
#vitualAntiAliasedAlongYhorizontal:vertical:form:color:xRun:yRun:colorDictionary:blendStart:
comment/format in:
#drawEllipse:withColor:
#drawEllipse:withValue:
#fillArc:radius:from:angle:withColor:
#fillEllipse:withColor:
#fillEllipse:withValue:
changed: #fillAntiAliasedArc:radius:from:angle:withColor:colorDictionary:blendStart: (send #virtualAntiAliasedAlongXvertical:horizontal:form:color:xRun:yRun:colorDictionary:blendStart: instead of #vitualAntiAliasedAlongXvertical:horizontal:form:color:xRun:yRun:colorDictionary:blendStart:, send #virtualAntiAliasedAlongYhorizontal:vertical:form:color:xRun:yRun:colorDictionary:blendStart: instead of #vitualAntiAliasedAlongYhorizontal:vertical:form:color:xRun:yRun:colorDictionary:blendStart:)
--- a/Image.st Thu Feb 16 19:14:19 2017 +0100
+++ b/Image.st Thu Feb 16 20:20:18 2017 +0100
@@ -9530,14 +9530,14 @@
self drawEllipse:aRectangle withValue:(self valueFromColor:aColor)
"
- |cm i|
-
- cm := Array with:Color white with:Color black with:Color red.
-
- i := Depth8Image extent:300@400 depth:8 palette:cm.
+ |i|
+
+ i := Depth8Image extent:300@400 depth:8 palette:{ Color white . Color black . Color red }.
i drawEllipse:(0@0 corner:80@100) withColor:Color red.
i inspect.
"
+
+ "Modified (comment): / 16-02-2017 / 20:14:31 / cg"
!
drawEllipse:aRectangle withValue:aPixelValueOrNil
@@ -9576,14 +9576,14 @@
self release. "/ device-image is no longer valid
"
- |cm i|
-
- cm := Array with:Color white with:Color black with:Color red.
-
- i := Depth8Image extent:300@400 depth:8 palette:cm.
+ |i|
+
+ i := Depth8Image extent:300@400 depth:8 palette:{ Color white . Color black . Color red }.
i drawEllipse:(0@0 corner:80@100) withColor:Color red.
i inspect.
"
+
+ "Modified: / 16-02-2017 / 20:19:18 / cg"
!
drawLineFrom:startPoint to:endPoint withColor:aColorOrPixelValue
@@ -9743,8 +9743,9 @@
!
fillAntiAliasedArc:origin radius:r from:startAngle angle:angle withColor:aColor colorDictionary:colorDictionary blendStart:blendStart
- "draw a circle with some pixel value.
- By using a tempForm, we assure that the same pixel algorithm is used as in a window"
+ "fill an antialiased circle with some pixel value.
+ By using a tempForm, we assure that the same pixel algorithm is used as in a window.
+ Compare the output of the example code at the end to the output from fillArc:radius:from:angle:withColor:"
|tempForm wI "{ Class: SmallInteger }"
hI "{ Class: SmallInteger }"
@@ -9769,8 +9770,8 @@
#(left right) do:[:aHorizontal |
#(top bottom) do:[:aVertical |
- self vitualAntiAliasedAlongXvertical:aVertical horizontal:aHorizontal form:tempImage color:aColor xRun:xRun yRun:yRun colorDictionary:colorDictionary blendStart:blendStart.
- self vitualAntiAliasedAlongYhorizontal:aHorizontal vertical:aVertical form:tempImage color:aColor xRun:xRun yRun:yRun colorDictionary:colorDictionary blendStart:blendStart.
+ self virtualAntiAliasedAlongXvertical:aVertical horizontal:aHorizontal form:tempImage color:aColor xRun:xRun yRun:yRun colorDictionary:colorDictionary blendStart:blendStart.
+ self virtualAntiAliasedAlongYhorizontal:aHorizontal vertical:aVertical form:tempImage color:aColor xRun:xRun yRun:yRun colorDictionary:colorDictionary blendStart:blendStart.
].
].
].
@@ -9782,11 +9783,9 @@
"
- |colorMap aaImgArray|
-
- colorMap := Array with:Color white with:Color black with:Color red with:Color blue.
-
- aaImgArray := Depth8Image extent:200@200 depth:8 antiAliasedPalette:colorMap bgColor:Color white.
+ |aaImgArray|
+
+ aaImgArray := Depth8Image extent:200@200 depth:8 antiAliasedPalette:{ Color white . Color black . Color red . Color blue} bgColor:Color white.
aaImgArray last fillAntiAliasedArc:105@95 radius:80 from:0 angle:90 withColor:Color red
colorDictionary:aaImgArray first
blendStart:aaImgArray second.
@@ -9796,10 +9795,12 @@
aaImgArray last inspect.
"
+
+ "Modified (comment): / 16-02-2017 / 20:12:59 / cg"
!
fillArc:origin radius:r from:startAngle angle:angle withColor:aColorOrIndex
- "draw a circle with some pixel value.
+ "fill a circle with some pixel value.
By using a tempForm, we assure that the same pixel algorithm is used as in a window"
|tempForm tempImage
@@ -9835,15 +9836,15 @@
self release. "/ device-image is no longer valid
"
- |cm i|
-
- cm := Array with:Color white with:Color black with:Color red with:Color blue.
-
- i := Depth8Image extent:200@200 depth:8 palette:cm.
+ |i|
+
+ i := Depth8Image extent:200@200 depth:8 palette:{ Color white . Color black . Color red . Color blue}.
i fillArc:105@95 radius:80 from:0 angle:90 withColor:Color red.
i fillArc:100@100 radius:80 from:90 angle:270 withColor:Color blue.
i inspect.
"
+
+ "Modified (comment): / 16-02-2017 / 20:12:37 / cg"
!
fillEllipse:aRectangle withColor:aColor
@@ -9853,14 +9854,14 @@
self fillEllipse:aRectangle withValue:(self valueFromColor:aColor)
"
- |cm i|
-
- cm := Array with:Color white with:Color black with:Color red.
-
- i := Depth8Image extent:100@100 depth:8 palette:cm.
+ |i|
+
+ i := Depth8Image extent:100@100 depth:8 palette:{ Color white . Color black . Color red }.
i fillEllipse:(0@0 corner:80@100) withColor:Color red.
i inspect.
"
+
+ "Modified (comment): / 16-02-2017 / 20:12:11 / cg"
!
fillEllipse:aRectangle withValue:aPixelValueOrNil
@@ -9899,14 +9900,14 @@
self release. "/ device-image is no longer valid
"
- |cm i|
-
- cm := Array with:Color white with:Color black with:Color red.
-
- i := Depth8Image extent:300@400 depth:8 palette:cm.
+ |i|
+
+ i := Depth8Image extent:300@400 depth:8 palette:{ Color white . Color black . Color red }.
i fillEllipse:(0@0 corner:80@100) withColor:Color red.
i inspect.
"
+
+ "Modified (comment): / 16-02-2017 / 20:11:56 / cg"
!
fillRectangle:aRectangle withColor:aColor
@@ -15096,7 +15097,7 @@
!Image methodsFor:'virtual anti-aliased'!
-vitualAntiAliasedAlongXvertical:bottomOrTop horizontal:leftOrRight form:tempForm color:aColor xRun:xRun yRun:yRun colorDictionary:colorDictionary blendStart:blendStart
+virtualAntiAliasedAlongXvertical:bottomOrTop horizontal:leftOrRight form:tempForm color:aColor xRun:xRun yRun:yRun colorDictionary:colorDictionary blendStart:blendStart
|isBottom isLeft additionalY workPoint startX endX pixels pixelPos percent distance nearestKey tmp|
isBottom := bottomOrTop sameAs:#bottom.
@@ -15165,9 +15166,11 @@
].
].
].
-!
-
-vitualAntiAliasedAlongYhorizontal:leftOrRight vertical:bottomOrTop form:tempForm color:aColor xRun:xRun yRun:yRun colorDictionary:colorDictionary blendStart:blendStart
+
+ "Created: / 16-02-2017 / 20:02:54 / cg"
+!
+
+virtualAntiAliasedAlongYhorizontal:leftOrRight vertical:bottomOrTop form:tempForm color:aColor xRun:xRun yRun:yRun colorDictionary:colorDictionary blendStart:blendStart
|isLeft isBottom additionalX workPoint startY endY pixels pixelPos percent distance nearestKey tmp|
isLeft := leftOrRight sameAs:#left.
@@ -15236,6 +15239,8 @@
].
].
].
+
+ "Created: / 16-02-2017 / 20:02:41 / cg"
! !
!Image class methodsFor:'documentation'!