Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for SetGray16 (0.14 sec)

  1. src/image/image_test.go

    		m.Gray16At(4, 5)
    	}
    }
    
    func BenchmarkGraySetGray16(b *testing.B) {
    	m := NewGray16(Rect(0, 0, 10, 10))
    	c := color.Gray16{0x13}
    	b.ResetTimer()
    
    	for i := 0; i < b.N; i++ {
    		m.SetGray16(4, 5, c)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 30 02:00:49 UTC 2021
    - 10.8K bytes
    - Viewed (0)
  2. src/image/png/reader.go

    					}
    					nrgba64.SetNRGBA64(x, y, color.NRGBA64{ycol, ycol, ycol, acol})
    				}
    			} else {
    				for x := 0; x < width; x++ {
    					ycol := uint16(cdat[2*x+0])<<8 | uint16(cdat[2*x+1])
    					gray16.SetGray16(x, y, color.Gray16{ycol})
    				}
    			}
    		case cbGA16:
    			for x := 0; x < width; x++ {
    				ycol := uint16(cdat[4*x+0])<<8 | uint16(cdat[4*x+1])
    				acol := uint16(cdat[4*x+2])<<8 | uint16(cdat[4*x+3])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:45 UTC 2023
    - 26K bytes
    - Viewed (0)
  3. src/image/image.go

    	gray := (19595*uint32(c.R) + 38470*uint32(c.G) + 7471*uint32(c.B) + 1<<15) >> 16
    	i := p.PixOffset(x, y)
    	p.Pix[i+0] = uint8(gray >> 8)
    	p.Pix[i+1] = uint8(gray)
    }
    
    func (p *Gray16) SetGray16(x, y int, c color.Gray16) {
    	if !(Point{x, y}.In(p.Rect)) {
    		return
    	}
    	i := p.PixOffset(x, y)
    	p.Pix[i+0] = uint8(c.Y >> 8)
    	p.Pix[i+1] = uint8(c.Y)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:45 UTC 2023
    - 34.9K bytes
    - Viewed (0)
Back to top