comparison Core/Images/ImageProcessing.cpp @ 4079:73c22208272f

ImageProcessing::ShiftScale2()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 22 Jun 2020 18:59:45 +0200
parents 2a170a8f1faf
children f18eaade6153
comparison
equal deleted inserted replaced
4077:ae7ebd5b0443 4079:73c22208272f
1468 throw OrthancException(ErrorCode_NotImplemented); 1468 throw OrthancException(ErrorCode_NotImplemented);
1469 } 1469 }
1470 } 1470 }
1471 1471
1472 1472
1473 void ImageProcessing::ShiftScale2(ImageAccessor& image,
1474 float offset,
1475 float scaling,
1476 bool useRound)
1477 {
1478 if (std::abs(scaling) < 0.001f)
1479 {
1480 Set(image, offset);
1481 }
1482 else
1483 {
1484 ShiftScale(image, offset / scaling, scaling, useRound);
1485 }
1486 }
1487
1488
1489 void ImageProcessing::ShiftScale2(ImageAccessor& target,
1490 const ImageAccessor& source,
1491 float offset,
1492 float scaling,
1493 bool useRound)
1494 {
1495 if (std::abs(scaling) < 0.0001f)
1496 {
1497 Set(target, offset);
1498 }
1499 else
1500 {
1501 ShiftScale(target, source, offset / scaling, scaling, useRound);
1502 }
1503 }
1504
1505
1506
1473 void ImageProcessing::Invert(ImageAccessor& image, int64_t maxValue) 1507 void ImageProcessing::Invert(ImageAccessor& image, int64_t maxValue)
1474 { 1508 {
1475 const unsigned int width = image.GetWidth(); 1509 const unsigned int width = image.GetWidth();
1476 const unsigned int height = image.GetHeight(); 1510 const unsigned int height = image.GetHeight();
1477 1511