Merge "Improve RS documentation." into jb-mr2-dev
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -22,6 +22,7 @@ import android.graphics.BitmapFactory;
|
||||
import android.util.TypedValue;
|
||||
|
||||
/**
|
||||
* Only intended for use by generated reflected code.
|
||||
*
|
||||
**/
|
||||
public class AllocationAdapter extends Allocation {
|
||||
|
||||
@@ -19,9 +19,9 @@ package android.renderscript;
|
||||
import android.util.Log;
|
||||
|
||||
/**
|
||||
* BaseObj is the base class for interfacing with native renderscript objects.
|
||||
* It primarly contains code for tracking the native object ID and forcably
|
||||
* disconecting the object from the native allocation for early cleanup.
|
||||
* BaseObj is the base class for all RenderScript objects owned by a RS context.
|
||||
* It is responsible for lifetime management and resource tracking. This class
|
||||
* should not be used by a user application.
|
||||
*
|
||||
**/
|
||||
public class BaseObj {
|
||||
@@ -75,8 +75,7 @@ public class BaseObj {
|
||||
|
||||
/**
|
||||
* setName assigns a name to an object. This object can later be looked up
|
||||
* by this name. This name will also be retained if the object is written
|
||||
* to an A3D file.
|
||||
* by this name.
|
||||
*
|
||||
* @param name The name to assign to the object.
|
||||
*/
|
||||
@@ -125,10 +124,9 @@ public class BaseObj {
|
||||
}
|
||||
|
||||
/**
|
||||
* destroy disconnects the object from the native object effectively
|
||||
* rendering this java object dead. The primary use is to force immediate
|
||||
* cleanup of resources when it is believed the GC will not respond quickly
|
||||
* enough.
|
||||
* Frees any native resources associated with this object. The
|
||||
* primary use is to force immediate cleanup of resources when it is
|
||||
* believed the GC will not respond quickly enough.
|
||||
*/
|
||||
synchronized public void destroy() {
|
||||
if(mDestroyed) {
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript byte2 type back to the Android system.
|
||||
* Class for exposing the native RenderScript byte2 type back to the Android system.
|
||||
*
|
||||
**/
|
||||
public class Byte2 {
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript byte3 type back to the Android system.
|
||||
* Class for exposing the native RenderScript byte3 type back to the Android system.
|
||||
*
|
||||
**/
|
||||
public class Byte3 {
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript byte4 type back to the Android system.
|
||||
* Class for exposing the native RenderScript byte4 type back to the Android system.
|
||||
*
|
||||
**/
|
||||
public class Byte4 {
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript double2 type back
|
||||
* Class for exposing the native RenderScript double2 type back
|
||||
* to the Android system.
|
||||
*
|
||||
**/
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript double3 type back
|
||||
* Class for exposing the native RenderScript double3 type back
|
||||
* to the Android system.
|
||||
*
|
||||
**/
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript double4 type back
|
||||
* Class for exposing the native RenderScript double4 type back
|
||||
* to the Android system.
|
||||
*
|
||||
**/
|
||||
|
||||
@@ -20,31 +20,37 @@ import java.lang.reflect.Field;
|
||||
import android.util.Log;
|
||||
|
||||
/**
|
||||
* <p>The most basic data type. An element represents one cell of a memory allocation.
|
||||
* Element is the basic data type of Renderscript. An element can be of two forms: Basic elements or Complex forms.
|
||||
* Examples of basic elements are:</p>
|
||||
* <ul>
|
||||
* <li>Single float value</li>
|
||||
* <li>4 element float vector</li>
|
||||
* <li>single RGB-565 color</li>
|
||||
* <li>single unsigned int 16</li>
|
||||
* </ul>
|
||||
* <p>Complex elements contain a list of sub-elements and names that
|
||||
* represents a structure of data. The fields can be accessed by name
|
||||
* from a script or shader. The memory layout is defined and ordered. Data
|
||||
* alignment is determined by the most basic primitive type. i.e. a float4
|
||||
* vector will be aligned to sizeof(float) and not sizeof(float4). The
|
||||
* ordering of elements in memory will be the order in which they were added
|
||||
* with each component aligned as necessary. No re-ordering will be done.</p>
|
||||
* <p>An Element represents one item within an {@link
|
||||
* android.renderscript.Allocation}. An Element is roughly equivalent to a C
|
||||
* type in a RenderScript kernel. Elements may be basic or complex. Some basic
|
||||
* elements are</p> <ul> <li>A single float value (equivalent to a float in a
|
||||
* kernel)</li> <li>A four-element float vector (equivalent to a float4 in a
|
||||
* kernel)</li> <li>An unsigned 32-bit integer (equivalent to an unsigned int in
|
||||
* a kernel)</li> <li>A single signed 8-bit integer (equivalent to a char in a
|
||||
* kernel)</li> </ul> <p>A complex element is roughly equivalent to a C struct
|
||||
* and contains a number of basic or complex Elements. From Java code, a complex
|
||||
* element contains a list of sub-elements and names that represents a
|
||||
* particular data structure. Structs used in RS scripts are available to Java
|
||||
* code by using the {@code ScriptField_structname} class that is reflected from
|
||||
* a particular script.</p>
|
||||
*
|
||||
* <p>The primary source of elements are from scripts. A script that exports a
|
||||
* bind point for a data structure generates a Renderscript element to represent the
|
||||
* data exported by the script. The other common source of elements is from bitmap formats.</p>
|
||||
* <p>Basic Elements are comprised of a {@link
|
||||
* android.renderscript.Element.DataType} and a {@link
|
||||
* android.renderscript.Element.DataKind}. The DataType encodes C type
|
||||
* information of an Element, while the DataKind encodes how that Element should
|
||||
* be interpreted by a {@link android.renderscript.Sampler}. Note that {@link
|
||||
* android.renderscript.Allocation} objects with DataKind {@link
|
||||
* android.renderscript.Element.DataKind#USER} cannot be used as input for a
|
||||
* {@link android.renderscript.Sampler}. In general, {@link
|
||||
* android.renderscript.Allocation} objects that are intended for use with a
|
||||
* {@link android.renderscript.Sampler} should use bitmap-derived Elements such
|
||||
* as {@link android.renderscript.Element#RGBA_8888} or {@link
|
||||
* android.renderscript#Element.A_8}.</p>
|
||||
*
|
||||
* <div class="special reference">
|
||||
* <h3>Developer Guides</h3>
|
||||
* <p>For more information about creating an application that uses Renderscript, read the
|
||||
* <a href="{@docRoot}guide/topics/renderscript/index.html">Renderscript</a> developer guide.</p>
|
||||
* <p>For more information about creating an application that uses RenderScript, read the
|
||||
* <a href="{@docRoot}guide/topics/renderscript/index.html">RenderScript</a> developer guide.</p>
|
||||
* </div>
|
||||
**/
|
||||
public class Element extends BaseObj {
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.BitSet;
|
||||
|
||||
/**
|
||||
* Utility class for packing arguments and structures from Android system objects to
|
||||
* Renderscript objects.
|
||||
* RenderScript objects.
|
||||
*
|
||||
* This class is only intended to be used to support the
|
||||
* reflected code generated by the RS tool chain. It should not
|
||||
|
||||
@@ -30,9 +30,9 @@ import android.util.TypedValue;
|
||||
/**
|
||||
* @hide
|
||||
* @deprecated in API 16
|
||||
* FileA3D allows users to load Renderscript objects from files
|
||||
* FileA3D allows users to load RenderScript objects from files
|
||||
* or resources stored on disk. It could be used to load items
|
||||
* such as 3D geometry data converted to a Renderscript format from
|
||||
* such as 3D geometry data converted to a RenderScript format from
|
||||
* content creation tools. Currently only meshes are supported
|
||||
* in FileA3D.
|
||||
*
|
||||
@@ -56,7 +56,7 @@ public class FileA3D extends BaseObj {
|
||||
UNKNOWN (0),
|
||||
/**
|
||||
* @deprecated in API 16
|
||||
* Renderscript Mesh object
|
||||
* RenderScript Mesh object
|
||||
**/
|
||||
MESH (1);
|
||||
|
||||
@@ -72,7 +72,7 @@ public class FileA3D extends BaseObj {
|
||||
|
||||
/**
|
||||
* @deprecated in API 16
|
||||
* IndexEntry contains information about one of the Renderscript
|
||||
* IndexEntry contains information about one of the RenderScript
|
||||
* objects inside the file's index. It could be used to query the
|
||||
* object's type and also name and load the object itself if
|
||||
* necessary.
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript float2 type back to the Android system.
|
||||
* Class for exposing the native RenderScript float2 type back to the Android system.
|
||||
*
|
||||
**/
|
||||
public class Float2 {
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript float2 type back to the Android system.
|
||||
* Class for exposing the native RenderScript float2 type back to the Android system.
|
||||
*
|
||||
**/
|
||||
public class Float3 {
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript float2 type back to the Android system.
|
||||
* Class for exposing the native RenderScript float2 type back to the Android system.
|
||||
*
|
||||
**/
|
||||
public class Float4 {
|
||||
|
||||
@@ -39,7 +39,7 @@ import android.util.TypedValue;
|
||||
* faces, and different font sizes. During creation, the Android system quieries device's screen DPI to
|
||||
* ensure proper sizing across multiple device configurations.</p>
|
||||
* <p>Fonts are rendered using screen-space positions and no state setup beyond binding a
|
||||
* font to the Renderscript is required. A note of caution on performance, though the state changes
|
||||
* font to the RenderScript is required. A note of caution on performance, though the state changes
|
||||
* are transparent to the user, they do happen internally, and it is more efficient to
|
||||
* render large batches of text in sequence. It is also more efficient to render multiple
|
||||
* characters at once instead of one by one to improve draw call batching.</p>
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript int2 type back to the Android system.
|
||||
* Class for exposing the native RenderScript int2 type back to the Android system.
|
||||
*
|
||||
**/
|
||||
public class Int2 {
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript int3 type back to the Android system.
|
||||
* Class for exposing the native RenderScript int3 type back to the Android system.
|
||||
*
|
||||
**/
|
||||
public class Int3 {
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript int4 type back to the Android system.
|
||||
* Class for exposing the native RenderScript int4 type back to the Android system.
|
||||
*
|
||||
**/
|
||||
public class Int4 {
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript long2 type back to the Android system.
|
||||
* Class for exposing the native RenderScript long2 type back to the Android system.
|
||||
**/
|
||||
public class Long2 {
|
||||
public Long2() {
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript long3 type back to the Android system.
|
||||
* Class for exposing the native RenderScript long3 type back to the Android system.
|
||||
**/
|
||||
public class Long3 {
|
||||
public Long3() {
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript long4 type back to the Android system.
|
||||
* Class for exposing the native RenderScript long4 type back to the Android system.
|
||||
**/
|
||||
public class Long4 {
|
||||
public Long4() {
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript rs_matrix2x2 type back to the Android system.
|
||||
* Class for exposing the native RenderScript rs_matrix2x2 type back to the Android system.
|
||||
*
|
||||
**/
|
||||
public class Matrix2f {
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript rs_matrix3x3 type back to the Android system.
|
||||
* Class for exposing the native RenderScript rs_matrix3x3 type back to the Android system.
|
||||
*
|
||||
**/
|
||||
public class Matrix3f {
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript rs_matrix4x4 type back to the Android system.
|
||||
* Class for exposing the native RenderScript rs_matrix4x4 type back to the Android system.
|
||||
*
|
||||
**/
|
||||
public class Matrix4f {
|
||||
|
||||
@@ -24,7 +24,7 @@ import android.util.Log;
|
||||
* @hide
|
||||
* @deprecated in API 16
|
||||
* <p>This class is a container for geometric data displayed with
|
||||
* Renderscript. Internally, a mesh is a collection of allocations that
|
||||
* RenderScript. Internally, a mesh is a collection of allocations that
|
||||
* represent vertex data (positions, normals, texture
|
||||
* coordinates) and index data such as triangles and lines. </p>
|
||||
* <p>
|
||||
@@ -32,7 +32,7 @@ import android.util.Log;
|
||||
* allocation that is provided separately, as multiple allocation
|
||||
* objects, or done as a combination of both. When a
|
||||
* vertex channel name matches an input in the vertex program,
|
||||
* Renderscript automatically connects the two together.
|
||||
* RenderScript automatically connects the two together.
|
||||
* </p>
|
||||
* <p>
|
||||
* Parts of the mesh can be rendered with either explicit
|
||||
|
||||
@@ -276,7 +276,7 @@ public class Program extends BaseObj {
|
||||
try {
|
||||
mShader = new String(str, 0, strLength, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
Log.e("Renderscript shader creation", "Could not decode shader string");
|
||||
Log.e("RenderScript shader creation", "Could not decode shader string");
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
@@ -23,7 +23,7 @@ import android.util.Log;
|
||||
/**
|
||||
* @hide
|
||||
* @deprecated in API 16
|
||||
* <p>The Renderscript fragment program, also known as fragment shader is responsible
|
||||
* <p>The RenderScript fragment program, also known as fragment shader is responsible
|
||||
* for manipulating pixel data in a user defined way. It's constructed from a GLSL
|
||||
* shader string containing the program body, textures inputs, and a Type object
|
||||
* that describes the constants used by the program. Similar to the vertex programs,
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
/**
|
||||
* @hide
|
||||
* <p>The Renderscript vertex program, also known as a vertex shader, describes a stage in
|
||||
* <p>The RenderScript vertex program, also known as a vertex shader, describes a stage in
|
||||
* the graphics pipeline responsible for manipulating geometric data in a user-defined way.
|
||||
* The object is constructed by providing the Renderscript system with the following data:</p>
|
||||
* The object is constructed by providing the RenderScript system with the following data:</p>
|
||||
* <ul>
|
||||
* <li>Element describing its varying inputs or attributes</li>
|
||||
* <li>GLSL shader string that defines the body of the program</li>
|
||||
@@ -28,7 +28,7 @@
|
||||
* <p>Once the program is created, you bind it to the graphics context, RenderScriptGL, and it will be used for
|
||||
* all subsequent draw calls until you bind a new program. If the program has constant inputs,
|
||||
* the user needs to bind an allocation containing those inputs. The allocation's type must match
|
||||
* the one provided during creation. The Renderscript library then does all the necessary plumbing
|
||||
* the one provided during creation. The RenderScript library then does all the necessary plumbing
|
||||
* to send those constants to the graphics hardware. Varying inputs to the shader, such as position, normal,
|
||||
* and texture coordinates are matched by name between the input Element and the Mesh object being drawn.
|
||||
* The signatures don't have to be exact or in any strict order. As long as the input name in the shader
|
||||
|
||||
@@ -19,7 +19,7 @@ package android.renderscript;
|
||||
|
||||
/**
|
||||
* Base class for all exceptions thrown by the Android
|
||||
* Renderscript
|
||||
* RenderScript
|
||||
*/
|
||||
public class RSDriverException extends RSRuntimeException {
|
||||
public RSDriverException(String string) {
|
||||
|
||||
@@ -19,7 +19,7 @@ package android.renderscript;
|
||||
|
||||
/**
|
||||
* Base class for all exceptions thrown by the Android
|
||||
* Renderscript
|
||||
* RenderScript
|
||||
*/
|
||||
public class RSIllegalArgumentException extends RSRuntimeException {
|
||||
public RSIllegalArgumentException(String string) {
|
||||
|
||||
@@ -19,7 +19,7 @@ package android.renderscript;
|
||||
|
||||
/**
|
||||
* Base class for all exceptions thrown by the Android
|
||||
* Renderscript
|
||||
* RenderScript
|
||||
*/
|
||||
public class RSInvalidStateException extends RSRuntimeException {
|
||||
public RSInvalidStateException(String string) {
|
||||
|
||||
@@ -19,7 +19,7 @@ package android.renderscript;
|
||||
|
||||
/**
|
||||
* Base class for all exceptions thrown by the Android
|
||||
* Renderscript
|
||||
* RenderScript
|
||||
*/
|
||||
public class RSRuntimeException
|
||||
extends java.lang.RuntimeException {
|
||||
|
||||
@@ -36,8 +36,8 @@ import android.view.SurfaceView;
|
||||
*
|
||||
* <div class="special reference">
|
||||
* <h3>Developer Guides</h3>
|
||||
* <p>For more information about creating an application that uses Renderscript, read the
|
||||
* <a href="{@docRoot}guide/topics/renderscript/index.html">Renderscript</a> developer guide.</p>
|
||||
* <p>For more information about creating an application that uses RenderScript, read the
|
||||
* <a href="{@docRoot}guide/topics/renderscript/index.html">RenderScript</a> developer guide.</p>
|
||||
* </div>
|
||||
*/
|
||||
public class RSSurfaceView extends SurfaceView implements SurfaceHolder.Callback {
|
||||
|
||||
@@ -33,15 +33,14 @@ import android.view.Surface;
|
||||
|
||||
|
||||
/**
|
||||
* Renderscript base master class. An instance of this class creates native
|
||||
* worker threads for processing commands from this object. This base class
|
||||
* does not provide any extended capabilities beyond simple data processing.
|
||||
* For extended capabilities use derived classes such as RenderScriptGL.
|
||||
* This class provides access to a RenderScript context, which controls RenderScript
|
||||
* initialization, resource management, and teardown. An instance of the RenderScript
|
||||
* class must be created before any other RS objects can be created.
|
||||
*
|
||||
* <div class="special reference">
|
||||
* <h3>Developer Guides</h3>
|
||||
* <p>For more information about creating an application that uses Renderscript, read the
|
||||
* <a href="{@docRoot}guide/topics/renderscript/index.html">Renderscript</a> developer guide.</p>
|
||||
* <p>For more information about creating an application that uses RenderScript, read the
|
||||
* <a href="{@docRoot}guide/topics/renderscript/index.html">RenderScript</a> developer guide.</p>
|
||||
* </div>
|
||||
**/
|
||||
public class RenderScript {
|
||||
@@ -903,11 +902,14 @@ public class RenderScript {
|
||||
//
|
||||
|
||||
/**
|
||||
* Base class application should derive from for handling RS messages
|
||||
* coming from their scripts. When a script calls sendToClient the data
|
||||
* fields will be filled in and then the run method called by a message
|
||||
* handling thread. This will occur some time after sendToClient completes
|
||||
* in the script.
|
||||
* The base class from which an application should derive in order
|
||||
* to receive RS messages from scripts. When a script calls {@code
|
||||
* rsSendToClient}, the data fields will be filled, and the run
|
||||
* method will be called on a separate thread. This will occur
|
||||
* some time after {@code rsSendToClient} completes in the script,
|
||||
* as {@code rsSendToClient} is asynchronous. Message handlers are
|
||||
* not guaranteed to have completed when {@link
|
||||
* android.renderscript.RenderScript#finish} returns.
|
||||
*
|
||||
*/
|
||||
public static class RSMessageHandler implements Runnable {
|
||||
@@ -918,9 +920,10 @@ public class RenderScript {
|
||||
}
|
||||
}
|
||||
/**
|
||||
* If an application is expecting messages it should set this field to an
|
||||
* instance of RSMessage. This instance will receive all the user messages
|
||||
* sent from sendToClient by scripts from this context.
|
||||
* If an application is expecting messages, it should set this
|
||||
* field to an instance of {@link RSMessageHandler}. This
|
||||
* instance will receive all the user messages sent from {@code
|
||||
* sendToClient} by scripts from this context.
|
||||
*
|
||||
*/
|
||||
RSMessageHandler mMessageCallback = null;
|
||||
@@ -944,9 +947,9 @@ public class RenderScript {
|
||||
}
|
||||
|
||||
/**
|
||||
* Runtime error base class. An application should derive from this class
|
||||
* if it wishes to install an error handler. When errors occur at runtime
|
||||
* the fields in this class will be filled and the run method called.
|
||||
* The runtime error handler base class. An application should derive from this class
|
||||
* if it wishes to install an error handler. When errors occur at runtime,
|
||||
* the fields in this class will be filled, and the run method will be called.
|
||||
*
|
||||
*/
|
||||
public static class RSErrorHandler implements Runnable {
|
||||
@@ -959,7 +962,7 @@ public class RenderScript {
|
||||
/**
|
||||
* Application Error handler. All runtime errors will be dispatched to the
|
||||
* instance of RSAsyncError set here. If this field is null a
|
||||
* RSRuntimeException will instead be thrown with details about the error.
|
||||
* {@link RSRuntimeException} will instead be thrown with details about the error.
|
||||
* This will cause program termaination.
|
||||
*
|
||||
*/
|
||||
@@ -973,10 +976,9 @@ public class RenderScript {
|
||||
}
|
||||
|
||||
/**
|
||||
* RenderScript worker threads priority enumeration. The default value is
|
||||
* NORMAL. Applications wishing to do background processing such as
|
||||
* wallpapers should set their priority to LOW to avoid starving forground
|
||||
* processes.
|
||||
* RenderScript worker thread priority enumeration. The default value is
|
||||
* NORMAL. Applications wishing to do background processing should set
|
||||
* their priority to LOW to avoid starving forground processes.
|
||||
*/
|
||||
public enum Priority {
|
||||
LOW (Process.THREAD_PRIORITY_BACKGROUND + (5 * Process.THREAD_PRIORITY_LESS_FAVORABLE)),
|
||||
@@ -1043,7 +1045,7 @@ public class RenderScript {
|
||||
}
|
||||
if (mRS.nContextGetUserMessage(mRS.mContext, rbuf) !=
|
||||
RS_MESSAGE_TO_CLIENT_USER) {
|
||||
throw new RSDriverException("Error processing message from Renderscript.");
|
||||
throw new RSDriverException("Error processing message from RenderScript.");
|
||||
}
|
||||
|
||||
if(mRS.mMessageCallback != null) {
|
||||
@@ -1128,7 +1130,7 @@ public class RenderScript {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a basic RenderScript context.
|
||||
* Create a RenderScript context.
|
||||
*
|
||||
* @hide
|
||||
* @param ctx The context.
|
||||
@@ -1149,7 +1151,7 @@ public class RenderScript {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a basic RenderScript context.
|
||||
* Create a RenderScript context.
|
||||
*
|
||||
* @param ctx The context.
|
||||
* @return RenderScript
|
||||
@@ -1159,7 +1161,7 @@ public class RenderScript {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a basic RenderScript context.
|
||||
* Create a RenderScript context.
|
||||
*
|
||||
*
|
||||
* @param ctx The context.
|
||||
@@ -1182,8 +1184,8 @@ public class RenderScript {
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait for any commands in the fifo between the java bindings and native to
|
||||
* be processed.
|
||||
* Wait for any pending asynchronous opeations (such as copies to a RS
|
||||
* allocation or RS script executions) to complete.
|
||||
*
|
||||
*/
|
||||
public void finish() {
|
||||
@@ -1191,8 +1193,9 @@ public class RenderScript {
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy this renderscript context. Once this function is called its no
|
||||
* longer legal to use this or any objects created by this context.
|
||||
* Destroys this RenderScript context. Once this function is called,
|
||||
* using this context or any objects belonging to this context is
|
||||
* illegal.
|
||||
*
|
||||
*/
|
||||
public void destroy() {
|
||||
|
||||
@@ -31,7 +31,7 @@ import android.view.SurfaceView;
|
||||
/**
|
||||
* @hide
|
||||
* @deprecated in API 16
|
||||
* The Graphics derivitive of Renderscript. Extends the basic context to add a
|
||||
* The Graphics derivitive of RenderScript. Extends the basic context to add a
|
||||
* root script which is the display window for graphical output. When the
|
||||
* system needs to update the display the currently bound root script will be
|
||||
* called. This script is expected to issue the rendering commands to repaint
|
||||
@@ -39,8 +39,8 @@ import android.view.SurfaceView;
|
||||
*
|
||||
* <div class="special reference">
|
||||
* <h3>Developer Guides</h3>
|
||||
* <p>For more information about creating an application that uses Renderscript, read the
|
||||
* <a href="{@docRoot}guide/topics/renderscript/index.html">Renderscript</a> developer guide.</p>
|
||||
* <p>For more information about creating an application that uses RenderScript, read the
|
||||
* <a href="{@docRoot}guide/topics/renderscript/index.html">RenderScript</a> developer guide.</p>
|
||||
* </div>
|
||||
**/
|
||||
public class RenderScriptGL extends RenderScript {
|
||||
|
||||
@@ -28,9 +28,14 @@ import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
|
||||
/**
|
||||
* Sampler object which defines how data is extracted from textures. Samplers
|
||||
* are attached to Program objects (currently only ProgramFragment) when those objects
|
||||
* need to access texture data.
|
||||
* Sampler object that defines how Allocations can be read as textures within a
|
||||
* kernel. Samplers are used in conjunction with the {@code rsSample} runtime
|
||||
* function to return values from normalized coordinates.
|
||||
*
|
||||
* Any Allocation used with a Sampler must have been created with {@link
|
||||
* android.renderscript.Allocation#USAGE_GRAPHICS_TEXTURE}; using a Sampler on
|
||||
* an {@link android.renderscript.Allocation} that was not created with {@link
|
||||
* android.renderscript.Allocation#USAGE_GRAPHICS_TEXTURE} is undefined.
|
||||
**/
|
||||
public class Sampler extends BaseObj {
|
||||
public enum Value {
|
||||
@@ -275,9 +280,8 @@ public class Sampler extends BaseObj {
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder for creating non-standard samplers. Usefull if mix and match of
|
||||
* wrap modes is necesary or if anisotropic filtering is desired.
|
||||
*
|
||||
* Builder for creating non-standard samplers. This is only necessary if
|
||||
* a Sampler with different min and mag modes is desired.
|
||||
*/
|
||||
public static class Builder {
|
||||
RenderScript mRS;
|
||||
|
||||
@@ -19,7 +19,8 @@ package android.renderscript;
|
||||
import android.util.SparseArray;
|
||||
|
||||
/**
|
||||
*
|
||||
* The parent class for all executable scripts. This should not be used by
|
||||
* applications.
|
||||
**/
|
||||
public class Script extends BaseObj {
|
||||
|
||||
@@ -46,14 +47,6 @@ public class Script extends BaseObj {
|
||||
private final SparseArray<KernelID> mKIDs = new SparseArray<KernelID>();
|
||||
/**
|
||||
* Only to be used by generated reflected classes.
|
||||
*
|
||||
*
|
||||
* @param slot
|
||||
* @param sig
|
||||
* @param ein
|
||||
* @param eout
|
||||
*
|
||||
* @return KernelID
|
||||
*/
|
||||
protected KernelID createKernelID(int slot, int sig, Element ein, Element eout) {
|
||||
KernelID k = mKIDs.get(slot);
|
||||
@@ -92,11 +85,6 @@ public class Script extends BaseObj {
|
||||
private final SparseArray<FieldID> mFIDs = new SparseArray();
|
||||
/**
|
||||
* Only to be used by generated reflected classes.
|
||||
*
|
||||
* @param slot
|
||||
* @param e
|
||||
*
|
||||
* @return FieldID
|
||||
*/
|
||||
protected FieldID createFieldID(int slot, Element e) {
|
||||
FieldID f = mFIDs.get(slot);
|
||||
@@ -118,7 +106,6 @@ public class Script extends BaseObj {
|
||||
/**
|
||||
* Only intended for use by generated reflected code.
|
||||
*
|
||||
* @param slot
|
||||
*/
|
||||
protected void invoke(int slot) {
|
||||
mRS.nScriptInvoke(getID(mRS), slot);
|
||||
@@ -127,8 +114,6 @@ public class Script extends BaseObj {
|
||||
/**
|
||||
* Only intended for use by generated reflected code.
|
||||
*
|
||||
* @param slot
|
||||
* @param v
|
||||
*/
|
||||
protected void invoke(int slot, FieldPacker v) {
|
||||
if (v != null) {
|
||||
@@ -141,10 +126,6 @@ public class Script extends BaseObj {
|
||||
/**
|
||||
* Only intended for use by generated reflected code.
|
||||
*
|
||||
* @param slot
|
||||
* @param ain
|
||||
* @param aout
|
||||
* @param v
|
||||
*/
|
||||
protected void forEach(int slot, Allocation ain, Allocation aout, FieldPacker v) {
|
||||
if (ain == null && aout == null) {
|
||||
@@ -169,11 +150,6 @@ public class Script extends BaseObj {
|
||||
/**
|
||||
* Only intended for use by generated reflected code.
|
||||
*
|
||||
* @param slot
|
||||
* @param ain
|
||||
* @param aout
|
||||
* @param v
|
||||
* @param sc
|
||||
*/
|
||||
protected void forEach(int slot, Allocation ain, Allocation aout, FieldPacker v, LaunchOptions sc) {
|
||||
if (ain == null && aout == null) {
|
||||
@@ -208,8 +184,6 @@ public class Script extends BaseObj {
|
||||
/**
|
||||
* Only intended for use by generated reflected code.
|
||||
*
|
||||
* @param va
|
||||
* @param slot
|
||||
*/
|
||||
public void bindAllocation(Allocation va, int slot) {
|
||||
mRS.validate();
|
||||
@@ -223,8 +197,6 @@ public class Script extends BaseObj {
|
||||
/**
|
||||
* Only intended for use by generated reflected code.
|
||||
*
|
||||
* @param index
|
||||
* @param v
|
||||
*/
|
||||
public void setVar(int index, float v) {
|
||||
mRS.nScriptSetVarF(getID(mRS), index, v);
|
||||
@@ -236,8 +208,6 @@ public class Script extends BaseObj {
|
||||
/**
|
||||
* Only intended for use by generated reflected code.
|
||||
*
|
||||
* @param index
|
||||
* @param v
|
||||
*/
|
||||
public void setVar(int index, double v) {
|
||||
mRS.nScriptSetVarD(getID(mRS), index, v);
|
||||
@@ -249,8 +219,6 @@ public class Script extends BaseObj {
|
||||
/**
|
||||
* Only intended for use by generated reflected code.
|
||||
*
|
||||
* @param index
|
||||
* @param v
|
||||
*/
|
||||
public void setVar(int index, int v) {
|
||||
mRS.nScriptSetVarI(getID(mRS), index, v);
|
||||
@@ -263,8 +231,6 @@ public class Script extends BaseObj {
|
||||
/**
|
||||
* Only intended for use by generated reflected code.
|
||||
*
|
||||
* @param index
|
||||
* @param v
|
||||
*/
|
||||
public void setVar(int index, long v) {
|
||||
mRS.nScriptSetVarJ(getID(mRS), index, v);
|
||||
@@ -277,8 +243,6 @@ public class Script extends BaseObj {
|
||||
/**
|
||||
* Only intended for use by generated reflected code.
|
||||
*
|
||||
* @param index
|
||||
* @param v
|
||||
*/
|
||||
public void setVar(int index, boolean v) {
|
||||
mRS.nScriptSetVarI(getID(mRS), index, v ? 1 : 0);
|
||||
@@ -290,8 +254,6 @@ public class Script extends BaseObj {
|
||||
/**
|
||||
* Only intended for use by generated reflected code.
|
||||
*
|
||||
* @param index
|
||||
* @param o
|
||||
*/
|
||||
public void setVar(int index, BaseObj o) {
|
||||
mRS.nScriptSetVarObj(getID(mRS), index, (o == null) ? 0 : o.getID(mRS));
|
||||
@@ -300,8 +262,6 @@ public class Script extends BaseObj {
|
||||
/**
|
||||
* Only intended for use by generated reflected code.
|
||||
*
|
||||
* @param index
|
||||
* @param v
|
||||
*/
|
||||
public void setVar(int index, FieldPacker v) {
|
||||
mRS.nScriptSetVarV(getID(mRS), index, v.getData());
|
||||
@@ -310,10 +270,6 @@ public class Script extends BaseObj {
|
||||
/**
|
||||
* Only intended for use by generated reflected code.
|
||||
*
|
||||
* @param index
|
||||
* @param v
|
||||
* @param e
|
||||
* @param dims
|
||||
*/
|
||||
public void setVar(int index, FieldPacker v, Element e, int[] dims) {
|
||||
mRS.nScriptSetVarVE(getID(mRS), index, v.getData(), e.getID(mRS), dims);
|
||||
@@ -322,8 +278,6 @@ public class Script extends BaseObj {
|
||||
/**
|
||||
* Only intended for use by generated reflected code.
|
||||
*
|
||||
* @param index
|
||||
* @param v
|
||||
*/
|
||||
public void getVarV(int index, FieldPacker v) {
|
||||
mRS.nScriptGetVarV(getID(mRS), index, v.getData());
|
||||
@@ -338,6 +292,10 @@ public class Script extends BaseObj {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Only intended for use by generated reflected code.
|
||||
*
|
||||
*/
|
||||
public static class Builder {
|
||||
RenderScript mRS;
|
||||
|
||||
|
||||
@@ -30,7 +30,8 @@ import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
|
||||
/**
|
||||
*
|
||||
* The superclass for all user-defined scripts. This is only
|
||||
* intended to be used by the generated derived classes.
|
||||
**/
|
||||
public class ScriptC extends Script {
|
||||
private static final String TAG = "ScriptC";
|
||||
|
||||
@@ -20,24 +20,26 @@ import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* ScriptGroup creates a groups of scripts which are executed
|
||||
* together based upon upon one execution call as if they were
|
||||
* all part of a single script. The scripts may be connected
|
||||
* internally or to an external allocation. For the internal
|
||||
* connections the intermediate results are not observable after
|
||||
* the execution of the script.
|
||||
* ScriptGroup creates a group of kernels that are executed
|
||||
* together with one execution call as if they were a single kernel.
|
||||
* The kernels may be connected internally or to an external allocation.
|
||||
* The intermediate results for internal connections are not observable
|
||||
* after the execution of the script.
|
||||
* <p>
|
||||
* The external connections are grouped into inputs and outputs.
|
||||
* External connections are grouped into inputs and outputs.
|
||||
* All outputs are produced by a script kernel and placed into a
|
||||
* user supplied allocation. Inputs are similar but supply the
|
||||
* input of a kernal. Inputs bounds to a script are set directly
|
||||
* upon the script.
|
||||
* user-supplied allocation. Inputs provide the input of a kernel.
|
||||
* Inputs bound to script globals are set directly upon the script.
|
||||
* <p>
|
||||
* A ScriptGroup must contain at least one kernel. A ScriptGroup
|
||||
* must contain only a single directed acyclic graph (DAG) of
|
||||
* script kernels and connections. Attempting to create a
|
||||
* ScriptGroup with multiple DAGs or attempting to create
|
||||
* a cycle within a ScriptGroup will throw an exception.
|
||||
* <p>
|
||||
* Currently, all kernels in a ScriptGroup must be from separate
|
||||
* Script objects. Attempting to use multiple kernels from the same
|
||||
* Script object will result in an {@link android.renderscript.RSInvalidStateException}.
|
||||
*
|
||||
**/
|
||||
public final class ScriptGroup extends BaseObj {
|
||||
@@ -93,8 +95,8 @@ public final class ScriptGroup extends BaseObj {
|
||||
|
||||
/**
|
||||
* Sets an input of the ScriptGroup. This specifies an
|
||||
* Allocation to be used for the kernels which require a kernel
|
||||
* input and that input is provided external to the group.
|
||||
* Allocation to be used for kernels that require an input
|
||||
* Allocation provided from outside of the ScriptGroup.
|
||||
*
|
||||
* @param s The ID of the kernel where the allocation should be
|
||||
* connected.
|
||||
@@ -113,8 +115,8 @@ public final class ScriptGroup extends BaseObj {
|
||||
|
||||
/**
|
||||
* Sets an output of the ScriptGroup. This specifies an
|
||||
* Allocation to be used for the kernels which require a kernel
|
||||
* output and that output is provided external to the group.
|
||||
* Allocation to be used for the kernels that require an output
|
||||
* Allocation visible after the ScriptGroup is executed.
|
||||
*
|
||||
* @param s The ID of the kernel where the allocation should be
|
||||
* connected.
|
||||
@@ -133,8 +135,8 @@ public final class ScriptGroup extends BaseObj {
|
||||
|
||||
/**
|
||||
* Execute the ScriptGroup. This will run all the kernels in
|
||||
* the script. The state of the connecting lines will not be
|
||||
* observable after this operation.
|
||||
* the ScriptGroup. No internal connection results will be visible
|
||||
* after execution of the ScriptGroup.
|
||||
*/
|
||||
public void execute() {
|
||||
mRS.nScriptGroupExecute(getID(mRS));
|
||||
@@ -142,20 +144,25 @@ public final class ScriptGroup extends BaseObj {
|
||||
|
||||
|
||||
/**
|
||||
* Create a ScriptGroup. There are two steps to creating a
|
||||
* ScriptGoup.
|
||||
* Helper class to build a ScriptGroup. A ScriptGroup is
|
||||
* created in two steps.
|
||||
* <p>
|
||||
* First all the Kernels to be used by the group should be
|
||||
* added. Once this is done the kernels should be connected.
|
||||
* Kernels cannot be added once a connection has been made.
|
||||
* First, all kernels to be used by the ScriptGroup should be added.
|
||||
* <p>
|
||||
* Second, add connections. There are two forms of connections.
|
||||
* Kernel to Kernel and Kernel to Field. Kernel to Kernel is
|
||||
* higher performance and should be used where possible. The
|
||||
* line of connections cannot form a loop. If a loop is detected
|
||||
* an exception is thrown.
|
||||
* Second, add connections between kernels. There are two types
|
||||
* of connections: kernel to kernel and kernel to field.
|
||||
* Kernel to kernel allows a kernel's output to be passed to
|
||||
* another kernel as input. Kernel to field allows the output of
|
||||
* one kernel to be bound as a script global. Kernel to kernel is
|
||||
* higher performance and should be used where possible.
|
||||
* <p>
|
||||
* Once all the connections are made a call to create will
|
||||
* A ScriptGroup must contain a single directed acyclic graph (DAG); it
|
||||
* cannot contain cycles. Currently, all kernels used in a ScriptGroup
|
||||
* must come from different Script objects. Additionally, all kernels
|
||||
* in a ScriptGroup must have at least one input, output, or internal
|
||||
* connection.
|
||||
* <p>
|
||||
* Once all connections are made, a call to {@link #create} will
|
||||
* return the ScriptGroup object.
|
||||
*
|
||||
*/
|
||||
@@ -166,10 +173,10 @@ public final class ScriptGroup extends BaseObj {
|
||||
private int mKernelCount;
|
||||
|
||||
/**
|
||||
* Create a builder for generating a ScriptGroup.
|
||||
* Create a Builder for generating a ScriptGroup.
|
||||
*
|
||||
*
|
||||
* @param rs The Renderscript context.
|
||||
* @param rs The RenderScript context.
|
||||
*/
|
||||
public Builder(RenderScript rs) {
|
||||
mRS = rs;
|
||||
|
||||
@@ -40,7 +40,7 @@ public final class ScriptIntrinsic3DLUT extends ScriptIntrinsic {
|
||||
*
|
||||
* The defaults tables are identity.
|
||||
*
|
||||
* @param rs The Renderscript context
|
||||
* @param rs The RenderScript context
|
||||
* @param e Element type for intputs and outputs
|
||||
*
|
||||
* @return ScriptIntrinsic3DLUT
|
||||
@@ -55,6 +55,13 @@ public final class ScriptIntrinsic3DLUT extends ScriptIntrinsic {
|
||||
return new ScriptIntrinsic3DLUT(id, rs, e);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@link android.renderscript.Allocation} to be used as the lookup table.
|
||||
*
|
||||
* The lookup table must use the same {@link android.renderscript.Element} as the intrinsic.
|
||||
*
|
||||
*/
|
||||
|
||||
public void setLUT(Allocation lut) {
|
||||
final Type t = lut.getType();
|
||||
|
||||
|
||||
@@ -18,8 +18,7 @@ package android.renderscript;
|
||||
|
||||
|
||||
/**
|
||||
* Intrinsic kernels for blending two buffers. Each blend function is a separate
|
||||
* kernel to make it easy to change between blend modes.
|
||||
* Intrinsic kernels for blending two {@link android.renderscript.Allocation} objects.
|
||||
**/
|
||||
public class ScriptIntrinsicBlend extends ScriptIntrinsic {
|
||||
ScriptIntrinsicBlend(int id, RenderScript rs) {
|
||||
@@ -27,11 +26,10 @@ public class ScriptIntrinsicBlend extends ScriptIntrinsic {
|
||||
}
|
||||
|
||||
/**
|
||||
* Supported elements types are uchar4
|
||||
* Supported elements types are {@link Element#U8_4}
|
||||
*
|
||||
*
|
||||
* @param rs
|
||||
* @param e
|
||||
* @param rs The RenderScript context
|
||||
* @param e Element type for inputs and outputs
|
||||
*
|
||||
* @return ScriptIntrinsicBlend
|
||||
*/
|
||||
@@ -53,7 +51,7 @@ public class ScriptIntrinsicBlend extends ScriptIntrinsic {
|
||||
}
|
||||
|
||||
/**
|
||||
* dst = {0, 0, 0, 0}
|
||||
* Sets dst = {0, 0, 0, 0}
|
||||
*
|
||||
* @param ain The source buffer
|
||||
* @param aout The destination buffer
|
||||
@@ -73,7 +71,7 @@ public class ScriptIntrinsicBlend extends ScriptIntrinsic {
|
||||
|
||||
|
||||
/**
|
||||
* dst = src
|
||||
* Sets dst = src
|
||||
*
|
||||
* @param ain The source buffer
|
||||
* @param aout The destination buffer
|
||||
@@ -92,8 +90,9 @@ public class ScriptIntrinsicBlend extends ScriptIntrinsic {
|
||||
}
|
||||
|
||||
/**
|
||||
* dst = dst
|
||||
* This is a NOP
|
||||
* Sets dst = dst
|
||||
*
|
||||
* This is a NOP.
|
||||
*
|
||||
* @param ain The source buffer
|
||||
* @param aout The destination buffer
|
||||
@@ -112,7 +111,7 @@ public class ScriptIntrinsicBlend extends ScriptIntrinsic {
|
||||
}
|
||||
|
||||
/**
|
||||
* dst = src + dst * (1.0 - src.a)
|
||||
* Sets dst = src + dst * (1.0 - src.a)
|
||||
*
|
||||
* @param ain The source buffer
|
||||
* @param aout The destination buffer
|
||||
@@ -131,7 +130,7 @@ public class ScriptIntrinsicBlend extends ScriptIntrinsic {
|
||||
}
|
||||
|
||||
/**
|
||||
* dst = dst + src * (1.0 - dst.a)
|
||||
* Sets dst = dst + src * (1.0 - dst.a)
|
||||
*
|
||||
* @param ain The source buffer
|
||||
* @param aout The destination buffer
|
||||
@@ -150,7 +149,7 @@ public class ScriptIntrinsicBlend extends ScriptIntrinsic {
|
||||
}
|
||||
|
||||
/**
|
||||
* dst = src * dst.a
|
||||
* Sets dst = src * dst.a
|
||||
*
|
||||
* @param ain The source buffer
|
||||
* @param aout The destination buffer
|
||||
@@ -169,7 +168,7 @@ public class ScriptIntrinsicBlend extends ScriptIntrinsic {
|
||||
}
|
||||
|
||||
/**
|
||||
* dst = dst * src.a
|
||||
* Sets dst = dst * src.a
|
||||
*
|
||||
* @param ain The source buffer
|
||||
* @param aout The destination buffer
|
||||
@@ -188,7 +187,7 @@ public class ScriptIntrinsicBlend extends ScriptIntrinsic {
|
||||
}
|
||||
|
||||
/**
|
||||
* dst = src * (1.0 - dst.a)
|
||||
* Sets dst = src * (1.0 - dst.a)
|
||||
*
|
||||
* @param ain The source buffer
|
||||
* @param aout The destination buffer
|
||||
@@ -207,7 +206,7 @@ public class ScriptIntrinsicBlend extends ScriptIntrinsic {
|
||||
}
|
||||
|
||||
/**
|
||||
* dst = dst * (1.0 - src.a)
|
||||
* Sets dst = dst * (1.0 - src.a)
|
||||
*
|
||||
* @param ain The source buffer
|
||||
* @param aout The destination buffer
|
||||
@@ -266,7 +265,7 @@ public class ScriptIntrinsicBlend extends ScriptIntrinsic {
|
||||
}
|
||||
|
||||
/**
|
||||
* dst = {src.r ^ dst.r, src.g ^ dst.g, src.b ^ dst.b, src.a ^ dst.a}
|
||||
* Sets dst = {src.r ^ dst.r, src.g ^ dst.g, src.b ^ dst.b, src.a ^ dst.a}
|
||||
*
|
||||
* @param ain The source buffer
|
||||
* @param aout The destination buffer
|
||||
@@ -295,7 +294,7 @@ public class ScriptIntrinsicBlend extends ScriptIntrinsic {
|
||||
}
|
||||
*/
|
||||
/**
|
||||
* dst = src * dst
|
||||
* Sets dst = src * dst
|
||||
*
|
||||
* @param ain The source buffer
|
||||
* @param aout The destination buffer
|
||||
@@ -391,7 +390,7 @@ public class ScriptIntrinsicBlend extends ScriptIntrinsic {
|
||||
}
|
||||
*/
|
||||
/**
|
||||
* dst = min(src + dst, 1.0)
|
||||
* Sets dst = min(src + dst, 1.0)
|
||||
*
|
||||
* @param ain The source buffer
|
||||
* @param aout The destination buffer
|
||||
@@ -410,7 +409,7 @@ public class ScriptIntrinsicBlend extends ScriptIntrinsic {
|
||||
}
|
||||
|
||||
/**
|
||||
* dst = max(dst - src, 0.0)
|
||||
* Sets dst = max(dst - src, 0.0)
|
||||
*
|
||||
* @param ain The source buffer
|
||||
* @param aout The destination buffer
|
||||
|
||||
@@ -40,7 +40,7 @@ public final class ScriptIntrinsicBlur extends ScriptIntrinsic {
|
||||
*
|
||||
* Supported elements types are {@link Element#U8_4}
|
||||
*
|
||||
* @param rs The Renderscript context
|
||||
* @param rs The RenderScript context
|
||||
* @param e Element type for inputs and outputs
|
||||
*
|
||||
* @return ScriptIntrinsicBlur
|
||||
|
||||
@@ -41,7 +41,7 @@ public final class ScriptIntrinsicColorMatrix extends ScriptIntrinsic {
|
||||
*
|
||||
* Supported elements types are {@link Element#U8_4}
|
||||
*
|
||||
* @param rs The Renderscript context
|
||||
* @param rs The RenderScript context
|
||||
* @param e Element type for intputs and outputs
|
||||
*
|
||||
* @return ScriptIntrinsicColorMatrix
|
||||
|
||||
@@ -41,7 +41,7 @@ public final class ScriptIntrinsicConvolve3x3 extends ScriptIntrinsic {
|
||||
* <p> [ 0, 0, 0 ]
|
||||
* </code>
|
||||
*
|
||||
* @param rs The Renderscript context
|
||||
* @param rs The RenderScript context
|
||||
* @param e Element type for intputs and outputs
|
||||
*
|
||||
* @return ScriptIntrinsicConvolve3x3
|
||||
|
||||
@@ -42,7 +42,7 @@ public final class ScriptIntrinsicConvolve5x5 extends ScriptIntrinsic {
|
||||
* <p> [ 0, 0, 0, 0, 0 ]
|
||||
* </code>
|
||||
*
|
||||
* @param rs The Renderscript context
|
||||
* @param rs The RenderScript context
|
||||
* @param e Element type for intputs and outputs
|
||||
*
|
||||
* @return ScriptIntrinsicConvolve5x5
|
||||
|
||||
@@ -47,7 +47,7 @@ public final class ScriptIntrinsicLUT extends ScriptIntrinsic {
|
||||
*
|
||||
* The defaults tables are identity.
|
||||
*
|
||||
* @param rs The Renderscript context
|
||||
* @param rs The RenderScript context
|
||||
* @param e Element type for intputs and outputs
|
||||
*
|
||||
* @return ScriptIntrinsicLUT
|
||||
|
||||
@@ -36,7 +36,7 @@ public final class ScriptIntrinsicYuvToRGB extends ScriptIntrinsic {
|
||||
*
|
||||
* Supported elements types are {@link Element#U8_4}
|
||||
*
|
||||
* @param rs The Renderscript context
|
||||
* @param rs The RenderScript context
|
||||
* @param e Element type for output
|
||||
*
|
||||
* @return ScriptIntrinsicYuvToRGB
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript Short2 type back to the Android system.
|
||||
* Class for exposing the native RenderScript Short2 type back to the Android system.
|
||||
*
|
||||
**/
|
||||
public class Short2 {
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript short3 type back to the Android system.
|
||||
* Class for exposing the native RenderScript short3 type back to the Android system.
|
||||
*
|
||||
**/
|
||||
public class Short3 {
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Class for exposing the native Renderscript short4 type back to the Android system.
|
||||
* Class for exposing the native RenderScript short4 type back to the Android system.
|
||||
*
|
||||
**/
|
||||
public class Short4 {
|
||||
|
||||
@@ -23,24 +23,29 @@ import android.graphics.ImageFormat;
|
||||
import android.util.Log;
|
||||
|
||||
/**
|
||||
* <p>Type is an allocation template. It consists of an Element and one or more
|
||||
* dimensions. It describes only the layout of memory but does not allocate any
|
||||
* storage for the data that is described.</p>
|
||||
* <p>A Type describes the {@link android.renderscript.Element} and dimensions used for an {@link
|
||||
* android.renderscript.Allocation} or a parallel operation. Types are created through {@link
|
||||
* android.renderscript.Type.Builder}.</p>
|
||||
*
|
||||
* <p>A Type consists of several dimensions. Those are X, Y, Z, LOD (level of
|
||||
* detail), Faces (faces of a cube map). The X,Y,Z dimensions can be assigned
|
||||
* any positive integral value within the constraints of available memory. A
|
||||
* single dimension allocation would have an X dimension of greater than zero
|
||||
* while the Y and Z dimensions would be zero to indicate not present. In this
|
||||
* regard an allocation of x=10, y=1 would be considered 2 dimensionsal while
|
||||
* x=10, y=0 would be considered 1 dimensional.</p>
|
||||
* <p>A Type always includes an {@link android.renderscript.Element} and an X
|
||||
* dimension. A Type may be multidimensional, up to three dimensions. A nonzero
|
||||
* value in the Y or Z dimensions indicates that the dimension is present. Note
|
||||
* that a Type with only a given X dimension and a Type with the same X
|
||||
* dimension but Y = 1 are not equivalent.</p>
|
||||
*
|
||||
* <p>The LOD and Faces dimensions are booleans to indicate present or not present.</p>
|
||||
* <p>A Type also supports inclusion of level of detail (LOD) or cube map
|
||||
* faces. LOD and cube map faces are booleans to indicate present or not
|
||||
* present. </p>
|
||||
*
|
||||
* <p>A Type also supports YUV format information to support an {@link
|
||||
* android.renderscript.Allocation} in a YUV format. The YUV formats supported
|
||||
* are {@link android.graphics.ImageFormat#YV12} and {@link
|
||||
* android.graphics.ImageFormat#NV21}.</p>
|
||||
*
|
||||
* <div class="special reference">
|
||||
* <h3>Developer Guides</h3>
|
||||
* <p>For more information about creating an application that uses Renderscript, read the
|
||||
* <a href="{@docRoot}guide/topics/renderscript/index.html">Renderscript</a> developer guide.</p>
|
||||
* <p>For more information about creating an application that uses RenderScript, read the
|
||||
* <a href="{@docRoot}guide/topics/renderscript/index.html">RenderScript</a> developer guide.</p>
|
||||
* </div>
|
||||
**/
|
||||
public class Type extends BaseObj {
|
||||
@@ -277,11 +282,9 @@ public class Type extends BaseObj {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the YUV layout for a Type. This controls how the memory is
|
||||
* interpreted. Generally and application should not need to call this
|
||||
* function and it would be set by the Camera.
|
||||
* Set the YUV layout for a Type.
|
||||
*
|
||||
* only NV21, YV12. Enums from ImageFormat
|
||||
* @param yuvFormat {@link android.graphics.ImageFormat#YV12} or {@link android.graphics.ImageFormat#NV21}
|
||||
*/
|
||||
public Builder setYuvFormat(int yuvFormat) {
|
||||
switch (yuvFormat) {
|
||||
@@ -299,7 +302,7 @@ public class Type extends BaseObj {
|
||||
|
||||
|
||||
/**
|
||||
* Validate structure and create a new type.
|
||||
* Validate structure and create a new Type.
|
||||
*
|
||||
* @return Type
|
||||
*/
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
<BODY>
|
||||
<p>RenderScript provides support for high-performance computation across heterogeneous processors.</p>
|
||||
|
||||
<p>This package is for the latest native version of RenderScript included on
|
||||
Android devices. Developers interested in running RenderScript on any Android
|
||||
device running {@link android.os.Build.VERSION_CODES#GINGERBREAD} or newer
|
||||
should see the {@link android.support.v8.renderscript} package.
|
||||
|
||||
<p>For more information, see the
|
||||
<a href="{@docRoot}guide/topics/renderscript/index.html">RenderScript</a> developer guide.</p>
|
||||
{@more}
|
||||
|
||||
Reference in New Issue
Block a user