Here is an open source library helps many Fl_RGB_Image processing to make some featured GUI. You can clone or download source code in free on GitHub page.
It designed to work with any type of gcc ( llvm-gcc and MinGW-W64 ) with just a copy and type ‘make’, or modify Makefile.{your compiler} and copy to it as Makefile, then it could be compiled and writes libfl_imgtk.a into “lib” directory includes fl_imgtk.h.
What you can do ?
It provides some features to processing Fl_RGB_Image as like Photoshop.
- Flip image in vertical or horizental.
- Rotate image in any degree with smoothen pixels.
- Adjusting contrast, bright and gamma.
- Drawing image to blurred ( by using fl_smimg rescaling ).
- Rescale with muliple filters ( nearest, bilinear, bicubic, lanczos, b-spline )
- Tone mapping ( HDRi ) with two different algorithms : Drago and Reinhard ( refered to FreeImage3 )
- Kernel matrix filtering ( basically supports blur, blur more, sharpen, sharpen more filters)
Specially any user can make a new kernel filter easily. - Draw Fl_Widget to Fl_RGB_Image
- Draw Fl_Widget to blurred Fl_RGB_Image as it could be used in cool background.
- Cropping image to a part of new image.
Building
Before you start with this open source library, prepare what FLTK library compiled or installed in your system. I amd working my clone version of FLTK 1.3.4-1.
First you need to do, download or cloen with your git into your working directoy. Then, copy Makefile.{your compiler} to Makefle. ( ex, cp Makefile.gcc Makefile )
Now just proceeding make.
If you faced to unknown reference of FLTK libraries, you may need edit Makefile.
# Makefile for fl_imgtk
# (C)2017 Raphael Kim / rageworx@gmail.com
#
#########################################################################
# About cross compiler, or other platform :
#
# To enable build for embedded linux, you may encomment next 2 lines.
# Or, may need to change your cross compiler path with environments.
# It is up to developer !
# CCPREPATH = ${ARM_LINUX_GCC_PATH}
# CCPREFIX = arm-linux-
# To enable build for embedded linux, change following line.
# CCPATH = ${CCPREPATH}/${CCPREFIX}
CCPATH =
#########################################################################
# Compiler configure.
GCC = ${CCPATH}gcc
GPP = ${CCPATH}g++
AR = ${CCPATH}ar
# FLTK place
FLTKDIR = /usr/include
FLTKLIBDIR = /usr/lib
FLTKLIBS = -L$(FLTKLIBDIR) -lfltk -lfltk_images -lfltk_png -lfltk_jpeg
# Sources and how it built
# Optimization issue: recommend to build with using -ffast-math option.
# Change if your CPU architecture supports more high technologies.
INCDIR = ./inc
SOURCEDIR = ./src
OBJDIR = ./obj/Release
OUTBIN = libfl_imgtk.a
OUTDIR = ./lib
DEFINEOPT = -DUSING_INTERPOLATED_ROTATE_FREE -DUSING_OMP
OPTIMIZEOPT = -ffast-math -fopenmp -O3 -s
CPUARCHOPT = -mavx
ifeq (64bit,$(firstword $(MAKECMDGOALS)))
OBJDIR = ./obj64/Release
OUTDIR = ./lib64
CPUARCHOPT += -m64
endif
ifeq (debug,$(firstword $(MAKECMDGOALS)))
DEFINEOPT += -DDEBUG
OUTBIN = libfl_imgtk_d.a
endif
CFLAGS = -I$(INCDIR) -I$(SOURCEDIR) -I$(FLTKDIR) $(DEFINEOPT) $(OPTIMIZEOPT) $(CPUARCHOPT) $(BITSOPT) $(FLTKLIBS)
.PHONY: 64bit
all: prepare clean ${OUTDIR}/${OUTBIN}
64bit: all
debug: all
prepare:
@mkdir -p ${OBJDIR}
@mkdir -p ${OUTDIR}
${OBJDIR}/fl_imgtk_tonemap.o:
@$(GPP) -c ${SOURCEDIR}/fl_imgtk_tonemap.cpp ${CFLAGS} -o $@
${OBJDIR}/fl_smimg.o:
@$(GPP) -c ${SOURCEDIR}/fl_smimg.cpp ${CFLAGS} -o $@
${OBJDIR}/fl_imgtk.o:
@$(GPP) -c ${SOURCEDIR}/fl_imgtk.cpp ${CFLAGS} -o $@
${OUTDIR}/${OUTBIN}: ${OBJDIR}/fl_imgtk_tonemap.o ${OBJDIR}/fl_smimg.o ${OBJDIR}/fl_imgtk.o
@echo "Generating $@ ..."
@$(AR) -q $@ ${OBJDIR}/*.o
@cp -f ${INCDIR}/fl_imgtk.h ${OUTDIR}
clean:
@echo "Cleaning built directories ..."
@rm -rf ${OBJDIR}/*
@rm -rf ${OUTDIR}/${OUTBIN}You can changes FLTK_xxx configuration to your right place. It will works well any platform that availed to compile FLTK library.
Any question ?
You can make a new issue on my GitHub page, or my Guest book on my blog.
License
- MIT License
External Licenses
- FLTK license
- FreeImage (3) license.
