User Tools

Site Tools


isp:hue_rotation

This is an old revision of the document!


Hue rotation

Really, no magic here, once you process the image in HSL color space. The operation is as trivial as adding or subtracting a specified value from the pixel's H component:

// pseudo-code
void hue_rotation(/*array of pixels*/image, double _hue){
  for(const & pixel: image){
    pixel.hue = std::clamp(pixel.hue + _hue, 0., 360.); // hue is in range [0..360]°
  }
}
/home/adminsub2r/public_html/dokuwiki/data/attic/isp/hue_rotation.1557334841.txt.gz · Last modified: 2019/05/08 17:00 by Igor Yefmov