mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 00:47:56 +01:00
lib/lowleveljpeg: add Abs method, nil checks
This commit is contained in:
1 parent
12b404f58d
commit
f483ef0849
4 files changed
+42
-2
No files matched your search
@@ -236,6 +236,12 @@ func downsample4x4(dst []uint8, src *BlockU8) {
|
||||
|
||||
// DownsampleFrom reduces one 16×16 quad-block to one 8×8 block.
|
||||
func (dst *BlockU8) DownsampleFrom(src *QuadBlockU8) {
|
||||
if dst == nil {
|
||||
return
|
||||
} else if src == nil {
|
||||
dst.SetToNeutral()
|
||||
return
|
||||
}
|
||||
for y := 0; y < 8; y++ {
|
||||
for x := 0; x < 8; x++ {
|
||||
d := (y << 3) | (x << 0)
|
||||
|
||||
Reference in new issue
Block a user