Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for NewGray (0.19 sec)

  1. src/image/draw/example_test.go

    package draw_test
    
    import (
    	"fmt"
    	"image"
    	"image/color"
    	"image/draw"
    	"math"
    )
    
    func ExampleDrawer_floydSteinberg() {
    	const width = 130
    	const height = 50
    
    	im := image.NewGray(image.Rectangle{Max: image.Point{X: width, Y: height}})
    	for x := 0; x < width; x++ {
    		for y := 0; y < height; y++ {
    			dist := math.Sqrt(math.Pow(float64(x-width/2), 2)/3+math.Pow(float64(y-height/2), 2)) / (height / 1.5) * 255
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 18:07:05 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  2. src/image/draw/bench_test.go

    					uint8(13 * x % 0x100),
    					uint8(11 * y % 0x100),
    					uint8((11*x + 13*y) % 0x100),
    					uint8((31*x + 37*y) % 0x100),
    				})
    			}
    		}
    		src = src1
    	case color.GrayModel:
    		src1 := image.NewGray(image.Rect(0, 0, srcw, srch))
    		for y := 0; y < srch; y++ {
    			for x := 0; x < srcw; x++ {
    				src1.SetGray(x, y, color.Gray{
    					uint8((11*x + 13*y) % 0x100),
    				})
    			}
    		}
    		src = src1
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 18:07:05 UTC 2023
    - 6.6K bytes
    - Viewed (0)
Back to top