egami
C++ Image Processing program
/homes/esi30/DCS339/coursework/src/Processes/utils.cpp
Go to the documentation of this file.
00001 #include "utils.hpp"
00002 #include "../display_unit.hpp"
00003 
00004 void add_max(Image_unit **lhs, const Image_unit *rhs){
00005     if(!*lhs){
00006         *lhs = new Image_unit(*rhs);
00007         return;
00008     }
00009     Image_unit *tlhs=*lhs;
00010     for(unsigned y=0; y<tlhs->height(); ++y)
00011         for(unsigned x=0; x<tlhs->width(); ++x){
00012             tlhs->red(y, x, std::max(tlhs->red(y, x), rhs->red(y, x)));
00013             tlhs->green(y, x, std::max(tlhs->green(y, x), rhs->green(y, x)));
00014             tlhs->blue(y, x, std::max(tlhs->blue(y, x), rhs->blue(y, x)));
00015         }
00016 }
00017 
00018 namespace Processes{
00019     void utils(){
00021     }
00022 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends