DocumentationOverviewBuilding ASL Documentation Library Wiki Docs Indices Browse Perforce More InfoRelease NotesWiki Site Search License Success Stories Contributors MediaDownloadPerforce Depots SupportASL SourceForge HomeMailing Lists Discussion Forums Report Bugs Suggest Features Contribute to ASL RSSShort-text newsFull-text news File releases Other Adobe ProjectsAdobe AirAdobe GIL Adobe Labs Adobe Media Gallery Adobe XMP Tamarin project (Mozilla Foundation) Other ResourcesBoostRIAForge SGI STL |
dng_spline.h00001 /*****************************************************************************/ 00002 // Copyright 2006-2007 Adobe Systems Incorporated 00003 // All Rights Reserved. 00004 // 00005 // NOTICE: Adobe permits you to use, modify, and distribute this file in 00006 // accordance with the terms of the Adobe license agreement accompanying it. 00007 /*****************************************************************************/ 00008 00009 /* $Id: //mondo/workarea/stern/camera_raw/dng_sdk/source/dng_spline.h#4 $ */ 00010 /* $DateTime: 2007/12/05 09:51:03 $ */ 00011 /* $Change: 403668 $ */ 00012 /* $Author: stern $ */ 00013 00014 /*****************************************************************************/ 00015 00016 #ifndef __dng_spline__ 00017 #define __dng_spline__ 00018 00019 /*****************************************************************************/ 00020 00021 #include "dng_1d_function.h" 00022 00023 #include <vector> 00024 00025 /*****************************************************************************/ 00026 00027 inline real64 EvaluateSplineSegment (real64 x, 00028 real64 x0, 00029 real64 y0, 00030 real64 s0, 00031 real64 x1, 00032 real64 y1, 00033 real64 s1) 00034 { 00035 00036 real64 A = x1 - x0; 00037 00038 real64 B = (x - x0) / A; 00039 00040 real64 C = (x1 - x) / A; 00041 00042 real64 D = ((y0 * (2.0 - C + B) + (s0 * A * B)) * (C * C)) + 00043 ((y1 * (2.0 - B + C) - (s1 * A * C)) * (B * B)); 00044 00045 return D; 00046 00047 } 00048 00049 /*****************************************************************************/ 00050 00051 class dng_spline_solver: public dng_1d_function 00052 { 00053 00054 protected: 00055 00056 std::vector<real64> X; 00057 std::vector<real64> Y; 00058 00059 std::vector<real64> S; 00060 00061 public: 00062 00063 dng_spline_solver (); 00064 00065 virtual ~dng_spline_solver (); 00066 00067 void Reset (); 00068 00069 void Add (real64 x, real64 y); 00070 00071 void Solve (); 00072 00073 virtual bool IsIdentity () const; 00074 00075 virtual real64 Evaluate (real64 x) const; 00076 00077 private: 00078 00079 // Hidden copy constructor and assignment operator. 00080 00081 dng_spline_solver (const dng_spline_solver &solver); 00082 00083 dng_spline_solver & operator= (const dng_spline_solver &solver); 00084 00085 }; 00086 00087 /*****************************************************************************/ 00088 00089 #endif 00090 00091 /*****************************************************************************/ |