Probably noob question. I wish to use CImg library to make some processing of images. How ever some of them may be type of (8 bit) and some of them (16 bit). Unfortunately I don't know the type of data until user don't pick file to process. Of course I can do like this:
...
CImg <unsigned char> img_unisgned_char;
CImg <unsigned short> img_unisgned_short;
...
if (user_pick_8bit) img_unisgned_char.load_raw(fname,img_size_x,img_size_y);
if (user_pick_16bit) img_unisgned_short.load_raw(fname,img_size_x,img_size_y);
...
But 99% of CImg methods looks exactly the same for 'unsigned char','int' or 'float' type (like 'load_raw' or 'blur' for example). Is there any way to make - I don't know - pointer? - so when user pick the file I can make magic like:
if (user_pick_8_bit) img = img_unisgned_char;
if (user_pick_16bit) img = img_unisgned_short;
...
//now no mother of what type is picked up by user I simply make:
img.load_raw(...);