MCPcopy Create free account
hub / github.com/Kitware/VTK / EncodeAsBase64Png

Method EncodeAsBase64Png

Web/Core/vtkDataEncoder.cxx:290–301  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

288
289//------------------------------------------------------------------------------
290const char* vtkDataEncoder::EncodeAsBase64Png(vtkImageData* img, int compressionLevel)
291{
292 // Perform in-memory write of image as png
293 vtkNew<vtkPNGWriter> writer;
294 writer->WriteToMemoryOn();
295 writer->SetInputData(img);
296 writer->SetCompressionLevel(compressionLevel);
297 writer->Write();
298
299 // Return Base64-encoded string
300 return this->Internals->GetBase64EncodedImage(writer->GetResult());
301}
302
303//------------------------------------------------------------------------------
304const char* vtkDataEncoder::EncodeAsBase64Jpg(vtkImageData* img, int quality)

Callers 1

testEncodingsMethod · 0.80

Calls 4

SetInputDataMethod · 0.45
SetCompressionLevelMethod · 0.45
WriteMethod · 0.45
GetResultMethod · 0.45

Tested by 1

testEncodingsMethod · 0.64