API Addition Suggestion for Leia Android Media SDK

While analyzing an app I wrote to convert to use the Android Media SDK, I see a need for additional API signature methods.
Currently we set the quadview with a single bitmap (2x2 image) as in
quadView.setQuadBitmap(quadBitmap);
I would like to pass an array of Bitmap for each image (LL, LM, RM, RR)
This will allow me to generate or use multiple images from different camera views without having to merge into a single Bitmap (2x2). I do not want to be forced to “package” the images into 2x2. It will allow easier parallax changes to the 4V images.

The same applies to
Bitmap quadBitmap = synthesizer2.toQuadBitmap(multiviewImage);
Here there should be an API method option to return an array of Bitmap.

A use case example is a lenticular array of 32 photos for example,and I want to pick a sequence of 4 to display at one time without having to combine into one Bitmap.

The API additions could also help when SBS images come from different file packaging sources, like MPO, JPS, L/R pairs, video extracted stills, multiple cameras edited images, etc.

Thanks,
Andy

6 Likes

Thanks for the great feedback, Andy. We are constantly trying to improve our SDKs and will definitely add more flexibility to the APIs in future releases.

However, there are alternatives to unblock you in your project using the current release.

  1. For your first query,

Currently we set the quadview with a single bitmap (2x2 image) as in
quadView.setQuadBitmap(quadBitmap);
I would like to pass an array of Bitmap for each image (LL, LM, RM, RR)

You can use the different bitmaps representing camera views, by building the MultiviewImage instance yourself. The MultiviewImage object consists of a collection of ViewPoints where each ViewPoint represents the image and disparity map from a single camera view point. When working with 2x2 images, disparity maps are not needed.

You can simply construct the MultiviewImage as shown below.

MultiviewImage multiviewImage = new MultiviewImage();
multiviewImage.getViewPoints().add(new ViewPoint(bitmap00, null, 0.0f, 0f));
multiviewImage.getViewPoints().add(new ViewPoint(bitmap01, null, 1.0f, 0f));
multiviewImage.getViewPoints().add(new ViewPoint(bitmap10, null, 2.0f, 0f));
multiviewImage.getViewPoints().add(new ViewPoint(bitmap11, null, 3.0f, 0f));

Finally, you can use the MultiviewSynthesizer to generate a 2x2 for you, using the MultiviewImage instance created in the last step.

MultiviewSynthesizer2 synthesizer2 = MultiviewSynthesizer2.createMultiviewSynthesizer(this);
Bitmap quadBitmap = synthesizer2.toQuadBitmap(multiviewImage);
  1. For your second query,

The same applies to
Bitmap quadBitmap = synthesizer2.toQuadBitmap(multiviewImage);
Here there should be an API method option to return an array of Bitmap.

You can use the ViewPoints in the decoded MultiviewImage to obtain the bitmaps for the different camera views. Please note that only the MultiviewImage obtained from a 2x2 will have 4 viewpoints. You can get the bitmaps as shown below.

Bitmap bitmap00 = multiviewImage.getViewPoints().get(0).getAlbedo();
Bitmap bitmap01 = multiviewImage.getViewPoints().get(1).getAlbedo();
Bitmap bitmap10 = multiviewImage.getViewPoints().get(2).getAlbedo();
Bitmap bitmap11 = multiviewImage.getViewPoints().get(3).getAlbedo();

Hope this helps you in your app. Feel free to reach out if you have any questions.

2 Likes

I would see this more from a performance point of view, not just for convenience. I don’t know how much it would safe but I think that merging 4 pics into one in client app code, then splitting them up in device code for the display is an unnecessary overhead.

Definitely. Like I said, this is an alternative. We will be adding more flexibility, keeping performance in mind.

2 Likes

Thanks for the new information. I was unaware of the ViewPoint class and its use in this Media SDK design.

2 Likes