[API]3D Interlace library v4

Search This thread

HJ200

Inactive Recognized Developer
Dec 28, 2008
393
464
Hi folks,

A lot of people asked for the code to interlace images (used for the 3D Wallpaper Picker).

So here's a library to use in your own code projects.

License:
Free, as long as you mention my username in the credits. I also would like to know via PM if you published any app using it :)

Projects currently using this lib
[APP]AOSP 4.3 Gallery with 3D - View jps and mpo in 3D
[APP] ImageView 3D
[APP][v2.5] 3D Wallpapers picker
[liveWallpaper][evoStereo3D] JellyBeansGLES2 3D customizable interactive
[APP] [SENSE 4.0/4.1] Gallery 3D PlugIn [11 Oct 12]

Changelog
v4: Huge rewrite to improve speed and reduce OutOfMemory exceptions. Also added fillmode, to resize image inside or outside given bounds. Improved 2D loading speed
v3: Added HTC 3D switching (no-su), improved 3D loading, added new Activity3D, added load2D (left eye)
v2: Improved mpo decoding
v1: Initial version

Thanks
jmztaylor, who created the first app to enable the 3D display, which can be found in the Play Store.
Chillisaus for the help on the mpo decoding.
 

Attachments

  • Tools3D_v2.jar
    7.8 KB · Views: 324
  • Tools3D_v3.jar
    9.2 KB · Views: 64
  • Tools3D_v4.jar
    14.3 KB · Views: 253
Last edited:

HJ200

Inactive Recognized Developer
Dec 28, 2008
393
464
API: Scale, crop and interlace bitmap

Code:
/**
 * Create a Tools3D object with default dimension
 *  [user=955119]@param[/user] orientation Bitmap output in either LANDSCAPE or PORTRAIT
 */
public Tools3D(Orientation orientation);

Code:
/**
 * Create a Tools3D object with a given output dimension
 *  [user=955119]@param[/user] outputDimension Bitmap output width x height
 */
 public Tools3D(Dimension outputDimension);

Code:
/**
 * Interlace a bitmap
 *  [user=955119]@param[/user] pathName Location of the image to interlace (.mpo, .jps and side-by-side images supported)
 *  [user=2056652]@return[/user] Interlaced bitmap for the given screen dimension or default HTC EVO 3D screen size
 *  [user=948141]@Throw[/user]s ParserException
 */
public Bitmap interlace(String pathName) throws ParserException, OutOfMemoryError;
 
Last edited:

HJ200

Inactive Recognized Developer
Dec 28, 2008
393
464
API: Force 3D mode

Code:
/**
 * Force 3D mode <b>WARNING! USER NEEDS TO HAVE SU INSTALLED</b>
 * [user=955119]@param[/user] mode3D OFF, LANDSCAPE or PORTRAIT
 */
public static void set3DMode(Mode3D mode3D) throws IOException;

Code:
/**
 * Make a Activity view 3D by default
 */
public MyActivity extends Activity3D{

   public void onCreate(Bundle savedInstance) {
      set3D(true); // Orientation will find out Landscape or Portrait
   }
}
 
Last edited:

bihariel

Senior Member
Apr 9, 2010
962
990
If any Android apps developer could create/modify a gallery app ( for example modifying an open source app) to use this tool to view 3D images, it would be awesome. I hope some one could do it.
 

HJ200

Inactive Recognized Developer
Dec 28, 2008
393
464
If any Android apps developer could create/modify a gallery app ( for example modifying an open source app) to use this tool to view 3D images, it would be awesome. I hope some one could do it.

Did you see the 3rd url in the fipo?

Sent from my HTC EVO 3D X515m using xda premium
 
  • Like
Reactions: TheDrake

HJ200

Inactive Recognized Developer
Dec 28, 2008
393
464
Hi folks,

