Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for bytesPerPixel (0.15 sec)

  1. src/image/png/paeth_test.go

    }
    
    // slowFilterPaeth is a slow but simple implementation of func filterPaeth.
    func slowFilterPaeth(cdat, pdat []byte, bytesPerPixel int) {
    	for i := 0; i < bytesPerPixel; i++ {
    		cdat[i] += paeth(0, pdat[i], 0)
    	}
    	for i := bytesPerPixel; i < len(cdat); i++ {
    		cdat[i] += paeth(cdat[i-bytesPerPixel], pdat[i], pdat[i-bytesPerPixel])
    	}
    }
    
    func TestPaeth(t *testing.T) {
    	for a := 0; a < 256; a += 15 {
    		for b := 0; b < 256; b += 15 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 08 04:08:51 UTC 2014
    - 2.2K bytes
    - Viewed (0)
  2. src/image/png/paeth.go

    // cdat is the current row's data, pdat is the previous row's data.
    func filterPaeth(cdat, pdat []byte, bytesPerPixel int) {
    	var a, b, c, pa, pb, pc int
    	for i := 0; i < bytesPerPixel; i++ {
    		a, c = 0, 0
    		for j := i; j < len(cdat); j += bytesPerPixel {
    			b = int(pdat[j])
    			pa = b - c
    			pb = a - c
    			pc = abs(pa + pb)
    			pa = abs(pa)
    			pb = abs(pb)
    			if pa <= pb && pa <= pc {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 08 04:08:51 UTC 2014
    - 1.7K bytes
    - Viewed (0)
  3. src/image/png/reader.go

    			// check above that width != 0, and so len(cdat) != 0.
    			for i := 0; i < bytesPerPixel; i++ {
    				cdat[i] += pdat[i] / 2
    			}
    			for i := bytesPerPixel; i < len(cdat); i++ {
    				cdat[i] += uint8((int(cdat[i-bytesPerPixel]) + int(pdat[i])) / 2)
    			}
    		case ftPaeth:
    			filterPaeth(cdat, pdat, bytesPerPixel)
    		default:
    			return nil, FormatError("bad filter type")
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:45 UTC 2023
    - 26K bytes
    - Viewed (0)
  4. src/image/png/reader_test.go

    	}
    }
    
    func benchmarkDecode(b *testing.B, filename string, bytesPerPixel int) {
    	data, err := os.ReadFile(filename)
    	if err != nil {
    		b.Fatal(err)
    	}
    	cfg, err := DecodeConfig(bytes.NewReader(data))
    	if err != nil {
    		b.Fatal(err)
    	}
    	b.SetBytes(int64(cfg.Width * cfg.Height * bytesPerPixel))
    	b.ReportAllocs()
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 24 12:12:12 UTC 2022
    - 28.5K bytes
    - Viewed (0)
  5. src/image/image.go

    //
    // This panics instead of returning an error because of backwards
    // compatibility. The NewXxx functions do not return an error.
    func pixelBufferLength(bytesPerPixel int, r Rectangle, imageTypeName string) int {
    	totalLength := mul3NonNeg(bytesPerPixel, r.Dx(), r.Dy())
    	if totalLength < 0 {
    		panic("image: New" + imageTypeName + " Rectangle has huge or negative dimensions")
    	}
    	return totalLength
    }
    
    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