• CImg的使用,入门


    CImg的使用:
    const char *imageIN="image.jpg"
    const char *imageOUT="imgeout.jpg"
    CImg<uchar> input_image(imageIN);
    
     size_t image_width = input_image.width();  
     size_t image_height = input_image.height();
     size_t channels = input_image.spectrum();  
     
      CImg<uchar> output_image(image_width, image_height, input_image.depth(), channels); //create
      
      //pout points to some data
      for(size_t h=0; h<image_height; ++h)         
        for (size_t w=0; w<image_width; ++w) {   
            output_image(w, h, 0, 2) = *pout;     //B
            output_image(w, h, 0, 1) = *(pout+1); //G
            output_image(w, h, 0, 0) = *(pout+2); //R
            pout +=3;                            
        }
        
    output_image.save(imageOUT);       //save  
  • 相关阅读:
    第十三周
    意见评论
    第十二周
    冲刺10
    冲刺9
    冲刺8
    团队冲刺第二十二天-KeepRunningAPP
    找水王
    第十四周总结
    搜狗输入法评价
  • 原文地址:https://www.cnblogs.com/hansjorn/p/4962472.html
Copyright © 2020-2023  润新知