Skip to content

Commit

Permalink
draw/memdraw: fix two print formats
Browse files Browse the repository at this point in the history
  • Loading branch information
rsc committed Apr 10, 2024
1 parent 4083899 commit 03bb196
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions draw/memdraw/draw.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ var tablesbuilt int

/* perfect approximation to NTSC = .299r+.587g+.114b when 0 ≤ r,g,b < 256 */
func _RGB2K(r, g, b uint8) uint8 {
// fmt.Printf("RGB2K %#x %#x %#x -> %#x\n%s", r, g, b,
// uint8((156763*int(r) + 307758*int(g) + 59769*int(b)) >> 19),
// string(debug.Stack()))
// fmt.Printf("RGB2K %#x %#x %#x -> %#x\n%s", r, g, b,
// uint8((156763*int(r) + 307758*int(g) + 59769*int(b)) >> 19),
// string(debug.Stack()))
return uint8((156763*int(r) + 307758*int(g) + 59769*int(b)) >> 19)
}

Expand Down Expand Up @@ -2239,7 +2239,7 @@ func memoptdraw(par *memDrawParam) int {
dp := byteaddr(dst, par.r.Min)
v := par.sdval
if _DBG {
fmt.Fprintf(os.Stderr, "sdval %lud, depth %d\n", v, dst.Depth)
fmt.Fprintf(os.Stderr, "sdval %d, depth %d\n", v, dst.Depth)
}
switch dst.Depth {
case 1, 2, 4:
Expand Down
2 changes: 1 addition & 1 deletion draw/memdraw/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func writememimage(fd *os.File, i *Image) error {
return fmt.Errorf("no data")
}
n = loutp
hdr := []byte(fmt.Sprintf("%11d %11ld ", r.Max.Y, n))
hdr := []byte(fmt.Sprintf("%11d %11d ", r.Max.Y, n))
fd.Write(hdr)
fd.Write(outbuf[:n])
r.Min.Y = r.Max.Y
Expand Down

0 comments on commit 03bb196

Please sign in to comment.