Skip to content
Raphael Kim edited this page Jul 14, 2023 · 5 revisions

(lib)fl_imgtk

What is fl_imgtk ?

  • fl_imgtk is a shorten word for "FLTK image toolkit".

What supports to do ?

  • You can change many things to do on Fl_RGB_Image.
  • Currently supports these:
    1. Flipping images
    2. Rotating images in any degree with minimal pixel modulating.
    3. Rescale(or resize) in many filters: nearest, bicubic, lanczos, B-Splie.
    4. Tone mapping (HDRi) for Drago and Reinhard
    5. Kernel matrix filters
    6. Contrast, Gamma, Bright control.
    7. Draws Fl_Widget to Fl_RGB_Image easily.
    8. Make blurred Fl_Widget image to Fl_RGB_Image as you can use in background blurred image for beautiful GUI.

Limits

  • My C++ code designed to get maximize optimized by compiler level with many options.
  • But without compiler power, ther's no fastest way now.
  • Recommend to use OpenMP (is availed) and Fast-Math with AVX architecture( Intel and AMD x86 base )

License

  • MIT License, yeah !

Referenced

  • Some algorithms from FreeImage3 library
  • Desinged for FLTK, and it follows FLTK License.

Color format issue

  • FLTK has indexed color within 255 from 0, like FL_BLACK, FL_WHITE or FL_xx .
  • fl_imgtk don't convert colors !
  • fl_imgtk only has this byte orders to expression color space : 0xRRGGBBAA.
  • If you want to convert color space from index, use Fl::get_color();, and refer to fl_cmap.h.
  • When you got 24bit color from Fl::get_color(), then need to do this uint32_t flimgtk_color = Fl::get_color( FL_RED ) | 0x000000FF;
  • Always fltk returns non-alpha mask, but fl_imgtk matter alpha depth, 0x00 to 0xFF.

For Raspberry Pi 3 users:

  • It should be possible to build with modified Makefile from Makefile.gcc.
    1. Make sure already built fltk-1.3.4-2-ts for your Rasberry Pi3 in your board.
    2. Copy Makefile.gcc to Makefile, then open Makefile with vim.
    3. Just remove -mavx in line of "CPUARCHOPT =" ( line 41 ).
    4. Write file and exit with ( wq command ) in vim.
    5. Just run a "make" in your shell.