imview

package module
v0.0.0-...-7f26a71 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2016 License: MIT Imports: 8 Imported by: 2

README

imview

Simple image viewer written in Go + OpenGL.

Installation

go get -u github.com/fogleman/imview/cmd/imview

Usage

imview first.jpg second.png third.bmp

API

You can show a single image...

import "github.com/fogleman/imview"

var image *image.RGBA
// ...
imview.Show(image)

Or multiple images, each in their own window...

import "github.com/fogleman/imview"

var images []*image.RGBA
// ...
imview.Show(images...)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImageToRGBA

func ImageToRGBA(src image.Image) *image.RGBA

func LoadImage

func LoadImage(path string) (image.Image, error)

func Show

func Show(images ...*image.RGBA) error

Types

type Texture

type Texture struct {
	Handle uint32
}

func NewTexture

func NewTexture() *Texture

func (*Texture) Bind

func (t *Texture) Bind()

func (*Texture) SetImage

func (t *Texture) SetImage(im image.Image)

func (*Texture) SetMagFilter

func (t *Texture) SetMagFilter(x int32)

func (*Texture) SetMinFilter

func (t *Texture) SetMinFilter(x int32)

func (*Texture) SetRGBA

func (t *Texture) SetRGBA(im *image.RGBA)

func (*Texture) SetWrapS

func (t *Texture) SetWrapS(x int32)

func (*Texture) SetWrapT

func (t *Texture) SetWrapT(x int32)

type Window

type Window struct {
	*glfw.Window
	Image   image.Image
	Texture *Texture
}

func NewWindow

func NewWindow(im image.Image) (*Window, error)

func (*Window) Draw

func (window *Window) Draw()

func (*Window) DrawImage

func (window *Window) DrawImage()

func (*Window) SetImage

func (window *Window) SetImage(im image.Image)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL