filter: basic: comment and removing const

This commit is contained in:
Ella Pietraroia 2020-02-03 10:52:04 +10:30
parent f27a18282b
commit c1881cef3a
1 changed files with 3 additions and 3 deletions

View File

@ -142,7 +142,7 @@ func (bf *Basic) Write(f []byte) (int, error) {
} }
// If there are not enough motion pixels then discard the frame. // If there are not enough motion pixels then discard the frame.
if bf.motion < pixels { if bf.motion < bf.pix {
return len(f), nil return len(f), nil
} }
@ -163,12 +163,12 @@ func (bf *Basic) process(j int, wg *sync.WaitGroup) {
diff := diffR + diffG + diffB diff := diffR + diffG + diffB
if diff > threshold { if diff > bf.thresh {
bf.motion++ bf.motion++
} }
if bf.debug { if bf.debug {
if diff > threshold { if diff > bf.thresh {
bf.bwImg.SetRGBA(i, j, color.RGBA{0xff, 0xff, 0xff, 0xff}) bf.bwImg.SetRGBA(i, j, color.RGBA{0xff, 0xff, 0xff, 0xff})
} else { } else {
bf.bwImg.SetRGBA(i, j, color.RGBA{0x00, 0x00, 0x00, 0xff}) bf.bwImg.SetRGBA(i, j, color.RGBA{0x00, 0x00, 0x00, 0xff})