Tutorials Multimedia in the Net

Winter Semester 2006/2007

Imlib2, Xlib, Bitwise Operators

Raphael Wimmer <raphael.wimmer@medien.ifi.lmu.de>


What we will cover today

ImLib2

How imlib2 works

Bitwise Operators


be aware of portability issues

Pixel manipulation

int rgba, ch;

/* retrieve & modify */
ch = (rgba & 0x00ff0000) >> 16; // get green channel
ch = (ch * 5) & 0xff; // modify channel;

/* put back */
rgba &= 0xff00ffff; // reset green channel
rgba |= (ch << 16); // set green channel;

Documentation

imlib2:

XLib: