Mercurial > hg > orthanc-stone
comparison Framework/Toolbox/ImageGeometry.cpp @ 507:ce49eae4c887 bgo-commands-codegen
Codegen + Warning fixes
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Fri, 01 Mar 2019 16:18:38 +0100 |
parents | b70e9be013e4 |
children | 2d8ab34c8c91 |
comparison
equal
deleted
inserted
replaced
506:801d2697a1b1 | 507:ce49eae4c887 |
---|---|
74 { | 74 { |
75 return false; | 75 return false; |
76 } | 76 } |
77 else | 77 else |
78 { | 78 { |
79 int tmp; | 79 int tmp = static_cast<int>(std::floor(extent.GetX1())); |
80 | |
81 tmp = std::floor(extent.GetX1()); | |
82 if (tmp < 0) | 80 if (tmp < 0) |
83 { | 81 { |
84 x1 = 0; | 82 x1 = 0; |
85 } | 83 } |
86 else | 84 else |
87 { | 85 { |
88 x1 = static_cast<unsigned int>(tmp); | 86 x1 = static_cast<unsigned int>(tmp); |
89 } | 87 } |
90 | 88 |
91 tmp = std::floor(extent.GetY1()); | 89 tmp = static_cast<int>(std::floor(extent.GetY1())); |
92 if (tmp < 0) | 90 if (tmp < 0) |
93 { | 91 { |
94 y1 = 0; | 92 y1 = 0; |
95 } | 93 } |
96 else | 94 else |
97 { | 95 { |
98 y1 = static_cast<unsigned int>(tmp); | 96 y1 = static_cast<unsigned int>(tmp); |
99 } | 97 } |
100 | 98 |
101 tmp = std::ceil(extent.GetX2()); | 99 tmp = static_cast<int>(std::ceil(extent.GetX2())); |
102 if (tmp < 0) | 100 if (tmp < 0) |
103 { | 101 { |
104 return false; | 102 return false; |
105 } | 103 } |
106 else if (static_cast<unsigned int>(tmp) >= targetWidth) | 104 else if (static_cast<unsigned int>(tmp) >= targetWidth) |
110 else | 108 else |
111 { | 109 { |
112 x2 = static_cast<unsigned int>(tmp); | 110 x2 = static_cast<unsigned int>(tmp); |
113 } | 111 } |
114 | 112 |
115 tmp = std::ceil(extent.GetY2()); | 113 tmp = static_cast<int>(std::ceil(extent.GetY2())); |
116 if (tmp < 0) | 114 if (tmp < 0) |
117 { | 115 { |
118 return false; | 116 return false; |
119 } | 117 } |
120 else if (static_cast<unsigned int>(tmp) >= targetHeight) | 118 else if (static_cast<unsigned int>(tmp) >= targetHeight) |
393 typedef typename Reader::PixelType PixelType; | 391 typedef typename Reader::PixelType PixelType; |
394 | 392 |
395 Reader reader(source); | 393 Reader reader(source); |
396 unsigned int x1, y1, x2, y2; | 394 unsigned int x1, y1, x2, y2; |
397 | 395 |
398 const float floatWidth = source.GetWidth(); | 396 const float floatWidth = static_cast<float>(source.GetWidth()); |
399 const float floatHeight = source.GetHeight(); | 397 const float floatHeight = static_cast<float>(source.GetHeight()); |
400 | 398 |
401 if (GetProjectiveTransformExtent(x1, y1, x2, y2, a, | 399 if (GetProjectiveTransformExtent(x1, y1, x2, y2, a, |
402 source.GetWidth(), source.GetHeight(), | 400 source.GetWidth(), source.GetHeight(), |
403 target.GetWidth(), target.GetHeight())) | 401 target.GetWidth(), target.GetHeight())) |
404 { | 402 { |