Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/auxiliary/darklibrary.cpp
Show First 20 Lines • Show All 276 Lines • ▼ Show 20 Line(s) | 276 | { | |||
---|---|---|---|---|---|
277 | subtract(darkData, lightImage, filter, offsetX, offsetY); | 277 | subtract(darkData, lightImage, filter, offsetX, offsetY); | ||
278 | }); | 278 | }); | ||
279 | 279 | | |||
280 | return; | 280 | return; | ||
281 | } | 281 | } | ||
282 | 282 | | |||
283 | FITSData *lightData = lightImage->getImageData(); | 283 | FITSData *lightData = lightImage->getImageData(); | ||
284 | 284 | | |||
285 | T *lightBuffer = reinterpret_cast<T *>(lightData->getImageBuffer()); | 285 | T *lightBuffer = reinterpret_cast<T *>(lightData->getWritableImageBuffer()); | ||
286 | int lightW = lightData->width(); | 286 | int lightW = lightData->width(); | ||
287 | int lightH = lightData->height(); | 287 | int lightH = lightData->height(); | ||
288 | 288 | | |||
289 | int darkW = darkData->width(); | 289 | int darkW = darkData->width(); | ||
290 | int darkoffset = offsetX + offsetY * darkW; | 290 | int darkoffset = offsetX + offsetY * darkW; | ||
291 | T *darkBuffer = reinterpret_cast<T *>(darkData->getImageBuffer()) + darkoffset; | 291 | T const *darkBuffer = reinterpret_cast<T const*>(darkData->getImageBuffer()) + darkoffset; | ||
292 | 292 | | |||
293 | for (int i = 0; i < lightH; i++) | 293 | for (int i = 0; i < lightH; i++) | ||
294 | { | 294 | { | ||
295 | for (int j = 0; j < lightW; j++) | 295 | for (int j = 0; j < lightW; j++) | ||
296 | lightBuffer[j] = (lightBuffer[j] > darkBuffer[j]) ? (lightBuffer[j] - darkBuffer[j]) : 0; | 296 | lightBuffer[j] = (lightBuffer[j] > darkBuffer[j]) ? (lightBuffer[j] - darkBuffer[j]) : 0; | ||
297 | 297 | | |||
298 | lightBuffer += lightW; | 298 | lightBuffer += lightW; | ||
299 | darkBuffer += darkW; | 299 | darkBuffer += darkW; | ||
▲ Show 20 Lines • Show All 250 Lines • Show Last 20 Lines |