comparison Core/ImageFormats/ImageProcessing.cpp @ 854:ff530685e46a jpeg

fast version of image copy
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 06 Jun 2014 12:35:08 +0200
parents 839be3022203
children 610a9a1ed855
comparison
equal deleted inserted replaced
853:839be3022203 854:ff530685e46a
58 58
59 assert(source.GetPitch() >= lineSize && target.GetPitch() >= lineSize); 59 assert(source.GetPitch() >= lineSize && target.GetPitch() >= lineSize);
60 60
61 for (unsigned int y = 0; y < source.GetHeight(); y++) 61 for (unsigned int y = 0; y < source.GetHeight(); y++)
62 { 62 {
63 memcpy(target.GetRow(y), source.GetRow(y), lineSize); 63 memcpy(target.GetRow(y), source.GetConstRow(y), lineSize);
64 } 64 }
65 } 65 }
66
66 67
67 void ImageProcessing::Convert(ImageAccessor& target, 68 void ImageProcessing::Convert(ImageAccessor& target,
68 const ImageAccessor& source) 69 const ImageAccessor& source)
69 { 70 {
70 if (target.GetWidth() != source.GetWidth() || 71 if (target.GetWidth() != source.GetWidth() ||
76 if (source.GetFormat() == target.GetFormat()) 77 if (source.GetFormat() == target.GetFormat())
77 { 78 {
78 Copy(target, source); 79 Copy(target, source);
79 return; 80 return;
80 } 81 }
82
83 throw OrthancException(ErrorCode_NotImplemented);
81 } 84 }
85
86
87 void ImageProcessing::ShiftRight(ImageAccessor& image,
88 unsigned int shift)
89 {
90 if (image.GetWidth() == 0 ||
91 image.GetHeight() == 0 ||
92 shift == 0)
93 {
94 // Nothing to do
95 return;
96 }
97
98 throw OrthancException(ErrorCode_NotImplemented);
99 }
100
82 } 101 }