Commits

timfel  committed 83b3e91

add BitBlt, GrafPort, Form, and Canvas classes that work in pure smalltalk

  • Participants
  • Parent commits 89c1c5b

Comments (0)

Files changed (1)

File images/BitBltPureSmalltalk.st

+Object subclass: #BitBltPure
 	destDepth = 16
      dst.R = color.R * mask.R * colorAlpha + (1 - (mask.R * colorAlpha)) * dst.R
      dst.G = color.G * mask.G * colorAlpha + (1 - (mask.G* colorAlpha)) * dst.G
      dst.B = color.B * mask.B * colorAlpha + (1 - (mask.B* colorAlpha)) * dst.B
      dst.R = color.R * mask.R * colorAlpha + (1 - (mask.R * colorAlpha)) * dst.R
      dst.G = color.G * mask.G * colorAlpha + (1 - (mask.G* colorAlpha)) * dst.G
      dst.B = color.B * mask.B * colorAlpha + (1 - (mask.B* colorAlpha)) * dst.B
 	"Try a shortcut for stuff that should be run as quickly as possible"
 	Note: This method is intended to deal with different source formats."
 	Note: This method is intended to deal with different source formats."
 
 
 
        "Paint a border whose rectangular area is defined by rect. The
        | blt |
        blt := (BitBltSmalltalk toForm: self) combinationRule: rule; fillColor: fillColor.
        blt sourceOrigin: 0@0.
        blt destOrigin: rect origin.
        blt width: rect width; height: borderWidth; copyBits.
        blt destY: rect corner y - borderWidth; copyBits.
        blt destY: rect origin y + borderWidth.
        blt height: rect height - borderWidth - borderWidth; width:
        blt destX: rect corner x - borderWidth; copyBits! !
 | f f2 f3 | f := Form fromUser. f2 := Form fromDisplay: (0@0 extent: f extent). f3 := f2 deepCopy.
 | f f2 f3 | f := Form fromUser. f replaceColor: f peripheralColor withColor: Color transparent.
 | d |
 | f diff | f := Form fromUser.
 | r tallies nonZero |