TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/plugin/ofxToGil/rect.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_OFXTOGIL_RECT_HPP_
00002 #define _TUTTLE_OFXTOGIL_RECT_HPP_
00003 
00004 #include <ofxCore.h>
00005 
00006 #include <tuttle/common/system/compatibility.hpp>
00007 #include <terry/math/Rect.hpp>
00008 
00009 namespace tuttle {
00010 namespace plugin {
00011 
00012 inline terry::Rect<double> ofxToGil( const OfxRectD& r )
00013 {
00014         return terry::Rect<double>( r.x1, r.y1, r.x2, r.y2 );
00015 }
00016 
00017 inline OfxRectD gilToOfx( const terry::Rect<double>& r )
00018 {
00019         const OfxRectD rect = { r.x1, r.y1, r.x2, r.y2 };
00020         return rect;
00021 }
00022 
00023 inline terry::Rect<std::ssize_t> ofxToGil( const OfxRectI& r )
00024 {
00025         return terry::Rect<std::ssize_t>( r.x1, r.y1, r.x2, r.y2 );
00026 }
00027 
00028 inline OfxRectI gilToOfx( const terry::Rect<std::ssize_t>& r )
00029 {
00030         const OfxRectI rect = { r.x1, r.y1, r.x2, r.y2 };
00031         return rect;
00032 }
00033 
00034 }
00035 }
00036 
00037 
00038 #endif
00039