squeak의 BitBlt(픽셀 이동) 가지고 놀기.
참고.
* http://squeak.qp.land.to/wiki/index.php?BitBlt
* Form method : Combination Rule
* 이미지 alpha 값 조절: 크기가 같은 2개의 이미지(알파이미지, 원본이미지)를 합침
Display newDepth:32.
| alphaBlit alphaForm |
alphaForm := Form extent: (ImageMorph new extent) depth: 32.
"alphaForm asMorph openInWorld." "test"
alphaForm fillColor: (Color r: 1.0 g: 1.0 b: 0.0 alpha: 0.3).
anImage := ImageMorph new imageForm.
alphaBlit := BitBlt
destForm: anImage
sourceForm: alphaForm
fillColor: Color red "any Color but Color transparent"
combinationRule: 4 "4번은 투명, Form erase"
destOrigin: 0@0
sourceOrigin: 0@0
extent: (anImage extent)
clipRect: (anImage boundingBox).
alphaBlit copyBits. "적용"
(SketchMorph withForm: anImage) openInWorld.
* 이미지에서 원하는 부분 추출.
* 이미지 마스킹
----
WarpBlt
참고 http://www.ida.liu.se/~ETE257/timetable/LectureMorphic.html
| f warp r pts|
f := Form fromUser.
warp := (WarpBlt toForm: Display)
cellSize: 1;
sourceForm: f;
cellSize: 2; "installs a colormap"
combinationRule: Form over.
r := (0@0) extent: f extent.
pts := {r topLeft. r bottomLeft. r bottomRight. r topRight}.
warp
copyQuad: pts
toRect: ((0@0) extent: (200@200)).