X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvAnimatedGIFWriter.cxx;h=8ba0f69062a3b0b2591c79ce409e3ddbcd1bbcf8;hb=ce4f422636ff94e4462cbd0f13f3c5dac66ce545;hp=934d7dd24e80fa797755082ed0259e94903542b8;hpb=66d644a09be8cbd79cbda488e22337bf60d65303;p=clitk.git diff --git a/vv/vvAnimatedGIFWriter.cxx b/vv/vvAnimatedGIFWriter.cxx index 934d7dd..8ba0f69 100644 --- a/vv/vvAnimatedGIFWriter.cxx +++ b/vv/vvAnimatedGIFWriter.cxx @@ -18,6 +18,7 @@ vvAnimatedGIFWriter::vvAnimatedGIFWriter() { Rate = 5; Loops = 0; + Dither = false; } //--------------------------------------------------------------------------- @@ -77,10 +78,18 @@ void vvAnimatedGIFWriter::End() std::vector cximages( RGBslices.size() ); for(unsigned int i=0; iCreateFromArray((BYTE *)cast->GetOutput()->GetScalarPointer(0,0,i), - width, height, 8, width, false); cximages[i]->SetFrameDelay(100/Rate); - cximages[i]->SetPalette(pal); + if(Dither) { + cximages[i]->CreateFromArray((BYTE *)RGBvolume->GetOutput()->GetScalarPointer(0,0,i), + width, height, 24, width*3, false); + cximages[i]->SwapRGB2BGR(); + cximages[i]->DecreaseBpp(8, true, pal); + } + else { + cximages[i]->CreateFromArray((BYTE *)cast->GetOutput()->GetScalarPointer(0,0,i), + width, height, 8, width, false); + cximages[i]->SetPalette(pal); + } } // Create gif