AlbumShaper
1.0a3
|
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 #ifndef BACKEND_ENHANCEMENTS_TILT_INTERNAL_H 00012 #define BACKEND_ENHANCEMENTS_TILT_INTERNAL_H 00013 00014 //In orded to prevent roundoff error from propogating 00015 //across multiple pixel computations I've created 00016 //my own DPoint class that resembles a QPoint but uses doubles instead. 00017 class DPoint 00018 { 00019 public: 00020 DPoint(); 00021 DPoint( double x, double y ); 00022 double x() const; 00023 double y() const; 00024 private: 00025 double xpos, ypos; 00026 }; 00027 00028 //finds the 2-dimensionally interpolated pixel color 00029 //using the supplied double coordinates and image object 00030 QRgb interpolatedPixelValue( double xp, double yp, QImage* image ); 00031 00032 //blends two rgb colors using a weight between 0-1, used by interpolate function 00033 QRgb blendColors( QRgb color1, QRgb color2, double alpha ); 00034 00035 //finds the intersection between two lines described by p1-p2 and p3-p4 00036 DPoint findTwoLineIntersection(DPoint p1, DPoint p2, DPoint p3, DPoint p4); 00037 00038 #endif //BACKEND_ENHANCEMENTS_TILT_INTERNAL_H