[squeak-dev] The Inbox: GraphicsTests-mt.60.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jul 14 14:15:13 UTC 2022


A new version of GraphicsTests was added to project The Inbox:
http://source.squeak.org/inbox/GraphicsTests-mt.60.mcz

==================== Summary ====================

Name: GraphicsTests-mt.60
Author: mt
Time: 8 June 2022, 2:51:46.704335 pm
UUID: 9f9183cf-e64b-424d-bd3e-292e80ad7c68
Ancestors: GraphicsTests-mt.59

Complements Graphics-mt.520.

=============== Diff against GraphicsTests-mt.59 ===============

Item was removed:
- SystemOrganization addCategory: #'GraphicsTests-Files'!
- SystemOrganization addCategory: #'GraphicsTests-Primitives'!
- SystemOrganization addCategory: #'GraphicsTests-Text'!

Item was removed:
- TestCase subclass: #BMPReadWriterTest
- 	instanceVariableNames: ''
- 	classVariableNames: ''
- 	poolDictionaries: ''
- 	category: 'GraphicsTests-Files'!

Item was removed:
- ----- Method: BMPReadWriterTest>>bmpData16bit (in category 'data') -----
- bmpData16bit
- 	"Created via:
- 		(Base64MimeConverter mimeEncode: 
- 			(FileStream readOnlyFileNamed: 'bmptest16b.bmp') binary)
- 				contents
- 	"
- 	^(Base64MimeConverter mimeDecodeToBytes:
- 'Qk24AAAAAAAAADYAAAAoAAAACAAAAAgAAAABABAAAAAAAIIAAADDDgAAww4AAAAAAAAAAAAA
- 4APgA+AD4AMfAB8AHwAfAOAD4APgA+ADHwAfAB8AHwDgA+AD/3//f/9//38fAB8A4APgA/9/
- /3//f/9/HwAfAAAAAAD/f/9//3//fwB8AHwAAAAA/3//f/9//38AfAB8AAAAAAAAAAAAfAB8
- AHwAfAAAAAAAAAAAAHwAfAB8AHwAAA==' readStream) contents!

Item was removed:
- ----- Method: BMPReadWriterTest>>bmpData24bit (in category 'data') -----
- bmpData24bit
- 	"Created via:
- 		(Base64MimeConverter mimeEncode: 
- 			(FileStream readOnlyFileNamed: 'bmptest24.bmp') binary)
- 				contents
- 	"
- 	^(Base64MimeConverter mimeDecodeToBytes:
- 'Qk32AAAAAAAAADYAAAAoAAAACAAAAAgAAAABABgAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAA
- AP8AAP8AAP8AAP8A/wAA/wAA/wAA/wAAAP8AAP8AAP8AAP8A/wAA/wAA/wAA/wAAAP8AAP8A
- /////////////////wAA/wAAAP8AAP8A/////////////////wAA/wAAAAAAAAAA////////
- ////////AAD/AAD/AAAAAAAA////////////////AAD/AAD/AAAAAAAAAAAAAAAAAAD/AAD/
- AAD/AAD/AAAAAAAAAAAAAAAAAAD/AAD/AAD/AAD/' readStream) contents!

Item was removed:
- ----- Method: BMPReadWriterTest>>bmpData32bit (in category 'data') -----
- bmpData32bit
- 	"Created via:
- 		(Base64MimeConverter mimeEncode: 
- 			(FileStream readOnlyFileNamed: 'bmptest32b.bmp') binary)
- 				contents
- 	"
- 	^(Base64MimeConverter mimeDecodeToBytes:
- 'Qk04AQAAAAAAADYAAAAoAAAACAAAAAgAAAABACAAAAAAAAIBAADDDgAAww4AAAAAAAAAAAAA
- AP8AAAD/AAAA/wAAAP8AAP8AAAD/AAAA/wAAAP8AAAAA/wAAAP8AAAD/AAAA/wAA/wAAAP8A
- AAD/AAAA/wAAAAD/AAAA/wAA////AP///wD///8A////AP8AAAD/AAAAAP8AAAD/AAD///8A
- ////AP///wD///8A/wAAAP8AAAAAAAAAAAAAAP///wD///8A////AP///wAAAP8AAAD/AAAA
- AAAAAAAA////AP///wD///8A////AAAA/wAAAP8AAAAAAAAAAAAAAAAAAAAAAAAA/wAAAP8A
- AAD/AAAA/wAAAAAAAAAAAAAAAAAAAAAAAAD/AAAA/wAAAP8AAAD/AAAA'
- readStream) contents!

Item was removed:
- ----- Method: BMPReadWriterTest>>bmpData4bit (in category 'data') -----
- bmpData4bit
- 	"Created via:
- 		(Base64MimeConverter mimeEncode: 
- 			(FileStream readOnlyFileNamed: 'bmptest4.bmp') binary)
- 				contents
- 	"
- 	^(Base64MimeConverter mimeDecodeToBytes:
- 'Qk12BAAAAAAAADYEAAAoAAAACAAAAAgAAAABAAgAAAAAAEAAAADEDgAAxA4AAAAAAAAAAAAA
- AAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDAwADA3MAA8MqmAAAgQAAAIGAAACCAAAAg
- oAAAIMAAACDgAABAAAAAQCAAAEBAAABAYAAAQIAAAECgAABAwAAAQOAAAGAAAABgIAAAYEAA
- AGBgAABggAAAYKAAAGDAAABg4AAAgAAAAIAgAACAQAAAgGAAAICAAACAoAAAgMAAAIDgAACg
- AAAAoCAAAKBAAACgYAAAoIAAAKCgAACgwAAAoOAAAMAAAADAIAAAwEAAAMBgAADAgAAAwKAA
- AMDAAADA4AAA4AAAAOAgAADgQAAA4GAAAOCAAADgoAAA4MAAAODgAEAAAABAACAAQABAAEAA
- YABAAIAAQACgAEAAwABAAOAAQCAAAEAgIABAIEAAQCBgAEAggABAIKAAQCDAAEAg4ABAQAAA
- QEAgAEBAQABAQGAAQECAAEBAoABAQMAAQEDgAEBgAABAYCAAQGBAAEBgYABAYIAAQGCgAEBg
- wABAYOAAQIAAAECAIABAgEAAQIBgAECAgABAgKAAQIDAAECA4ABAoAAAQKAgAECgQABAoGAA
- QKCAAECgoABAoMAAQKDgAEDAAABAwCAAQMBAAEDAYABAwIAAQMCgAEDAwABAwOAAQOAAAEDg
- IABA4EAAQOBgAEDggABA4KAAQODAAEDg4ACAAAAAgAAgAIAAQACAAGAAgACAAIAAoACAAMAA
- gADgAIAgAACAICAAgCBAAIAgYACAIIAAgCCgAIAgwACAIOAAgEAAAIBAIACAQEAAgEBgAIBA
- gACAQKAAgEDAAIBA4ACAYAAAgGAgAIBgQACAYGAAgGCAAIBgoACAYMAAgGDgAICAAACAgCAA
- gIBAAICAYACAgIAAgICgAICAwACAgOAAgKAAAICgIACAoEAAgKBgAICggACAoKAAgKDAAICg
- 4ACAwAAAgMAgAIDAQACAwGAAgMCAAIDAoACAwMAAgMDgAIDgAACA4CAAgOBAAIDgYACA4IAA
- gOCgAIDgwACA4OAAwAAAAMAAIADAAEAAwABgAMAAgADAAKAAwADAAMAA4ADAIAAAwCAgAMAg
- QADAIGAAwCCAAMAgoADAIMAAwCDgAMBAAADAQCAAwEBAAMBAYADAQIAAwECgAMBAwADAQOAA
- wGAAAMBgIADAYEAAwGBgAMBggADAYKAAwGDAAMBg4ADAgAAAwIAgAMCAQADAgGAAwICAAMCA
- oADAgMAAwIDgAMCgAADAoCAAwKBAAMCgYADAoIAAwKCgAMCgwADAoOAAwMAAAMDAIADAwEAA
- wMBgAMDAgADAwKAA8Pv/AKSgoACAgIAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////APr6
- +vr8/Pz8+vr6+vz8/Pz6+v/////8/Pr6//////z8AAD/////+fkAAP/////5+QAAAAD5+fn5
- AAAAAPn5+fk=' readStream) contents!

Item was removed:
- ----- Method: BMPReadWriterTest>>bmpData8bit (in category 'data') -----
- bmpData8bit
- 	"Created via:
- 		(Base64MimeConverter mimeEncode: 
- 			(FileStream readOnlyFileNamed: 'bmptest8.bmp') binary)
- 				contents
- 	"
- 	^(Base64MimeConverter mimeDecodeToBytes:
- 'Qk12BAAAAAAAADYEAAAoAAAACAAAAAgAAAABAAgAAAAAAEAAAADEDgAAxA4AAAAAAAAAAAAA
- AAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDAwADA3MAA8MqmAAAgQAAAIGAAACCAAAAg
- oAAAIMAAACDgAABAAAAAQCAAAEBAAABAYAAAQIAAAECgAABAwAAAQOAAAGAAAABgIAAAYEAA
- AGBgAABggAAAYKAAAGDAAABg4AAAgAAAAIAgAACAQAAAgGAAAICAAACAoAAAgMAAAIDgAACg
- AAAAoCAAAKBAAACgYAAAoIAAAKCgAACgwAAAoOAAAMAAAADAIAAAwEAAAMBgAADAgAAAwKAA
- AMDAAADA4AAA4AAAAOAgAADgQAAA4GAAAOCAAADgoAAA4MAAAODgAEAAAABAACAAQABAAEAA
- YABAAIAAQACgAEAAwABAAOAAQCAAAEAgIABAIEAAQCBgAEAggABAIKAAQCDAAEAg4ABAQAAA
- QEAgAEBAQABAQGAAQECAAEBAoABAQMAAQEDgAEBgAABAYCAAQGBAAEBgYABAYIAAQGCgAEBg
- wABAYOAAQIAAAECAIABAgEAAQIBgAECAgABAgKAAQIDAAECA4ABAoAAAQKAgAECgQABAoGAA
- QKCAAECgoABAoMAAQKDgAEDAAABAwCAAQMBAAEDAYABAwIAAQMCgAEDAwABAwOAAQOAAAEDg
- IABA4EAAQOBgAEDggABA4KAAQODAAEDg4ACAAAAAgAAgAIAAQACAAGAAgACAAIAAoACAAMAA
- gADgAIAgAACAICAAgCBAAIAgYACAIIAAgCCgAIAgwACAIOAAgEAAAIBAIACAQEAAgEBgAIBA
- gACAQKAAgEDAAIBA4ACAYAAAgGAgAIBgQACAYGAAgGCAAIBgoACAYMAAgGDgAICAAACAgCAA
- gIBAAICAYACAgIAAgICgAICAwACAgOAAgKAAAICgIACAoEAAgKBgAICggACAoKAAgKDAAICg
- 4ACAwAAAgMAgAIDAQACAwGAAgMCAAIDAoACAwMAAgMDgAIDgAACA4CAAgOBAAIDgYACA4IAA
- gOCgAIDgwACA4OAAwAAAAMAAIADAAEAAwABgAMAAgADAAKAAwADAAMAA4ADAIAAAwCAgAMAg
- QADAIGAAwCCAAMAgoADAIMAAwCDgAMBAAADAQCAAwEBAAMBAYADAQIAAwECgAMBAwADAQOAA
- wGAAAMBgIADAYEAAwGBgAMBggADAYKAAwGDAAMBg4ADAgAAAwIAgAMCAQADAgGAAwICAAMCA
- oADAgMAAwIDgAMCgAADAoCAAwKBAAMCgYADAoIAAwKCgAMCgwADAoOAAwMAAAMDAIADAwEAA
- wMBgAMDAgADAwKAA8Pv/AKSgoACAgIAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////APr6
- +vr8/Pz8+vr6+vz8/Pz6+v/////8/Pr6//////z8AAD/////+fkAAP/////5+QAAAAD5+fn5
- AAAAAPn5+fk=' readStream) contents!

Item was removed:
- ----- Method: BMPReadWriterTest>>bmpDataR5G6B5 (in category 'data') -----
- bmpDataR5G6B5
- 	"This is a BMP file based on BitmapV4Header which is currently unsupported."
- 	"Created via:
- 		(Base64MimeConverter mimeEncode: 
- 			(FileStream readOnlyFileNamed: 'bmptest16-R5G6B5.bmp') binary)
- 				contents
- 	"
- 	^(Base64MimeConverter mimeDecodeToBytes:
- 'Qk3IAAAAAAAAAEYAAAA4AAAACAAAAAgAAAABABAAAwAAAIIAAADDDgAAww4AAAAAAAAAAAAA
- APgAAOAHAAAfAAAAAAAAAOAH4AfgB+AHHwAfAB8AHwDgB+AH4AfgBx8AHwAfAB8A4AfgB///
- ////////HwAfAOAH4Af//////////x8AHwAAAAAA//////////8A+AD4AAAAAP//////////
- APgA+AAAAAAAAAAAAPgA+AD4APgAAAAAAAAAAAD4APgA+AD4AAA='
- readStream) contents!

Item was removed:
- ----- Method: BMPReadWriterTest>>bmpDataX4R4G4B4 (in category 'data') -----
- bmpDataX4R4G4B4
- 	"This is a BMP file based on BitmapV4Header which is currently unsupported."
- 	"Created via:
- 		(Base64MimeConverter mimeEncode: 
- 			(FileStream readOnlyFileNamed: 'bmptest16-X4R4G4B4.bmp') binary)
- 				contents
- 	"
- 	^(Base64MimeConverter mimeDecodeToBytes:
- 'Qk3IAAAAAAAAAEYAAAA4AAAACAAAAAgAAAABABAAAwAAAIIAAADDDgAAww4AAAAAAAAAAAAA
- AA8AAPAAAAAPAAAAAAAAAPAA8ADwAPAADwAPAA8ADwDwAPAA8ADwAA8ADwAPAA8A8ADwAP8P
- /w//D/8PDwAPAPAA8AD/D/8P/w//Dw8ADwAAAAAA/w//D/8P/w8ADwAPAAAAAP8P/w//D/8P
- AA8ADwAAAAAAAAAAAA8ADwAPAA8AAAAAAAAAAAAPAA8ADwAPAAA='
- readStream) contents!

Item was removed:
- ----- Method: BMPReadWriterTest>>bmpDataX8R8G8B8 (in category 'data') -----
- bmpDataX8R8G8B8
- 	"This is a BMP file based on BitmapV4Header which is currently unsupported."
- 	"Created via:
- 		(Base64MimeConverter mimeEncode: 
- 			(FileStream readOnlyFileNamed: 'bmptest32-X8R8G8B8.bmp') binary)
- 				contents
- 	"
- 	^(Base64MimeConverter mimeDecodeToBytes:
- 'Qk1IAQAAAAAAAEYAAAA4AAAACAAAAAgAAAABACAAAwAAAAIBAADDDgAAww4AAAAAAAAAAAAA
- AAAA/wAA/wAA/wAAAAAAAAAA/wAAAP8AAAD/AAAA/wAA/wAAAP8AAAD/AAAA/wAAAAD/AAAA
- /wAAAP8AAAD/AAD/AAAA/wAAAP8AAAD/AAAAAP8AAAD/AAD///8A////AP///wD///8A/wAA
- AP8AAAAA/wAAAP8AAP///wD///8A////AP///wD/AAAA/wAAAAAAAAAAAAAA////AP///wD/
- //8A////AAAA/wAAAP8AAAAAAAAAAAD///8A////AP///wD///8AAAD/AAAA/wAAAAAAAAAA
- AAAAAAAAAAAAAAD/AAAA/wAAAP8AAAD/AAAAAAAAAAAAAAAAAAAAAAAAAP8AAAD/AAAA/wAA
- AP8AAA=='
- readStream) contents!

Item was removed:
- ----- Method: BMPReadWriterTest>>testBmp16Bit (in category 'tests') -----
- testBmp16Bit
- 	| reader form |
- 	reader := BMPReadWriter new on: (ReadStream on: self bmpData16bit).
- 	form := reader nextImage.
- 	"special black here to compensate for zero-is-transparent effect"
- 	self assert: (form colorAt: 7 at 1) = Color red.
- 	self assert: (form colorAt: 1 at 7) = Color green.
- 	self assert: (form colorAt: 7 at 7) = Color blue.
- 	self assert: (form colorAt: 4 at 4) = Color white.
- 	self assert: (form pixelValueAt: 1 at 1) = 16r8000.
- !

Item was removed:
- ----- Method: BMPReadWriterTest>>testBmp24Bit (in category 'tests') -----
- testBmp24Bit
- 	| reader form |
- 	reader := BMPReadWriter new on: (ReadStream on: self bmpData24bit).
- 	form := reader nextImage.
- 	self assert: (form colorAt: 7 at 1) = Color red.
- 	self assert: (form colorAt: 1 at 7) = Color green.
- 	self assert: (form colorAt: 7 at 7) = Color blue.
- 	self assert: (form colorAt: 4 at 4) = Color white.
- 	self assert: (form pixelValueAt: 1 at 1) = 16rFF000001.
- !

Item was removed:
- ----- Method: BMPReadWriterTest>>testBmp32Bit (in category 'tests') -----
- testBmp32Bit
- 	| reader form |
- 	reader := BMPReadWriter new on: (ReadStream on: self bmpData32bit).
- 	form := reader nextImage.
- 	self assert: (form colorAt: 7 at 1) = Color red.
- 	self assert: (form colorAt: 1 at 7) = Color green.
- 	self assert: (form colorAt: 7 at 7) = Color blue.
- 	self assert: (form colorAt: 4 at 4) = Color white.
- 	self assert: (form pixelValueAt: 1 at 1) = 16rFF000000.
- !

Item was removed:
- ----- Method: BMPReadWriterTest>>testBmp4Bit (in category 'tests') -----
- testBmp4Bit
- 	| reader form |
- 	reader := BMPReadWriter new on: (ReadStream on: self bmpData4bit).
- 	form := reader nextImage.
- 	self assert: (form colorAt: 1 at 1) = Color black.
- 	self assert: (form colorAt: 7 at 1) = Color red.
- 	self assert: (form colorAt: 1 at 7) = Color green.
- 	self assert: (form colorAt: 7 at 7) = Color blue.
- 	self assert: (form colorAt: 4 at 4) = Color white.
- !

Item was removed:
- ----- Method: BMPReadWriterTest>>testBmp8Bit (in category 'tests') -----
- testBmp8Bit
- 	| reader form |
- 	reader := BMPReadWriter new on: (ReadStream on: self bmpData8bit).
- 	form := reader nextImage.
- 	self assert: (form colorAt: 1 at 1) = Color black.
- 	self assert: (form colorAt: 7 at 1) = Color red.
- 	self assert: (form colorAt: 1 at 7) = Color green.
- 	self assert: (form colorAt: 7 at 7) = Color blue.
- 	self assert: (form colorAt: 4 at 4) = Color white.
- !

Item was removed:
- ClassTestCase subclass: #BitBltTest
- 	instanceVariableNames: ''
- 	classVariableNames: ''
- 	poolDictionaries: ''
- 	category: 'GraphicsTests-Primitives'!

Item was removed:
- ----- Method: BitBltTest>>testAllAlphasRgbAdd (in category 'tests') -----
- testAllAlphasRgbAdd
- 	"self run: #testAllAlphasRgbAdd"
- 	| sourceForm destForm blt correctAlphas |
- 	<timeout: 15>
-      correctAlphas := 0.
-      0  to: 255 do: [:sourceAlpha |
-          sourceForm := Form extent: 1 @ 1 depth: 32.
-          sourceForm bits at: 1 put: sourceAlpha << 24 + (33 << 16) + (25 << 8) + 27.
-          0 to: 255 do: [:destAlpha |
-              destForm := Form extent: 1 @ 1 depth: 32.
-              destForm bits at: 1 put: destAlpha << 24 + (255 << 16) + (255 << 8) + 255.
-               blt := BitBlt new.
-               blt sourceForm: sourceForm.
-               blt sourceOrigin: 0 @ 0.
-               blt setDestForm: destForm.
-               blt destOrigin: 0 @ 0.
-               blt combinationRule: 20.	"rgbAdd"
-               blt copyBits.
-               correctAlphas := correctAlphas
-                 + (((blt destForm bits at: 1) digitAt: 4) = (destAlpha + sourceAlpha min: 255)
-                          ifTrue: [1]
-                          ifFalse: [0])
-       ]].
-      self assert: 65536 equals: correctAlphas!

Item was removed:
- ----- Method: BitBltTest>>testAllAlphasRgbMax (in category 'tests') -----
- testAllAlphasRgbMax
- 	"self run: #testAllAlphasRgbMax"
- 	| sourceForm destForm blt correctAlphas |
- 	<timeout: 10>
-      correctAlphas := 0.
-      0  to: 255 do: [:sourceAlpha |
-          sourceForm := Form extent: 1 @ 1 depth: 32.
-          sourceForm bits at: 1 put: sourceAlpha << 24 + (33 << 16) + (25 << 8) + 27.
-          0 to: 255 do: [:destAlpha |
-              destForm := Form extent: 1 @ 1 depth: 32.
-              destForm bits at: 1 put: destAlpha << 24 + (255 << 16) + (255 << 8) + 255.
-               blt := BitBlt new.
-               blt sourceForm: sourceForm.
-               blt sourceOrigin: 0 @ 0.
-               blt setDestForm: destForm.
-               blt destOrigin: 0 @ 0.
-               blt combinationRule: 27.	"rgbMax"
-               blt copyBits.
-               correctAlphas := correctAlphas
-                 + (((blt destForm bits at: 1) digitAt: 4) = (destAlpha max: sourceAlpha)
-                          ifTrue: [1]
-                          ifFalse: [0])
-       ]].
-      self assert: 65536 equals: correctAlphas!

Item was removed:
- ----- Method: BitBltTest>>testAllAlphasRgbMin (in category 'tests') -----
- testAllAlphasRgbMin
- 	"self run: #testAllAlphasRgbMin"
- 	| sourceForm destForm blt correctAlphas |
- 	<timeout: 10>
-      correctAlphas := 0.
-      0  to: 255 do: [:sourceAlpha |
-          sourceForm := Form extent: 1 @ 1 depth: 32.
-          sourceForm bits at: 1 put: sourceAlpha << 24 + (33 << 16) + (25 << 8) + 27.
-          0 to: 255 do: [:destAlpha |
-              destForm := Form extent: 1 @ 1 depth: 32.
-              destForm bits at: 1 put: destAlpha << 24 + (255 << 16) + (255 << 8) + 255.
-               blt := BitBlt new.
-               blt sourceForm: sourceForm.
-               blt sourceOrigin: 0 @ 0.
-               blt setDestForm: destForm.
-               blt destOrigin: 0 @ 0.
-               blt combinationRule: 28.	"rgbMin"
-               blt copyBits.
-               correctAlphas := correctAlphas
-                 + (((blt destForm bits at: 1) digitAt: 4) = (destAlpha min: sourceAlpha)
-                          ifTrue: [1]
-                          ifFalse: [0])
-       ]].
-      self assert: 65536 equals: correctAlphas!

Item was removed:
- ----- Method: BitBltTest>>testAllAlphasRgbMinInvert (in category 'tests') -----
- testAllAlphasRgbMinInvert
- 	"self run: #testAllAlphasRgbMinInvert"
- 	| sourceForm destForm blt correctAlphas |
- 	<timeout: 10>
-      correctAlphas := 0.
-      0  to: 255 do: [:sourceAlpha |
-          sourceForm := Form extent: 1 @ 1 depth: 32.
-          sourceForm bits at: 1 put: sourceAlpha << 24 + (33 << 16) + (25 << 8) + 27.
-          0 to: 255 do: [:destAlpha |
-              destForm := Form extent: 1 @ 1 depth: 32.
-              destForm bits at: 1 put: destAlpha << 24 + (255 << 16) + (255 << 8) + 255.
-               blt := BitBlt new.
-               blt sourceForm: sourceForm.
-               blt sourceOrigin: 0 @ 0.
-               blt setDestForm: destForm.
-               blt destOrigin: 0 @ 0.
-               blt combinationRule: 29.	"rgbMinInvert"
-               blt copyBits.
-               correctAlphas := correctAlphas
-                 + (((blt destForm bits at: 1) digitAt: 4) = (destAlpha min: 255-sourceAlpha)
-                          ifTrue: [1]
-                          ifFalse: [0])
-       ]].
-      self assert: 65536 equals: correctAlphas!

Item was removed:
- ----- Method: BitBltTest>>testAllAlphasRgbMul (in category 'tests') -----
- testAllAlphasRgbMul
- 	"self run: #testAllAlphasRgbMul"
- 	| sourceForm destForm blt correctAlphas |
- 	<timeout: 10>
-      correctAlphas := 0.
-      0  to: 255 do: [:sourceAlpha |
-          sourceForm := Form extent: 1 @ 1 depth: 32.
-          sourceForm bits at: 1 put: sourceAlpha << 24 + (33 << 16) + (25 << 8) + 27.
-          0 to: 255 do: [:destAlpha |
-              destForm := Form extent: 1 @ 1 depth: 32.
-              destForm bits at: 1 put: destAlpha << 24 + (255 << 16) + (255 << 8) + 255.
-               blt := BitBlt new.
-               blt sourceForm: sourceForm.
-               blt sourceOrigin: 0 @ 0.
-               blt setDestForm: destForm.
-               blt destOrigin: 0 @ 0.
-               blt combinationRule: 37.	"rgbMul"
-               blt copyBits.
-               correctAlphas := correctAlphas
-                 + (((blt destForm bits at: 1) digitAt: 4) = ((destAlpha+1) * (sourceAlpha+1)- 1 // 256)
-                          ifTrue: [1]
-                          ifFalse: [0])
-       ]].
-      self assert: 65536 equals: correctAlphas!

Item was removed:
- ----- Method: BitBltTest>>testAllAlphasRgbSub (in category 'tests') -----
- testAllAlphasRgbSub
- 	"self run: #testAllAlphasRgbSub"
- 	| sourceForm destForm blt correctAlphas |
- 	<timeout: 10>
-      correctAlphas := 0.
-      0  to: 255 do: [:sourceAlpha |
-          sourceForm := Form extent: 1 @ 1 depth: 32.
-          sourceForm bits at: 1 put: sourceAlpha << 24 + (33 << 16) + (25 << 8) + 27.
-          0 to: 255 do: [:destAlpha |
-              destForm := Form extent: 1 @ 1 depth: 32.
-              destForm bits at: 1 put: destAlpha << 24 + (255 << 16) + (255 << 8) + 255.
-               blt := BitBlt new.
-               blt sourceForm: sourceForm.
-               blt sourceOrigin: 0 @ 0.
-               blt setDestForm: destForm.
-               blt destOrigin: 0 @ 0.
-               blt combinationRule: 21.	"rgbSub"
-               blt copyBits.
-               correctAlphas := correctAlphas
-                 + (((blt destForm bits at: 1) digitAt: 4) = (destAlpha - sourceAlpha) abs
-                          ifTrue: [1]
-                          ifFalse: [0])
-       ]].
-      self assert: 65536 equals: correctAlphas!

Item was removed:
- ----- Method: BitBltTest>>testAlphaCompositing (in category 'tests') -----
- testAlphaCompositing
- 	"self run: #testAlphaCompositing"
- 
- 	| bb f1 f2 mixColor result eps |
- 	f1 := Form extent: 1 at 1 depth: 32.
- 	f2 := Form extent: 1 at 1 depth: 32.
- 	eps := 0.5 / 255.
- 	0 to: 255 do:[:i|
- 		f1 colorAt: 0 at 0 put: Color blue.
- 		mixColor := Color red alpha: i / 255.0.
- 		f2 colorAt: 0 at 0 put: mixColor.
- 		mixColor := f2 colorAt: 0 at 0.
- 		bb := BitBlt toForm: f1.
- 		bb sourceForm: f2.
- 		bb combinationRule: Form blend.
- 		bb copyBits.
- 		result := f1 colorAt: 0 at 0.
- 		self assert: (result red - mixColor alpha) abs < eps.
- 		self assert: (result blue - (1.0 - mixColor alpha)) abs < eps.
- 		self assert: result alpha = 1.0.
- 	].!

Item was removed:
- ----- Method: BitBltTest>>testAlphaCompositing2 (in category 'tests') -----
- testAlphaCompositing2
- 	"self run: #testAlphaCompositing2"
- 
- 	| bb f1 f2 mixColor result eps |
- 	f1 := Form extent: 1 at 1 depth: 32.
- 	f2 := Form extent: 1 at 1 depth: 32.
- 	eps := 0.5 / 255.
- 	0 to: 255 do:[:i|
- 		f1 colorAt: 0 at 0 put: Color transparent.
- 		mixColor := Color red alpha: i / 255.0.
- 		f2 colorAt: 0 at 0 put: mixColor.
- 		mixColor := f2 colorAt: 0 at 0.
- 		bb := BitBlt toForm: f1.
- 		bb sourceForm: f2.
- 		bb combinationRule: Form blend.
- 		bb copyBits.
- 		result := f1 colorAt: 0 at 0.
- 		self assert: (result red - mixColor alpha) abs < eps.
- 		self assert: result alpha = mixColor alpha.
- 	].!

Item was removed:
- ----- Method: BitBltTest>>testPeekerUnhibernateBug (in category 'tests - bugs') -----
- testPeekerUnhibernateBug
- 	"self run: #testPeekerUnhibernateBug"
- 
- 	| bitBlt |
- 	bitBlt := BitBlt bitPeekerFromForm: Display.
- 	bitBlt destForm hibernate.
- 	
- 	"This should not throw an exception."
- 	self
- 		shouldnt: [bitBlt pixelAt: 1 at 1]
- 		raise: Error!

Item was removed:
- ----- Method: BitBltTest>>testPivelValueAt (in category 'tests') -----
- testPivelValueAt
- "tests for the pixel peeking extension to bitBlt"
- "	self run: #testPixelValueAt"
- 	|formList pixels |	
- "make a Form of each depth"
- 	formList := #[1 2 4 8 16 32] collect:[:d| Form extent: 17 at 7 depth: d] as: Array.
- 	pixels := Dictionary new.
- 	pixels at: 1 put: 1; at: 2 put: 3; at:4 put: 7; at: 8 put: 16rFF; at: 16 put: 16rFFFF ; at: 32 put: 16rFFFFFFFF.
- 
- "poke pixels to 
- topleft (to test handling 0)
- bottomright (to test limits)
- middle (just because)
- peek at each location (to make sure it matches expectations)"
- 	formList do:[:f| |d pixval|
- 		d := f depth.
- 		pixval := pixels at: d.
- 		f pixelValueAt: 0 at 0 put: pixval.
- 		f pixelValueAt: 16 at 6 put: pixval.
- 		f pixelValueAt: 7 at 3 put: pixval.
- 			self assert: (f pixelValueAt: 0 at 0) = pixval. 
- 			self assert: (f pixelValueAt: 1 at 0) = 0. 
- 			self assert: (f pixelValueAt: 16 at 6) = pixval. 
- 			self assert:(f pixelValueAt: 15 at 6) = 0. 
- 			self assert: (f pixelValueAt: 7 at 3) = pixval.
- 			self assert: (f pixelValueAt: 6 at 3) = 0.
- 	]!

Item was removed:
- ----- Method: BitBltTest>>testPokerUnhibernateBug (in category 'tests - bugs') -----
- testPokerUnhibernateBug
- 	"self run: #testPokerUnhibernateBug"
- 
- 	| bitBlt |
- 	bitBlt := BitBlt bitPokerToForm: Display.
- 	bitBlt sourceForm hibernate.
- 	
- 	self 
- 		shouldnt: [bitBlt pixelAt: 1 at 1 put: 0]
- 		raise: Error.!

Item was removed:
- TestCase subclass: #CharacterScannerTest
- 	instanceVariableNames: 'style mWidth spaceWidth'
- 	classVariableNames: ''
- 	poolDictionaries: ''
- 	category: 'GraphicsTests-Text'!

Item was removed:
- ----- Method: CharacterScannerTest>>setUp (in category 'running') -----
- setUp
- 	style := TextStyle default copy.
- 	style firstIndent: 0; restIndent: 0; rightIndent: 0.
- 	mWidth := style defaultFont widthOf: $m.
- 	spaceWidth := style defaultFont widthOf: Character space.!

Item was removed:
- ----- Method: CharacterScannerTest>>testBreakAnywhere (in category 'tests') -----
- testBreakAnywhere
- 	| p text cbs indicesOfM |
- 	text := ((String new: 2 withAll: $m) , (String space) , (String new: 2 withAll: $m)) asText.
- 	p := NewParagraph new.
- 	p
- 		compose: text
- 		style: style
- 		from: 1
- 		in: (0 @ 0 corner: mWidth+1 @ (style lineGrid * 6)).
- 	indicesOfM := (1 to: text size) select: [:i | (text at: i) = $m].
- 	self assert: p lines size equals: indicesOfM size description: 'Each m is on a new line'.
- 	self assert: (p lines collect: #first) equals: indicesOfM description: 'Each line begins with m'.
- 	
- 	cbs := indicesOfM collect: [:i | p characterBlockForIndex: i].
- 	self assert: (cbs collect: #left as: Set) size = 1 description: 'Selecting before each m align on same column'
- 	 
- 		!

Item was removed:
- ----- Method: CharacterScannerTest>>testBreakAnywhereWhenFirstCharDoesNotFit (in category 'tests') -----
- testBreakAnywhereWhenFirstCharDoesNotFit
- 	| p text cbs |
- 	text := ((String new: 2 withAll: $m) , (String space) , (String new: 2 withAll: $m)) asText.
- 	p := NewParagraph new.
- 	p
- 		compose: text
- 		style: style
- 		from: 1
- 		in: (0 @ 0 corner: mWidth-1 @ (style lineGrid * 7)).
- 	self assert: p lines size equals: text size + 1 description: 'Each character is on a new line, past end also'.
- 	self assert: (p lines collect: #first) equals: (1 to: text size + 1) asArray description: 'Each character is on a new line'.
- 	
- 	cbs := (1 to: text size + 1) collect: [:i | p characterBlockForIndex: i].
- 	self assert: (cbs collect: #left as: Set) size = 1 description: 'Selecting before each character align on left'
- 	 
- 		!

Item was removed:
- ----- Method: CharacterScannerTest>>testBreakAtLastCr (in category 'tests') -----
- testBreakAtLastCr
- 	| p text cbfirst cblast cbend cbend2 |
- 	text := ((String new: 4 withAll: $m) , (String new: 2 withAll: Character space) , String cr) asText.
- 	p := NewParagraph new.
- 	p
- 		compose: text
- 		style: style
- 		from: 1
- 		in: (0 @ 0 corner: mWidth*4+(spaceWidth*2)+1 @ (style lineGrid * 4)).
- 	self assert: p lines size = 2 description: 'An empty last line after CR must be materialized'.
- 	self assert: p lines first last = 7 description: 'The CR is included in the line preceding it'.
- 	
- 	cbfirst := p characterBlockForIndex: 1.
- 	cblast := p characterBlockForIndex: text size.
- 	self assert: cblast origin y = cbfirst origin y description: 'The CR coordinate is still on the first line'.
- 	cbend := p characterBlockForIndex: text size + 1.
- 	self assert: cbend origin y >= cblast corner y description: 'Past end is located on the next line'.
- 	
- 	cbend2 := p characterBlockAtPoint: 0 @ (cbend corner y + style lineGrid).
- 	self assert: cbend = cbend2 description: 'Clicking below the second line gives the past end location'.
- 	self assert: cbend origin = cbend2 origin.
- 	self assert: cbend corner = cbend2 corner.
- 	 
- 		!

Item was removed:
- ----- Method: CharacterScannerTest>>testBreakAtLastSpace (in category 'tests') -----
- testBreakAtLastSpace
- 	| p text cbfirst cblast cbend cbend2 |
- 	text := ((String new: 4 withAll: $m) , (String new: 3 withAll: Character space)) asText.
- 	p := NewParagraph new.
- 	p
- 		compose: text
- 		style: style
- 		from: 1
- 		in: (0 @ 0 corner: mWidth*4+(spaceWidth*2)+1 @ (style lineGrid * 4)).
- 	self assert: p lines size = 2 description: 'In leftFlush alignment, spaces at end of line overflowing the right margin should flow on next line'.
- 	self assert: p lines first last = 7 description: 'The space which is crossing the right margin is included in the first line as if it were a CR'.
- 	
- 	cbfirst := p characterBlockForIndex: 1.
- 	cblast := p characterBlockForIndex: text size.
- 	self assert: cblast origin y = cbfirst origin y description: 'The last space coordinate is still on the first line'.
- 	cbend := p characterBlockForIndex: text size + 1.
- 	self assert: cbend origin y >= cblast corner y description: 'Past end is located on the next line'.
- 	
- 	cbend2 := p characterBlockAtPoint: 0 @ (cbend corner y + style lineGrid).
- 	self assert: cbend = cbend2 description: 'Clicking below the second line gives the past end location'.
- 	self assert: cbend origin = cbend2 origin.
- 	self assert: cbend corner = cbend2 corner.
- 	 
- 		!

Item was removed:
- ----- Method: CharacterScannerTest>>testBreakAtSpace (in category 'tests') -----
- testBreakAtSpace
- 	| p text cbfirst cblast cbend cbend2 |
- 	text := ((String new: 4 withAll: $m) , (String new: 4 withAll: Character space)) asText.
- 	p := NewParagraph new.
- 	p
- 		compose: text
- 		style: style
- 		from: 1
- 		in: (0 @ 0 corner: mWidth*4+(spaceWidth*2)+1 @ (style lineGrid * 4)).
- 	self assert: p lines size = 2 description: 'In leftFlush alignment, spaces at end of line overflowing the right margin should flow on next line'.
- 	self assert: p lines first last = 7 description: 'The space which is crossing the right margin is included in the first line as if it were a CR'.
- 	
- 	cbfirst := p characterBlockForIndex: 1.
- 	cblast := p characterBlockForIndex: text size.
- 	self assert: cblast origin y >= cbfirst corner y description: 'The last space coordinate is under the first line'.
- 	cbend := p characterBlockForIndex: text size + 1.
- 	self assert: cbend origin x >= cblast corner x description: 'Past end is located right of last space'.
- 	
- 	cbend2 := p characterBlockAtPoint: 0 @ (cbend corner y + style lineGrid).
- 	self assert: cbend = cbend2 description: 'Clicking below the second line gives the past end location'.
- 	self assert: cbend origin = cbend2 origin.
- 	self assert: cbend corner = cbend2 corner.
- 	 
- 		!

Item was removed:
- ----- Method: CharacterScannerTest>>testBreakBeforeLongWord (in category 'tests') -----
- testBreakBeforeLongWord
- 	| p text cbfirst cblast cbend cbend2 cbend1 cbspace |
- 	text := ((String with: $m) , (String with: Character space) , (String new: 4 withAll: $m)) asText.
- 	p := NewParagraph new.
- 	p
- 		compose: text
- 		style: style
- 		from: 1
- 		in: (0 @ 0 corner: mWidth*4+(spaceWidth*2)+1 @ (style lineGrid * 4)).
- 	self assert: p lines size = 2 description: 'In leftFlush alignment, a long word overflowing the right margin should flow on next line'.
- 	self assert: p lines first last = 2 description: 'The space before the long word is on the first line'.
- 	
- 	cbfirst := p characterBlockForIndex: 1.
- 	cblast := p characterBlockForIndex: text size.
- 	self assert: cblast origin y >= cbfirst corner y description: 'The long word coordinate is under the first line'.
- 	cbend := p characterBlockForIndex: text size + 1.
- 	self assert: cbend origin x >= cblast corner x description: 'Past end is located right of long word'.
- 	
- 	cbend2 := p characterBlockAtPoint: 0 @ (cbend corner y + style lineGrid).
- 	self assert: cbend = cbend2 description: 'Clicking below the second line gives the past end location'.
- 	self assert: cbend origin = cbend2 origin.
- 	self assert: cbend corner = cbend2 corner.
- 	
- 	cbspace := p characterBlockForIndex: 2.
- 	self assert: cbspace origin y = cbfirst origin y description: 'The space is on the first line'.
- 	
- 	cbend1 := p characterBlockAtPoint: cbspace corner x + 1 @ cbspace center y.
- 	self assert: cbend1 origin x >= cbspace corner x description: 'Clicking after the space starts right after the space'.
- 	self assert: cbend1 origin y = cbspace origin y description: 'Clicking after the space starts on same line as the space'.
- 	self assert: cbend1 stringIndex = 3  description: 'Clicking after the space starts on the long word'.
- 	 
- 		!

Item was removed:
- ----- Method: CharacterScannerTest>>testClickLeftOfCenteredText (in category 'tests') -----
- testClickLeftOfCenteredText
- 	| p text cbfirst cbfirst2 |
- 	style := TextStyle default.
- 	mWidth := style defaultFont widthOf: $m.
- 	spaceWidth := style defaultFont widthOf: Character space.
- 	text := (String new: 4 withAll: $m) asText.
- 	text addAttribute: TextAlignment centered from: 1 to: text size.
- 	p := NewParagraph new.
- 	p
- 		compose: text
- 		style: style
- 		from: 1
- 		in: (2 @ 2 extent: mWidth*8 @ (style lineGrid * 2)).
- 	
- 	cbfirst := p characterBlockForIndex: 1.
- 	cbfirst2 := p characterBlockAtPoint: 1 @ cbfirst center y.
- 	self assert: cbfirst = cbfirst2.
- 	self assert: cbfirst origin = cbfirst2 origin description: 'Clicking left of the margin shall position the cursor correctly'.!

Item was removed:
- ClassTestCase subclass: #ColorTest
- 	instanceVariableNames: ''
- 	classVariableNames: ''
- 	poolDictionaries: ''
- 	category: 'GraphicsTests-Primitives'!

Item was removed:
- ----- Method: ColorTest>>expectedFailures (in category 'failures') -----
- expectedFailures
- 
- 	^ #(testColorsFromPixelValue32BitBlack)!

Item was removed:
- ----- Method: ColorTest>>testAsHTMLColor (in category 'tests') -----
- testAsHTMLColor
- 
- 	| table aColorString |
- 	table := #('0' '1' '2' '3' '4' '5' '6' '7' '8' '9' 'A' 'B' 'C' 'D' 'E' 'F').
- 
- 	table do: [ :each |
- 		aColorString := '#', each, each, '0000'.
- 		self assert: (Color fromString: aColorString) asHTMLColor equals: aColorString].
- 
- 	table do: [ :each |
- 		aColorString := '#', '00', each, each, '00'.
- 		self assert: (Color fromString: aColorString) asHTMLColor equals: aColorString].
- 
- 	table do: [ :each |
- 		aColorString := '#', '0000', each, each.
- 		self assert: (Color fromString: aColorString) asHTMLColor equals: aColorString].
- 
- 	table do: [ :each |
- 		aColorString := '#', each, each, each, each, each, each.
- 		self assert: (Color fromString: aColorString) asHTMLColor equals: aColorString].
- 	
- 	table do: [ :each |
- 		aColorString := '#', each, each, each, each, each, each, each, each.
- 		each = 'F'
- 			ifTrue: [self assert: (Color fromString: aColorString) asHTMLColor equals: '#FFFFFF' description: 'For full alpha channel the no alpha color is used']
- 			ifFalse: [self assert: (Color fromString: aColorString) asHTMLColor equals: aColorString]].!

Item was removed:
- ----- Method: ColorTest>>testColorFrom (in category 'tests') -----
- testColorFrom
- 	self assert: ((Color colorFrom: #white) asHTMLColor sameAs: '#ffffff').
- 	self assert: ((Color colorFrom: #(1.0 0.5 0.0)) asHTMLColor sameAs: '#ff8000').
- 	self assert: ((Color colorFrom: (Color white)) asHTMLColor sameAs: '#ffffff').
- 	self assert: ((Color colorFrom: '#FF8800') asHTMLColor sameAs: '#ff8800').
- 	self assert: ((Color colorFrom: '#222222') asHTMLColor sameAs: '#222222').!

Item was removed:
- ----- Method: ColorTest>>testColorsFromPixelValue32BitBlack (in category 'tests') -----
- testColorsFromPixelValue32BitBlack
- 
- 	"This is a test which tests for the particular behavior of
- 	colorFromPixelValue:depth: which set 32bit rgb black to transparent."
- 	self assert: Color black equals: (Color colorFromPixelValue: 16rFF000000 depth: 32)!

Item was removed:
- ----- Method: ColorTest>>testConstructorsAreConsistent (in category 'tests') -----
- testConstructorsAreConsistent
- 	
- 	"Color seaFoam asHTMLColor".
- 	self assert: (Color r: 0 g: 1 b: 128/255) equals: (Color fromString: '#00FF80').
- 	self assert: (Color r: 0 g: 1 b: 128/255) equals: (Color r: 0 g: 255 b: 128 range: 255).!

Item was removed:
- ----- Method: ColorTest>>testFromString (in category 'tests') -----
- testFromString
- 	self assert: ((Color fromString: '#FF8800') asHTMLColor sameAs: '#ff8800');
- 		assert: ((Color fromString: 'FF8800') asHTMLColor sameAs: '#ff8800');
- 		assert: ((Color fromString: '126,42,33') asHTMLColor sameAs:  '#7E2A21');
- 		assert: ((Color fromString: '00000000') asHTMLColor sameAs: '#00000000'); "html with alpha channel"
- 		assert: ((Color fromString: '#8C500BAE') asHTMLColor sameAs: '#8C500BAE');
- 		assert: ((Color fromString: 'white') asHTMLColor sameAs: '#ffffff');
- 		assert: ((Color fromString: 'black') asHTMLColor sameAs: '#000000');
- 		assert: ((Color fromString: nil) asHTMLColor sameAs: '#ffffff');
- 		assert: ((Color fromString: 'inexistent color') asHTMLColor sameAs: '#ffffff'); "should return white"
- 		assert: ((Color fromString: 'XXXXXX') asHTMLColor sameAs: '#ffffff') description: 'Color string should be alphanumeric';
- 		assert: ((Color fromString: '000000000') asHTMLColor sameAs: '#ffffff') description: 'number string too long'. 
- 		
- 	self
- 		assert: (Color fromString: 'DARKGRAY') = Color darkGray description: 'Color can be specified with a case insensitive color name';
- 		assert: (Color fromString: '#blue') = Color blue description: 'Color can be specified with a leading literal sharp'.!

Item was removed:
- ----- Method: ColorTest>>testHSV (in category 'tests') -----
- testHSV
- 	"Test the color wheel modulo 360"
- 	
- 	self assert: (Color h: 0 s: 1 v: 1) = Color red.
- 	self assert: (Color h: 60 s: 1 v: 1) = Color yellow.
- 	self assert: (Color h: 120 s: 1 v: 1) = Color green.
- 	self assert: (Color h: 180 s: 1 v: 1) = Color cyan.
- 	self assert: (Color h: 240 s: 1 v: 1) = Color blue.
- 	self assert: (Color h: 300 s: 1 v: 1) = Color magenta.
- 	self assert: (Color h: 0+360 s: 1 v: 1) = Color red.
- 	self assert: (Color h: 120+720 s: 1 v: 1) = Color green.
- 	self assert: (Color h: 180-360 s: 1 v: 1) = Color cyan.
- 	self assert: (Color h: 240-720 s: 1 v: 1) = Color blue.!

Item was removed:
- ----- Method: ColorTest>>testMultiplyByArray (in category 'tests') -----
- testMultiplyByArray
- 	| newColor oldColor tolerance |
- 	tolerance := 0.001.
- 
- 	oldColor := Color r: 0.75 g: 0.5 b: 0.25.
- 	newColor := oldColor * #(0.1 2 3).
- 
- 	self assert: (0.075 - newColor red) abs < tolerance.
- 	self assert: (1 - newColor green) abs < tolerance.
- 	self assert: (0.75 - newColor blue) abs < tolerance.!

Item was removed:
- ----- Method: ColorTest>>testMultiplyByArrayIdentityTransform (in category 'tests') -----
- testMultiplyByArrayIdentityTransform
- 	| newColor oldColor tolerance |
- 	tolerance := 0.001.
- 
- 	oldColor := Color r: 0.75 g: 0.5 b: 0.25.
- 	newColor := oldColor * 2.
- 
- 	self assert: (1 - newColor red) abs < tolerance.
- 	self assert: (1 - newColor green) abs < tolerance.
- 	self assert: (0.5 - newColor blue) abs < tolerance.!

Item was removed:
- ----- Method: ColorTest>>testMultiplyByNumber (in category 'tests') -----
- testMultiplyByNumber
- 	| newColor oldColor tolerance |
- 	tolerance := 0.001.
- 
- 	oldColor := Color r: 0.75 g: 0.5 b: 0.25.
- 	newColor := oldColor * 2.
- 
- 	self assert: (1 - newColor red) abs < tolerance.
- 	self assert: (1 - newColor green) abs < tolerance.
- 	self assert: (0.5 - newColor blue) abs < tolerance.!

Item was removed:
- ----- Method: ColorTest>>testNegated (in category 'tests') -----
- testNegated
- 
- 	self assert: Color blue equals: Color yellow negated.
- 	self assert: (Color blue alpha: 0.4) equals: (Color yellow alpha: 0.4) negated.!

Item was removed:
- ----- Method: ColorTest>>testPrintHtmlString (in category 'tests') -----
- testPrintHtmlString
- 	"self debug: #testPrintHtmlString"
- 	
- 	"test the semantic of components"
- 	self assert: Color white printHtmlString = 'FFFFFF'.
- 	self assert: Color red printHtmlString =  'FF0000'.
- 	self assert: Color green printHtmlString =  '00FF00'.
- 	self assert: Color blue printHtmlString =  '0000FF'.
- 	self assert: Color black printHtmlString = '000000'.
- 	
- 	"test all possible values for each component (but no combinatorial)"
- 	16r00 to: 16rFF do:
- 		[:component |
- 		| xx o roo ogo oob |
- 		xx := component printStringBase: 16 length: 2 padded: true.
- 		o := '00'.
- 		roo := xx , o , o.
- 		ogo := o , xx , o.
- 		oob := o , o , xx.
- 		self assert: roo equals: (Color fromString: '#' , roo) printHtmlString.
- 		self assert: ogo equals: (Color fromString: '#' , ogo) printHtmlString.
- 		self assert: oob equals: (Color fromString: '#' , oob) printHtmlString].!

Item was removed:
- ClassTestCase subclass: #FormTest
- 	instanceVariableNames: ''
- 	classVariableNames: ''
- 	poolDictionaries: ''
- 	category: 'GraphicsTests-Primitives'!
- 
- !FormTest commentStamp: 'ar 7/21/2007 21:39' prior: 0!
- Various tests for class form.!

Item was removed:
- ----- Method: FormTest>>testIsAllWhite (in category 'tests') -----
- testIsAllWhite	"self run: #testIsAllWhite"
- 	"Make sure #isAllWhite works for all bit depths"
- 	
- 	#(-32 -16 -8 -4 -2 -1 1 2 4 8 16 32) do:[:d| | form |
- 		form := Form extent: 16 at 16 depth: d.
- 		form fillBlack.
- 		self deny: form isAllWhite.
- 		form fillWhite.
- 		self assert: form isAllWhite.
- 	].
- !

Item was removed:
- TestCase subclass: #GIFReadWriterTest
- 	instanceVariableNames: 'colorBlack'
- 	classVariableNames: ''
- 	poolDictionaries: ''
- 	category: 'GraphicsTests-Files'!

Item was removed:
- ----- Method: GIFReadWriterTest>>animatedColorFrames (in category 'support') -----
- animatedColorFrames
- 	"Responds with a collection of AnimatedImageFrames
- 	each containing equal-sized rectangles of green, red, 
- 	yellow. and black. When animated, these rectangles move
- 	into each other's positions, then back"
- 	| frames topLeft topRight bottomLeft bottomRight revFrames |
- 	frames := OrderedCollection new.
- 	topLeft := (0 at 0 extent: 200 at 200).
- 	topRight := (200 at 0 extent: 400 at 200).
- 	bottomLeft := (0 at 200 extent: 200 at 400).
- 	bottomRight := (200 at 200 extent: 400 at 400).
- 	
- 	0 to: 200 by: 20 do: [ :num |
- 		| newTopLeft newTopRight newBottomLeft newBottomRight canvas |
- 		newTopLeft := topLeft translateBy: (num at 0).
- 		newTopRight := topRight translateBy: (0 at num).
- 		newBottomLeft := (bottomLeft origin - (0 at num)) corner: (bottomLeft extent - (0 at num)).
- 		newBottomRight := (bottomRight origin - (num at 0)) extent: (bottomLeft extent - (0 at 0)).
- 		canvas := FormCanvas extent: 400 at 400 depth: 32.
- 		canvas
- 			fillRectangle: newTopLeft color: Color green;
- 			fillRectangle: newTopRight color: Color red;
- 			fillRectangle: newBottomLeft color: Color yellow;
- 			fillRectangle: newBottomRight color: Color black.
- 		frames add: (AnimatedImageFrame new
- 			form: canvas form;
- 			disposal: #restoreBackground;
- 			delay: 60) ].
- 
- 	revFrames := frames reversed.
- 	revFrames do: [ :f | frames add: f ].
- 	^ frames!

Item was removed:
- ----- Method: GIFReadWriterTest>>expectedFailures (in category 'failures') -----
- expectedFailures
- 
- 	^ #(
- 		testAnimatedColorsOutInRealBlack
- 		testColorsFileOutInRealBlack
- 		testColorsOutInRealBlack
- 	)!

Item was removed:
- ----- Method: GIFReadWriterTest>>setUp (in category 'running') -----
- setUp
- 
- 	super setUp.
- 	colorBlack := Color r: 0 g: 0 b: 1/255.!

Item was removed:
- ----- Method: GIFReadWriterTest>>testAnimatedColorsOutIn (in category 'tests') -----
- testAnimatedColorsOutIn
- 	"Ensure that the colored rectangles in the created
- 	animated gif are correct at different frames"
- 	| frames outBytes writer reader inBytes activeFrame |
- 	frames := self animatedColorFrames.
- 	
- 	"Write out the GIF bytes to the byte stream"
- 	outBytes := WriteStream on: (ByteArray new).
- 	writer := GIFReadWriter on: outBytes.
- 	frames do: [ :f | writer nextPutFrame: f ].
- 	writer close.
- 	
- 	"Read the GIF byte stream back into a GIF"
- 	inBytes := ReadStream on: (outBytes contents).
- 	reader := GIFReadWriter on: inBytes.
- 	reader
- 		readHeader;
- 		readBody.
- 	
- 	self assert: reader isAnimated equals: true.
- 	activeFrame := reader frames at: 1.
- 	self assert: (activeFrame form colorAt: 100 at 100) equals: Color green.
- 	self assert: (activeFrame form colorAt: 300 at 100) equals: Color red.
- 	self assert: (activeFrame form colorAt: 100 at 300) equals: Color yellow.
- 	self assert: (activeFrame form colorAt: 300 at 300) equals: colorBlack.
- 	activeFrame := reader frames at: 11.
- 	self assert: (activeFrame form colorAt: 100 at 100) equals: Color yellow.
- 	self assert: (activeFrame form colorAt: 300 at 100) equals: Color green.
- 	self assert: (activeFrame form colorAt: 100 at 300) equals: colorBlack.
- 	self assert: (activeFrame form colorAt: 300 at 300) equals: Color red.
- 	!

Item was removed:
- ----- Method: GIFReadWriterTest>>testAnimatedColorsOutInRealBlack (in category 'tests') -----
- testAnimatedColorsOutInRealBlack
- 
- 	colorBlack := Color black.
- 	self testAnimatedColorsOutIn.!

Item was removed:
- ----- Method: GIFReadWriterTest>>testColorsFileOutIn (in category 'tests') -----
- testColorsFileOutIn
- 	"Ensure that the colors that are written match up
- 	to the colors that are read in again"
- 	| canvas form outBytes inBytes writer reader |
- 	canvas := FormCanvas extent: 400 at 400.
- 	canvas
- 		fillRectangle: (0 at 0 extent: 200 at 200) color: Color green;
- 		fillRectangle: (200 at 0 extent: 400 at 200) color: Color red;
- 		fillRectangle: (0 at 200 extent: 200 at 400) color: Color yellow;
- 		fillRectangle: (200 at 200 extent: 400 at 400) color: colorBlack.
- 	form := canvas form.
- 	outBytes := FileStream fileNamed: 'testColorsFileOutIn.gif'.
- 	writer := GIFReadWriter on: outBytes.
- 	writer
- 		nextPutImage: form;
- 		close.
- 	inBytes := 'testColorsFileOutIn.gif' asDirectoryEntry readStream binary.
- 	reader := GIFReadWriter on: inBytes.
- 	reader
- 		readHeader;
- 		readBody.
- 	inBytes close.
- 	'testColorsFileOutIn.gif' asDirectoryEntry delete.
- 	self assert: reader isAnimated equals: false.
- 	self assert: (reader form colorAt: 50 at 50) equals: Color green.
- 	self assert: (reader form colorAt: 250 at 50) equals: Color red.
- 	self assert: (reader form colorAt: 50 at 250) equals: Color yellow.
- 	self assert: (reader form colorAt: 250 at 250) equals: colorBlack.!

Item was removed:
- ----- Method: GIFReadWriterTest>>testColorsFileOutInRealBlack (in category 'tests') -----
- testColorsFileOutInRealBlack
- 
- 	colorBlack := Color black.
- 	self testColorsFileOutIn.!

Item was removed:
- ----- Method: GIFReadWriterTest>>testColorsOutIn (in category 'tests') -----
- testColorsOutIn
- 	"Ensure that the colors that are written match up
- 	to the colors that are read in again"
- 	| canvas form outBytes inBytes writer reader |
- 	canvas := FormCanvas extent: 400 at 400.
- 	canvas
- 		fillRectangle: (0 at 0 extent: 200 at 200) color: Color green;
- 		fillRectangle: (200 at 0 extent: 400 at 200) color: Color red;
- 		fillRectangle: (0 at 200 extent: 200 at 400) color: Color yellow;
- 		fillRectangle: (200 at 200 extent: 400 at 400) color: colorBlack.
- 	form := canvas form.
- 	outBytes := WriteStream on: (ByteArray new).
- 	writer := GIFReadWriter on: outBytes.
- 	writer
- 		nextPutImage: form;
- 		close.
- 	outBytes := outBytes contents.
- 	inBytes := ReadStream on: outBytes.
- 	reader := GIFReadWriter on: inBytes.
- 	reader
- 		readHeader;
- 		readBody.
- 	self assert: reader isAnimated equals: false.
- 	self assert: (reader form colorAt: 50 at 50) equals: Color green.
- 	self assert: (reader form colorAt: 250 at 50) equals: Color red.
- 	self assert: (reader form colorAt: 50 at 250) equals: Color yellow.
- 	self assert: (reader form colorAt: 250 at 250) equals: colorBlack.!

Item was removed:
- ----- Method: GIFReadWriterTest>>testColorsOutInRealBlack (in category 'tests') -----
- testColorsOutInRealBlack
- 
- 	colorBlack := Color black.
- 	self testColorsOutIn.!

Item was removed:
- ----- Method: JPEGReadWriter>>decompressionTest (in category '*GraphicsTests') -----
- decompressionTest
- 	"Test decompression; don't generate actual image"
- 	
- MessageTally spyOn:[ | x xStep yStep y |
- 	ditherMask := DitherMasks at: 32.
- 	residuals := WordArray new: 3.
- 	sosSeen := false.
- 	self parseFirstMarker.
- 	[sosSeen] whileFalse: [self parseNextMarker].
- 	xStep := mcuWidth * DCTSize.
- 	yStep := mcuHeight * DCTSize.
- 	y := 0.
- 	1 to: mcuRowsInScan do:
- 		[:row |
- 		x := 0.
- 		1 to: mcusPerRow do:
- 			[:col |
- 			self decodeMCU.
- 			self idctMCU.
- 			self colorConvertMCU.
- 			x := x + xStep].
- 		y := y + yStep].
- ].!

Item was removed:
- TestCase subclass: #JPEGReadWriter2Test
- 	instanceVariableNames: ''
- 	classVariableNames: ''
- 	poolDictionaries: ''
- 	category: 'GraphicsTests-Files'!

Item was removed:
- ----- Method: JPEGReadWriter2Test>>formBytes (in category 'private') -----
- formBytes
- 	"A jpeg that was generated from Squeak. When written to and from a
- 	stream, the same bytes should be obtained."
- 
- 	^ #(255 216 255 224 0 16 74 70 73 70 0 1 1 0 0 1 0 1 0 0 255 219 0 67 0 8 6 6 7 6 5 8 7 7 7 9 9 8 10 12 20 13 12 11 11 12 25 18 19 15 20 29 26 31 30 29 26 28 28 32 36 46 39 32 34 44 35 28 28 40 55 41 44 48 49 52 52 52 31 39 57 61 56 50 60 46 51 52 50 255 219 0 67 1 9 9 9 12 11 12 24 13 13 24 50 33 28 33 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 255 192 0 17 8 0 1 0 1 3 1 34 0 2 17 1 3 17 1 255 196 0 31 0 0 1 5 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 255 196 0 181 16 0 2 1 3 3 2 4 3 5 5 4 4 0 0 1 125 1 2 3 0 4 17 5 18 33 49 65 6 19 81 97 7 34 113 20 50 129 145 161 8 35 66 177 193 21 82 209 240 36 51 98 114 130 9 10 22 23 24 25 26 37 38 39 40 41 42 52 53 54 55 56 57 58 67 68 69 70 71 72 73 74 83 84 85 86 87 88 89 90 99 100 101 102 103 104 105 106 115 116 117 118 119 120 121 122 131 132 133 134 135 136 137 138 146 147 148 149 150 151 152 153 154 162 163 164 165 166 
 167 168 169 170 178 179 180 181 182 183 184 185 186 194 195 196 197 198 199 200 201 202 210 211 212 213 214 215 216 217 218 225 226 227 228 229 230 231 232 233 234 241 242 243 244 245 246 247 248 249 250 255 196 0 31 1 0 3 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 255 196 0 181 17 0 2 1 2 4 4 3 4 7 5 4 4 0 1 2 119 0 1 2 3 17 4 5 33 49 6 18 65 81 7 97 113 19 34 50 129 8 20 66 145 161 177 193 9 35 51 82 240 21 98 114 209 10 22 36 52 225 37 241 23 24 25 26 38 39 40 41 42 53 54 55 56 57 58 67 68 69 70 71 72 73 74 83 84 85 86 87 88 89 90 99 100 101 102 103 104 105 106 115 116 117 118 119 120 121 122 130 131 132 133 134 135 136 137 138 146 147 148 149 150 151 152 153 154 162 163 164 165 166 167 168 169 170 178 179 180 181 182 183 184 185 186 194 195 196 197 198 199 200 201 202 210 211 212 213 214 215 216 217 218 226 227 228 229 230 231 232 233 234 242 243 244 245 246 247 248 249 250 255 218 0 12 3 1 0 2 17 3 17 0 63 0 40 162 138 0 255 217) asByteArray!

Item was removed:
- ----- Method: JPEGReadWriter2Test>>testHighEntropyImageCanBeWrittenInHighQuality (in category 'tests') -----
- testHighEntropyImageCanBeWrittenInHighQuality
- 	"This should not throw an exception."
- 	ByteArray streamContents: [ :stream |
- 		| form rng |
- 		form := Form extent: 20 @ 20 depth: 32.
- 		rng := Random seed: 36rSQUEAK.
- 		0 to: form height do: [ :y |
- 			0 to: form width do: [ :x |
- 				form pixelValueAt: x @ y put: (rng nextInt: 16r100000000) - 1 ] ].
- 		(JPEGReadWriter2 on: stream) 
- 			nextPutImage: form quality: 100 progressiveJPEG: true ]!

Item was removed:
- ----- Method: JPEGReadWriter2Test>>testPluginPresent (in category 'tests') -----
- testPluginPresent
- 
- 	self assert: JPEGReadWriter2 new isPluginPresent!

Item was removed:
- ----- Method: JPEGReadWriter2Test>>testPrimJPEGReadImage (in category 'tests') -----
- testPrimJPEGReadImage
- 
- 	| form |
- 	form := JPEGReadWriter2 formFromStream: self formBytes readStream.
- 	self should: form bits first = 16rFF808080
- 
- "[Vm-dev] JPEGReadWriter2Plugin
- Bert Freudenberg bert at freudenbergs.de
- Mon Sep 27 15:22:43 UTC 2010
- 
- Hi,
- 
- have there been changes lately to the jpeg plugin?
- 
- On a Mac 4.2.4 VM I see an off-by-one error, all pixels are moved to the right, the first pixel is transparent. On a Mac 5.8.1 Cog VM it works as expected though.
- 
- Here's my little test:
- 
- (JPEGReadWriter2 formFromStream: #[16rFF 16rD8 16rFF 16rE0 16r00 16r10 16r4A 16r46 16r49 16r46 16r00 16r01 16r01 16r01 16r00 16r48 16r00 16r48 16r00 16r00 16rFF 16rDB 16r00 16r43 16r00 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rFF 16rC2 16r00 16r0B 16r08 16r00 16r01 16r00 16r01 16r01 16r01 16r11 16r00 16rFF 16rC4 16r00 16r14 16r10 16r01 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16rFF 16rDA 16r00 16r08 16r01 16r01 16r00 16r01 16r3F 16r10] readStream) bits first hex
- 
- On 5.8.11 I get 16rFF808080 as expected, on 4.2.4 I get 0.
- "!

Item was removed:
- ----- Method: JPEGReadWriter2Test>>testPrimJPEGWriteImage (in category 'tests') -----
- testPrimJPEGWriteImage
- 
- 	| form bytes ws |
- 	form := JPEGReadWriter2 formFromStream: self formBytes readStream.
- 	ws := WriteStream on: ByteArray new.
- 	JPEGReadWriter2 putForm: form onStream: ws.
- 	bytes := ws contents.
- 	self should: self formBytes = bytes!

Item was removed:
- TestCase subclass: #PNGReadWriterTest
- 	instanceVariableNames: 'fileName'
- 	classVariableNames: ''
- 	poolDictionaries: ''
- 	category: 'GraphicsTests-Files'!

Item was removed:
- ----- Method: PNGReadWriterTest>>coloredFiles16 (in category 'tests - decoding') -----
- coloredFiles16
- 	"Created by
- 		{Color red. Color green. Color blue. Color black} collect:[:fillC|
- 			| ff bytes |
- 			ff := Form extent: 32 at 32 depth: 16.
- 			ff fillColor: fillC.
- 			bytes := WriteStream on: ByteArray new.
- 			PNGReadWriter putForm: ff onStream: bytes.
- 			fillC ->
- 				(Base64MimeConverter mimeEncode: (bytes contents readStream)) contents
- 		].
- 	"
- 	^{Color red-> 
- 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQFBQUBSsjp7wAAADZJ
- REFUeF7lziEBAAAMAjD6J8b9MRAT80uT65Af8AN+wA/4AT/gB/yAH/ADfsAP+AE/4AfmgQdc
- z9xqBS2pdAAAAABJRU5ErkJggg=='.
- 	Color green->
- 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQFBQUBSsjp7wAAADVJ
- REFUeF7lziEBAAAMAjD6J77jMRAT80sunfIDfsAP+AE/4Af8gB/wA37AD/gBP+AH/MA68HyT
- 3Gqf2I6NAAAAAElFTkSuQmCC'.
- 		Color blue->
- 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQFBQUBSsjp7wAAADVJ
- REFUeF7lziEBAAAMAjD6J77jMRAT80ty3fIDfsAP+AE/4Af8gB/wA37AD/gBP+AH/MA48JxX
- 3GpYhihrAAAAAElFTkSuQmCC'.
- 	Color black->
- 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQFBQUBSsjp7wAAADVJ
- REFUeF7lziEBAAAMAjDk+xfmMRAT80ty3fIDfsAP+AE/4Af8gB/wA37AD/gBP+AH/MA48LbT
- HD3MKH3GAAAAAElFTkSuQmCC'
- }!

Item was removed:
- ----- Method: PNGReadWriterTest>>coloredFiles32 (in category 'tests - decoding') -----
- coloredFiles32
- 	"Created by
- 		{Color red. Color green. Color blue. Color black} collect:[:fillC|
- 			| ff bytes |
- 			ff := Form extent: 32 at 32 depth: 32.
- 			ff fillColor: fillC.
- 			bytes := WriteStream on: ByteArray new.
- 			PNGReadWriter putForm: ff onStream: bytes.
- 			fillC ->
- 				(Base64MimeConverter mimeEncode: (bytes contents readStream)) contents
- 		].
- 	"
- 	^{
- 		Color red -> 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAANUlEQVR4XuXOIQEAAAwEoe9f
- +hZjAoFnbfVo+QE/4Af8gB/wA37AD/gBP+AH/IAf8AN+4DlwVA34ajP6EEoAAAAASUVORK5C
- YII='.
- 		Color green -> 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAM0lEQVR4XuXOMQ0AAAACIPuX
- 1hgejAIkPfMDfsAP+AE/4Af8gB/wA37AD/gBP+AH/MA7MFfR+Grvv2BdAAAAAElFTkSuQmCC'.
- 
- 	Color blue->
- 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAANElEQVR4XuXOIQEAAAACIP+f
- 1hkGAp0k7Zcf8AN+wA/4AT/gB/yAH/ADfsAP+AE/4AfOgQFblfhqnnPWHAAAAABJRU5ErkJg
- gg=='.
- 		Color black -> 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAANUlEQVR4XuXOMQEAAAwCINc/
- tIvhwcFPkuuWH/ADfsAP+AE/4Af8gB/wA37AD/gBP+AHxoEH95UAPU59TTMAAAAASUVORK5C
- YII='
- }!

Item was removed:
- ----- Method: PNGReadWriterTest>>coloredFiles8 (in category 'tests - decoding') -----
- coloredFiles8
- 	"Created by
- 		{Color red. Color green. Color blue. Color black} collect:[:fillC|
- 			| ff bytes |
- 			ff := Form extent: 32 at 32 depth: 8.
- 			ff fillColor: fillC.
- 			bytes := WriteStream on: ByteArray new.
- 			PNGReadWriter putForm: ff onStream: bytes.
- 			fillC ->
- 				(Base64MimeConverter mimeEncode: (bytes contents readStream)) contents
- 		].
- 	"
- 	^{Color red->
- 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAADAFBMVEX///8AAAD///9/f3//
- AAAA/wAAAP8A/////wD/AP8fHx8/Pz9fX1+fn5+/v7/f398HBwcPDw8XFxcnJycvLy83NzdH
- R0dPT09XV1dnZ2dvb293d3eHh4ePj4+Xl5enp6evr6+3t7fHx8fPz8/X19fn5+fv7+/39/cA
- AAAAMgAAZQAAmAAAywAA/wAAADIAMjIAZTIAmDIAyzIA/zIAAGUAMmUAZWUAmGUAy2UA/2UA
- AJgAMpgAZZgAmJgAy5gA/5gAAMsAMssAZcsAmMsAy8sA/8sAAP8AMv8AZf8AmP8Ay/8A//8y
- AAAyMgAyZQAymAAyywAy/wAyADIyMjIyZTIymDIyyzIy/zIyAGUyMmUyZWUymGUyy2Uy/2Uy
- AJgyMpgyZZgymJgyy5gy/5gyAMsyMssyZcsymMsyy8sy/8syAP8yMv8yZf8ymP8yy/8y//9l
- AABlMgBlZQBlmABlywBl/wBlADJlMjJlZTJlmDJlyzJl/zJlAGVlMmVlZWVlmGVly2Vl/2Vl
- AJhlMphlZZhlmJhly5hl/5hlAMtlMstlZctlmMtly8tl/8tlAP9lMv9lZf9lmP9ly/9l//+Y
- AACYMgCYZQCYmACYywCY/wCYADKYMjKYZTKYmDKYyzKY/zKYAGWYMmWYZWWYmGWYy2WY/2WY
- AJiYMpiYZZiYmJiYy5iY/5iYAMuYMsuYZcuYmMuYy8uY/8uYAP+YMv+YZf+YmP+Yy/+Y///L
- AADLMgDLZQDLmADLywDL/wDLADLLMjLLZTLLmDLLyzLL/zLLAGXLMmXLZWXLmGXLy2XL/2XL
- AJjLMpjLZZjLmJjLy5jL/5jLAMvLMsvLZcvLmMvLy8vL/8vLAP/LMv/LZf/LmP/Ly//L////
- AAD/MgD/ZQD/mAD/ywD//wD/ADL/MjL/ZTL/mDL/yzL//zL/AGX/MmX/ZWX/mGX/y2X//2X/
- AJj/Mpj/ZZj/mJj/y5j//5j/AMv/Msv/Zcv/mMv/y8v//8v/AP//Mv//Zf//mP//y/////9E
- CiHUAAAAGklEQVR4XmO4cwc/YLgz8hWMfAUjX8EIVQAAbnlwLukXXkcAAAAASUVORK5CYII='.
- 
- 	Color green->
- 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAADAFBMVEX///8AAAD///9/f3//
- AAAA/wAAAP8A/////wD/AP8fHx8/Pz9fX1+fn5+/v7/f398HBwcPDw8XFxcnJycvLy83NzdH
- R0dPT09XV1dnZ2dvb293d3eHh4ePj4+Xl5enp6evr6+3t7fHx8fPz8/X19fn5+fv7+/39/cA
- AAAAMgAAZQAAmAAAywAA/wAAADIAMjIAZTIAmDIAyzIA/zIAAGUAMmUAZWUAmGUAy2UA/2UA
- AJgAMpgAZZgAmJgAy5gA/5gAAMsAMssAZcsAmMsAy8sA/8sAAP8AMv8AZf8AmP8Ay/8A//8y
- AAAyMgAyZQAymAAyywAy/wAyADIyMjIyZTIymDIyyzIy/zIyAGUyMmUyZWUymGUyy2Uy/2Uy
- AJgyMpgyZZgymJgyy5gy/5gyAMsyMssyZcsymMsyy8sy/8syAP8yMv8yZf8ymP8yy/8y//9l
- AABlMgBlZQBlmABlywBl/wBlADJlMjJlZTJlmDJlyzJl/zJlAGVlMmVlZWVlmGVly2Vl/2Vl
- AJhlMphlZZhlmJhly5hl/5hlAMtlMstlZctlmMtly8tl/8tlAP9lMv9lZf9lmP9ly/9l//+Y
- AACYMgCYZQCYmACYywCY/wCYADKYMjKYZTKYmDKYyzKY/zKYAGWYMmWYZWWYmGWYy2WY/2WY
- AJiYMpiYZZiYmJiYy5iY/5iYAMuYMsuYZcuYmMuYy8uY/8uYAP+YMv+YZf+YmP+Yy/+Y///L
- AADLMgDLZQDLmADLywDL/wDLADLLMjLLZTLLmDLLyzLL/zLLAGXLMmXLZWXLmGXLy2XL/2XL
- AJjLMpjLZZjLmJjLy5jL/5jLAMvLMsvLZcvLmMvLy8vL/8vLAP/LMv/LZf/LmP/Ly//L////
- AAD/MgD/ZQD/mAD/ywD//wD/ADL/MjL/ZTL/mDL/yzL//zL/AGX/MmX/ZWX/mGX/y2X//2X/
- AJj/Mpj/ZZj/mJj/y5j//5j/AMv/Msv/Zcv/mMv/y8v//8v/AP//Mv//Zf//mP//y/////9E
- CiHUAAAAGUlEQVR4XmPQ1cUPGHRHvoKRr2DkKxihCgBZ3bQBCq5u/AAAAABJRU5ErkJggg=='.
- 
- 	Color blue->
- 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAADAFBMVEX///8AAAD///9/f3//
- AAAA/wAAAP8A/////wD/AP8fHx8/Pz9fX1+fn5+/v7/f398HBwcPDw8XFxcnJycvLy83NzdH
- R0dPT09XV1dnZ2dvb293d3eHh4ePj4+Xl5enp6evr6+3t7fHx8fPz8/X19fn5+fv7+/39/cA
- AAAAMgAAZQAAmAAAywAA/wAAADIAMjIAZTIAmDIAyzIA/zIAAGUAMmUAZWUAmGUAy2UA/2UA
- AJgAMpgAZZgAmJgAy5gA/5gAAMsAMssAZcsAmMsAy8sA/8sAAP8AMv8AZf8AmP8Ay/8A//8y
- AAAyMgAyZQAymAAyywAy/wAyADIyMjIyZTIymDIyyzIy/zIyAGUyMmUyZWUymGUyy2Uy/2Uy
- AJgyMpgyZZgymJgyy5gy/5gyAMsyMssyZcsymMsyy8sy/8syAP8yMv8yZf8ymP8yy/8y//9l
- AABlMgBlZQBlmABlywBl/wBlADJlMjJlZTJlmDJlyzJl/zJlAGVlMmVlZWVlmGVly2Vl/2Vl
- AJhlMphlZZhlmJhly5hl/5hlAMtlMstlZctlmMtly8tl/8tlAP9lMv9lZf9lmP9ly/9l//+Y
- AACYMgCYZQCYmACYywCY/wCYADKYMjKYZTKYmDKYyzKY/zKYAGWYMmWYZWWYmGWYy2WY/2WY
- AJiYMpiYZZiYmJiYy5iY/5iYAMuYMsuYZcuYmMuYy8uY/8uYAP+YMv+YZf+YmP+Yy/+Y///L
- AADLMgDLZQDLmADLywDL/wDLADLLMjLLZTLLmDLLyzLL/zLLAGXLMmXLZWXLmGXLy2XL/2XL
- AJjLMpjLZZjLmJjLy5jL/5jLAMvLMsvLZcvLmMvLy8vL/8vLAP/LMv/LZf/LmP/Ly//L////
- AAD/MgD/ZQD/mAD/ywD//wD/ADL/MjL/ZTL/mDL/yzL//zL/AGX/MmX/ZWX/mGX/y2X//2X/
- AJj/Mpj/ZZj/mJj/y5j//5j/AMv/Msv/Zcv/mMv/y8v//8v/AP//Mv//Zf//mP//y/////9E
- CiHUAAAAGUlEQVR4XmNwc8MPGNxGvoKRr2DkKxihCgCl7xgQRbPxcwAAAABJRU5ErkJggg=='.
- 
- 	Color black->
- 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAADAFBMVEX///8AAAD///9/f3//
- AAAA/wAAAP8A/////wD/AP8fHx8/Pz9fX1+fn5+/v7/f398HBwcPDw8XFxcnJycvLy83NzdH
- R0dPT09XV1dnZ2dvb293d3eHh4ePj4+Xl5enp6evr6+3t7fHx8fPz8/X19fn5+fv7+/39/cA
- AAAAMgAAZQAAmAAAywAA/wAAADIAMjIAZTIAmDIAyzIA/zIAAGUAMmUAZWUAmGUAy2UA/2UA
- AJgAMpgAZZgAmJgAy5gA/5gAAMsAMssAZcsAmMsAy8sA/8sAAP8AMv8AZf8AmP8Ay/8A//8y
- AAAyMgAyZQAymAAyywAy/wAyADIyMjIyZTIymDIyyzIy/zIyAGUyMmUyZWUymGUyy2Uy/2Uy
- AJgyMpgyZZgymJgyy5gy/5gyAMsyMssyZcsymMsyy8sy/8syAP8yMv8yZf8ymP8yy/8y//9l
- AABlMgBlZQBlmABlywBl/wBlADJlMjJlZTJlmDJlyzJl/zJlAGVlMmVlZWVlmGVly2Vl/2Vl
- AJhlMphlZZhlmJhly5hl/5hlAMtlMstlZctlmMtly8tl/8tlAP9lMv9lZf9lmP9ly/9l//+Y
- AACYMgCYZQCYmACYywCY/wCYADKYMjKYZTKYmDKYyzKY/zKYAGWYMmWYZWWYmGWYy2WY/2WY
- AJiYMpiYZZiYmJiYy5iY/5iYAMuYMsuYZcuYmMuYy8uY/8uYAP+YMv+YZf+YmP+Yy/+Y///L
- AADLMgDLZQDLmADLywDL/wDLADLLMjLLZTLLmDLLyzLL/zLLAGXLMmXLZWXLmGXLy2XL/2XL
- AJjLMpjLZZjLmJjLy5jL/5jLAMvLMsvLZcvLmMvLy8vL/8vLAP/LMv/LZf/LmP/Ly//L////
- AAD/MgD/ZQD/mAD/ywD//wD/ADL/MjL/ZTL/mDL/yzL//zL/AGX/MmX/ZWX/mGX/y2X//2X/
- AJj/Mpj/ZZj/mJj/y5j//5j/AMv/Msv/Zcv/mMv/y8v//8v/AP//Mv//Zf//mP//y/////9E
- CiHUAAAAGUlEQVR4XmNgZMQPGBhHvoKRr2DkKxihCgBEmAQBphO0cAAAAABJRU5ErkJggg=='
- }!

Item was removed:
- ----- Method: PNGReadWriterTest>>decodeColors:depth: (in category 'tests - decoding') -----
- decodeColors: colorsAndFiles depth: requiredDepth
- 	
- 	colorsAndFiles do:[:assoc| | form color bytes |
- 		color := assoc key.
- 		bytes := Base64MimeConverter mimeDecodeToBytes: assoc value readStream.
- 		form := PNGReadWriter formFromStream: bytes.
- 		self assert: requiredDepth equals: form depth description: 'Form depth'.
- 		self assert: (color pixelValueForDepth: requiredDepth) equals: (form pixelValueAt: 1 at 1) description: 'Corner pixel'.
- 	].!

Item was removed:
- ----- Method: PNGReadWriterTest>>drawStuffOn: (in category 'helpers') -----
- drawStuffOn: aForm
- 	"Draw stuff on aForm. Avoid any symmetry."
- 	| canvas |
- 	canvas := FormCanvas on: aForm.
- 	canvas frameAndFillRectangle: (1 @ 1 corner: aForm extent - 15) fillColor: Color red borderWidth: 3 borderColor: Color green.
- 	canvas fillOval: (aForm boundingBox topRight - (15 @ -5) extent: 20 @ 20) color: Color blue borderWidth: 1 borderColor: Color white.
- 	^aForm
- 	"(PNGReadWriterTest new drawStuffOn: (Form extent: 32 @ 32 depth: 16)) display"!

Item was removed:
- ----- Method: PNGReadWriterTest>>drawTransparentStuffOn: (in category 'helpers') -----
- drawTransparentStuffOn: aForm
- 	"Draw stuff on aForm. Avoid any symmetry."
- 	| canvas |
- 	canvas := FormCanvas on: aForm.
- 	canvas frameAndFillRectangle: (1 @ 1 corner: aForm extent - 15) fillColor: (Color red alpha: 0.25) borderWidth: 3 borderColor: (Color green alpha: 0.5).
- 	canvas fillOval: (aForm boundingBox topRight - (15 @ -5) extent: 20 @ 20) color: (Color white alpha: 0.75) borderWidth: 1 borderColor: Color blue.
- 	^aForm
- 	"(PNGReadWriterTest new drawStuffOn: (Form extent: 32 @ 32 depth: 16)) display"!

Item was removed:
- ----- Method: PNGReadWriterTest>>encodeAndDecode: (in category 'helpers') -----
- encodeAndDecode: original
- 	"Make sure that the given form is encoded and decoded correctly"
- 	| stream bytes decoded |
- 	"encode"
- 	stream := ByteArray new writeStream.
- 	(PNGReadWriter on: stream) nextPutImage: original; close.
- 	bytes := stream contents.
- 
- 	self writeEncoded: bytes.
- 
- 	"decode"
- 	stream := self readEncoded: bytes.
- 	decoded := (PNGReadWriter new on: stream) nextImage.
- 	decoded display.
- 
- 	"compare"
- 	self assert: original width = decoded width.
- 	self assert: original height = decoded height.
- 	self assert: original depth = decoded depth.
- 	self assert: original bits = decoded bits.
- 	self assert: original class == decoded class.
- 	(original isColorForm) ifTrue:[
- 		original colors with: decoded colors do:[:c1 :c2| | maxErr |
- 			"we must round here due to encoding errors"
- 			maxErr := 1. "max. error for 8bit rgb component"
- 			self assert: ((c1 red * 255) truncated - (c2 red * 255) truncated) abs <= maxErr.
- 			self assert: ((c1 green * 255) truncated - (c2 green * 255) truncated) abs <= maxErr.
- 			self assert: ((c1 blue * 255) truncated - (c2 blue * 255) truncated) abs <= maxErr.
- 			self assert: ((c1 alpha * 255) truncated - (c2 alpha * 255) truncated) abs <= maxErr.
- 		].
- 	].!

Item was removed:
- ----- Method: PNGReadWriterTest>>encodeAndDecodeAlpha: (in category 'helpers') -----
- encodeAndDecodeAlpha: original
- 	fileName := 'testAlpha', original depth printString,'.png'.
- 	self encodeAndDecode: original.!

Item was removed:
- ----- Method: PNGReadWriterTest>>encodeAndDecodeColor:depth: (in category 'helpers') -----
- encodeAndDecodeColor: aColor depth: aDepth
- 	| aForm |
- 	fileName := 'testColor', aColor name, aDepth printString,'.png'.
- 	aForm := Form extent: 32 at 32 depth: aDepth.
- 	aForm fillColor: aColor.
- 	self encodeAndDecode: aForm.
- !

Item was removed:
- ----- Method: PNGReadWriterTest>>encodeAndDecodeDisplay: (in category 'helpers') -----
- encodeAndDecodeDisplay: depth
- 	| form |
- 	fileName := 'testDisplay', depth printString,'.png'.
- 	form := Form extent: (Display extent min: 560 at 560) depth: depth.
- 	Smalltalk isMorphic 
- 		ifTrue:[Project current world fullDrawOn: form getCanvas]
- 		ifFalse:[Display displayOn: form].
- 	self encodeAndDecode: form.!

Item was removed:
- ----- Method: PNGReadWriterTest>>encodeAndDecodeForm: (in category 'helpers') -----
- encodeAndDecodeForm: original
- 	fileName := 'testForm', original depth printString,'.png'.
- 	self encodeAndDecode: original.!

Item was removed:
- ----- Method: PNGReadWriterTest>>encodeAndDecodeReverse: (in category 'helpers') -----
- encodeAndDecodeReverse: original
- 	"Make sure that the given form is encoded and decoded correctly"
- 	| stream bytes decoded reversed |
- 	fileName := 'testReverse', original depth printString,'.png'.
- 	self assert: original class == Form. "won't work with ColorForm"
- 	"Switch pixel order"
- 	reversed := Form extent: original extent depth: original depth negated.
- 	original displayOn: reversed.
- 	self assert: original width = reversed width.
- 	self assert: original height = reversed height.
- 	self assert: original depth = reversed depth.
- 	self deny: original nativeDepth = reversed nativeDepth.
- 	original depth = 32
- 		ifTrue:[self assert: original bits = reversed bits]
- 		ifFalse:[self deny: original bits = reversed bits].
- 
- 	"encode"
- 	stream := ByteArray new writeStream.
- 	(PNGReadWriter on: stream) nextPutImage: reversed; close.
- 	bytes := stream contents.
- 	self writeEncoded: bytes.
- 
- 	"decode"
- 	stream := bytes readStream.
- 	decoded := (PNGReadWriter new on: stream) nextImage.
- 	decoded display.
- 
- 	"compare"
- 	self assert: original width = decoded width.
- 	self assert: original height = decoded height.
- 	self assert: original depth = decoded depth.
- 	self assert: original bits = decoded bits.
- 	self assert: original class == decoded class.
- 	(original isColorForm) ifTrue:[
- 		original colors with: decoded colors do:[:c1 :c2| | maxErr |
- 			"we must round here due to encoding errors"
- 			maxErr := 1. "max. error for 8bit rgb component"
- 			self assert: ((c1 red * 255) truncated - (c2 red * 255) truncated) abs <= maxErr.
- 			self assert: ((c1 green * 255) truncated - (c2 green * 255) truncated) abs <= maxErr.
- 			self assert: ((c1 blue * 255) truncated - (c2 blue * 255) truncated) abs <= maxErr.
- 			self assert: ((c1 alpha * 255) truncated - (c2 alpha * 255) truncated) abs <= maxErr.
- 		].
- 	].!

Item was removed:
- ----- Method: PNGReadWriterTest>>encodeAndDecodeStream: (in category 'helpers') -----
- encodeAndDecodeStream: file
- 	| aForm |
- 	file reset.
- 	(PNGReadWriter new on: file) understandsImageFormat ifFalse:[^self error: 'don''t understand format!!' ].
- 	file reset.
- 	aForm := (PNGReadWriter new on: file) nextImage.
- 	aForm ifNil:[^self error: 'nil form' ].
- 	aForm display.
- 	self encodeAndDecode: aForm.
- !

Item was removed:
- ----- Method: PNGReadWriterTest>>encodeAndDecodeWithColors: (in category 'helpers') -----
- encodeAndDecodeWithColors: aColorForm
- 	"Screw around with aColorForm colors"
- 	| colors nColors indexedColors max myRandom |
- 	fileName := 'testColors', aColorForm depth printString,'.png'.
- 	indexedColors := Color indexedColors.
- 	nColors := 1 bitShift: aColorForm depth.
- 	colors := WriteStream on: Array new.
- 
- 	"Make first half translucent"
- 	max := nColors // 2.
- 	1 to: max do:[:i|
- 		colors nextPut: ((indexedColors at: i) alpha: i / max asFloat).
- 	].
- 
- 	"Make random choices for second half"
- 	myRandom := Random seed: 42315.
- 	max to: nColors do:[:i|
- 		colors nextPut: (indexedColors atRandom: myRandom).
- 	].
- !

Item was removed:
- ----- Method: PNGReadWriterTest>>encodeAndDecodeWithError: (in category 'helpers') -----
- encodeAndDecodeWithError: aStream
- 	self should:[self encodeAndDecodeStream: aStream] raise: Error!

Item was removed:
- ----- Method: PNGReadWriterTest>>encodeColors:depth: (in category 'tests - decoding') -----
- encodeColors: colorsAndFiles depth: requiredDepth
- 	
- 	colorsAndFiles do:[:assoc| | ff color original encoded |
- 		color := assoc key.
- 		original := Base64MimeConverter mimeDecodeToBytes: assoc value readStream.
- 		ff := Form extent: 32 at 32 depth: requiredDepth.
- 		ff fillColor: color.
- 		encoded := WriteStream on: ByteArray new.
- 		PNGReadWriter putForm: ff onStream: encoded.
- 		self assert: (encoded contents = original contents).
- 	].!

Item was removed:
- ----- Method: PNGReadWriterTest>>grayScaleData (in category 'tests - grayscale') -----
(excessive size, no diff calculated)

Item was removed:
- ----- Method: PNGReadWriterTest>>readEncoded: (in category 'helpers') -----
- readEncoded: bytes
- 	"Answer a ReadStream on the file named by fileName, if possible; else a ReadStream on bytes"
- 
- 	fileName ifNil:[^ bytes readStream ].
- 	^(FileStream oldFileOrNoneNamed: fileName) ifNil: [ 
- 		Transcript nextPutAll: 'can''t open ', fileName; cr.
- 		bytes readStream ].
- !

Item was removed:
- ----- Method: PNGReadWriterTest>>setUp (in category 'helpers') -----
- setUp
- 	fileName := nil.!

Item was removed:
- ----- Method: PNGReadWriterTest>>tearDown (in category 'helpers') -----
- tearDown
- 	Project current world changed.
- 	fileName notNil ifTrue: [FileDirectory default deleteFileNamed: fileName]!

Item was removed:
- ----- Method: PNGReadWriterTest>>test16Bit (in category 'tests - bits') -----
- test16Bit
- 	self encodeAndDecodeForm: (self drawStuffOn: (Form extent: 33 at 33 depth: 16))!

Item was removed:
- ----- Method: PNGReadWriterTest>>test16BitDisplay (in category 'tests - bits') -----
- test16BitDisplay
- 	self encodeAndDecodeDisplay: 16!

Item was removed:
- ----- Method: PNGReadWriterTest>>test16BitReversed (in category 'tests - bits') -----
- test16BitReversed
- 	self encodeAndDecodeReverse: (self drawStuffOn: (Form extent: 33 at 33 depth: 16))!

Item was removed:
- ----- Method: PNGReadWriterTest>>test1Bit (in category 'tests - bits') -----
- test1Bit
- 	self encodeAndDecodeForm: (self drawStuffOn: (Form extent: 33 at 33 depth: 1))!

Item was removed:
- ----- Method: PNGReadWriterTest>>test1BitColors (in category 'tests - bits') -----
- test1BitColors
- 	self encodeAndDecodeWithColors: (self drawStuffOn: (Form extent: 33 at 33 depth: 1))!

Item was removed:
- ----- Method: PNGReadWriterTest>>test1BitDisplay (in category 'tests - bits') -----
- test1BitDisplay
- 	self encodeAndDecodeDisplay: 1!

Item was removed:
- ----- Method: PNGReadWriterTest>>test1BitReversed (in category 'tests - bits') -----
- test1BitReversed
- 	self encodeAndDecodeReverse: (self drawStuffOn: (Form extent: 33 at 33 depth: 1))!

Item was removed:
- ----- Method: PNGReadWriterTest>>test2Bit (in category 'tests - bits') -----
- test2Bit
- 	self encodeAndDecodeForm: (self drawStuffOn: (Form extent: 33 at 33 depth: 2))!

Item was removed:
- ----- Method: PNGReadWriterTest>>test2BitColors (in category 'tests - bits') -----
- test2BitColors
- 	self encodeAndDecodeWithColors: (self drawStuffOn: (Form extent: 33 at 33 depth: 2))!

Item was removed:
- ----- Method: PNGReadWriterTest>>test2BitDisplay (in category 'tests - bits') -----
- test2BitDisplay
- 	self encodeAndDecodeDisplay: 2!

Item was removed:
- ----- Method: PNGReadWriterTest>>test2BitReversed (in category 'tests - bits') -----
- test2BitReversed
- 	self encodeAndDecodeReverse: (self drawStuffOn: (Form extent: 33 at 33 depth: 2))!

Item was removed:
- ----- Method: PNGReadWriterTest>>test32Bit (in category 'tests - bits') -----
- test32Bit
- 	self encodeAndDecodeForm: (self drawStuffOn: (Form extent: 33 at 33 depth: 32))!

Item was removed:
- ----- Method: PNGReadWriterTest>>test32BitDisplay (in category 'tests - bits') -----
- test32BitDisplay
- 	self encodeAndDecodeDisplay: 32!

Item was removed:
- ----- Method: PNGReadWriterTest>>test32BitReversed (in category 'tests - bits') -----
- test32BitReversed
- 	self encodeAndDecodeReverse: (self drawStuffOn: (Form extent: 33 at 33 depth: 32))!

Item was removed:
- ----- Method: PNGReadWriterTest>>test4Bit (in category 'tests - bits') -----
- test4Bit
- 	self encodeAndDecodeForm: (self drawStuffOn: (Form extent: 33 at 33 depth: 4))!

Item was removed:
- ----- Method: PNGReadWriterTest>>test4BitColors (in category 'tests - bits') -----
- test4BitColors
- 	self encodeAndDecodeWithColors: (self drawStuffOn: (Form extent: 33 at 33 depth: 4))!

Item was removed:
- ----- Method: PNGReadWriterTest>>test4BitDisplay (in category 'tests - bits') -----
- test4BitDisplay
- 	self encodeAndDecodeDisplay: 4!

Item was removed:
- ----- Method: PNGReadWriterTest>>test4BitReversed (in category 'tests - bits') -----
- test4BitReversed
- 	self encodeAndDecodeReverse: (self drawStuffOn: (Form extent: 33 at 33 depth: 4))!

Item was removed:
- ----- Method: PNGReadWriterTest>>test8Bit (in category 'tests - bits') -----
- test8Bit
- 	self encodeAndDecodeForm: (self drawStuffOn: (Form extent: 33 at 33 depth: 8))!

Item was removed:
- ----- Method: PNGReadWriterTest>>test8BitColors (in category 'tests - bits') -----
- test8BitColors
- 	self encodeAndDecodeWithColors: (self drawStuffOn: (Form extent: 33 at 33 depth: 8))!

Item was removed:
- ----- Method: PNGReadWriterTest>>test8BitDisplay (in category 'tests - bits') -----
- test8BitDisplay
- 	self encodeAndDecodeDisplay: 8!

Item was removed:
- ----- Method: PNGReadWriterTest>>test8BitReversed (in category 'tests - bits') -----
- test8BitReversed
- 	self encodeAndDecodeReverse: (self drawStuffOn: (Form extent: 33 at 33 depth: 8))!

Item was removed:
- ----- Method: PNGReadWriterTest>>testAlphaCoding (in category 'tests - bits') -----
- testAlphaCoding
- 	self encodeAndDecodeAlpha: (self drawTransparentStuffOn: (Form extent: 33 at 33 depth: 32))!

Item was removed:
- ----- Method: PNGReadWriterTest>>testBlack16 (in category 'tests - colors') -----
- testBlack16
- 	self encodeAndDecodeColor: Color blue depth: 16!

Item was removed:
- ----- Method: PNGReadWriterTest>>testBlack32 (in category 'tests - colors') -----
- testBlack32
- 	self encodeAndDecodeColor: Color blue depth: 32!

Item was removed:
- ----- Method: PNGReadWriterTest>>testBlack8 (in category 'tests - colors') -----
- testBlack8
- 	self encodeAndDecodeColor: Color blue depth: 8!

Item was removed:
- ----- Method: PNGReadWriterTest>>testBlue16 (in category 'tests - colors') -----
- testBlue16
- 	self encodeAndDecodeColor: Color blue depth: 16!

Item was removed:
- ----- Method: PNGReadWriterTest>>testBlue32 (in category 'tests - colors') -----
- testBlue32
- 	self encodeAndDecodeColor: Color blue depth: 32!

Item was removed:
- ----- Method: PNGReadWriterTest>>testBlue8 (in category 'tests - colors') -----
- testBlue8
- 	self encodeAndDecodeColor: Color blue depth: 8!

Item was removed:
- ----- Method: PNGReadWriterTest>>testGrayScale (in category 'tests - grayscale') -----
- testGrayScale
- 
- 	| form reader |
- 	reader := PNGReadWriter on: self grayScaleData readStream.
- 	form := reader nextImage.
- 	self assert: form extent = (217 at 125).
- 	self assert: form depth = 8.
- !

Item was removed:
- ----- Method: PNGReadWriterTest>>testGreen16 (in category 'tests - colors') -----
- testGreen16
- 	self encodeAndDecodeColor: Color green depth: 16!

Item was removed:
- ----- Method: PNGReadWriterTest>>testGreen32 (in category 'tests - colors') -----
- testGreen32
- 	self encodeAndDecodeColor: Color green depth: 32!

Item was removed:
- ----- Method: PNGReadWriterTest>>testGreen8 (in category 'tests - colors') -----
- testGreen8
- 	self encodeAndDecodeColor: Color green depth: 8!

Item was removed:
- ----- Method: PNGReadWriterTest>>testNewFromSampleBytes (in category 'tests - decoding') -----
- testNewFromSampleBytes
- 	"Based on a problem report by Hilaire Fernandes, this fails on 64 bit Spur if a
- 	synthesized LargeInteger parameter to Bitmap #at:put: is not normalized prior
- 	to calling the primitive. See problem report at
- 	http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/2017-June/032660.html"
- 
- 	| sampleBytes png form |
- 	sampleBytes := #[137 80 78 71 13 10 26 10 0 0 0 13 73 72
- 		68 82 0 0 0 48 0 0 0 48 16 6 0 0 0 7 146 37 196 0 0 0 6 98 75 71 68 255
- 		255 255 255 255 255 9 88 247 220 0 0 0 9 112 72 89 115 0 0 0 72 0 0 0 72
- 		0 70 201 107 62 0 0 1 153 73 68 65 84 120 218 237 155 73 110 195 48 12
- 		69 227 162 183 211 9 180 11 130 220 77 39 208 249 210 77 181 8 81 69 19
- 		39 169 255 109 12 35 137 197 255 105 81 244 144 219 13 0 0 0 0 0 116 16
- 		66 8 33 188 94 214 113 120 99 214 151 111 238 1 115 206 57 231 235 178
- 		54 68 10 238 19 112 58 1 189 1 238 158 16 233 25 255 37 117 224 221 141
- 		215 210 193 158 128 83 140 215 210 181 156 0 26 216 169 139 180 155 210
- 		218 50 184 124 126 74 34 122 245 204 234 101 207 224 41 221 145 150 14
- 		49 67 118 77 132 118 220 98 93 208 168 64 107 172 226 18 63 19 91 194
- 		172 103 132 117 124 106 194 117 132 210 227 215 143 103 109 124 65 173 4
- 		181 4 173 149 128 254 223 121 49 190 160 190 6 212 4 126 22 94 12 163 91
- 		173 241 229 112 219 141 188 51 106 184 223 46 139 162 62 3 164 137 49
- 		198 24 253 117 89 219 241 183 145 181 82 180 94 154 192 47 212 248 247
- 		253 209 45 152 102 205 120 36 130 137 182 193 159 19 5 22 233 53 158 126
- 		31 48 209 54 190 181 15 8 189 247 215 71 141 174 25 127 218 243 137 105
- 		168 17 53 99 164 140 247 154 8 183 119 67 139 177 41 165 148 210 117 209
- 		125 233 241 181 16 187 18 158 21 254 124 62 30 247 251 186 241 173 113
- 		122 227 148 70 237 145 100 175 33 210 120 139 207 205 237 232 255 22 71
- 		129 45 16 60 3 158 163 123 6 140 214 74 239 198 207 198 201 189 102 12
- 		151 32 26 128 155 23 150 22 105 189 96 38 181 88 31 211 206 113 163 165
- 		151 109 17 182 110 231 118 213 193 222 5 237 154 8 171 184 217 254 31
- 		176 123 9 114 255 146 177 187 128 224 3 0 0 0 0 192 198 252 0 102 116 72
- 		96 211 171 62 8 0 0 0 0 73 69 78 68 174 66 96 130].
- 
- 	png := PNGReadWriter on: sampleBytes readStream.
- 	form := png nextImage.
- 	self assert: Form equals: form class.
- !

Item was removed:
- ----- Method: PNGReadWriterTest>>testPngDecodingColors16 (in category 'tests - decoding') -----
- testPngDecodingColors16
- 	self decodeColors: self coloredFiles16 depth: 16.!

Item was removed:
- ----- Method: PNGReadWriterTest>>testPngDecodingColors32 (in category 'tests - decoding') -----
- testPngDecodingColors32
- 	self decodeColors: self coloredFiles32 depth: 32.!

Item was removed:
- ----- Method: PNGReadWriterTest>>testPngDecodingColors8 (in category 'tests - decoding') -----
- testPngDecodingColors8
- 	self decodeColors: self coloredFiles8 depth: 8.!

Item was removed:
- ----- Method: PNGReadWriterTest>>testPngEncodingColors16 (in category 'tests - decoding') -----
- testPngEncodingColors16
- 	self encodeColors: self coloredFiles16 depth: 16.!

Item was removed:
- ----- Method: PNGReadWriterTest>>testPngEncodingColors32 (in category 'tests - decoding') -----
- testPngEncodingColors32
- 	self encodeColors: self coloredFiles32 depth: 32.!

Item was removed:
- ----- Method: PNGReadWriterTest>>testPngEncodingColors8 (in category 'tests - decoding') -----
- testPngEncodingColors8
- 	self encodeColors: self coloredFiles8 depth: 8.!

Item was removed:
- ----- Method: PNGReadWriterTest>>testPngSuite (in category 'tests - bits') -----
- testPngSuite
- 	"Requires the suite from 
- 		ftp://swrinde.nde.swri.edu/pub/png/images/suite/PngSuite.zip
- 	to be present as PngSuite.zip"
- 	| file |
- 	file := [FileStream readOnlyFileNamed: 'PngSuite.zip'] on: Error do:[nil].
- 	file ifNil:[^self].
- 	[ | zip entries |
- 	zip := ZipArchive new readFrom: file.
- 	entries := zip members select:[:mbr| mbr fileName asLowercase endsWith: '.png'].
- 	entries do:[:mbr| 
- 		(mbr fileName asLowercase first = $x)
- 			ifTrue: [self encodeAndDecodeWithError: mbr contentStream ]
- 			ifFalse: [self encodeAndDecodeStream: mbr contentStream ] ].
- 	] ensure:[file close].!

Item was removed:
- ----- Method: PNGReadWriterTest>>testRed16 (in category 'tests - colors') -----
- testRed16
- 	self encodeAndDecodeColor: Color red depth: 16!

Item was removed:
- ----- Method: PNGReadWriterTest>>testRed32 (in category 'tests - colors') -----
- testRed32
- 	self encodeAndDecodeColor: Color red depth: 32!

Item was removed:
- ----- Method: PNGReadWriterTest>>testRed8 (in category 'tests - colors') -----
- testRed8
- 	self encodeAndDecodeColor: Color red depth: 8!

Item was removed:
- ----- Method: PNGReadWriterTest>>writeEncoded: (in category 'helpers') -----
- writeEncoded: bytes
- 	fileName ifNil:[^self].
- 	false ifTrue:[^self].
- 	FileStream forceNewFileNamed: fileName do: [:file | file nextPutAll: bytes]!

Item was removed:
- ClassTestCase subclass: #PointTest
- 	instanceVariableNames: ''
- 	classVariableNames: ''
- 	poolDictionaries: ''
- 	category: 'GraphicsTests-Primitives'!
- 
- !PointTest commentStamp: '<historical>' prior: 0!
- This is the unit test for the class Point. Unit tests are a good way to exercise the functionality of your system in a repeatable and automatic manner. They are therefore recommended if you plan to release anything. For more information, see: 
- 	- http://www.c2.com/cgi/wiki?UnitTest
- 	- http://minnow.cc.gatech.edu/squeak/1547
- 	- the sunit class category!

Item was removed:
- ----- Method: PointTest>>testBasicFourDirections (in category 'tests') -----
- testBasicFourDirections
- 	"fourDirections returns the four rotation of the receiver in counter clockwise order with the receiver appearing last. "
- 
- 	| samples results rejects |
- 	self assert:  (0 asPoint fourDirections) = (Array new: 4 withAll: 0 asPoint) . 
- 	samples := 0 asPoint eightNeighbors  .
- 	results := {
- 		{ 0 @ -1 . 	-1 @  0 . 	 0 @  1 . 	 1 @  0}.
- 		{ 1 @ -1 . 	-1 @ -1 . 	-1 @  1 . 	 1 @  1}.
- 		{ 1 @  0 . 	 0 @ -1 . 	-1 @  0 . 	 0 @  1}.
- 		{ 1 @  1 . 	 1 @ -1 . 	-1 @ -1 . 	-1 @  1}.
- 		{ 0 @  1 . 	 1 @  0 . 	 0 @ -1 . 	-1 @  0}.
- 		{-1 @  1 . 	 1 @  1 . 	 1 @ -1 . 	-1 @ -1}.
- 		{-1 @  0 . 	 0 @  1 . 	 1 @  0 . 	 0 @ -1}.
- 		{-1 @ -1 . 	-1 @  1 . 	 1 @  1 . 	 1 @ -1} } .
- 
- 	rejects := (1 to: samples size ) reject: [ :each |
- 		 (samples at: each) fourDirections = (results at: each) ] .
- 
- 	self assert: rejects isEmpty!

Item was removed:
- ----- Method: PointTest>>testBearingToPoint (in category 'tests') -----
- testBearingToPoint
- 
- 	self assert: (0 @ 0 bearingToPoint: 0 @ 0) = 0.
- 	self assert: (0 @ 0 bearingToPoint: 0 @ -1) = 0.
- 	self assert: (0 @ 0 bearingToPoint: 1 @ 0) = 90.
- 	self assert: (0 @ 0 bearingToPoint: 0 @ 1) = 180.
- 	self assert: (0 @ 0 bearingToPoint: -1 @ 0) = 270.
- 	self assert: (0 @ 0 bearingToPoint: 1 @ 1) = 135.
- 	self assert: (0 @ 0 bearingToPoint: 0.01 @ 0) = 90.
- 	self assert: (0 @ 0 bearingToPoint: -2 @ -3) = 326.
- 	self assert: (0 @ 0 bearingToPoint: -0 @ 0) = 0.
- 	
- 	self assert: (-2 @ -3 bearingToPoint: 0 @ 0) = 146.!

Item was removed:
- ----- Method: PointTest>>testFourDirectionsInvarients (in category 'tests') -----
- testFourDirectionsInvarients
- " fourDirections returns the four rotation of the reciever in counter clockwise order with the reciever appearing last. "
- 
- | samples  rejects |
- 
- samples := 
- 0 asPoint eightNeighbors  .
- 
- rejects :=
- (1 to: samples size ) reject: [ :each |
- 		 (samples at: each) fourDirections last = ( samples  at: each) ] .
- 
- self assert: ( rejects isEmpty) .
- 
- 
- !

Item was removed:
- ----- Method: PointTest>>testFourDirectionsRotationInvarients (in category 'tests') -----
- testFourDirectionsRotationInvarients
- " fourDirections returns the four rotation of the reciever in counter clockwise order with the reciever appearing last. "
- 
- | samples  rejects |
- 
- samples := 
- 0 asPoint eightNeighbors  .
- 
- rejects :=
- (1 to: samples size ) reject: [ :each | | answer  |
- 		(answer :=  (samples at: each) fourDirections ) .
- 		(1 to: 4) allSatisfy: [ :eachDirIndex | 
- 			( answer atWrap: eachDirIndex)  leftRotated
- 					 = (( answer atWrap: eachDirIndex + 1) )  ] ] .
- 
- self assert: ( rejects isEmpty) .
- 
- 
- !

Item was removed:
- ----- Method: PointTest>>testIsZero (in category 'tests') -----
- testIsZero
- 
- 	self assert: (0 at 0) isZero.	
- 	self deny:  (0 at 1) isZero.
- 	self deny:  (1 at 0) isZero.
- 	self deny:  (1 at 1) isZero.!

Item was removed:
- ----- Method: PointTest>>testNormal (in category 'tests') -----
- testNormal
- 	"quick check of results for #normal."
- 	| samples rejects results |
- 	samples := 0 asPoint eightNeighbors , (Array with: 0 asPoint) .
- 
- 	results := 
-  		{ 0.0 @ 1.0 .
- 		-0.707106781186547 @ 0.707106781186547 .
- 		-1.0 @ 0.0 .
- 		-0.707106781186547 @ -0.707106781186547 .
- 		0.0 @ -1.0 .
- 		0.707106781186547 @ -0.707106781186547 .
- 		1.0 @ 0.0 .
- 		0.707106781186547 @ 0.707106781186547 .
- 		-1 @ 0} .
- 
- 	rejects := (1 to: samples size ) reject:
- 		[ :each | ((samples at: each) normal - (results at: each)) abs  < 1e-15 asPoint ] .
- 
- 	self assert: rejects isEmpty!

Item was removed:
- ----- Method: PointTest>>testNormal2 (in category 'tests') -----
- testNormal2
- 	"quick check of results for #normal.
- 	differs from the other testNormal in the way that the difference is measured."
- 
- 	| samples rejects results differences |
- 	samples := 0 asPoint eightNeighbors , (Array with: 0 asPoint) .
- 
- 	results := 
- 		{ 0.0 @ 1.0 .
- 		-0.707106781186547 @ 0.707106781186547 .
- 		-1.0 @ 0.0 .
- 		-0.707106781186547 @ -0.707106781186547 .
- 		0.0 @ -1.0 .
- 		0.707106781186547 @ -0.707106781186547 .
- 		1.0 @ 0.0 .
- 		0.707106781186547 @ 0.707106781186547 .
- 		-1 @ 0} .
- 	differences := samples with: results collect: [ :each :eachResult |
- 		each normal - eachResult ] .
- 
- 	rejects := differences reject: [ :each | 
- 		(each x closeTo: 0.0) and: [each y closeTo: 0.0] ] .
- 
- 	self assert: rejects isEmpty!

Item was removed:
- ----- Method: PointTest>>testRectangleMix (in category 'tests') -----
- testRectangleMix
- 
- 	{
- 		Rectangle center: 60 at 60 extent: 100 at 100.
- 		Rectangle origin: 10 at 10 extent: 100 at 100.
- 		Rectangle origin: 10 at 10 corner: 110 at 110.
- 
- 		"1) Point/receiver is the origin, i.e. upper left corner."
- 		10 at 10 extent: 100 at 100.
- 		10 at 10 corner: 110 at 110.
- 
- 		"2) Point/receiver is the extent."
- 		100 at 100 origin: 10 at 10.
- 		100 at 100 center: 60 at 60.
- 
- 		"3) Receiver and argument are either origin or corner."
- 		110 at 110 rect: 10 at 10.
- 		
- 	} permutationsDo: [:rects |
- 		rects overlappingPairsDo: [:r1 :r2 |
- 			self assert: r1 equals: r2]].!

Item was removed:
- ----- Method: PointTest>>testRectangleWithCenter (in category 'tests') -----
- testRectangleWithCenter
- 
- 	self
- 		assert: (Rectangle center: 50 at 50 extent: 100 at 100)
- 		equals: (100 at 100 center: 50 at 50).!

Item was removed:
- ----- Method: PointTest>>testRectangleWithCorner (in category 'tests') -----
- testRectangleWithCorner
- 
- 	self
- 		assert: (Rectangle origin: 10 at 10 corner: 110 at 110)
- 		equals: (10 at 10 corner: 110 at 110).!

Item was removed:
- ----- Method: PointTest>>testRectangleWithExtent (in category 'tests') -----
- testRectangleWithExtent
- 
- 	self
- 		assert: (Rectangle origin: 50 at 50 extent: 100 at 100)
- 		equals: (50 at 50 extent: 100 at 100).!

Item was removed:
- ----- Method: PointTest>>testRectangleWithOrigin (in category 'tests') -----
- testRectangleWithOrigin
- 
- 	self
- 		assert: (Rectangle origin: 50 at 50 extent: 100 at 100)
- 		equals: (100 at 100 origin: 50 at 50).!

Item was removed:
- ----- Method: PointTest>>testRectangleWithPoints (in category 'tests') -----
- testRectangleWithPoints
- 
- 	self
- 		assert: (Rectangle origin: 50 at 50 corner: 100 at 100)
- 		equals: (100 at 100 rect: 50 at 50).!

Item was removed:
- ----- Method: PointTest>>testRotations (in category 'tests') -----
- testRotations
- " Here we are testing rightRotated and leftRotated which are new.
- Because there is really no coverage for point functions this also serves as a tests of sorts for 
- rotateBy:CenterAt:"
- 
- | samples |
- samples :=
- 0 asPoint eightNeighbors 
- , (Array with: 0 asPoint) .
- 
- self assert: (samples allSatisfy: [ :each |
- 	each rightRotated leftRotated = each ] ) .
- 
- self assert: (samples allSatisfy: [ :each |
- 	each rightRotated  = (each rotateBy: #right centerAt: 0 asPoint)] ) .
- 
- self assert: (samples allSatisfy: [ :each |
- 	each leftRotated  = (each rotateBy: #left centerAt: 0 asPoint ) ] ) .
- 
- self assert: (samples allSatisfy: [ :each |
- 	each negated  = (each rotateBy: #pi centerAt: 0 asPoint ) ] ) .
- 
- self assert: (samples allSatisfy: [ :each | 
- 	each leftRotated leftRotated leftRotated leftRotated = each ]) .
- 
- self assert: (samples allSatisfy: [ :each |
- 	each rightRotated rightRotated rightRotated rightRotated  = each ] ) .
- !

Item was removed:
- ----- Method: PointTest>>testSign (in category 'tests') -----
- testSign 
- 	| samples results rejects |
- 	samples := 0 asPoint eightNeighbors , (Array with: 0 asPoint).
- 
- 	results := samples collect: [ :each | each sign ].
- 	
- 	rejects := (1 to: samples size ) reject: [ :each |
- 		 (samples at: each) = (results at: each) ] .
- 
- 	self assert: (rejects isEmpty) 
- 
- 
- !

Item was removed:
- ----- Method: PointTest>>testTheta (in category 'tests') -----
- testTheta
-       | result dir tan x y |
- 	self assert: ((0 @ 1) theta - 90.0 degreesToRadians) abs < 1e-15.
- 	self assert: ((0 @ -1) theta - 270.0 degreesToRadians) abs < 1e-15.
- 	" See code of old and new theta"
- 	x := 1.0 . y := -1.0.
- 	tan := y  / x .
- 	dir := tan arcTan.
-       result :=  360.0 degreesToRadians + dir.
-       self assert: ((x @ y) theta - result) abs < 1e-15.
- 	x := -1.0. "Don't reuse old results when you want numeric precision!!"
- 	tan := y  / x .
- 	dir := tan arcTan.
-       result :=  180.0 degreesToRadians + dir.
-       self assert: ((x @ y) theta - result) abs < 1e-15.
- 
- 	!

Item was removed:
- ----- Method: PointTest>>testZeroPointNormal (in category 'tests') -----
- testZeroPointNormal
- 	"old: normal of zero point raised divide by zero error.
- 	new: normal of zero point returns a direction right rotated from zero points direction."
- 
- 	self assert: 90 equals: (0 asPoint normal bearingToPoint: 0 asPoint).!

Item was removed:
- TestCase subclass: #RectangleTest
- 	instanceVariableNames: ''
- 	classVariableNames: ''
- 	poolDictionaries: ''
- 	category: 'GraphicsTests-Primitives'!

Item was removed:
- ----- Method: RectangleTest>>testArea (in category 'tests') -----
- testArea
- 	| r1 empty |
- 	r1 := 0 at 0 extent: 10 at 20.
- 	self assert: r1 area = (10*20).
- 	self assert: (r1 translateBy: -20 at 10) area = (10*20) description: 'translation preserves area'.
- 	
- 	empty := 10 at 20 corner: 0 at 0.
- 	self assert: empty area = 0 description: 'the area of an empty rectangle is null'.
- 	empty := 10 at 0 corner: 0 at 20.
- 	self assert: empty area = 0 description: 'the area of an empty rectangle is null'.
- 	empty := 0 at 20 corner: 10 at 0.
- 	self assert: empty area = 0 description: 'the area of an empty rectangle is null'.!

Item was removed:
- ----- Method: RectangleTest>>testAreasOutside1 (in category 'tests') -----
- testAreasOutside1
-    "RectangleTest new testAreasOutside1"
-     | frame rects visibleArea  |
-     frame := 0 at 0 extent: 300 at 300.
-     rects := OrderedCollection new: 80.
-     0 to: 3 do: [:i |
-       0 to: 2 do: [:j |
-             rects add: (i at j * 20 extent: 10 at 10)
-     ]  ].
-   
-    visibleArea := Array with: frame.
-    rects do: [:rect |  | remnants |
-       remnants := OrderedCollection new.
-       visibleArea do: [:a | remnants addAll: (a areasOutside: rect)].
-       visibleArea := remnants.
-   ].
-   visibleArea := visibleArea asArray.
-   self assert: (visibleArea allSatisfy: [:r | r area ~= 0]).
- 
-    1 to: visibleArea size do: [:idx |
-      idx + 1 to: visibleArea size do: [:idx2 |
-         self deny: ((visibleArea at: idx) intersects: (visibleArea at: idx2)).
-   ]  ].
- 
-   1 to: rects size do: [:idx |
-      1 to: visibleArea size do: [:idx2 |
-         self deny: ((rects at: idx) intersects: (visibleArea at: idx2)).
-   ]  ].
- 
- !

Item was removed:
- ----- Method: RectangleTest>>testAreasOutside2 (in category 'tests') -----
- testAreasOutside2
-    "RectangleTest new testAreasOutside2"
-     | frame rects visibleArea  |
-     frame := 0 at 0 extent: 300 at 300.
-     rects := OrderedCollection new: 80.
-     rects add: (50 at 50 corner: 200 @ 200);
-           add: (100 at 100 corner: 250 at 250).
-   
-    visibleArea := Array with: frame.
-    rects do: [:rect |  | remnants |
-       remnants := OrderedCollection new.
-       visibleArea do: [:a | remnants addAll: (a areasOutside: rect)].
-       visibleArea := remnants.
-   ].
-   visibleArea := visibleArea asArray.
-   self assert: (visibleArea allSatisfy: [:r | r area ~= 0]).
- 
-    1 to: visibleArea size do: [:idx |
-      idx + 1 to: visibleArea size do: [:idx2 |
-         self deny: ((visibleArea at: idx) intersects: (visibleArea at: idx2)).
-   ]  ].
- 
-   1 to: rects size do: [:idx |
-      1 to: visibleArea size do: [:idx2 |
-         self deny: ((rects at: idx) intersects: (visibleArea at: idx2)).
-   ]  ].
- 
- !

Item was removed:
- ----- Method: RectangleTest>>testBottomHalf (in category 'tests') -----
- testBottomHalf
- 	| r |
- 	r := 10 at 20 corner: 30 at 50.
- 	self assert: (10 at 35 corner: 30 at 50) equals: r bottomHalf.
- 	self assert: (10 at 42 corner: 30 at 50) equals: r bottomHalf bottomHalf!

Item was removed:
- ----- Method: RectangleTest>>testBottomLeftQuadrant (in category 'tests') -----
- testBottomLeftQuadrant
- 	| r |
- 	r := 10 at 20 corner: 30 at 50.
- 	self assert: (10 at 35 corner: 20 at 50) equals: r bottomLeftQuadrant.
- 	self assert: (10 at 42 corner: 15 at 50) equals: r bottomLeftQuadrant bottomLeftQuadrant!

Item was removed:
- ----- Method: RectangleTest>>testBottomRightQuadrant (in category 'tests') -----
- testBottomRightQuadrant
- 	| r |
- 	r := 10 at 20 corner: 30 at 50.
- 	self assert: (20 at 35 corner: 30 at 50) equals: r bottomRightQuadrant.
- 	self assert: (25 at 42 corner: 30 at 50) equals: r bottomRightQuadrant bottomRightQuadrant!

Item was removed:
- ----- Method: RectangleTest>>testCenter (in category 'tests') -----
- testCenter
- 	| r1 c |
- 	r1 := 0 at 0 extent: 10 at 20.
- 	c := r1 center.
- 	self assert: (r1 containsPoint: c) description: 'the center is inside the rectangle'.
- 	self assert: (r1 topLeft dist: c) = (r1 bottomRight dist: c).
- 	self assert: (r1 bottomLeft dist: c) = (r1 topRight dist: c).
- 	self assert: (r1 topLeft dist: c) = (r1 bottomLeft dist: c).
- 	self assert: (r1 translateBy: -20 at 10) center = (c translateBy: -20 at 10) description: 'the center is translated with the rectangle'.!

Item was removed:
- ----- Method: RectangleTest>>testCenterEmpty (in category 'tests') -----
- testCenterEmpty
- 	| r1 c |
- 	r1 := 30 at 10 corner: 10 at 20.
- 	c := r1 center.
- 	self deny: (r1 containsPoint: c) description: 'An empty rectangle does not contain any point.'.
- 	self assert: (r1 topLeft dist: c) = (r1 bottomRight dist: c).
- 	self assert: (r1 bottomLeft dist: c) = (r1 topRight dist: c).
- 	self assert: (r1 topLeft dist: c) = (r1 bottomLeft dist: c).
- 	self assert: (r1 translateBy: -20 at 10) center = (c translateBy: -20 at 10) description: 'the center is translated with the rectangle'.!

Item was removed:
- ----- Method: RectangleTest>>testCorner1 (in category 'tests') -----
- testCorner1
-    "RectangleTest new testCorner1"
-     | rect |
-    rect := 10 at 10 extent: 20 at 30.
-    self deny: (rect containsPoint: rect corner).!

Item was removed:
- ----- Method: RectangleTest>>testDegeneratedIntersectionTest (in category 'tests') -----
- testDegeneratedIntersectionTest
- 	| horizontalLine verticalLine outsideRectangle |
- 	horizontalLine := 10 at 10 extent: 20 at 0.
- 	verticalLine := 20 at 0 extent: 0 at 20.
- 	self assert: (horizontalLine intersects: verticalLine).
- 	outsideRectangle := 100 at 10 extent: 20 at 20.
- 	self deny: (horizontalLine intersects: outsideRectangle).!

Item was removed:
- ----- Method: RectangleTest>>testFlip (in category 'tests') -----
- testFlip
- 	| r1 c r1Horiz r1Vert |
- 	r1 := 30 at 10 extent: 10 at 20.
- 	c := 5 at 5.
- 	r1Horiz := r1 flipBy: #horizontal centerAt: c.
- 	r1Vert := r1 flipBy: #vertical centerAt: c.
- 
- 	self assert: r1 area = r1Horiz area description: 'flip preserves area'.
- 	self assert: r1 area = r1Vert area description: 'flip preserves area'.
- 	
- 	self assert: r1 extent = r1Horiz extent description: 'flip preserves extent'.
- 	self assert: r1 extent = r1Vert extent description: 'flip preserves extent'.
- 	
- 	self assert:  (r1 flipBy: #horizontal centerAt: r1 center) = r1.
- 	self assert:  (r1 flipBy: #vertical centerAt: r1 center) = r1!

Item was removed:
- ----- Method: RectangleTest>>testFlipEmpty (in category 'tests') -----
- testFlipEmpty
- 	| r1 c r1Horiz r1Vert |
- 	r1 := 30 at 10 corner: 10 at 20.
- 	c := 5 at 5.
- 	r1Horiz := r1 flipBy: #horizontal centerAt: c.
- 	r1Vert := r1 flipBy: #vertical centerAt: c.
- 	
- 	self assert: r1 area = r1Horiz area description: 'flip preserves area'.
- 	self assert: r1 area = r1Vert area description: 'flip preserves area'.
- 	
- 	self assert: r1 extent = r1Horiz extent description: 'flip preserves extent'.
- 	self assert: r1 extent = r1Vert extent description: 'flip preserves extent'.
- 	
- 	self assert:  (r1 flipBy: #horizontal centerAt: r1 center) = r1.
- 	self assert:  (r1 flipBy: #vertical centerAt: r1 center) = r1!

Item was removed:
- ----- Method: RectangleTest>>testIntersection1 (in category 'tests') -----
- testIntersection1
-    "RectangleTest new testIntersection1"
-     | rect1 rect2 |
-    rect1 := 10 at 10 corner: 20 at 30.
-    rect2 := rect1 corner extent: 20 at 40.
-    self deny: (rect1 intersects: rect2).!

Item was removed:
- ----- Method: RectangleTest>>testIntersection2 (in category 'tests') -----
- testIntersection2
-    "RectangleTest new testIntersection2"
-     | rect1 rect2 |
-    rect1 := 0 at 0 corner: 40 at 40.
-    rect2 := 40 at 40 corner: 50 at 50.
-    self deny: (rect1 intersects: rect2);
-         deny: (rect2 intersects: rect1).!

Item was removed:
- ----- Method: RectangleTest>>testIntersectionEmpty (in category 'tests') -----
- testIntersectionEmpty
- 	| rect1 empty1 empty2 |
- 	rect1 := 10 at 10 corner: 40 at 40.
- 	empty1 := 50 at 50 corner: 0 at 0.
- 	empty2 := 30 at 30 corner: 20 at 20.
- 	self
- 		deny: (rect1 intersects: empty1);
- 		deny: (rect1 intersects: empty2);
- 		deny: (empty1 intersects: rect1);
- 		deny: (empty2 intersects: rect1);
- 		deny: (empty1 intersects: empty2);
- 		deny: (empty2 intersects: empty1).!

Item was removed:
- ----- Method: RectangleTest>>testLeftHalf (in category 'tests') -----
- testLeftHalf
- 	| r |
- 	r := 10 at 20 corner: 30 at 50.
- 	self assert: (10 at 20 corner: 20 at 50) equals: r leftHalf.
- 	self assert: (10 at 20 corner: 15 at 50) equals: r leftHalf leftHalf!

Item was removed:
- ----- Method: RectangleTest>>testMergingDisjointRects (in category 'tests') -----
- testMergingDisjointRects
- 
- 	| coll merge |
- 	coll := OrderedCollection new.
- 	coll add: (Rectangle left: -10 right: 0 top: -10 bottom: 0).
- 	coll add: (Rectangle left: 0 right: 10 top: 0 bottom: 10).
- 	merge := Rectangle merging: coll.
- 	self assert: merge = (Rectangle left: -10 right: 10 top: -10 bottom: 10).!

Item was removed:
- ----- Method: RectangleTest>>testMergingNestedRects (in category 'tests') -----
- testMergingNestedRects
- 
- 	| coll merge |
- 	coll := OrderedCollection new.
- 	coll add: (Rectangle left: 1 right: 10 top: 1 bottom: 10).
- 	coll add: (Rectangle left: 4 right: 5 top: 4 bottom: 5).
- 	merge := Rectangle merging: coll.
- 	self assert: merge = coll first.!

Item was removed:
- ----- Method: RectangleTest>>testMergingOverlappingRects (in category 'tests') -----
- testMergingOverlappingRects
- 
- 	| coll merge |
- 	coll := OrderedCollection new.
- 	coll add: (Rectangle left: 5 right: 10 top: 0 bottom: 15).
- 	coll add: (Rectangle left: 0 right: 15 top: 5 bottom: 10).
- 	merge := Rectangle merging: coll.
- 	self assert: merge = (Rectangle left: 0 right: 15 top: 0 bottom: 15).!

Item was removed:
- ----- Method: RectangleTest>>testMergingTrivial (in category 'tests') -----
- testMergingTrivial
- 
- 	| coll merge |
- 	coll := OrderedCollection new.
- 	coll add: (Rectangle left: 1 right: 1 top: 1 bottom: 1).
- 
- 	merge := Rectangle merging: coll.
- 	self assert: merge = coll first.
- !

Item was removed:
- ----- Method: RectangleTest>>testMergingTwoRects (in category 'tests') -----
- testMergingTwoRects
- 
- 	| coll merge |
- 	coll := OrderedCollection new.
- 	coll add: (Rectangle left: 1 right: 1 top: 1 bottom: 1).
- 	coll add: (Rectangle left: 10 right: 10 top: 10 bottom: 10).
- 
- 	merge := Rectangle merging: coll.
- 	self assert: merge = (Rectangle left: 1 right: 10 top: 1 bottom: 10).!

Item was removed:
- ----- Method: RectangleTest>>testPointAtFraction (in category 'tests') -----
- testPointAtFraction
- 	
- 	| r |
- 	r := Rectangle origin: 0 at 0 extent: 50 at 50.
- 	
- 	{
- 		r topLeft . 0.0 @ 0.0 .
- 		r center . 0.5 @ 0.5 .
- 		r bottomRight . 1.0 @ 1.0 .
- 		
- 		5 at 5 . 0.1 @ 0.1 .
- 		40 at 50 . 0.8 @ 1.0
- 	
- 	} groupsDo: [ :expected :fraction |
- 		self assert: expected equals: (r pointAtFraction: fraction)].!

Item was removed:
- ----- Method: RectangleTest>>testPointAtFractionExact (in category 'tests') -----
- testPointAtFractionExact
- 	
- 	| r |
- 	r := Rectangle origin: 0.2 at 0.2 corner: 1.0 at 1.0.
- 	
- 	{
- 		r topLeft . 0.0 @ 0.0 .
- 		"r center . 0.5 @ 0.5 . --- Not yet working."
- 		r bottomRight . 1.0 @ 1.0 .
- 		
- 		0.6 @ 0.6 . 0.5 @ 0.5 .
- 	
- 	} groupsDo: [ :expected :fraction |
- 		self assert: (expected closeTo: (r pointAtFraction: fraction))].!

Item was removed:
- ----- Method: RectangleTest>>testRandomPoint (in category 'tests') -----
- testRandomPoint
- 	
- 	| r |
- 	r := Rectangle origin: 0 at 0 extent: 50 at 50.
- 	self assert: (r containsPoint: r randomPoint).
- 	self assert: r randomPoint isIntegerPoint.!

Item was removed:
- ----- Method: RectangleTest>>testRandomPointExact (in category 'tests') -----
- testRandomPointExact
- 	
- 	| r |
- 	r := Rectangle origin: 0.2 at 0.2 corner: 1.0 at 1.0.
- 	self assert: (r containsPoint: r randomPoint).
- 	self deny: r randomPoint isIntegerPoint.!

Item was removed:
- ----- Method: RectangleTest>>testRightHalf (in category 'tests') -----
- testRightHalf
- 	| r |
- 	r := 10 at 20 corner: 30 at 50.
- 	self assert: (20 at 20 corner: 30 at 50) equals: r rightHalf.
- 	self assert: (25 at 20 corner: 30 at 50) equals: r rightHalf rightHalf!

Item was removed:
- ----- Method: RectangleTest>>testRotate (in category 'tests') -----
- testRotate
- 	| r1 c r1Left r1Right r1Pi |
- 	r1 := 30 at 10 extent: 10 at 20.
- 	c := 5 at 5.
- 	r1Left := r1 rotateBy: #left centerAt: c.
- 	r1Right := r1 rotateBy: #right centerAt: c.
- 	r1Pi := r1 rotateBy: #pi centerAt: c.
- 	
- 	self assert: r1 area = r1Left area description: 'rotation preserves area'.
- 	self assert: r1 area = r1Right area description: 'rotation preserves area'.
- 	self assert: r1 area = r1Pi area description: 'rotation preserves area'.
- 	
- 	self assert: r1 extent transposed = r1Left extent.
- 	self assert: r1 extent transposed = r1Right extent.
- 	self assert: r1 extent = r1Pi extent.
- 	
- 	self assert:  (r1 rotateBy: #pi centerAt: r1 center) = r1!

Item was removed:
- ----- Method: RectangleTest>>testRotateEmpty (in category 'tests') -----
- testRotateEmpty
- 	| r1 c r1Left r1Right r1Pi |
- 	r1 := 30 at 10 corner: 10 at 20.
- 	c := 5 at 5.
- 	r1Left := r1 rotateBy: #left centerAt: c.
- 	r1Right := r1 rotateBy: #right centerAt: c.
- 	r1Pi := r1 rotateBy: #pi centerAt: c.
- 	
- 	self assert: r1 area = r1Left area description: 'rotation preserves area'.
- 	self assert: r1 area = r1Right area description: 'rotation preserves area'.
- 	self assert: r1 area = r1Pi area description: 'rotation preserves area'.
- 	
- 	self assert: r1 extent transposed = r1Left extent.
- 	self assert: r1 extent transposed = r1Right extent.
- 	self assert: r1 extent = r1Pi extent.
- 	
- 	self assert:  (r1 rotateBy: #pi centerAt: r1 center) = r1!

Item was removed:
- ----- Method: RectangleTest>>testRoundingAfterHalfPixelTranslation (in category 'tests') -----
- testRoundingAfterHalfPixelTranslation
- 	"A rectangle right on the cusp of rounding changes shape if origin and
- 	corner are in differenct quadrants"
- 	"self debug: #testRoundingAfterHalfPixelTranslation"
- 	| trouble noTrouble |
- 	trouble := 10 negated asPoint rect: 10 asPoint.
- 	noTrouble := trouble translateBy: 15.
- 	
- 	10 timesRepeat: [trouble := (trouble translateBy: 0.5) rounded].
- 	10 timesRepeat: [noTrouble := (noTrouble translateBy: 0.5) rounded].
- 	
- 	self assert: trouble extent = noTrouble extent!

Item was removed:
- ----- Method: RectangleTest>>testRoundingAfterHalfPixelTranslationFirstQuadrant (in category 'tests') -----
- testRoundingAfterHalfPixelTranslationFirstQuadrant
- 	"A rectangle right on the cusp of rounding changes shape if origin and
- 	corner are in differenct quadrants"
- 	"self debug: #testRoundingAfterHalfPixelTranslation"
- 	| a b |
- 	a := 10 asPoint rect: 10 asPoint.
- 	b := a translateBy: 15.
- 	
- 	10 timesRepeat: [a := (a translateBy: 0.5) rounded].
- 	10 timesRepeat: [b := (b translateBy: 0.5) rounded].
- 	
- 	self assert: a extent = b extent!

Item was removed:
- ----- Method: RectangleTest>>testStoreOn (in category 'tests') -----
- testStoreOn
- 	| assoc assoc2 |
- 	assoc := (0 at 0 extent: 1 at 1) -> 0.
- 	assoc2 := Compiler evaluate: assoc storeString.
- 	self assert: assoc key = assoc2 key.
- 	self assert: assoc value = assoc2 value.!

Item was removed:
- ----- Method: RectangleTest>>testTopHalf (in category 'tests') -----
- testTopHalf
- 	| r |
- 	r := 10 at 20 corner: 30 at 50.
- 	self assert: (10 at 20 corner: 30 at 35) equals: r topHalf.
- 	self assert: (10 at 20 corner: 30 at 27) equals: r topHalf topHalf!

Item was removed:
- ----- Method: RectangleTest>>testTopLeftQuadrant (in category 'tests') -----
- testTopLeftQuadrant
- 	| r |
- 	r := 10 at 20 corner: 30 at 50.
- 	self assert: (10 at 20 corner: 20 at 35) equals: r topLeftQuadrant.
- 	self assert: (10 at 20 corner: 15 at 27) equals: r topLeftQuadrant topLeftQuadrant!

Item was removed:
- ----- Method: RectangleTest>>testTopRightQuadrant (in category 'tests') -----
- testTopRightQuadrant
- 	| r |
- 	r := 10 at 20 corner: 30 at 50.
- 	self assert: (20 at 20 corner: 30 at 35) equals: r topRightQuadrant.
- 	self assert: (25 at 20 corner: 30 at 27) equals: r topRightQuadrant topRightQuadrant!

Item was removed:
- HashAndEqualsTestCase subclass: #TextStyleTest
- 	instanceVariableNames: ''
- 	classVariableNames: ''
- 	poolDictionaries: ''
- 	category: 'GraphicsTests-Text'!

Item was removed:
- ----- Method: TextStyleTest>>setUp (in category 'initialize-release') -----
- setUp
- 	super setUp.
- 	prototypes add: TextStyle default !



More information about the Squeak-dev mailing list