00001 //============================================== 00002 // copyright : (C) 2003-2005 by Will Stokes 00003 //============================================== 00004 // This program is free software; you can redistribute it 00005 // and/or modify it under the terms of the GNU General 00006 // Public License as published by the Free Software 00007 // Foundation; either version 2 of the License, or 00008 // (at your option) any later version. 00009 //============================================== 00010 00011 //Systemwide includes 00012 #include <qimage.h> 00013 #include <qstring.h> 00014 #include <math.h> 00015 00016 //Projectwide includes 00017 #include "invert.h" 00018 #include "../../gui/statusWidget.h" 00019 00020 //---------------------------------------------- 00021 // Inputs: 00022 // ------- 00023 // QString filename - location of original image on disk 00024 // StatusWidget* status - widget for making progress visible to user 00025 // 00026 // Outputs: 00027 // -------- 00028 // QImage* returned - constructed image 00029 // 00030 // Description: 00031 // ------------ 00032 // This method constructs an inverted version of 00033 // the image using Qt's invertPixels method. If we were 00034 // to do this on our own special care to correctly handle the color 00035 // depth would be necessary. 00036 //---------------------------------------------- 00037 00038 //============================================== 00039 QImage* invertEffect( QString filename, StatusWidget* ) 00040 { 00041 //load image 00042 QImage* editedImage = new QImage( filename ); 00043 00044 //invert pixel colors, but not alpha components 00045 editedImage->invertPixels( false ); 00046 00047 //return pointer to edited image 00048 return editedImage; 00049 } 00050 //==============================================