comparison OrthancFramework/Sources/Images/ImageProcessing.h @ 4056:55727d85f419 framework

fix for msvc2008
author s.jodogne@gmail.com
date Thu, 11 Jun 2020 13:46:57 +0200
parents d25f4c0fa160
children d6362b2c4b61
comparison
equal deleted inserted replaced
4055:9214e3a7b0a2 4056:55727d85f419
34 #pragma once 34 #pragma once
35 35
36 #include "../OrthancFramework.h" 36 #include "../OrthancFramework.h"
37 37
38 #include "ImageAccessor.h" 38 #include "ImageAccessor.h"
39
39 #include <vector> 40 #include <vector>
40
41 #include <stdint.h> 41 #include <stdint.h>
42 #include <algorithm>
43 #include <boost/noncopyable.hpp> 42 #include <boost/noncopyable.hpp>
44 43
45 namespace Orthanc 44 namespace Orthanc
46 { 45 {
47 class ORTHANC_PUBLIC ImageProcessing : public boost::noncopyable 46 class ORTHANC_PUBLIC ImageProcessing : public boost::noncopyable
48 { 47 {
49 public: 48 public:
50 class ImagePoint 49 class ORTHANC_PUBLIC ImagePoint
51 { 50 {
52 int32_t x_; 51 int32_t x_;
53 int32_t y_; 52 int32_t y_;
54 53
55 public: 54 public:
56 ImagePoint(int32_t x, int32_t y) 55 ImagePoint(int32_t x,
57 : x_(x), 56 int32_t y) :
58 y_(y) 57 x_(x),
58 y_(y)
59 { 59 {
60 } 60 }
61 61
62 int32_t GetX() const {return x_;} 62 int32_t GetX() const
63 {
64 return x_;
65 }
63 66
64 int32_t GetY() const {return y_;} 67 int32_t GetY() const
68 {
69 return y_;
70 }
65 71
66 void Set(int32_t x, int32_t y) 72 void Set(int32_t x, int32_t y)
67 { 73 {
68 x_ = x; 74 x_ = x;
69 y_ = y; 75 y_ = y;
70 } 76 }
71 77
72 void ClipTo(int32_t minX, int32_t maxX, int32_t minY, int32_t maxY) 78 void ClipTo(int32_t minX, int32_t maxX, int32_t minY, int32_t maxY);
73 {
74 x_ = std::max(minX, std::min(maxX, x_));
75 y_ = std::max(minY, std::min(maxY, y_));
76 }
77 79
78 double GetDistanceTo(const ImagePoint& other) const; 80 double GetDistanceTo(const ImagePoint& other) const;
79 81
80 double GetDistanceToLine(double a, double b, double c) const; // where ax + by + c = 0 is the equation of the line 82 double GetDistanceToLine(double a, double b, double c) const; // where ax + by + c = 0 is the equation of the line
81 }; 83 };