equal
deleted
inserted
replaced
5326 |pictureDepth nPlanes| |
5326 |pictureDepth nPlanes| |
5327 |
5327 |
5328 |
5328 |
5329 nPlanes := samplesPerPixel. |
5329 nPlanes := samplesPerPixel. |
5330 (nPlanes == 2) ifTrue:[ |
5330 (nPlanes == 2) ifTrue:[ |
5331 'Image [info]: alpha plane ignored' infoPrintCR. |
5331 'Image [info]: alpha plane ignored' infoPrintCR. |
5332 ]. |
5332 ]. |
5333 "/ first plane only |
5333 "/ first plane only |
5334 pictureDepth := bitsPerSample at:1. |
5334 pictureDepth := bitsPerSample at:1. |
5335 |
5335 |
5336 "monochrome is very easy ..." |
5336 "monochrome is very easy ..." |
5337 |
5337 |
5338 (pictureDepth == 1) ifTrue:[ |
5338 (pictureDepth == 1) ifTrue:[ |
5339 ^ Form width:width height:height fromArray:self bits on:aDevice |
5339 ^ Form width:width height:height fromArray:self bits onDevice:aDevice |
5340 ]. |
5340 ]. |
5341 |
5341 |
5342 (aDevice visualType == #TrueColor) ifTrue:[ |
5342 (aDevice visualType == #TrueColor) ifTrue:[ |
5343 ^ self greyImageAsTrueColorFormOn:aDevice |
5343 ^ self greyImageAsTrueColorFormOn:aDevice |
5344 ]. |
5344 ]. |
5345 |
5345 |
5346 "/ PseudoColor conversion also works for StaticColor, |
5346 "/ PseudoColor conversion also works for StaticColor, |
5347 "/ GrayScale and DirectColor; although possibly with suboptimal results |
5347 "/ GrayScale and DirectColor; although possibly with suboptimal results |
5348 |
5348 |
11309 makeDeviceMonochromeBitmapOn:aDevice fromArray:monoBits |
11309 makeDeviceMonochromeBitmapOn:aDevice fromArray:monoBits |
11310 "given the bits of a monochrome bitmap, 8-bit padded and |
11310 "given the bits of a monochrome bitmap, 8-bit padded and |
11311 0-bits as black, create a device form for it" |
11311 0-bits as black, create a device form for it" |
11312 |
11312 |
11313 "/ monoBits invert. |
11313 "/ monoBits invert. |
11314 ^ (Form width:width height:height fromArray:monoBits on:aDevice) |
11314 ^ (Form width:width height:height fromArray:monoBits onDevice:aDevice) |
11315 colorMap:(Array with:Color black with:Color white). |
11315 colorMap:(Array with:Color black with:Color white). |
11316 |
11316 |
11317 "Created: 10.6.1996 / 20:18:09 / cg" |
11317 "Created: 10.6.1996 / 20:18:09 / cg" |
11318 "Modified: 17.4.1997 / 01:07:38 / cg" |
11318 "Modified: 17.4.1997 / 01:07:38 / cg" |
11319 ! |
11319 ! |
11320 |
11320 |
12882 ! ! |
12882 ! ! |
12883 |
12883 |
12884 !Image class methodsFor:'documentation'! |
12884 !Image class methodsFor:'documentation'! |
12885 |
12885 |
12886 version |
12886 version |
12887 ^ '$Header: /cvs/stx/stx/libview/Image.st,v 1.391 2007-05-29 10:16:33 cg Exp $' |
12887 ^ '$Header: /cvs/stx/stx/libview/Image.st,v 1.392 2007-05-30 11:41:43 stefan Exp $' |
12888 ! ! |
12888 ! ! |
12889 |
12889 |
12890 Image initialize! |
12890 Image initialize! |