Example a/image_formats: Image reading and writing example.

This example tests the reading and writing of many different image formats. image_formats" /> the tree is from the the Paria River Canyon in Arizona, USA. It makes me think of Jeremiah 17:8.

Screenshot of example a/image_formats


The comfile run by this example is as follows:

#image_formats.com

#For backwards compatibility we force .rgb to be read assuming SGI format.
gfx create texture tree image example tree.rgb linear clamp;
gfx create texture waterfall image example waterfall.tif linear clamp;
gfx create win 1;
gfx mod win 1 layout width 400 height 400;
gfx mod win 1 back texture tree tex_placement 10 -10 380 380;

#The file extension is used to determine the file format.  By
#prefixing a different extension you can override the format without
#changing the filename.
gfx print win 1 file sgi:image1.rgb;
gfx print win 1 file image2.tif;
#When converting to an indexed format, the alpha background gets lost,
#so use rgb to retrieve the image without alpha
gfx print win 1 file image3.gif format rgb;
#Postscript format renders the alpha as nothing
gfx print win 1 file image4.ps format rgb;
gfx print win 1 file image5.bmp format rgb;
gfx print win 1 file image6.jpg;

#Check that we can read these back in
gfx create texture image1 image image1.rgb;
gfx mod win 1 back texture image1;
gfx create texture image2 image image2.tif;
gfx mod win 1 back texture image2;
gfx create texture image3 image image3.gif;
gfx mod win 1 back texture image3;
gfx create texture image5 image image5.bmp;
gfx mod win 1 back texture image5;
gfx create texture image6 image image6.jpg;
gfx mod win 1 back texture image6;
gfx;

Files used by this example are:

Name               Modified     Size

image_formats.com 17-Mar-2014 1.3k COPYRIGHT 17-Mar-2014 504 tree.rgb 17-Mar-2014 555k waterfall.tif 17-Mar-2014 551k

Download the entire example:

Name                             Modified     Size

examples_a_image_formats.tar.gz 09-Mar-2016 4.9M

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmgui-wxFailureSun Mar 6 00:23:33 20167
last breakTue Feb 24 03:23:00 20157
cmgui-wx-debugFailureSun Mar 6 00:24:08 20167
last breakTue Feb 24 03:23:00 20156
cmgui-wx-debug-memorycheckFailureSun Mar 6 00:23:26 20169
last breakTue Feb 24 03:24:00 20157
cmgui-wx-debug-valgrindFailureSun Mar 6 01:45:56 2016187
last breakSun Mar 6 01:42:00 2016187
x86_64-linux
cmgui-wxFailureSun Mar 6 00:01:30 20160
last breakSun Mar 6 00:01:00 20160
cmgui-wx-debugFailureSun Mar 6 00:01:30 20160
last breakSun Mar 6 00:01:00 20160
cmgui-wx-debug-memorycheckFailureSun Mar 6 00:01:30 20160
last breakSun Mar 6 00:01:00 20160
cmgui-wx-debug-valgrindFailureSun Mar 6 00:03:28 20169
last breakSun Mar 6 00:03:00 20169
cmgui-wx-gcc-cad-debug-valgrindSuccessThu Jan 7 00:02:29 20167

Testing status by file:


Html last generated: Wed Mar 9 16:02:11 2016

Input last modified: Wed Mar 9 15:49:44 2016


CMISS Help / Examples / a / image_formats