Class JavaAWTVisionBackend
java.lang.Object
org.episteme.core.media.vision.backends.JavaAWTVisionBackend
- All Implemented Interfaces:
VisionAlgorithmProvider<BufferedImage>, VisionBackend, AlgorithmProvider, Backend, ComputeBackend, CPUBackend
@AutoService({Backend.class,ComputeBackend.class,VisionBackend.class,CPUBackend.class})
public class JavaAWTVisionBackend
extends Object
implements VisionBackend, CPUBackend
Basic VisionAlgorithmProvider using standard Java AWT (BufferedImage).
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(BufferedImage image, ImageOp<BufferedImage> op) Applies a generic operation to an image.Creates and returns the backend instance (or returns self if it is the backend).Creates an execution context for running operations.createImage(Object data, int width, int height) Creates a new image from the given data.Returns the type of hardware accelerator used by this backend.Returns the friendly name of this backend instance.Returns a description of the backend.getId()Returns the unique identifier for this backend (e.g., "javafx", "jmol", "cuda").getName()Returns the display name for UI presentation.intReturns the priority for auto-selection (higher = preferred).getType()Returns the backend type category (e.g., "plotting", "molecular", "tensor", "math").booleanChecks if this backend is currently available (libraries loaded, etc.).voidshutdown()Called when the application is shutting down or the backend is being replaced.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AlgorithmProvider
description, getMetadata, scoreMethods inherited from interface Backend
getAlgorithmProviders, getStatusMessage, isExplicitlyDisabledMethods inherited from interface CPUBackend
supportsComplexNumbers, supportsFloatingPoint, supportsParallelOpsMethods inherited from interface VisionAlgorithmProvider
getAlgorithmType
-
Constructor Details
-
JavaAWTVisionBackend
public JavaAWTVisionBackend()
-
-
Method Details
-
apply
Description copied from interface:VisionAlgorithmProviderApplies a generic operation to an image.- Specified by:
applyin interfaceVisionAlgorithmProvider<BufferedImage>
-
createImage
Description copied from interface:VisionAlgorithmProviderCreates a new image from the given data.- Specified by:
createImagein interfaceVisionAlgorithmProvider<BufferedImage>
-
getType
Description copied from interface:BackendReturns the backend type category (e.g., "plotting", "molecular", "tensor", "math").- Specified by:
getTypein interfaceBackend- Specified by:
getTypein interfaceComputeBackend- Specified by:
getTypein interfaceCPUBackend- Specified by:
getTypein interfaceVisionBackend
-
getId
Description copied from interface:BackendReturns the unique identifier for this backend (e.g., "javafx", "jmol", "cuda").- Specified by:
getIdin interfaceBackend- Specified by:
getIdin interfaceComputeBackend- Specified by:
getIdin interfaceVisionBackend
-
getBackendName
Description copied from interface:VisionBackendReturns the friendly name of this backend instance.- Specified by:
getBackendNamein interfaceVisionBackend
-
getName
Description copied from interface:BackendReturns the display name for UI presentation.- Specified by:
getNamein interfaceAlgorithmProvider- Specified by:
getNamein interfaceBackend- Specified by:
getNamein interfaceVisionAlgorithmProvider<BufferedImage>- Specified by:
getNamein interfaceVisionBackend
-
getDescription
Description copied from interface:BackendReturns a description of the backend.- Specified by:
getDescriptionin interfaceBackend- Specified by:
getDescriptionin interfaceComputeBackend- Specified by:
getDescriptionin interfaceVisionBackend
-
isAvailable
public boolean isAvailable()Description copied from interface:BackendChecks if this backend is currently available (libraries loaded, etc.).Default implementation checks
Backend.isExplicitlyDisabled()and returns false if it is.- Specified by:
isAvailablein interfaceAlgorithmProvider- Specified by:
isAvailablein interfaceBackend- Specified by:
isAvailablein interfaceVisionBackend
-
getPriority
public int getPriority()Description copied from interface:BackendReturns the priority for auto-selection (higher = preferred). Used when multiple backends are available.- Specified by:
getPriorityin interfaceAlgorithmProvider- Specified by:
getPriorityin interfaceBackend- Specified by:
getPriorityin interfaceVisionBackend
-
createBackend
Description copied from interface:BackendCreates and returns the backend instance (or returns self if it is the backend).- Specified by:
createBackendin interfaceBackend- Specified by:
createBackendin interfaceComputeBackend- Specified by:
createBackendin interfaceVisionBackend- Returns:
- The backend implementation object
-
shutdown
public void shutdown()Description copied from interface:BackendCalled when the application is shutting down or the backend is being replaced. Use this to release hardware resources, close file handles, or stop background threads.- Specified by:
shutdownin interfaceAlgorithmProvider- Specified by:
shutdownin interfaceBackend- Specified by:
shutdownin interfaceVisionBackend
-
getAcceleratorType
Description copied from interface:ComputeBackendReturns the type of hardware accelerator used by this backend.- Specified by:
getAcceleratorTypein interfaceComputeBackend- Specified by:
getAcceleratorTypein interfaceCPUBackend- Specified by:
getAcceleratorTypein interfaceVisionBackend- Returns:
- the accelerator type
-
createContext
Description copied from interface:ComputeBackendCreates an execution context for running operations.The context should be used within a try-with-resources block to ensure proper cleanup of resources.
- Specified by:
createContextin interfaceComputeBackend- Specified by:
createContextin interfaceVisionBackend- Returns:
- new execution context
-