Giter Site home page Giter Site logo

graphics-go's Introduction

This is a Graphics library for the Go programming language.

Unless otherwise noted, the graphics-go source files are distributed
under the BSD-style license found in the LICENSE file.

Contributions should follow the same procedure as for the Go project:
http://golang.org/doc/contribute.html

graphics-go's People

Contributors

crawshaw avatar nigeltao avatar proppy avatar xczas avatar

Watchers

 avatar

graphics-go's Issues

Src bounds checking fails and Transform results in index out of range panics

What steps will reproduce the problem?
1. Compile the following program

package main

import "image"
import "graphics-go.googlecode.com/hg/graphics"

func main() {

    src := image.NewGray(image.Rect(50,50,60,60))
    dst := image.NewGray(image.Rect(0,0,100,100))
    graphics.I.Transform(dst, src)
}

2. Run it.

What is the expected output? What do you see instead?
Absolutely nothing. Instead I get:

panic: runtime error: index out of range

goroutine 1 [running]:
graphics-go%2egooglecode%2ecom/hg/graphics.binterpRGBA(0xf84001c870, 
0x3200000032, 0xf84001c570, 0x4049400000000000, 0x4049400000000000, ...)
    /Users/gunca/Code/go/src/pkg/graphics-go.googlecode.com/hg/graphics/bilinear.go:104 +0x5e4
graphics-go%2egooglecode%2ecom/hg/graphics.Affine.Transform(0x3ff0000000000000, 
0x0, 0x0, 0x0, 0x3ff0000000000000, ...)
    /Users/gunca/Code/go/src/pkg/graphics-go.googlecode.com/hg/graphics/affine.go:66 +0x348
main.main()
    /Users/gunca/Code/go-rotate/rotate.go:10 +0x144

What version of the product are you using? On what operating system?
hg identify -> d7322ae4d055+ weekly/weekly.2011-09-21
latest graphics-go on Snow Leopard

Original issue reported on code.google.com by Gunchars on 12 Nov 2011 at 1:48

Transform and transformRGBA are using the inverse of the given transform

It seems that this entire package uses *inverse* transformations from the usual 
convention.

This is borne out by examination of the Transform functions, which transform 
from the destination to the source to look up pixels.

In addition, each of the Rotate, Translate, etc. functions generates an inverse 
matrix (for example, Translate puts -x and -y in the translation terms; 
Rotation produces at clockwise rotation by documentation, while the matrix it 
provides usually produces a ccw rotation).

If this is intentional it needs to be clearly documented - providing your own 
affine transform doesn't work as expected - you have to invert it first.

To fix this we'd need to add an Invert() function and call it before the 
transformations.  I'm happy to provide a patch if this is the correct route.



Original issue reported on code.google.com by [email protected] on 12 Jan 2012 at 7:13

gofix

See 
http://code.google.com/r/cbro-graphics-go/source/detail?r=ee82808bb1de44bcd6ef0d
0770f92d15f1f1ecba

Original issue reported on code.google.com by [email protected] on 2 Feb 2012 at 3:01

Convolution on subimages results in index out of range panic

Applying a convolution on an image obtained via a call to img.SubImage(rect) 
leads to a index out range error.

What steps will reproduce the problem?
go run main.go (attached)

What is the expected output? What do you see instead?
We do not expect an exception to be raised.

What version of the product are you using? On what operating system?
- go version: 1.2.2-1
- latest version of graphics-co
- up-to-date Archlinux

Original issue reported on code.google.com by [email protected] on 22 May 2014 at 11:10

Attachments:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.