Skip to content

coothon/glasses-v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Glasses

This is a program for viewing images "interactively": click and drag to move the image, and scroll to zoom. See --keybinds for more. Should support whatever images stb_image.h supports, as long as it can be converted to RGBA.

The program uses OpenGL hardware acceleration, thus it will not work without a video card that supports OpenGL and appopriate drivers. If you are unsure whether you have that, you probably do.

I made this for two reasons: I wanted a feh that you could use with the mouse (though feh has more uses than just viewing images); and I wanted the ability to change how the images are sampled with a keybind. Also, I wanted to use the Lanczos algorithm, as I'd heard it was the "best" technique.

However, using the Lanczos sampling method uses a bit more computing power, as it samples the texture 16 times per fragment, whereas the others sample only once per fragment. Also, it does some other calculations besides. Related: see the fragment shader for original author credit/Copyright (I have no idea what it's doing but it works).


Usage

$ glasses [switches] [path_to_image] # to load one image
$ glasses [switches] [path_to_directory] # to load all images in a directory

Building

$ make clean # for subsequent builds
$ make

Dependencies

  • OpenGL 4.6 (you can change the version, if you want) supported video card and drivers.
  • Linux.
  • GLFW3.

Switches

Short

Switch Effect
-l shorthand for --bilinear
-n shorthand for --nearest
-h shorthand for --lanczos

Long

Switch Effect
--bilinear start with bilinear sampling
--nearest start with nearest neighbour sampling
--lanczos start with lanczos sampling
--help print the help message
--keybinds print the keybinds

Keybinds

Key Effect
Left click and drag move image
Scroll wheel/+/- zoom in and out
r reset position and zoom
n set sampling mode to nearest neighbour
l set sampling mode to bilinear
h set sampling mode to lanczos
ESC/q quit
ENTER next image
BACKSPACE previous image

License/Copying

GPL-3.0

About

OpenGL accelerated image viewing program.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages