Pass along the image linesize to Image constructors so that Image knows about the requirement for it to be 32byte aligned.

pull/3001/head
Isaac Connor 2020-07-07 16:14:38 -04:00
parent fd9272241a
commit af74ecac4c
1 changed files with 3 additions and 2 deletions

View File

@ -531,6 +531,7 @@ Monitor::Monitor(
shared_data->last_write_index, shared_data->last_write_time );
sleep(1);
}
ref_image.Assign( width, height, camera->Colours(), camera->SubpixelOrder(),
image_buffer[shared_data->last_write_index].image->Buffer(), camera->ImageSize());
adaptive_skip = true;
@ -634,7 +635,7 @@ bool Monitor::connect() {
image_buffer = new Snapshot[image_buffer_count];
for ( int i = 0; i < image_buffer_count; i++ ) {
image_buffer[i].timestamp = &(shared_timestamps[i]);
image_buffer[i].image = new Image( width, height, camera->Colours(), camera->SubpixelOrder(), &(shared_images[i*camera->ImageSize()]) );
image_buffer[i].image = new Image( width, camera->LineSize(), height, camera->Colours(), camera->SubpixelOrder(), &(shared_images[i*camera->ImageSize()]) );
image_buffer[i].image->HoldBuffer(true); /* Don't release the internal buffer or replace it with another */
}
if ( (deinterlacing & 0xff) == 4) {
@ -2498,7 +2499,7 @@ int Monitor::Capture() {
if ( capture_image->Size() > camera->ImageSize() ) {
Error("Captured image %d does not match expected size %d check width, height and colour depth",
capture_image->Size(),camera->ImageSize() );
capture_image->Size(), camera->ImageSize() );
return -1;
}