Revise JavaCPP bindings and core package #72
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Streamline core API and reduce redundancies in JavaCPP wrapper.
The API for creating and writing ArrayJ looks like this now:
Changes in more detail:
cle::dType
andcle::mType
are represented as Java enumsnet.clesperanto.core.DataType
andnet.clesperanto.core.MemoryType
Reduce memory copying functions in
cleasperantoj.hpp
to only the primitive types. The distinction between signed and unsigned is unnecessary. Corresponding Java methods are inMemoryJ
instancesMemoryJ.BYTE
,MemoryJ.SHORT
,MemoryJ.INT
,MemoryJ.FLOAT
. TheDataType
enum has amemory()
method that maps to the appropriateMemoryJ
instance. For example,DataType.UINT8.memory() == MemoryJ.BYTE
.Move
ArrayJ
create/read/write methods intoArrayJ
.Revise
ImgLib2Converters
andImageJConverters
to not go through an additionalByteBuffer
. Just copy from/to primitive arrays directly.ArrayJ
constructors can extractDevice
from underlying_ArrayJ
directly. So we don't need theArrayJ(_ArrayJ, DeviceJ)
constructor anymore. However, this is left in for now, until we replace all the call sites inTier1
,Tier2
, etc. (This should be done through gencle?)There is a bit of confusion of how to handle width/height/depth/dimensions of an
cle::Array
consistently. I'll make a separate GitHub issue about that.