{"id":19795549,"url":"https://github.com/dkogan/gl_image_display","last_synced_at":"2026-02-25T16:03:08.722Z","repository":{"id":52114867,"uuid":"391563187","full_name":"dkogan/GL_image_display","owner":"dkogan","description":"Image-display library backed by OpenGL. Provided are a C library and a FLTK widget with C++ and Python interfaces","archived":false,"fork":false,"pushed_at":"2025-04-25T02:04:32.000Z","size":282,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-25T03:25:08.275Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dkogan.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-08-01T07:52:49.000Z","updated_at":"2025-04-25T02:04:35.000Z","dependencies_parsed_at":"2024-08-23T07:21:41.847Z","dependency_job_id":"55386a7d-bb5b-41a6-b476-a28ae77c67f7","html_url":"https://github.com/dkogan/GL_image_display","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkogan%2FGL_image_display","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkogan%2FGL_image_display/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkogan%2FGL_image_display/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkogan%2FGL_image_display/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dkogan","download_url":"https://codeload.github.com/dkogan/GL_image_display/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251817808,"owners_count":21648811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T07:16:38.676Z","updated_at":"2026-02-25T16:03:03.677Z","avatar_url":"https://github.com/dkogan.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is an image-display library that uses OpenGL internally for efficient\n(re)drawing. \n\n* Overview\nImage-display widgets are common in GUI toolkits (FLTK has [[https://www.fltk.org/doc-1.3/classFl__RGB__Image.html][=Fl_RGB_Image=]] for\ninstance), but they generally use the CPU to draw, which becomes slow when given\nlarge images. By contrast, /this/ toolkit uses OpenGL hardware, so after the\ninitial cost to load an image, the drawing, redrawing, panning and zooming are\neffectively free. This makes it possible to quickly build responsive\napplications that display images.\n\nThree separate interfaces are available:\n\n- C library defined in [[https://github.com/dkogan/GL_image_display/blob/master/GL_image_display.h][=GL_image_display.h=]]\n- C++ library providing an FLTK widget, defined in [[https://github.com/dkogan/GL_image_display/blob/master/Fl_Gl_Image_Widget.hh][=Fl_Gl_Image_Widget.hh=]]\n- Python library wrapping the FLTK widget to make it usable in Python. Defined\n  in the SWIG interface in [[https://github.com/dkogan/GL_image_display/blob/master/Fl_Gl_Image_Widget.i][=Fl_Gl_Image_Widget.i=]]\n\n* Build\nRun =make=. A few dependencies are required to build. See the =Build-Depends=\nsection in the [[https://salsa.debian.org/debian/gl-image-display/-/blob/master/debian/control][=debian/control= file]].\n\n* C library\nThe core functionality in this library is made available in the C library. This\ncan be used directly to build a GLUT application (sample in\n[[https://github.com/dkogan/GL_image_display/blob/master/GL_image_display-test-glut.c][=GL_image_display-test-glut.c=]]), or it can be used to implement higher-level\ncomponents, such as the [[https://github.com/dkogan/GL_image_display/blob/master/Fl_Gl_Image_Widget.hh][=Fl_Gl_Image_Widget=]] FLTK widget.\n\nPlease see [[https://github.com/dkogan/GL_image_display/blob/master/GL_image_display.h][=GL_image_display.h=]] and the GLUT sample for the API.\n\n* FLTK widget\nAn =Fl_Gl_Image_Widget= is provided in [[https://github.com/dkogan/GL_image_display/blob/master/Fl_Gl_Image_Widget.hh][=Fl_Gl_Image_Widget.hh=]], with a sample\napplication in [[https://github.com/dkogan/GL_image_display/blob/master/GL_image_display-test-fltk.cc][=GL_image_display-test-fltk.cc=]]. This is a \"normal\" FLTK widget,\nthat wraps the necessary functions from the C API, and that defines the expected\nUI behaviors to make it immediately usable. The UI supported by the default\n=Fl_Gl_Image_Widget::handle()= function:\n\n- Mouse click/drag pans\n\n- Mousewheel pans. Vertical and horizontal mousewheels are supported to pan in\n  the two directions\n\n- Ctrl-vertical-mousewheel zooms\n\n- =u= key on the keyboard reverts to the original full-size view (this is the\n  key used by [[http://gnuplot.info][gnuplot]].)\n\nTo define new/different interactions, subclass =Fl_Gl_Image_Widget=, and\noverride the =handle()= method.\n\nThe widget automatically handles resizing operations.\n\nThe normal usage sequence is very simple:\n\n- Construct the =Fl_Gl_Image_Widget=\n- Call the =update_image2()= method to give it data\n\nNote that the =set_panzoom()= method is =virtual=, so a derived class can\noverride it to get a \"notification\" of any pan/zoom operation. One application\nof this is to sync the pan/zoom setting between multiple =Fl_Gl_Image_Widget=\nobjects in a single application.\n\n* Python FLTK widget\nFor FLTK applications written in Python using [[https://pyfltk.sourceforge.io/][pyfltk]], a Python flavor of the\n=Fl_Gl_Image_Widget= is available. The wrapper code is generated with [[http://www.swig.org][SWIG]], so\nthe Python API largely mirrors the C++ API. Some Python-specific notes:\n\n- Instead of returning =False= to indicate failure, these functions raise an\n  =Exception=\n- SWIG directors are used, so the widget can be subclassed in Python, and works\n  as one would expect\n- =update_image2()= can take an image filename (as in C++) /or/ a numpy array of\n  data. The dimensions, depth and pitch are all read from this array\n- The pixel mapping functions =map_pixel_viewport_from_image()= and\n  =map_pixel_image_from_viewport()= ingest a length-2 iterable (or a numpy\n  array) and return a length-2 tuple.\n- =set_lines()= takes in =dict= objects each with keys\n  - =points=: a numpy array of shape (=Nsegments=,2,2). These are the line\n    segments, each represented as =(x0,y0)= - =(x1,y1)=\n  - =color_rgb=: a numpy array of shape (3,) which contains the RGB color for\n    this set of line segments. Each channel ranges from 0 to 1.\n\nA sample application is available in [[https://github.com/dkogan/GL_image_display/blob/master/GL_image_display-test-fltk.py][=GL_image_display-test-fltk.py=]].\n\n* Repository\n\nhttps://www.github.com/dkogan/GL_image_display\n\n* Author\n\nDima Kogan (=dima@secretsauce.net=)\n\n* License and Copyright\n\nCopyright (c) 2021 California Institute of Technology (\"Caltech\"). U.S.\nGovernment sponsorship acknowledged. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkogan%2Fgl_image_display","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdkogan%2Fgl_image_display","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkogan%2Fgl_image_display/lists"}