|
Beatmup Java package
|
Beatmup engine context. More...
Public Member Functions | |
| float | performTask (Task task) throws CoreException |
| Performs a given task in the main thread pool. More... | |
| float | performTask (Task task, int poolIndex) throws CoreException |
| Performs a given task. More... | |
| void | repeatTask (Task task, boolean abortCurrent) |
| Ensures a given task executed at least once. More... | |
| void | repeatTask (Task task, boolean abortCurrent, int poolIndex) |
| Ensures a given task executed at least once in a specific thread pool. More... | |
| int | submitPersistentTask (Task task) |
| Submits a persistent task in the main thread pool. More... | |
| int | submitPersistentTask (Task task, int poolIndex) |
| Submits a persistent task in a specified thread pool. More... | |
| void | waitForJob (int job) |
| Blocks until a given job in the main thread pool finishes. More... | |
| void | waitForJob (int job, int poolIndex) |
| Blocks until a given job in the main thread pool finishes. More... | |
| boolean | abortJob (int job) |
| Aborts a given submitted job. More... | |
| boolean | abortJob (int job, int poolIndex) |
| Aborts a given submitted job. More... | |
| void | limitWorkerCount (int newCount) |
| Sets maximum number of threads executing tasks in the main thread pool. More... | |
| void | limitWorkerCount (int newCount, int poolIndex) |
| Sets maximum number of threads executing tasks in a given thread pool. More... | |
| void | check () throws CoreException |
| Checks if the main thread pool is doing great: rethrows exceptions occurred during tasks execution, if any. More... | |
| void | check (int poolIndex) throws CoreException |
| Checks if a specific thread pool is doing great: rethrows exceptions occurred during tasks execution, if any. More... | |
| synchronized void | dispose () |
| Destroys the native object. More... | |
| Bitmap | renderChessboard (int width, int height, int cellSize, PixelFormat pixelFormat) |
| Renders a chessboard-like image. More... | |
| Bitmap | copyBitmap (Bitmap source, PixelFormat pixelFormat) |
| Creates a copy of given bitmap. More... | |
| IntPoint | scanlineSearch (Bitmap bitmap, Color color, IntPoint start) |
| Goes through a bitmap in scanline order (left to right, top to bottom) until a pixel of a given color is met. More... | |
| boolean | isGPUQueried () |
| Tests whether the GPU was already queried. More... | |
| boolean | isGPUReady () |
| Tests whether the GPU was already queried and successfully initialized. More... | |
| void | recycleGPUGarbage () |
| Recycles GPU-managed resources that are ready to be disposed in a separate task. More... | |
Static Public Member Functions | |
| static long | getTotalRAMBytes () |
Static Public Attributes | |
| static final IntPoint | SCANLINE_SEARCH_NOT_FOUND = new IntPoint(-1, -1) |
| Returned by Beatmup.Context.scanlineSearch() if no pixel of a specific color is found in the image. More... | |
Protected Member Functions | |
| Context (long handle) | |
| Creates a new context. More... | |
| void | watchBitmap (Bitmap bitmap) |
| Adds a bitmap to the watch list. More... | |
| synchronized void | unwatchBitmap (Bitmap bitmap) |
| Removes a bitmap from the watch list. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Beatmup.Object | |
| long | handle |
| pointer to the native object More... | |
Beatmup engine context.
Handles necessary data to interact with the engine through JNI layer
Definition at line 34 of file Context.java.
|
inlineprotected |
|
inline |
Performs a given task in the main thread pool.
| task | The task to run |
| CoreException | if the main thread pool has unprocessed exceptions thrown by previously executed tasks. |
Definition at line 78 of file Context.java.
|
inline |
Performs a given task.
| task | The task to run |
| poolIndex | Zero-based index of the thread pool to run the task in. |
| CoreException | if the thread pool has unprocessed exceptions thrown by previously executed tasks. |
Definition at line 90 of file Context.java.
|
inline |
Ensures a given task executed at least once.
| task | the task |
| abortCurrent | if true and a task is running, the abort signal is sent. |
Definition at line 100 of file Context.java.
|
inline |
Ensures a given task executed at least once in a specific thread pool.
| task | The task |
| abortCurrent | if true and a task is running, the abort signal is sent. |
| poolIndex | Index of the thread pool to run the task in |
Definition at line 111 of file Context.java.
|
inline |
Submits a persistent task in the main thread pool.
| task | The task |
Definition at line 121 of file Context.java.
|
inline |
Submits a persistent task in a specified thread pool.
| task | The task |
| poolIndex | Thread pool index |
Definition at line 132 of file Context.java.
|
inline |
Blocks until a given job in the main thread pool finishes.
| job | The job |
Definition at line 141 of file Context.java.
|
inline |
Blocks until a given job in the main thread pool finishes.
| job | The job |
| poolIndex | Thread pool index |
Definition at line 151 of file Context.java.
|
inline |
Aborts a given submitted job.
| job | The job |
true if the job was interrupted while running. Definition at line 161 of file Context.java.
|
inline |
Aborts a given submitted job.
| job | The job |
| poolIndex | Thread pool index |
true if the job was interrupted while running. Definition at line 172 of file Context.java.
|
inline |
Sets maximum number of threads executing tasks in the main thread pool.
| newCount | the new thread count limit |
Definition at line 181 of file Context.java.
|
inline |
Sets maximum number of threads executing tasks in a given thread pool.
| newCount | the new thread count limit |
| poolIndex | index of the thread pool |
Definition at line 191 of file Context.java.
|
inline |
Checks if the main thread pool is doing great: rethrows exceptions occurred during tasks execution, if any.
If no exception is thrown, the thread pool is okay.
| CoreException | occurred while running a task. |
Definition at line 201 of file Context.java.
|
inline |
Checks if a specific thread pool is doing great: rethrows exceptions occurred during tasks execution, if any.
If no exception is thrown, the thread pool is okay.
| poolIndex | The thread pool index |
| CoreException | occurred while running a task. |
Definition at line 212 of file Context.java.
|
inlineprotected |
Adds a bitmap to the watch list.
| bitmap | the new bitmap |
Definition at line 230 of file Context.java.
|
inlineprotected |
Removes a bitmap from the watch list.
| bitmap | the bitmap to remove |
Definition at line 241 of file Context.java.
|
inline |
Destroys the native object.
After the native object is destroyed, its Java counterpart likely becomes unusable.
Reimplemented from Beatmup.Object.
Reimplemented in Beatmup.Android.Context.
Definition at line 249 of file Context.java.
|
inline |
Renders a chessboard-like image.
| width | output image width in pixels |
| height | output image height in pixels |
| cellSize | chessboard cell size size in pixels |
| pixelFormat | output image pixel format |
Definition at line 269 of file Context.java.
|
inline |
Creates a copy of given bitmap.
| source | the bitmap |
| pixelFormat | pixel format of the copy |
Definition at line 283 of file Context.java.
Goes through a bitmap in scanline order (left to right, top to bottom) until a pixel of a given color is met.
| bitmap | the bitmap to scan |
| color | the color value to look for |
| start | starting pixel position |
Definition at line 296 of file Context.java.
|
inline |
Tests whether the GPU was already queried.
true if the GPU was queried Definition at line 309 of file Context.java.
|
inline |
Tests whether the GPU was already queried and successfully initialized.
true if yes Definition at line 318 of file Context.java.
|
inline |
Recycles GPU-managed resources that are ready to be disposed in a separate task.
Definition at line 326 of file Context.java.
|
inlinestatic |
Definition at line 334 of file Context.java.
Returned by Beatmup.Context.scanlineSearch() if no pixel of a specific color is found in the image.
Definition at line 341 of file Context.java.