comparison Framework/Viewport/CairoSurface.cpp @ 316:ce48c3b3b0e9

fix for new ImageAccessor API
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 08 Oct 2018 12:45:27 +0200
parents 5412adf19980
children 557c8ff1db5c
comparison
equal deleted inserted replaced
310:348e00b837b9 316:ce48c3b3b0e9
103 } 103 }
104 104
105 105
106 void CairoSurface::Copy(const CairoSurface& other) 106 void CairoSurface::Copy(const CairoSurface& other)
107 { 107 {
108 Orthanc::ImageAccessor source = other.GetConstAccessor(); 108 Orthanc::ImageAccessor source, target;
109 Orthanc::ImageAccessor target = GetAccessor(); 109 other.GetReadOnlyAccessor(source);
110 GetWriteableAccessor(target);
111
110 Orthanc::ImageProcessing::Copy(target, source); 112 Orthanc::ImageProcessing::Copy(target, source);
111 } 113 }
112 114
113 115
114 Orthanc::ImageAccessor CairoSurface::GetConstAccessor() const 116 void CairoSurface::GetReadOnlyAccessor(Orthanc::ImageAccessor& target) const
115 { 117 {
116 Orthanc::ImageAccessor accessor; 118 target.AssignReadOnly(Orthanc::PixelFormat_BGRA32, width_, height_, pitch_, buffer_);
117 accessor.AssignReadOnly(Orthanc::PixelFormat_BGRA32, width_, height_, pitch_, buffer_);
118 return accessor;
119 } 119 }
120
120 121
121 122 void CairoSurface::GetWriteableAccessor(Orthanc::ImageAccessor& target)
122 Orthanc::ImageAccessor CairoSurface::GetAccessor()
123 { 123 {
124 Orthanc::ImageAccessor accessor; 124 target.AssignWritable(Orthanc::PixelFormat_BGRA32, width_, height_, pitch_, buffer_);
125 accessor.AssignWritable(Orthanc::PixelFormat_BGRA32, width_, height_, pitch_, buffer_);
126 return accessor;
127 } 125 }
128 } 126 }