Class ARReferenceImage
java.lang.Object
com.codename1.ar.ARReferenceImage
A 2D image the AR session should recognize in the real world - a poster, a
game board, a product label. Register reference images through
ARSessionOptions#referenceImages(ARReferenceImage[]); when the camera
sees one, the session delivers an ARImageAnchor carrying this image's
name.
The physical width tells the platform how large the printed image is in the real world, which it needs to estimate the image's distance and pose accurately.
-
Constructor Summary
ConstructorsConstructorDescriptionARReferenceImage(String name, byte[] encodedImage, float physicalWidthMeters) Creates a reference image from encoded (PNG or JPEG) bytes.ARReferenceImage(String name, Image image, float physicalWidthMeters) Creates a reference image from anImage, encoding it as PNG. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]The encoded (PNG or JPEG) bytes of the image as a newly allocated array.getName()The unique name identifying this image.floatThe width of the printed image in meters.
-
Constructor Details
-
ARReferenceImage
Creates a reference image from encoded (PNG or JPEG) bytes.
Parameters
-
name: a unique name identifying this image inARImageAnchors -
encodedImage: the PNG or JPEG bytes of the image to detect -
physicalWidthMeters: the width of the printed image in meters
-
-
ARReferenceImage
-
-
Method Details
-
getName
The unique name identifying this image. -
getEncodedImage
public byte[] getEncodedImage()The encoded (PNG or JPEG) bytes of the image as a newly allocated array. -
getPhysicalWidthMeters
public float getPhysicalWidthMeters()The width of the printed image in meters.
-