public class GLModelCaptureRequest extends java.lang.Object implements GLOffscreenCaptureRequest
Modifier and Type | Class and Description |
---|---|
static interface |
GLModelCaptureRequest.Callback |
Modifier and Type | Field and Description |
---|---|
protected Envelope |
_aabb |
protected GLModelCaptureRequest.Callback |
_callback |
protected boolean |
_crop |
protected int |
_height |
protected Model |
_model |
protected ModelInfo |
_modelInfo |
protected java.lang.String |
_name |
protected java.io.File |
_outFile |
protected java.lang.String |
_uid |
protected int |
_width |
protected static java.util.Comparator<Mesh> |
COMP_Z |
protected float[] |
modelMatrix
Store model matrix.
|
protected float[] |
projectionMatrix
Ussed to project the scene onto a 2D viewport
|
Constructor and Description |
---|
GLModelCaptureRequest(java.lang.String name) |
GLModelCaptureRequest(java.lang.String name,
Model model) |
GLModelCaptureRequest(java.lang.String name,
ModelInfo modelInfo) |
Modifier and Type | Method and Description |
---|---|
protected void |
drawMesh(Mesh mesh) |
protected void |
drawMeshes(java.util.List<Mesh> meshes) |
int |
getHeight()
Return's the height of this renderer's surface
|
int |
getWidth()
Return's the width of this renderer's surface
|
void |
onDraw(GLOffscreenCaptureParams params)
Draw content to the current canvas provided by the render service
|
void |
onFinished(android.graphics.Bitmap bmp)
The content is finished being drawn and converted to a bitmap
|
void |
onStart()
Called on the GL thread before any other calls are made
|
void |
setCallback(GLModelCaptureRequest.Callback cb)
Set the callback to be run when this icon is finished being generated
|
void |
setLightingEnabled(boolean lighting)
Set whether model lighting is enabled
|
void |
setOutputFile(java.io.File file)
Set the file to save the finished icon to
|
void |
setOutputSize(int size,
boolean crop)
Set the desired output size of the capture
|
void |
setOutputSize(int width,
int height)
Set the desired output size of the capture
Note: This method will automatically disable cropping
|
void |
setStrokeColor(int color)
Set the color of the underlying stroke
|
void |
setStrokeColorContrast(boolean contrastColor)
Set whether the stroke color is automatically calculated based on the
overall color of the model, where a darker model will produce a white
stroke, and a lighter model will produce a black stroke
|
void |
setStrokeEnabled(boolean stroke)
Set whether the model should have a stroke behind it
|
void |
setStrokeOnly(boolean strokeOnly)
Set whether to only draw the outer stroke of the model
|
void |
setStrokeWidth(int width)
Set the width of the stroke
|
protected void |
setupCamera() |
protected static final java.util.Comparator<Mesh> COMP_Z
protected float[] modelMatrix
protected float[] projectionMatrix
protected final java.lang.String _uid
protected int _width
protected int _height
protected boolean _crop
protected java.lang.String _name
protected Model _model
protected ModelInfo _modelInfo
protected Envelope _aabb
protected java.io.File _outFile
protected GLModelCaptureRequest.Callback _callback
public GLModelCaptureRequest(java.lang.String name)
public GLModelCaptureRequest(java.lang.String name, ModelInfo modelInfo)
public GLModelCaptureRequest(java.lang.String name, Model model)
public void setOutputFile(java.io.File file)
file
- Output filepublic void setOutputSize(int width, int height)
width
- Width in pixelsheight
- Height in pixelspublic void setOutputSize(int size, boolean crop)
size
- The max width and height in pixelscrop
- True to automatically crop the image to the model boundspublic void setCallback(GLModelCaptureRequest.Callback cb)
cb
- Callbackpublic void setLightingEnabled(boolean lighting)
lighting
- True if enabledpublic void setStrokeEnabled(boolean stroke)
stroke
- True to enable strokepublic void setStrokeColor(int color)
color
- Stroke colorpublic void setStrokeWidth(int width)
width
- Width in pixelspublic void setStrokeOnly(boolean strokeOnly)
strokeOnly
- True for stroke onlypublic void setStrokeColorContrast(boolean contrastColor)
contrastColor
- True to use contrast color for the strokepublic void onStart()
GLOffscreenCaptureRequest
onStart
in interface GLOffscreenCaptureRequest
public int getWidth()
getWidth
in interface GLOffscreenCaptureRequest
public int getHeight()
getHeight
in interface GLOffscreenCaptureRequest
public void onFinished(android.graphics.Bitmap bmp)
GLOffscreenCaptureRequest
onFinished
in interface GLOffscreenCaptureRequest
bmp
- Bitmap outputpublic void onDraw(GLOffscreenCaptureParams params)
GLOffscreenCaptureRequest
onDraw
in interface GLOffscreenCaptureRequest
params
- Parameters used by capture serviceprotected void drawMeshes(java.util.List<Mesh> meshes)
protected void drawMesh(Mesh mesh)
protected void setupCamera()