As some of you might have read, I've found out how to enable the 3D screen without the need of root permissions. Here's a small library I made (it's not updated in the interlace library)

Note: this code only works on Sense 3.6 and Sense 4.0 roms, so you might want to implement the old method as a fallback (catch all Exceptions)

Code:
int LANDSCAPE = 0;
int PORTRAIT = 1;
int NORMAL = 2;

IDisplayService display = IDisplayService.Stub.asInterface(ServiceManager.getService("display"));
display.set3DMode(LANDSCAPE, "3dToggleTag");

Update: A fail-safe way to enable 3D is implemented in Tools3D_v3
 

Attachments

  • framework-3d.jar
    6 KB · Views: 103
Last edited:

mynote

Senior Member
Sep 15, 2009
51
12
Hi folks,

As some of you might have read, I've found out how to enable the 3D screen without the need of root permissions. Here's a small library I made (it's not updated in the interlace library)

Note: this code only works on Sense 3.6 and Sense 4.0 roms, so you might want to implement the old method as a fallback (catch all Exceptions)

Code:
int LANDSCAPE = 0;
int PORTRAIT = 1;
int NORMAL = 2;

IDisplayService display = IDisplayService.Stub.asInterface(ServiceManager.getService("display"));
display.set3DMode(LANDSCAPE, "3dToggleTag");

Ist that easy? Thank you!! ill try this out later
 
It's funny but on the LG Optimus 3D forum, developer @defcomg managed to port the stock ICS camera app to CM10. This way users can enjoy shooting 3D photos and videos after upgrading to Jellybean. The problem is that nobody has managed to turn on the parallax barrier, so photos and live preview are displayed side-by-side. On the Evo 3D, it's the exact opposite! The 3D display can be used thanks to you but the 3D camera can't. So I can't help but wonder if you devs could benefit from each other and bring the full 3D experience to CyanogenMod for both devices!

Sent from the 3rd dimension!
 
Last edited:

defcomg

Senior Member
Dec 10, 2006
3,854
3,302
33
It's funny but on the LG Optimus 3D forum, developer @defcomg managed to port the stock ICS camera app to CM10. This way users can enjoy shooting 3D photos and videos after upgrading to Jellybean. The problem is that nobody has managed to turn on the parallax barrier, so photos and live preview are displayed side-by-side. On the Evo 3D, it's the exact opposite! The 3D display can be used thanks to you but the 3D camera can't. So I can't help but wonder if you devs could benefit from each other and bring the full 3D experience to CyanogenMod for both devices!

Sent from the 3rd dimension!

hmm ?
 

HJ200

Inactive Recognized Developer
Dec 28, 2008
393
464
{...}The problem is that nobody has managed to turn on the parallax barrier, so photos and live preview are displayed side-by-side. On the Evo 3D, it's the exact opposite! The 3D display can be used thanks to you but the 3D camera can't. So I can't help but wonder if you devs could benefit from each other and bring the full 3D experience to CyanogenMod for both devices!{...}

Hi,

Unfortunately our method doesn't work on the Optimus 3D. If you want to test and prove I'm wrong, install this app:
https://play.google.com/store/apps/details?id=com.jmz.evo3d :silly:
 

Top Liked Posts

  • There are no posts matching your filters.
  • 21
    Hi folks,

    A lot of people asked for the code to interlace images (used for the 3D Wallpaper Picker).

    So here's a library to use in your own code projects.

    License:
    Free, as long as you mention my username in the credits. I also would like to know via PM if you published any app using it :)

    Projects currently using this lib
    [APP]AOSP 4.3 Gallery with 3D - View jps and mpo in 3D
    [APP] ImageView 3D
    [APP][v2.5] 3D Wallpapers picker
    [liveWallpaper][evoStereo3D] JellyBeansGLES2 3D customizable interactive
    [APP] [SENSE 4.0/4.1] Gallery 3D PlugIn [11 Oct 12]

    Changelog
    v4: Huge rewrite to improve speed and reduce OutOfMemory exceptions. Also added fillmode, to resize image inside or outside given bounds. Improved 2D loading speed
    v3: Added HTC 3D switching (no-su), improved 3D loading, added new Activity3D, added load2D (left eye)
    v2: Improved mpo decoding
    v1: Initial version

    Thanks
    jmztaylor, who created the first app to enable the 3D display, which can be found in the Play Store.
    Chillisaus for the help on the mpo decoding.
    7
    API: Scale, crop and interlace bitmap

    Code:
    /**
     * Create a Tools3D object with default dimension
     *  [user=955119]@param[/user] orientation Bitmap output in either LANDSCAPE or PORTRAIT
     */
    public Tools3D(Orientation orientation);

    Code:
    /**
     * Create a Tools3D object with a given output dimension
     *  [user=955119]@param[/user] outputDimension Bitmap output width x height
     */
     public Tools3D(Dimension outputDimension);

    Code:
    /**
     * Interlace a bitmap
     *  [user=955119]@param[/user] pathName Location of the image to interlace (.mpo, .jps and side-by-side images supported)
     *  [user=2056652]@return[/user] Interlaced bitmap for the given screen dimension or default HTC EVO 3D screen size
     *  [user=948141]@Throw[/user]s ParserException
     */
    public Bitmap interlace(String pathName) throws ParserException, OutOfMemoryError;
    7
    API: Force 3D mode

    Code:
    /**
     * Force 3D mode <b>WARNING! USER NEEDS TO HAVE SU INSTALLED</b>
     * [user=955119]@param[/user] mode3D OFF, LANDSCAPE or PORTRAIT
     */
    public static void set3DMode(Mode3D mode3D) throws IOException;

    Code:
    /**
     * Make a Activity view 3D by default
     */
    public MyActivity extends Activity3D{
    
       public void onCreate(Bundle savedInstance) {
          set3D(true); // Orientation will find out Landscape or Portrait
       }
    }
    5
    Github

    For anyone interested in the code:
    github.com/mtoonen/mpo2jps
    You can fork us, and if you have improvements, make a pull request.
    3
    API: Load 2D bitmaps

    Code:
    // Load 2D left eye of a 3D file
    imageview.setImageBitmap(Tools3D.load2D(file));