8000 GitHub - rphii/c-image-viewer: A lightweight image viewer written entirely in C and OpenGL 3.3
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

rphii/c-image-viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

civ - c image viewer. quite lightweight

the image viewer loads all specified images into memory (and never frees them) it will also, once viewed, load them into GPU.


dependencies:

  • rphii/rphiic
  • stb_image
  • pthreads
  • cglm
  • opengl
  • freetype
  • glfw
  • (glad - in src)
  • meson (build)

clone:

git clone https://github.com/rphii/c-image-viewer/

build with meson:

meson setup build   # only need to call once
meson compile -C build

install with meson:

meson install -C build

usage:

civ IMAGE-FILES-HERE

help: (defaults shown will be AFTER loading config and AFTER applying arguments, if any are passed)

civ --help

controls:

K                                 : previous image
J                                 : next image
S                                 : scaling
LEFT_SHIFT + S                    : change filter (nearest, linear)
MOUSE_LEFT_PAN                    : pan image
SCROLL                            : zoom image
D                                 : toggle description
ARROW_KEY_LEFT  | LEFT_SHIFT + H  : pan left
ARROW_KEY_RIGHT | LEFT_SHIFT + J  : pan down
ARROW_KEY_UP    | LEFT_SHIFT + K  : pan up
ARROW_KEY_DOWN  | LEFT_SHIFT + L  : pan right
I | LEFT_SHIFT + AROW_KEY_UP      : zoom in
O | LEFT_SHIFT + AROW_KEY_UP      : zoom out
Q | ESCAPE                        : quit
P                                 : print the filename of the active image to stdout
<
6E48
/pre>

Config

following paths get checked for a config file:

$XDG_CONFIG_HOME/imv/civ.conf
$HOME/.config/civ/civ.conf
/etc/civ/civ.conf

all options (the ones preceeded with --) listed in --help can be loaded with a config. if e.g. --help shows an option --filter, the equivalent for the config is filter = <value>

an example config:

font-path = /usr/share/fonts/lato/Lato-Regular.ttf
font-size = 12
show-loaded = false
show-description = yes
jobs = 4
filter = linear

Wayland

Changing from floating to tiling window can be done via:

windowrule = tile, title:^civ(\.out)?$

Distributions

TODO so I won't forget
  • don't load EVERYTHING, but keep some images around the currently active one loaded
    • CURRENTLY: freeing CPU memory when sent to GPU (as that appears to work?)
  • specify directory, check mime types (magic.h)
  • config file
    • pan speed
    • zoom speed
    • background color
    • text color
  • fix font - fontconfig ...
  • load font symbols for filename
  • config for key bindings ...
  • better error handling
  • info / verbose
  • make pthreads optional (single core)
  • type numbers -> go-to image
  • wayland - how to set tiling ? -> use wayland window instead of glfw

About

A lightweight image viewer written entirely in C and OpenGL 3.3

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0