ruby-iup 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +3 -0
- data/MANIFEST +8 -0
- data/MIT-LICENSE +18 -0
- data/README +12 -0
- data/Rakefile +68 -80
- data/doc/build_install.txt +9 -12
- data/examples/ctrl/cbox.rb +14 -15
- data/examples/ctrl/checkboard.rb +1 -1
- data/examples/ctrl/example1.rb +53 -53
- data/examples/ctrl/example2.rb +39 -39
- data/examples/ctrl/iupcolorbar.rb +95 -95
- data/examples/ctrl/iupcolorbrowser.rb +45 -45
- data/examples/ctrl/iupdial.rb +117 -117
- data/examples/ctrl/iupgetcolor.rb +7 -7
- data/examples/ctrl/iupgetparam.rb +62 -62
- data/examples/ctrl/iupglcanvas.rb +172 -172
- data/examples/ctrl/iupmask.rb +1 -3
- data/examples/ctrl/iupmatrix.rb +39 -39
- data/examples/ctrl/iupplot2.rb +2 -1
- data/examples/ctrl/iuptabs.rb +22 -22
- data/examples/ctrl/iuptree.rb +190 -190
- data/examples/ctrl/iupval.rb +71 -71
- data/examples/ctrl/numbering.rb +46 -46
- data/examples/ctrl/sample.rb +166 -166
- data/examples/dlg/iupfiledlg.rb +19 -19
- data/examples/dlg/iupgetfile.rb +19 -19
- data/examples/dlg/iuplistdialog.rb +26 -26
- data/examples/dlg/iupmessage.rb +5 -5
- data/examples/dlg/iupscanf.rb +17 -17
- data/examples/elem/iupdialog2.rb +25 -25
- data/examples/elem/iupfill.rb +51 -51
- data/examples/elem/iupframe.rb +25 -25
- data/examples/elem/iuphbox.rb +68 -68
- data/examples/elem/iupimage.rb +113 -113
- data/examples/elem/iupitem.rb +60 -60
- data/examples/elem/iuplabel.rb +57 -57
- data/examples/elem/iuplist.rb +41 -41
- data/examples/elem/iuplist2.rb +125 -125
- data/examples/elem/iupmenu.rb +32 -32
- data/examples/elem/iupmultiline.rb +24 -24
- data/examples/elem/iupmultiline2.rb +156 -156
- data/examples/elem/iupradio.rb +32 -32
- data/examples/elem/iupseparator.rb +81 -81
- data/examples/elem/iupsubmenu.rb +85 -85
- data/examples/elem/iuptext.rb +61 -61
- data/examples/elem/iuptimer.rb +36 -36
- data/examples/elem/iuptoggle.rb +110 -110
- data/examples/elem/iupvbox.rb +87 -87
- data/examples/elem/iupzbox.rb +60 -60
- data/examples/elem/mdisample.rb +377 -376
- data/examples/elem/scrollbar.rb +66 -66
- data/examples/elem/tray.rb +90 -90
- data/examples/func/iupgetattribute.rb +32 -32
- data/examples/func/iupidle.rb +48 -48
- data/ext/extconf.rb +62 -27
- data/ext/iup-linux/include/cd.h +9 -5
- data/ext/iup-linux/include/cd_private.h +13 -6
- data/ext/iup-linux/include/cdsvg.h +22 -0
- data/ext/iup-linux/include/im.h +287 -282
- data/ext/iup-linux/include/im_attrib.h +120 -116
- data/ext/iup-linux/include/im_attrib_flat.h +39 -39
- data/ext/iup-linux/include/im_binfile.h +224 -214
- data/ext/iup-linux/include/im_capture.h +365 -365
- data/ext/iup-linux/include/im_color.h +465 -465
- data/ext/iup-linux/include/im_colorhsi.h +56 -61
- data/ext/iup-linux/include/im_complex.h +180 -160
- data/ext/iup-linux/include/im_convert.h +142 -127
- data/ext/iup-linux/include/im_counter.h +69 -69
- data/ext/iup-linux/include/im_dib.h +195 -195
- data/ext/iup-linux/include/im_file.h +115 -111
- data/ext/iup-linux/include/im_format.h +97 -79
- data/ext/iup-linux/include/im_format_all.h +575 -576
- data/ext/iup-linux/include/im_format_avi.h +88 -87
- data/ext/iup-linux/include/im_format_ecw.h +93 -93
- data/ext/iup-linux/include/im_format_jp2.h +79 -78
- data/ext/iup-linux/include/im_format_raw.h +74 -64
- data/ext/iup-linux/include/im_format_wmv.h +101 -100
- data/ext/iup-linux/include/im_image.h +425 -403
- data/ext/iup-linux/include/im_kernel.h +315 -315
- data/ext/iup-linux/include/im_lib.h +191 -191
- data/ext/iup-linux/include/im_math.h +368 -368
- data/ext/iup-linux/include/im_math_op.h +214 -219
- data/ext/iup-linux/include/im_palette.h +172 -172
- data/ext/iup-linux/include/im_plus.h +73 -73
- data/ext/iup-linux/include/im_process.h +36 -35
- data/ext/iup-linux/include/im_process_ana.h +222 -221
- data/ext/iup-linux/include/im_process_glo.h +170 -170
- data/ext/iup-linux/include/im_process_loc.h +608 -577
- data/ext/iup-linux/include/im_process_pon.h +734 -712
- data/ext/iup-linux/include/im_raw.h +34 -34
- data/ext/iup-linux/include/im_util.h +277 -277
- data/ext/iup-linux/include/imlua.h +75 -83
- data/ext/iup-linux/include/iup.h +86 -40
- data/ext/iup-linux/include/iupcb.h +1 -25
- data/ext/iup-linux/include/iupcbox.h +1 -0
- data/ext/iup-linux/include/iupcbs.h +1 -1
- data/ext/iup-linux/include/iupcells.h +1 -130
- data/ext/iup-linux/include/iupcolorbar.h +1 -126
- data/ext/iup-linux/include/iupcontrols.h +26 -16
- data/ext/iup-linux/include/iupdef.h +205 -0
- data/ext/iup-linux/include/iupdial.h +1 -63
- data/ext/iup-linux/include/iupgauge.h +1 -57
- data/ext/iup-linux/include/iupgc.h +1 -0
- data/ext/iup-linux/include/iupgetparam.h +1 -27
- data/ext/iup-linux/include/iupgl.h +2 -7
- data/ext/iup-linux/include/iupim.h +7 -1
- data/ext/iup-linux/include/iupkey.h +4 -4
- data/ext/iup-linux/include/iupmask.h +2 -1
- data/ext/iup-linux/include/iupmatrix.h +1 -63
- data/ext/iup-linux/include/iupsbox.h +1 -0
- data/ext/iup-linux/include/iupspin.h +1 -21
- data/ext/iup-linux/include/iuptabs.h +1 -75
- data/ext/iup-linux/include/iuptree.h +1 -93
- data/ext/iup-linux/include/iupval.h +1 -46
- data/ext/iup-linux/include/old_im.h +59 -59
- data/ext/iup-linux/include/wd.h +5 -0
- data/ext/iup-linux/libcd.a +0 -0
- data/ext/iup-linux/libcdcontextplus.a +0 -0
- data/ext/iup-linux/libcdgdk.a +0 -0
- data/ext/iup-linux/libcdpdf.a +0 -0
- data/ext/iup-linux/libfreetype.a +0 -0
- data/ext/iup-linux/libim.a +0 -0
- data/ext/iup-linux/libim_fftw.a +0 -0
- data/ext/iup-linux/libim_jp2.a +0 -0
- data/ext/iup-linux/libim_process.a +0 -0
- data/ext/iup-linux/libiup.a +0 -0
- data/ext/iup-linux/libiup_pplot.a +0 -0
- data/ext/iup-linux/libiupcd.a +0 -0
- data/ext/iup-linux/libiupcontrols.a +0 -0
- data/ext/iup-linux/libiupgl.a +0 -0
- data/ext/iup-linux/libiupim.a +0 -0
- data/ext/iup-linux/libiupimglib.a +0 -0
- data/ext/iup-linux/libiupmot.a +0 -0
- data/ext/iup-linux/libpdflib.a +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cd.h +9 -5
- data/ext/{iup-win32 → iup-mingw32}/include/cd_canvas.hpp +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cd_old.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cd_private.h +13 -6
- data/ext/{iup-win32 → iup-mingw32}/include/cdcgm.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdclipbd.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cddbuf.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cddebug.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cddgn.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cddxf.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdemf.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdgdiplus.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdimage.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdirgb.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdiup.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdlua.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdlua3_private.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdlua5_private.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdluaim.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdluaiup.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdluapdf.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdmf.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdmf_private.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdnative.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdpdf.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdpicture.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdprint.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdps.h +0 -0
- data/ext/iup-mingw32/include/cdsvg.h +22 -0
- data/ext/{iup-win32 → iup-mingw32}/include/cdwmf.h +0 -0
- data/ext/iup-mingw32/include/im.h +287 -0
- data/ext/iup-mingw32/include/im_attrib.h +120 -0
- data/ext/iup-mingw32/include/im_attrib_flat.h +39 -0
- data/ext/iup-mingw32/include/im_binfile.h +224 -0
- data/ext/iup-mingw32/include/im_capture.h +365 -0
- data/ext/iup-mingw32/include/im_color.h +465 -0
- data/ext/iup-mingw32/include/im_colorhsi.h +56 -0
- data/ext/iup-mingw32/include/im_complex.h +180 -0
- data/ext/iup-mingw32/include/im_convert.h +142 -0
- data/ext/iup-mingw32/include/im_counter.h +69 -0
- data/ext/iup-mingw32/include/im_dib.h +195 -0
- data/ext/iup-mingw32/include/im_file.h +115 -0
- data/ext/iup-mingw32/include/im_format.h +97 -0
- data/ext/iup-mingw32/include/im_format_all.h +575 -0
- data/ext/iup-mingw32/include/im_format_avi.h +88 -0
- data/ext/iup-mingw32/include/im_format_ecw.h +93 -0
- data/ext/iup-mingw32/include/im_format_jp2.h +79 -0
- data/ext/iup-mingw32/include/im_format_raw.h +74 -0
- data/ext/iup-mingw32/include/im_format_wmv.h +101 -0
- data/ext/iup-mingw32/include/im_image.h +425 -0
- data/ext/iup-mingw32/include/im_kernel.h +315 -0
- data/ext/iup-mingw32/include/im_lib.h +191 -0
- data/ext/iup-mingw32/include/im_math.h +368 -0
- data/ext/iup-mingw32/include/im_math_op.h +214 -0
- data/ext/iup-mingw32/include/im_palette.h +172 -0
- data/ext/iup-mingw32/include/im_plus.h +73 -0
- data/ext/iup-mingw32/include/im_process.h +36 -0
- data/ext/iup-mingw32/include/im_process_ana.h +222 -0
- data/ext/iup-mingw32/include/im_process_glo.h +170 -0
- data/ext/iup-mingw32/include/im_process_loc.h +608 -0
- data/ext/iup-mingw32/include/im_process_pon.h +734 -0
- data/ext/iup-mingw32/include/im_raw.h +34 -0
- data/ext/iup-mingw32/include/im_util.h +277 -0
- data/ext/iup-mingw32/include/imlua.h +75 -0
- data/ext/{iup-win32 → iup-mingw32}/include/iup.h +86 -40
- data/ext/{iup-win32 → iup-mingw32}/include/iup_pplot.h +0 -0
- data/ext/iup-mingw32/include/iupcb.h +1 -0
- data/ext/iup-mingw32/include/iupcbox.h +1 -0
- data/ext/{iup-win32 → iup-mingw32}/include/iupcbs.h +1 -1
- data/ext/iup-mingw32/include/iupcells.h +1 -0
- data/ext/iup-mingw32/include/iupcolorbar.h +1 -0
- data/ext/iup-mingw32/include/iupcontrols.h +46 -0
- data/ext/{iup-win32 → iup-mingw32}/include/iupdef.h +205 -0
- data/ext/iup-mingw32/include/iupdial.h +1 -0
- data/ext/iup-mingw32/include/iupgauge.h +1 -0
- data/ext/iup-mingw32/include/iupgc.h +1 -0
- data/ext/iup-mingw32/include/iupgetparam.h +1 -0
- data/ext/{iup-win32 → iup-mingw32}/include/iupgl.h +2 -7
- data/ext/{iup-win32 → iup-mingw32}/include/iupim.h +7 -1
- data/ext/{iup-win32 → iup-mingw32}/include/iupkey.h +4 -4
- data/ext/{iup-win32 → iup-mingw32}/include/iuplua.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/iuplua_pplot.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/iupluacontrols.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/iupluagl.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/iupluaim.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/iupluaole.h +0 -0
- data/ext/{iup-win32 → iup-mingw32}/include/iupmask.h +2 -1
- data/ext/iup-mingw32/include/iupmatrix.h +1 -0
- data/ext/{iup-win32 → iup-mingw32}/include/iupole.h +0 -0
- data/ext/iup-mingw32/include/iupsbox.h +1 -0
- data/ext/iup-mingw32/include/iupspin.h +1 -0
- data/ext/iup-mingw32/include/iuptabs.h +1 -0
- data/ext/iup-mingw32/include/iuptree.h +1 -0
- data/ext/iup-mingw32/include/iupval.h +1 -0
- data/ext/iup-mingw32/include/old_im.h +59 -0
- data/ext/{iup-win32 → iup-mingw32}/include/wd.h +5 -0
- data/ext/{iup-win32 → iup-mingw32}/include/wd_old.h +0 -0
- data/ext/iup-mingw32/libcd.a +0 -0
- data/ext/iup-mingw32/libcdpdf.a +0 -0
- data/ext/iup-mingw32/libfreetype6.a +0 -0
- data/ext/iup-mingw32/libim.a +0 -0
- data/ext/iup-mingw32/libim_avi.a +0 -0
- data/ext/iup-mingw32/libim_fftw.a +0 -0
- data/ext/iup-mingw32/libim_jp2.a +0 -0
- data/ext/iup-mingw32/libim_process.a +0 -0
- data/ext/iup-mingw32/libiup.a +0 -0
- data/ext/iup-mingw32/libiup_pplot.a +0 -0
- data/ext/iup-mingw32/libiupcd.a +0 -0
- data/ext/iup-mingw32/libiupcontrols.a +0 -0
- data/ext/iup-mingw32/libiupgl.a +0 -0
- data/ext/iup-mingw32/libiupim.a +0 -0
- data/ext/iup-mingw32/libiupimglib.a +0 -0
- data/ext/iup-mingw32/libiupole.a +0 -0
- data/ext/iup-mingw32/libpdflib.a +0 -0
- data/ext/iup-mswin32/cd.lib +0 -0
- data/ext/iup-mswin32/cdcontextplus.lib +0 -0
- data/ext/iup-mswin32/cdgdk.lib +0 -0
- data/ext/iup-mswin32/cdpdf.lib +0 -0
- data/ext/iup-mswin32/freetype6.lib +0 -0
- data/ext/iup-mswin32/im.lib +0 -0
- data/ext/iup-mswin32/im_avi.lib +0 -0
- data/ext/iup-mswin32/im_capture.lib +0 -0
- data/ext/iup-mswin32/im_fftw.lib +0 -0
- data/ext/iup-mswin32/im_jp2.lib +0 -0
- data/ext/iup-mswin32/im_process.lib +0 -0
- data/ext/iup-mswin32/im_wmv.lib +0 -0
- data/ext/iup-mswin32/include/cd.h +498 -0
- data/ext/iup-mswin32/include/cd_canvas.hpp +358 -0
- data/ext/iup-mswin32/include/cd_old.h +158 -0
- data/ext/iup-mswin32/include/cd_private.h +369 -0
- data/ext/iup-mswin32/include/cdcgm.h +34 -0
- data/ext/iup-mswin32/include/cdclipbd.h +22 -0
- data/ext/iup-mswin32/include/cddbuf.h +23 -0
- data/ext/iup-mswin32/include/cddebug.h +24 -0
- data/ext/iup-mswin32/include/cddgn.h +23 -0
- data/ext/iup-mswin32/include/cddxf.h +22 -0
- data/ext/iup-mswin32/include/cdemf.h +22 -0
- data/ext/iup-mswin32/include/cdgdiplus.h +29 -0
- data/ext/iup-mswin32/include/cdimage.h +23 -0
- data/ext/iup-mswin32/include/cdirgb.h +30 -0
- data/ext/iup-mswin32/include/cdiup.h +22 -0
- data/ext/iup-mswin32/include/cdlua.h +39 -0
- data/ext/iup-mswin32/include/cdlua3_private.h +120 -0
- data/ext/iup-mswin32/include/cdlua5_private.h +141 -0
- data/ext/iup-mswin32/include/cdluaim.h +24 -0
- data/ext/iup-mswin32/include/cdluaiup.h +27 -0
- data/ext/iup-mswin32/include/cdluapdf.h +27 -0
- data/ext/iup-mswin32/include/cdmf.h +24 -0
- data/ext/iup-mswin32/include/cdmf_private.h +32 -0
- data/ext/iup-mswin32/include/cdnative.h +26 -0
- data/ext/iup-mswin32/include/cdpdf.h +38 -0
- data/ext/iup-mswin32/include/cdpicture.h +22 -0
- data/ext/iup-mswin32/include/cdprint.h +23 -0
- data/ext/iup-mswin32/include/cdps.h +37 -0
- data/ext/iup-mswin32/include/cdsvg.h +22 -0
- data/ext/iup-mswin32/include/cdwmf.h +22 -0
- data/ext/iup-mswin32/include/im.h +287 -0
- data/ext/iup-mswin32/include/im_attrib.h +120 -0
- data/ext/iup-mswin32/include/im_attrib_flat.h +39 -0
- data/ext/iup-mswin32/include/im_binfile.h +224 -0
- data/ext/iup-mswin32/include/im_capture.h +365 -0
- data/ext/iup-mswin32/include/im_color.h +465 -0
- data/ext/iup-mswin32/include/im_colorhsi.h +56 -0
- data/ext/iup-mswin32/include/im_complex.h +180 -0
- data/ext/iup-mswin32/include/im_convert.h +142 -0
- data/ext/iup-mswin32/include/im_counter.h +69 -0
- data/ext/iup-mswin32/include/im_dib.h +195 -0
- data/ext/iup-mswin32/include/im_file.h +115 -0
- data/ext/iup-mswin32/include/im_format.h +97 -0
- data/ext/iup-mswin32/include/im_format_all.h +575 -0
- data/ext/iup-mswin32/include/im_format_avi.h +88 -0
- data/ext/iup-mswin32/include/im_format_ecw.h +93 -0
- data/ext/iup-mswin32/include/im_format_jp2.h +79 -0
- data/ext/iup-mswin32/include/im_format_raw.h +74 -0
- data/ext/iup-mswin32/include/im_format_wmv.h +101 -0
- data/ext/iup-mswin32/include/im_image.h +425 -0
- data/ext/iup-mswin32/include/im_kernel.h +315 -0
- data/ext/iup-mswin32/include/im_lib.h +191 -0
- data/ext/iup-mswin32/include/im_math.h +368 -0
- data/ext/iup-mswin32/include/im_math_op.h +214 -0
- data/ext/iup-mswin32/include/im_palette.h +172 -0
- data/ext/iup-mswin32/include/im_plus.h +73 -0
- data/ext/iup-mswin32/include/im_process.h +36 -0
- data/ext/iup-mswin32/include/im_process_ana.h +222 -0
- data/ext/iup-mswin32/include/im_process_glo.h +170 -0
- data/ext/iup-mswin32/include/im_process_loc.h +608 -0
- data/ext/iup-mswin32/include/im_process_pon.h +734 -0
- data/ext/iup-mswin32/include/im_raw.h +34 -0
- data/ext/iup-mswin32/include/im_util.h +277 -0
- data/ext/iup-mswin32/include/imlua.h +75 -0
- data/ext/iup-mswin32/include/iup.h +364 -0
- data/ext/iup-mswin32/include/iup_pplot.h +40 -0
- data/ext/iup-mswin32/include/iupcb.h +1 -0
- data/ext/iup-mswin32/include/iupcbox.h +1 -0
- data/ext/iup-mswin32/include/iupcbs.h +43 -0
- data/ext/iup-mswin32/include/iupcells.h +1 -0
- data/ext/iup-mswin32/include/iupcolorbar.h +1 -0
- data/ext/iup-mswin32/include/iupcontrols.h +46 -0
- data/ext/iup-mswin32/include/iupdef.h +725 -0
- data/ext/iup-mswin32/include/iupdial.h +1 -0
- data/ext/iup-mswin32/include/iupgauge.h +1 -0
- data/ext/iup-mswin32/include/iupgc.h +1 -0
- data/ext/iup-mswin32/include/iupgetparam.h +1 -0
- data/ext/iup-mswin32/include/iupgl.h +96 -0
- data/ext/iup-mswin32/include/iupim.h +27 -0
- data/ext/iup-mswin32/include/iupkey.h +457 -0
- data/ext/iup-mswin32/include/iuplua.h +41 -0
- data/ext/iup-mswin32/include/iuplua_pplot.h +26 -0
- data/ext/iup-mswin32/include/iupluacontrols.h +27 -0
- data/ext/iup-mswin32/include/iupluagl.h +26 -0
- data/ext/iup-mswin32/include/iupluaim.h +26 -0
- data/ext/iup-mswin32/include/iupluaole.h +26 -0
- data/ext/iup-mswin32/include/iupmask.h +41 -0
- data/ext/iup-mswin32/include/iupmatrix.h +1 -0
- data/ext/iup-mswin32/include/iupole.h +24 -0
- data/ext/iup-mswin32/include/iupsbox.h +1 -0
- data/ext/iup-mswin32/include/iupspin.h +1 -0
- data/ext/iup-mswin32/include/iuptabs.h +1 -0
- data/ext/iup-mswin32/include/iuptree.h +1 -0
- data/ext/iup-mswin32/include/iupval.h +1 -0
- data/ext/iup-mswin32/include/old_im.h +59 -0
- data/ext/iup-mswin32/include/wd.h +83 -0
- data/ext/iup-mswin32/include/wd_old.h +85 -0
- data/ext/iup-mswin32/iup.lib +0 -0
- data/ext/iup-mswin32/iup_pplot.lib +0 -0
- data/ext/iup-mswin32/iupcd.lib +0 -0
- data/ext/iup-mswin32/iupcontrols.lib +0 -0
- data/ext/iup-mswin32/iupgl.lib +0 -0
- data/ext/iup-mswin32/iupgtk.lib +0 -0
- data/ext/iup-mswin32/iupim.lib +0 -0
- data/ext/{iup-win32/iupimglib.dll → iup-mswin32/iupimglib.lib} +0 -0
- data/ext/iup-mswin32/iupole.lib +0 -0
- data/ext/iup-mswin32/pdflib.lib +0 -0
- data/ext/iup.c +6 -37
- data/ext/{rb_cd.h → rb_cd.c} +300 -302
- data/ext/rb_iup.c +2485 -0
- data/ext/rb_iup.h +400 -2475
- data/ext/{rb_iup_pplot.h → rb_iup_pplot.c} +21 -22
- data/ext/{rb_iupcb.h → rb_iupcb.c} +2 -3
- data/ext/{rb_iupcells.h → rb_iupcells.c} +5 -5
- data/ext/{rb_iupcolorbar.h → rb_iupcolorbar.c} +2 -3
- data/ext/{rb_iupcontrols.h → rb_iupcontrols.c} +1 -1
- data/ext/{rb_iupdial.h → rb_iupdial.c} +3 -4
- data/ext/{rb_iupgauge.h → rb_iupgauge.c} +2 -3
- data/ext/{rb_iupgc.h → rb_iupgc.c} +1 -1
- data/ext/{rb_iupgetparam.h → rb_iupgetparam.c} +12 -10
- data/ext/{rb_iupgl.h → rb_iupgl.c} +10 -10
- data/ext/{rb_iupim.h → rb_iupim.c} +6 -6
- data/ext/{rb_iupmatrix.h → rb_iupmatrix.c} +15 -16
- data/ext/{rb_iupole.h → rb_iupole.c} +4 -4
- data/ext/{rb_iupsbox.h → rb_iupsbox.c} +3 -3
- data/ext/{rb_iupspin.h → rb_iupspin.c} +4 -5
- data/ext/{rb_iuptabs.h → rb_iuptabs.c} +5 -6
- data/ext/{rb_iuptree.h → rb_iuptree.c} +20 -21
- data/ext/{rb_iupval.h → rb_iupval.c} +3 -4
- data/ruby-iup.gemspec +26 -0
- data/test/test_ruby_iup.rb +25 -0
- metadata +395 -270
- data/ext/iup-linux/include/lauxlib.h +0 -174
- data/ext/iup-linux/include/lua.h +0 -388
- data/ext/iup-linux/include/lua.hpp +0 -9
- data/ext/iup-linux/include/luaconf.h +0 -763
- data/ext/iup-linux/include/lualib.h +0 -53
- data/ext/iup-linux/libcd.so +0 -0
- data/ext/iup-linux/libcdcontextplus.so +0 -0
- data/ext/iup-linux/libcdpdf.so +0 -0
- data/ext/iup-linux/libfreetype.so +0 -0
- data/ext/iup-linux/libim.so +0 -0
- data/ext/iup-linux/libim_fftw.so +0 -0
- data/ext/iup-linux/libim_jp2.so +0 -0
- data/ext/iup-linux/libim_process.so +0 -0
- data/ext/iup-linux/libiup.so +0 -0
- data/ext/iup-linux/libiup_pplot.so +0 -0
- data/ext/iup-linux/libiupcd.so +0 -0
- data/ext/iup-linux/libiupcontrols.so +0 -0
- data/ext/iup-linux/libiupgl.so +0 -0
- data/ext/iup-linux/libiupim.so +0 -0
- data/ext/iup-linux/libiupimglib.so +0 -0
- data/ext/iup-linux/libiupmot.so +0 -0
- data/ext/iup-linux/libpdflib.so +0 -0
- data/ext/iup-win32/cd.dll +0 -0
- data/ext/iup-win32/cd.lib +0 -0
- data/ext/iup-win32/cdcontextplus.dll +0 -0
- data/ext/iup-win32/cdcontextplus.lib +0 -0
- data/ext/iup-win32/cdpdf.dll +0 -0
- data/ext/iup-win32/cdpdf.lib +0 -0
- data/ext/iup-win32/freetype6.dll +0 -0
- data/ext/iup-win32/freetype6.lib +0 -0
- data/ext/iup-win32/im.dll +0 -0
- data/ext/iup-win32/im.lib +0 -0
- data/ext/iup-win32/im_avi.dll +0 -0
- data/ext/iup-win32/im_avi.lib +0 -0
- data/ext/iup-win32/im_capture.dll +0 -0
- data/ext/iup-win32/im_capture.lib +0 -0
- data/ext/iup-win32/im_ecw.dll +0 -0
- data/ext/iup-win32/im_fftw.dll +0 -0
- data/ext/iup-win32/im_fftw.lib +0 -0
- data/ext/iup-win32/im_jp2.dll +0 -0
- data/ext/iup-win32/im_jp2.lib +0 -0
- data/ext/iup-win32/im_process.dll +0 -0
- data/ext/iup-win32/im_process.lib +0 -0
- data/ext/iup-win32/im_wmv.dll +0 -0
- data/ext/iup-win32/im_wmv.lib +0 -0
- data/ext/iup-win32/imlua_capture51.dll +0 -0
- data/ext/iup-win32/imlua_capture51.lib +0 -0
- data/ext/iup-win32/imlua_wmv51.dll +0 -0
- data/ext/iup-win32/imlua_wmv51.lib +0 -0
- data/ext/iup-win32/include/iupcb.h +0 -25
- data/ext/iup-win32/include/iupcells.h +0 -130
- data/ext/iup-win32/include/iupcolorbar.h +0 -126
- data/ext/iup-win32/include/iupcontrols.h +0 -36
- data/ext/iup-win32/include/iupdial.h +0 -63
- data/ext/iup-win32/include/iupgauge.h +0 -57
- data/ext/iup-win32/include/iupgetparam.h +0 -27
- data/ext/iup-win32/include/iupmatrix.h +0 -63
- data/ext/iup-win32/include/iupspin.h +0 -21
- data/ext/iup-win32/include/iuptabs.h +0 -75
- data/ext/iup-win32/include/iuptree.h +0 -93
- data/ext/iup-win32/include/iupval.h +0 -46
- data/ext/iup-win32/iup.dll +0 -0
- data/ext/iup-win32/iup.lib +0 -0
- data/ext/iup-win32/iup_pplot.dll +0 -0
- data/ext/iup-win32/iup_pplot.lib +0 -0
- data/ext/iup-win32/iupcd.dll +0 -0
- data/ext/iup-win32/iupcd.lib +0 -0
- data/ext/iup-win32/iupcontrols.dll +0 -0
- data/ext/iup-win32/iupcontrols.lib +0 -0
- data/ext/iup-win32/iupgl.dll +0 -0
- data/ext/iup-win32/iupgl.lib +0 -0
- data/ext/iup-win32/iupgtk.dll +0 -0
- data/ext/iup-win32/iupgtk.lib +0 -0
- data/ext/iup-win32/iupim.dll +0 -0
- data/ext/iup-win32/iupim.lib +0 -0
- data/ext/iup-win32/iupimglib.lib +0 -0
- data/ext/iup-win32/iupole.dll +0 -0
- data/ext/iup-win32/iupole.lib +0 -0
- data/ext/iup-win32/iupstub.lib +0 -0
- data/ext/iup-win32/pdflib.dll +0 -0
- data/ext/iup-win32/pdflib.lib +0 -0
- data/ext/mkrf_conf.rb +0 -72
- data/ext/rb_iupcompat.h +0 -237
- data/ext/rb_iupdef.h +0 -3
- data/ext/rb_iupmask.h +0 -189
- data/lib/README +0 -1
@@ -0,0 +1,465 @@
|
|
1
|
+
/** \file
|
2
|
+
* \brief Color Manipulation
|
3
|
+
*
|
4
|
+
* See Copyright Notice in im_lib.h
|
5
|
+
*/
|
6
|
+
|
7
|
+
#ifndef __IM_COLOR_H
|
8
|
+
#define __IM_COLOR_H
|
9
|
+
|
10
|
+
#include "im_math.h"
|
11
|
+
|
12
|
+
/** \defgroup color Color Manipulation
|
13
|
+
*
|
14
|
+
* \par
|
15
|
+
* Functions to convert from one color space to another,
|
16
|
+
* and color gammut utilities.
|
17
|
+
* \par
|
18
|
+
* See \ref im_color.h
|
19
|
+
*
|
20
|
+
* \section s1 Some Color Science
|
21
|
+
* \par
|
22
|
+
* Y is luminance, a linear-light quantity.
|
23
|
+
* It is directly proportional to physical intensity
|
24
|
+
* weighted by the spectral sensitivity of human vision.
|
25
|
+
* \par
|
26
|
+
* L* is lightness, a nonlinear luminance
|
27
|
+
* that aproximates the perception of brightness.
|
28
|
+
* It is nearly perceptual uniform.
|
29
|
+
* It has a range of 0 to 100.
|
30
|
+
* \par
|
31
|
+
* Y' is luma, a nonlinear luminance that aproximates lightness.
|
32
|
+
* \par
|
33
|
+
* Brightness is a visual sensation according to which an area
|
34
|
+
* apears to exhibit more or less light.
|
35
|
+
* It is a subjective quantity and can not be measured.
|
36
|
+
* \par
|
37
|
+
* One unit of euclidian distante in CIE L*u*v* or CIE L*a*b* corresponds
|
38
|
+
* roughly to a just-noticeable difference (JND) of color.
|
39
|
+
* \par
|
40
|
+
\verbatim
|
41
|
+
ChromaUV = sqrt(u*u + v*v)
|
42
|
+
HueUV = atan2(v, u)
|
43
|
+
SaturationUV = ChromaUV / L (called psychometric saturation)
|
44
|
+
(the same can be calculated for Lab)
|
45
|
+
\endverbatim
|
46
|
+
* \par
|
47
|
+
* IEC 61966-2.1 Default RGB colour space - sRGB
|
48
|
+
* \li ITU-R Recommendation BT.709 (D65 white point).
|
49
|
+
* \li D65 White Point (X,Y,Z) = (0.9505 1.0000 1.0890)
|
50
|
+
* \par
|
51
|
+
* Documentation extracted from Charles Poynton - Digital Video and HDTV - Morgan Kaufmann - 2003.
|
52
|
+
*
|
53
|
+
* \section Links
|
54
|
+
* \li www.color.org - ICC
|
55
|
+
* \li www.srgb.com - sRGB
|
56
|
+
* \li www.poynton.com - Charles Poynton
|
57
|
+
* \li www.littlecms.com - A free Color Management System (use this if you need precise color conversions)
|
58
|
+
*
|
59
|
+
* \section cci Color Component Intervals
|
60
|
+
* \par
|
61
|
+
* All the color components are stored in the 0-max interval, even the signed ones. \n
|
62
|
+
* Here are the pre-defined intervals for each data type. These values are used for standard color conversion.
|
63
|
+
* You should normalize data before converting betwwen color spaces.
|
64
|
+
* \par
|
65
|
+
\verbatim
|
66
|
+
byte [0,255] or [-128,+127] (1 byte)
|
67
|
+
ushort [0,65535] or [-32768,+32767] (2 bytes)
|
68
|
+
int [0,16777215] or [-8388608,+8388607] (3 bytes)
|
69
|
+
float [0,1] or [-0.5,+0.5] (4 bytes)
|
70
|
+
\endverbatim
|
71
|
+
* \ingroup util */
|
72
|
+
|
73
|
+
/** Returns the zero value for color conversion porpouses. \n
|
74
|
+
* This is a value to be compensated when the data_type is unsigned and component is signed. \n
|
75
|
+
* \ingroup color */
|
76
|
+
inline float imColorZero(int data_type)
|
77
|
+
{
|
78
|
+
float zero[] = {128.0f, 32768.0f, 8388608.0f, 0.5f};
|
79
|
+
return zero[data_type];
|
80
|
+
}
|
81
|
+
|
82
|
+
/** Returns the maximum value for color conversion porpouses. \n
|
83
|
+
* \ingroup color */
|
84
|
+
inline int imColorMax(int data_type)
|
85
|
+
{
|
86
|
+
int max[] = {255, 65535, 16777215, 1};
|
87
|
+
return max[data_type];
|
88
|
+
}
|
89
|
+
|
90
|
+
/** Quantize r=0-1 values into q=0-max.
|
91
|
+
* max is the maximum value.
|
92
|
+
* max and the returned value are usually integers,
|
93
|
+
* but the dummy quantizer uses real values.
|
94
|
+
* See also \ref math.
|
95
|
+
* \ingroup color */
|
96
|
+
template <class T>
|
97
|
+
inline T imColorQuantize(const float& value, const T& max)
|
98
|
+
{
|
99
|
+
if (max == 1) return (T)value; // to allow a dummy quantizer
|
100
|
+
if (value >= 1) return max;
|
101
|
+
if (value <= 0) return 0;
|
102
|
+
/* return (T)imRound(value*(max + 1) - 0.5f); not necessary since all values are positive */
|
103
|
+
return (T)(value*(max + 1));
|
104
|
+
}
|
105
|
+
|
106
|
+
/** Reconstruct 0-max values into 0-1. \n
|
107
|
+
* max is the maximum value.
|
108
|
+
* max and the given value are usually integers,
|
109
|
+
* but the dummy reconstructor uses real values.
|
110
|
+
* See also \ref math.
|
111
|
+
* \ingroup color */
|
112
|
+
template <class T>
|
113
|
+
inline float imColorReconstruct(const T& value, const T& max)
|
114
|
+
{
|
115
|
+
if (max == 1) return (float)value; // to allow a dummy reconstructor
|
116
|
+
if (value <= 0) return 0;
|
117
|
+
if (value >= max) return 1;
|
118
|
+
return (((float)value + 0.5f)/((float)max + 1.0f));
|
119
|
+
}
|
120
|
+
|
121
|
+
/** Converts Y'CbCr to R'G'B' (all nonlinear). \n
|
122
|
+
* ITU-R Recommendation 601-1 with no headroom/footroom.
|
123
|
+
\verbatim
|
124
|
+
0 <= Y <= 1 ; -0.5 <= CbCr <= 0.5 ; 0 <= RGB <= 1
|
125
|
+
|
126
|
+
R'= Y' + 0.000 *Cb + 1.402 *Cr
|
127
|
+
G'= Y' - 0.344 *Cb - 0.714 *Cr
|
128
|
+
B'= Y' + 1.772 *Cb + 0.000 *Cr
|
129
|
+
\endverbatim
|
130
|
+
* \ingroup color */
|
131
|
+
template <class T>
|
132
|
+
inline void imColorYCbCr2RGB(const T Y, const T Cb, const T Cr,
|
133
|
+
T& R, T& G, T& B,
|
134
|
+
const T& zero, const T& max)
|
135
|
+
{
|
136
|
+
float r = float(Y + 1.402f * (Cr - zero));
|
137
|
+
float g = float(Y - 0.344f * (Cb - zero) - 0.714f * (Cr - zero));
|
138
|
+
float b = float(Y + 1.772f * (Cb - zero));
|
139
|
+
|
140
|
+
// now we should enforce 0<= rgb <= max
|
141
|
+
|
142
|
+
R = (T)IM_CROPMAX(r, max);
|
143
|
+
G = (T)IM_CROPMAX(g, max);
|
144
|
+
B = (T)IM_CROPMAX(b, max);
|
145
|
+
}
|
146
|
+
|
147
|
+
/** Converts R'G'B' to Y'CbCr (all nonlinear). \n
|
148
|
+
* ITU-R Recommendation 601-1 with no headroom/footroom.
|
149
|
+
\verbatim
|
150
|
+
0 <= Y <= 1 ; -0.5 <= CbCr <= 0.5 ; 0 <= RGB <= 1
|
151
|
+
|
152
|
+
Y' = 0.299 *R' + 0.587 *G' + 0.114 *B'
|
153
|
+
Cb = -0.169 *R' - 0.331 *G' + 0.500 *B'
|
154
|
+
Cr = 0.500 *R' - 0.419 *G' - 0.081 *B'
|
155
|
+
\endverbatim
|
156
|
+
* \ingroup color */
|
157
|
+
template <class T>
|
158
|
+
inline void imColorRGB2YCbCr(const T R, const T G, const T B,
|
159
|
+
T& Y, T& Cb, T& Cr,
|
160
|
+
const T& zero)
|
161
|
+
{
|
162
|
+
Y = (T)( 0.299f *R + 0.587f *G + 0.114f *B);
|
163
|
+
Cb = (T)(-0.169f *R - 0.331f *G + 0.500f *B + (float)zero);
|
164
|
+
Cr = (T)( 0.500f *R - 0.419f *G - 0.081f *B + (float)zero);
|
165
|
+
|
166
|
+
// there is no need for cropping here, YCrCr is already at the limits
|
167
|
+
}
|
168
|
+
|
169
|
+
/** Converts C'M'Y'K' to R'G'B' (all nonlinear). \n
|
170
|
+
* This is a poor conversion that works for a simple visualization.
|
171
|
+
\verbatim
|
172
|
+
0 <= CMYK <= 1 ; 0 <= RGB <= 1
|
173
|
+
|
174
|
+
R = (1 - K) * (1 - C)
|
175
|
+
G = (1 - K) * (1 - M)
|
176
|
+
B = (1 - K) * (1 - Y)
|
177
|
+
\endverbatim
|
178
|
+
* \ingroup color */
|
179
|
+
template <class T>
|
180
|
+
inline void imColorCMYK2RGB(const T C, const T M, const T Y, const T K,
|
181
|
+
T& R, T& G, T& B, const T& max)
|
182
|
+
{
|
183
|
+
T W = max - K;
|
184
|
+
R = (T)((W * (max - C)) / max);
|
185
|
+
G = (T)((W * (max - M)) / max);
|
186
|
+
B = (T)((W * (max - Y)) / max);
|
187
|
+
|
188
|
+
// there is no need for cropping here, RGB is already at the limits
|
189
|
+
}
|
190
|
+
|
191
|
+
/** Converts CIE XYZ to Rec 709 RGB (all linear). \n
|
192
|
+
* ITU-R Recommendation BT.709 (D65 white point). \n
|
193
|
+
\verbatim
|
194
|
+
0 <= XYZ <= 1 ; 0 <= RGB <= 1
|
195
|
+
|
196
|
+
R = 3.2406 *X - 1.5372 *Y - 0.4986 *Z
|
197
|
+
G = -0.9689 *X + 1.8758 *Y + 0.0415 *Z
|
198
|
+
B = 0.0557 *X - 0.2040 *Y + 1.0570 *Z
|
199
|
+
\endverbatim
|
200
|
+
* \ingroup color */
|
201
|
+
template <class T>
|
202
|
+
inline void imColorXYZ2RGB(const T X, const T Y, const T Z,
|
203
|
+
T& R, T& G, T& B, const T& max)
|
204
|
+
{
|
205
|
+
float r = 3.2406f *X - 1.5372f *Y - 0.4986f *Z;
|
206
|
+
float g = -0.9689f *X + 1.8758f *Y + 0.0415f *Z;
|
207
|
+
float b = 0.0557f *X - 0.2040f *Y + 1.0570f *Z;
|
208
|
+
|
209
|
+
// we need to crop because not all XYZ colors are visible
|
210
|
+
|
211
|
+
R = (T)IM_CROPMAX(r, max);
|
212
|
+
G = (T)IM_CROPMAX(g, max);
|
213
|
+
B = (T)IM_CROPMAX(b, max);
|
214
|
+
}
|
215
|
+
|
216
|
+
/** Converts Rec 709 RGB to CIE XYZ (all linear). \n
|
217
|
+
* ITU-R Recommendation BT.709 (D65 white point). \n
|
218
|
+
\verbatim
|
219
|
+
0 <= XYZ <= 1 ; 0 <= RGB <= 1
|
220
|
+
|
221
|
+
X = 0.4124 *R + 0.3576 *G + 0.1805 *B
|
222
|
+
Y = 0.2126 *R + 0.7152 *G + 0.0722 *B
|
223
|
+
Z = 0.0193 *R + 0.1192 *G + 0.9505 *B
|
224
|
+
\endverbatim
|
225
|
+
* \ingroup color */
|
226
|
+
template <class T>
|
227
|
+
inline void imColorRGB2XYZ(const T R, const T G, const T B,
|
228
|
+
T& X, T& Y, T& Z)
|
229
|
+
{
|
230
|
+
X = (T)(0.4124f *R + 0.3576f *G + 0.1805f *B);
|
231
|
+
Y = (T)(0.2126f *R + 0.7152f *G + 0.0722f *B);
|
232
|
+
Z = (T)(0.0193f *R + 0.1192f *G + 0.9505f *B);
|
233
|
+
|
234
|
+
// there is no need for cropping here, XYZ is already at the limits
|
235
|
+
}
|
236
|
+
|
237
|
+
#define IM_FWLAB(_w) (_w > 0.008856f? \
|
238
|
+
powf(_w, 1.0f/3.0f): \
|
239
|
+
7.787f * _w + 0.16f/1.16f)
|
240
|
+
|
241
|
+
/** Converts CIE XYZ (linear) to CIE L*a*b* (nonlinear). \n
|
242
|
+
* The white point is D65. \n
|
243
|
+
\verbatim
|
244
|
+
0 <= L <= 1 ; -0.5 <= ab <= +0.5 ; 0 <= XYZ <= 1
|
245
|
+
|
246
|
+
if (t > 0.008856)
|
247
|
+
f(t) = pow(t, 1/3)
|
248
|
+
else
|
249
|
+
f(t) = 7.787*t + 16/116
|
250
|
+
|
251
|
+
fX = f(X / Xn) fY = f(Y / Yn) fZ = f(Z / Zn)
|
252
|
+
|
253
|
+
L = 1.16 * fY - 0.16
|
254
|
+
a = 2.5 * (fX - fY)
|
255
|
+
b = (fY - fZ)
|
256
|
+
|
257
|
+
\endverbatim
|
258
|
+
* \ingroup color */
|
259
|
+
inline void imColorXYZ2Lab(const float X, const float Y, const float Z,
|
260
|
+
float& L, float& a, float& b)
|
261
|
+
{
|
262
|
+
float fX = X / 0.9505f; // white point D65
|
263
|
+
float fY = Y / 1.0f;
|
264
|
+
float fZ = Z / 1.0890f;
|
265
|
+
|
266
|
+
fX = IM_FWLAB(fX);
|
267
|
+
fY = IM_FWLAB(fY);
|
268
|
+
fZ = IM_FWLAB(fZ);
|
269
|
+
|
270
|
+
L = 1.16f * fY - 0.16f;
|
271
|
+
a = 2.5f * (fX - fY);
|
272
|
+
b = (fY - fZ);
|
273
|
+
}
|
274
|
+
|
275
|
+
#define IM_GWLAB(_w) (_w > 0.20689f? \
|
276
|
+
powf(_w, 3.0f): \
|
277
|
+
0.1284f * (_w - 0.16f/1.16f))
|
278
|
+
|
279
|
+
/** Converts CIE L*a*b* (nonlinear) to CIE XYZ (linear). \n
|
280
|
+
* The white point is D65. \n
|
281
|
+
* 0 <= L <= 1 ; -0.5 <= ab <= +0.5 ; 0 <= XYZ <= 1
|
282
|
+
* \ingroup color */
|
283
|
+
inline void imColorLab2XYZ(const float L, const float a, const float b,
|
284
|
+
float& X, float& Y, float& Z)
|
285
|
+
|
286
|
+
{
|
287
|
+
float fY = (L + 0.16f) / 1.16f;
|
288
|
+
float gY = IM_GWLAB(fY);
|
289
|
+
|
290
|
+
float fgY = IM_FWLAB(gY);
|
291
|
+
float gX = fgY + a / 2.5f;
|
292
|
+
float gZ = fgY - b;
|
293
|
+
gX = IM_GWLAB(gX);
|
294
|
+
gZ = IM_GWLAB(gZ);
|
295
|
+
|
296
|
+
X = gX * 0.9505f; // white point D65
|
297
|
+
Y = gY * 1.0f;
|
298
|
+
Z = gZ * 1.0890f;
|
299
|
+
}
|
300
|
+
|
301
|
+
/** Converts CIE XYZ (linear) to CIE L*u*v* (nonlinear). \n
|
302
|
+
* The white point is D65. \n
|
303
|
+
\verbatim
|
304
|
+
0 <= L <= 1 ; -1 <= uv <= +1 ; 0 <= XYZ <= 1
|
305
|
+
|
306
|
+
Y = Y / 1.0 (for D65)
|
307
|
+
if (Y > 0.008856)
|
308
|
+
fY = pow(Y, 1/3)
|
309
|
+
else
|
310
|
+
fY = 7.787 * Y + 0.16/1.16
|
311
|
+
L = 1.16 * fY - 0.16
|
312
|
+
|
313
|
+
U(x, y, z) = (4 * x)/(x + 15 * y + 3 * z)
|
314
|
+
V(x, y, z) = (9 * x)/(x + 15 * y + 3 * z)
|
315
|
+
un = U(Xn, Yn, Zn) = 0.1978 (for D65)
|
316
|
+
vn = V(Xn, Yn, Zn) = 0.4683 (for D65)
|
317
|
+
fu = U(X, Y, Z)
|
318
|
+
fv = V(X, Y, Z)
|
319
|
+
|
320
|
+
u = 13 * L * (fu - un)
|
321
|
+
v = 13 * L * (fv - vn)
|
322
|
+
\endverbatim
|
323
|
+
* \ingroup color */
|
324
|
+
inline void imColorXYZ2Luv(const float X, const float Y, const float Z,
|
325
|
+
float& L, float& u, float& v)
|
326
|
+
{
|
327
|
+
float XYZ = (float)(X + 15 * Y + 3 * Z);
|
328
|
+
float fY = Y / 1.0f;
|
329
|
+
|
330
|
+
if (XYZ != 0)
|
331
|
+
{
|
332
|
+
L = 1.16f * IM_FWLAB(fY) - 0.16f;
|
333
|
+
u = 6.5f * L * ((4 * X)/XYZ - 0.1978f);
|
334
|
+
v = 6.5f * L * ((9 * Y)/XYZ - 0.4683f);
|
335
|
+
}
|
336
|
+
else
|
337
|
+
{
|
338
|
+
L = u = v = 0;
|
339
|
+
}
|
340
|
+
}
|
341
|
+
|
342
|
+
/** Converts CIE L*u*v* (nonlinear) to CIE XYZ (linear). \n
|
343
|
+
* The white point is D65.
|
344
|
+
* 0 <= L <= 1 ; -0.5 <= uv <= +0.5 ; 0 <= XYZ <= 1 \n
|
345
|
+
* \ingroup color */
|
346
|
+
inline void imColorLuv2XYZ(const float L, const float u, const float v,
|
347
|
+
float& X, float& Y, float& Z)
|
348
|
+
|
349
|
+
{
|
350
|
+
float fY = (L + 0.16f) / 1.16f;
|
351
|
+
Y = IM_GWLAB(fY) * 1.0f;
|
352
|
+
|
353
|
+
float ul = 0.1978f, vl = 0.4683f;
|
354
|
+
if (L != 0)
|
355
|
+
{
|
356
|
+
ul = u / (6.5f * L) + 0.1978f;
|
357
|
+
vl = v / (6.5f * L) + 0.4683f;
|
358
|
+
}
|
359
|
+
|
360
|
+
X = ((9 * ul) / (4 * vl)) * Y;
|
361
|
+
Z = ((12 - 3 * ul - 20 * vl) / (4 * vl)) * Y;
|
362
|
+
}
|
363
|
+
|
364
|
+
/** Converts nonlinear values to linear values. \n
|
365
|
+
* We use the sRGB transfer function. sRGB uses ITU-R 709 primaries and D65 white point. \n
|
366
|
+
\verbatim
|
367
|
+
0 <= l <= 1 ; 0 <= v <= 1
|
368
|
+
|
369
|
+
if (v < 0.03928)
|
370
|
+
l = v / 12.92
|
371
|
+
else
|
372
|
+
l = pow((v + 0.055) / 1.055, 2.4)
|
373
|
+
\endverbatim
|
374
|
+
* \ingroup color */
|
375
|
+
inline float imColorTransfer2Linear(const float& nonlinear_value)
|
376
|
+
{
|
377
|
+
if (nonlinear_value < 0.03928f)
|
378
|
+
return nonlinear_value / 12.92f;
|
379
|
+
else
|
380
|
+
return powf((nonlinear_value + 0.055f) / 1.055f, 2.4f);
|
381
|
+
}
|
382
|
+
|
383
|
+
/** Converts linear values to nonlinear values. \n
|
384
|
+
* We use the sRGB transfer function. sRGB uses ITU-R 709 primaries and D65 white point. \n
|
385
|
+
\verbatim
|
386
|
+
0 <= l <= 1 ; 0 <= v <= 1
|
387
|
+
|
388
|
+
if (l < 0.0031308)
|
389
|
+
v = 12.92 * l
|
390
|
+
else
|
391
|
+
v = 1.055 * pow(l, 1/2.4) - 0.055
|
392
|
+
\endverbatim
|
393
|
+
* \ingroup color */
|
394
|
+
inline float imColorTransfer2Nonlinear(const float& value)
|
395
|
+
{
|
396
|
+
if (value < 0.0031308f)
|
397
|
+
return 12.92f * value;
|
398
|
+
else
|
399
|
+
return 1.055f * powf(value, 1.0f/2.4f) - 0.055f;
|
400
|
+
}
|
401
|
+
|
402
|
+
/** Converts RGB (linear) to R'G'B' (nonlinear).
|
403
|
+
* \ingroup color */
|
404
|
+
inline void imColorRGB2RGBNonlinear(const float RL, const float GL, const float BL,
|
405
|
+
float& R, float& G, float& B)
|
406
|
+
{
|
407
|
+
R = imColorTransfer2Nonlinear(RL);
|
408
|
+
G = imColorTransfer2Nonlinear(GL);
|
409
|
+
B = imColorTransfer2Nonlinear(BL);
|
410
|
+
}
|
411
|
+
|
412
|
+
/** Converts R'G'B' to Y' (all nonlinear). \n
|
413
|
+
\verbatim
|
414
|
+
Y' = 0.299 *R' + 0.587 *G' + 0.114 *B'
|
415
|
+
\endverbatim
|
416
|
+
* \ingroup color */
|
417
|
+
template <class T>
|
418
|
+
inline T imColorRGB2Luma(const T R, const T G, const T B)
|
419
|
+
{
|
420
|
+
return (T)((299 * R + 587 * G + 114 * B) / 1000);
|
421
|
+
}
|
422
|
+
|
423
|
+
/** Converts Luminance (CIE Y) to Lightness (CIE L*) (all linear). \n
|
424
|
+
* The white point is D65.
|
425
|
+
\verbatim
|
426
|
+
0 <= Y <= 1 ; 0 <= L* <= 1
|
427
|
+
|
428
|
+
Y = Y / 1.0 (for D65)
|
429
|
+
if (Y > 0.008856)
|
430
|
+
fY = pow(Y, 1/3)
|
431
|
+
else
|
432
|
+
fY = 7.787 * Y + 0.16/1.16
|
433
|
+
L = 1.16 * fY - 0.16
|
434
|
+
\endverbatim
|
435
|
+
* \ingroup color */
|
436
|
+
inline float imColorLuminance2Lightness(const float& Y)
|
437
|
+
{
|
438
|
+
return 1.16f * IM_FWLAB(Y) - 0.16f;
|
439
|
+
}
|
440
|
+
|
441
|
+
/** Converts Lightness (CIE L*) to Luminance (CIE Y) (all linear). \n
|
442
|
+
* The white point is D65.
|
443
|
+
\verbatim
|
444
|
+
0 <= Y <= 1 ; 0 <= L* <= 1
|
445
|
+
|
446
|
+
fY = (L + 0.16)/1.16
|
447
|
+
if (fY > 0.20689)
|
448
|
+
Y = pow(fY, 3)
|
449
|
+
else
|
450
|
+
Y = 0.1284 * (fY - 0.16/1.16)
|
451
|
+
Y = Y * 1.0 (for D65)
|
452
|
+
\endverbatim
|
453
|
+
* \ingroup color */
|
454
|
+
inline float imColorLightness2Luminance(const float& L)
|
455
|
+
{
|
456
|
+
float fY = (L + 0.16f) / 1.16f;
|
457
|
+
return IM_GWLAB(fY);
|
458
|
+
}
|
459
|
+
|
460
|
+
#undef IM_FWLAB
|
461
|
+
#undef IM_GWLAB
|
462
|
+
#undef IM_CROPL
|
463
|
+
#undef IM_CROPC
|
464
|
+
|
465
|
+
#endif
|