mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
Comment fix
This commit is contained in:
parent
e03076ef67
commit
f88f48f0ae
@ -100,6 +100,11 @@ func NewImage(width, height int, filter Filter) (*Image, error) {
|
||||
}
|
||||
|
||||
// NewImageFromImage creates a new image with the given image (img).
|
||||
//
|
||||
// NewImageFromImage generates a new texture and a new framebuffer.
|
||||
// Be careful that image objects will never be released
|
||||
// even though nothing refers the image object and GC works.
|
||||
// It is because there is no way to define finalizers for Go objects if you use GopherJS.
|
||||
func NewImageFromImage(img image.Image, filter Filter) (*Image, error) {
|
||||
var eimg *Image
|
||||
var err error
|
||||
|
8
image.go
8
image.go
@ -163,13 +163,11 @@ func (i *Image) At(x, y int) color.Color {
|
||||
return color.RGBA{r, g, b, a}
|
||||
}
|
||||
|
||||
// ReplacePixels replaces the pixels of image with p.
|
||||
// ReplacePixels replaces the pixels of the image with p.
|
||||
//
|
||||
// The given p must represent RGBA pre-multiplied alpha values.
|
||||
// The given p must represent RGBA pre-multiplied alpha values. len(p) must equal to 4 * (image width) * (image height).
|
||||
//
|
||||
// len(p) must equal to 4 * (image width) * (image height)
|
||||
//
|
||||
// This function may be slow.
|
||||
// This function may be slow (as for implementation, this calls glTexSubImage2D).
|
||||
func (i *Image) ReplacePixels(p []uint8) error {
|
||||
w, h := i.Size()
|
||||
l := 4 * w * h
|
||||
|
Loading…
Reference in New Issue
Block a user