Package net.haesleinhuepf.clij.clearcl
Class ClearCLImage
- java.lang.Object
-
- net.haesleinhuepf.clij.clearcl.abs.ClearCLBase
-
- net.haesleinhuepf.clij.clearcl.abs.ClearCLMemBase
-
- net.haesleinhuepf.clij.clearcl.ClearCLImage
-
- All Implemented Interfaces:
AutoCloseable,ClearCLImageInterface,ClearCLMemInterface,net.haesleinhuepf.clij.coremem.interfaces.SizedInBytes
public class ClearCLImage extends ClearCLMemBase implements ClearCLMemInterface, ClearCLImageInterface
ClearCLImage is the ClearCL abstraction for OpenCL images.- Author:
- royer
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidcopyTo(ClearCLBuffer pDstBuffer, boolean pBlockingCopy)Copies this image into an (OpenCl) buffer.voidcopyTo(ClearCLBuffer pDstBuffer, long[] pOriginInSrcImage, long[] pRegionInSrcImage, long pOffsetInDstBuffer, boolean pBlockingCopy)Copies a nD region from this image into a nD region of same dimensions into a (OpenCl) buffer.voidcopyTo(ClearCLHostImageBuffer pClearCLHostImage, boolean pBlockingCopy)Copies this buffer into a host image.voidcopyTo(ClearCLImage pDstImage, boolean pBlockingCopy)Copies this image to another image of same dimensions.voidcopyTo(ClearCLImage pDstImage, long[] pOriginInSrcImage, long[] pOriginInDstImage, long[] pRegion, boolean pBlockingCopy)Copies a nD region form this image to a nD region of same dimensions in another image.voidfill(float[] pRGBA, boolean pBlockingFill, boolean pNotifyListeners)Fills this image with a float RGBA 'color'.voidfill(float[] pRGBA, long[] pOrigin, long[] pRegion, boolean pBlockingFill, boolean pNotifyListeners)Fills a nD region of this image with a RGBA float 'color'.voidfill(float pColor, boolean pBlockingFill, boolean pNotifyListeners)Fills this image with a single channel 'color'.voidfill(int[] pRGBA, boolean pBlockingFill, boolean pNotifyListeners)Fills this image with an int RGBA 'color'.voidfill(int[] pRGBA, long[] pOrigin, long[] pRegion, boolean pBlockingFill, boolean pNotifyListeners)Fills a nD region of this image with a RGBA int 'color'.voidfill(int pColor, boolean pBlockingFill, boolean pNotifyListeners)Fills this image with a single channel 'color'.voidfillZero(boolean pBlockingFill, boolean pNotifyListeners)Fills this image with zeros.ImageChannelDataTypegetChannelDataType()Returns image channel typeImageChannelOrdergetChannelOrder()Returns image typeClearCLContextgetContext()Returns the context for this image.long[]getDimensions()Returns this image dimensions.ImageTypegetImageType()Returns image typeStringgetName()net.haesleinhuepf.clij.coremem.enums.NativeTypeEnumgetNativeType()Returns native typelonggetNumberOfChannels()Returns the number of channels in this imagelonggetSizeInBytes()booleanisFloat()Returns whether this image data type is floatbooleanisInteger()Returns whether this image data type is integerbooleanisNormalized()Returns whether this image is normalized (values between 0 and 1)booleanisSigned()Returns whether this image data type has a signnet.haesleinhuepf.clij.coremem.offheap.OffHeapMemoryreadFrom(byte[] pByteArray, boolean pBlockingRead)Reads from a Java byte array into this image.net.haesleinhuepf.clij.coremem.offheap.OffHeapMemoryreadFrom(char[] pCharArray, boolean pBlockingRead)Reads from a Java char array into this image.net.haesleinhuepf.clij.coremem.offheap.OffHeapMemoryreadFrom(double[] pDoubleArray, boolean pBlockingRead)Reads from a Java double array into this image.net.haesleinhuepf.clij.coremem.offheap.OffHeapMemoryreadFrom(float[] pFloatArray, boolean pBlockingRead)Reads from a Java float array into this image.net.haesleinhuepf.clij.coremem.offheap.OffHeapMemoryreadFrom(int[] pIntArray, boolean pBlockingRead)Reads from a Java int array into this image.net.haesleinhuepf.clij.coremem.offheap.OffHeapMemoryreadFrom(long[] pLongArray, boolean pBlockingRead)Reads from a Java long array into this image.net.haesleinhuepf.clij.coremem.offheap.OffHeapMemoryreadFrom(short[] pShortsArray, boolean pBlockingRead)Reads from a Java short array into this image.voidreadFrom(Buffer pBuffer, boolean pBlockingRead)Reads from a NIO buffer into this image.voidreadFrom(Buffer pBuffer, long[] pOrigin, long[] pRegion, boolean pBlockingRead)Reads from a NIO buffer into a nD region of this image.voidreadFrom(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory, boolean pBlockingRead)Reads from a CoreMem contiguous buffer into this image.voidreadFrom(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory, long[] pOrigin, long[] pRegion, boolean pBlockingRead)Reads from a CoreMem buffer into a nD region of this image.voidreadFrom(net.haesleinhuepf.clij.coremem.fragmented.FragmentedMemoryInterface pFragmentedMemory, boolean pBlockingRead)Reads from a CoreMem fragmented buffer into this image.voidreadFrom(net.haesleinhuepf.clij.coremem.fragmented.FragmentedMemoryInterface pFragmentedMemory, long[] pOrigin, long[] pRegion, boolean pBlockingRead)Reads from a CoreMem fragmented buffer into a nD region of this image.voidsetName(String name)StringtoString()voidwriteTo(Buffer pBuffer, boolean pBlockingRead)Writes a nD region of this image to a NIO buffer.voidwriteTo(Buffer pBuffer, long[] pOrigin, long[] pRegion, boolean pBlockingRead)Writes a nD region of this image to a NIO buffer.voidwriteTo(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory, boolean pBlockingRead)Writes a this image to a CoreMem buffer.voidwriteTo(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory, long[] pOrigin, long[] pRegion, boolean pBlockingRead)Writes a nD region of this image to a CoreMem buffer.-
Methods inherited from class net.haesleinhuepf.clij.clearcl.abs.ClearCLMemBase
addListener, getHostAccessType, getKernelAccessType, getMemAllocMode, notifyListenersOfChange, removeListener
-
Methods inherited from class net.haesleinhuepf.clij.clearcl.abs.ClearCLBase
getBackend, getPeerPointer, setPeerPointer
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.haesleinhuepf.clij.clearcl.interfaces.ClearCLImageInterface
getBackend, getDepth, getDimension, getHeight, getPeerPointer, getPixelSizeInBytes, getVolume, getWidth
-
Methods inherited from interface net.haesleinhuepf.clij.clearcl.interfaces.ClearCLMemInterface
addListener, getHostAccessType, getKernelAccessType, getMemAllocMode, notifyListenersOfChange
-
-
-
-
Field Detail
-
name
protected String name
-
-
Method Detail
-
fillZero
public void fillZero(boolean pBlockingFill, boolean pNotifyListeners)Fills this image with zeros.- Parameters:
pBlockingFill- true blocking call, false asynchronous callpNotifyListeners- true notify listeners, false do not notify
-
fill
public void fill(float pColor, boolean pBlockingFill, boolean pNotifyListeners)Fills this image with a single channel 'color'.- Parameters:
pColor- single channel float colorpBlockingFill- true blocking call, false asynchronous callpNotifyListeners- true notify listeners, false do not notify
-
fill
public void fill(int pColor, boolean pBlockingFill, boolean pNotifyListeners)Fills this image with a single channel 'color'.- Parameters:
pColor- single channel int colorpBlockingFill- true blocking call, false asynchronous callpNotifyListeners- true notify listeners, false do not notify
-
fill
public void fill(float[] pRGBA, boolean pBlockingFill, boolean pNotifyListeners)Fills this image with a float RGBA 'color'.- Parameters:
pRGBA- four float colorpBlockingFill- true blocking call, false asynchronous callpNotifyListeners- true notify listeners, false do not notify
-
fill
public void fill(int[] pRGBA, boolean pBlockingFill, boolean pNotifyListeners)Fills this image with an int RGBA 'color'.- Parameters:
pRGBA- four int colorpBlockingFill- true blocking call, false asynchronous callpNotifyListeners- true notify listeners, false do not notify
-
fill
public void fill(float[] pRGBA, long[] pOrigin, long[] pRegion, boolean pBlockingFill, boolean pNotifyListeners)Fills a nD region of this image with a RGBA float 'color'.- Parameters:
pRGBA- four float colorpOrigin- region originpRegion- region dimensionspBlockingFill- true blocking call, false asynchronous callpNotifyListeners- true notify listeners, false do not notify
-
fill
public void fill(int[] pRGBA, long[] pOrigin, long[] pRegion, boolean pBlockingFill, boolean pNotifyListeners)Fills a nD region of this image with a RGBA int 'color'.- Parameters:
pRGBA- four int colorpOrigin- region originpRegion- region dimensionspBlockingFill- true blocking call, false asynchronous callpNotifyListeners- true notify listeners, false do not notify
-
copyTo
public void copyTo(ClearCLImage pDstImage, boolean pBlockingCopy)
Copies this image to another image of same dimensions.- Specified by:
copyToin interfaceClearCLImageInterface- Parameters:
pDstImage- destination imagepBlockingCopy- true blocking call, false asynchronous call
-
copyTo
public void copyTo(ClearCLImage pDstImage, long[] pOriginInSrcImage, long[] pOriginInDstImage, long[] pRegion, boolean pBlockingCopy)
Copies a nD region form this image to a nD region of same dimensions in another image.- Parameters:
pDstImage- destination imagepOriginInSrcImage- origin in source imagepOriginInDstImage- origin in destination imagepRegion- region dimensionspBlockingCopy- true blocking call, false asynchronous call
-
copyTo
public void copyTo(ClearCLBuffer pDstBuffer, boolean pBlockingCopy)
Copies this image into an (OpenCl) buffer.- Specified by:
copyToin interfaceClearCLImageInterface- Parameters:
pDstBuffer- destination bufferpBlockingCopy- true blocking call, false asynchronous call
-
copyTo
public void copyTo(ClearCLBuffer pDstBuffer, long[] pOriginInSrcImage, long[] pRegionInSrcImage, long pOffsetInDstBuffer, boolean pBlockingCopy)
Copies a nD region from this image into a nD region of same dimensions into a (OpenCl) buffer.- Parameters:
pDstBuffer- destination bufferpOriginInSrcImage- origin is source imagepRegionInSrcImage- region dimensions in source imagepOffsetInDstBuffer- offset in destination buffer in elementspBlockingCopy- true blocking call, false asynchronous call
-
copyTo
public void copyTo(ClearCLHostImageBuffer pClearCLHostImage, boolean pBlockingCopy)
Copies this buffer into a host image.- Parameters:
pClearCLHostImage- host image.pBlockingCopy- true blocking call, false asynchronous call
-
writeTo
public void writeTo(Buffer pBuffer, boolean pBlockingRead)
Writes a nD region of this image to a NIO buffer.- Specified by:
writeToin interfaceClearCLImageInterface- Parameters:
pBuffer- NIO bufferpBlockingRead- true blocking call, false asynchronous call
-
writeTo
public void writeTo(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory, boolean pBlockingRead)Writes a this image to a CoreMem buffer.- Specified by:
writeToin interfaceClearCLImageInterface- Parameters:
pContiguousMemory- CoreMem bufferpBlockingRead- true blocking call, false asynchronous call
-
writeTo
public void writeTo(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory, long[] pOrigin, long[] pRegion, boolean pBlockingRead)Writes a nD region of this image to a CoreMem buffer.- Parameters:
pContiguousMemory- CoreMem bufferpOrigin- origin in imagepRegion- region dimensions in imagepBlockingRead- true blocking call, false asynchronous call
-
writeTo
public void writeTo(Buffer pBuffer, long[] pOrigin, long[] pRegion, boolean pBlockingRead)
Writes a nD region of this image to a NIO buffer.- Parameters:
pBuffer- NIO bufferpOrigin- origin in imagepRegion- region dimensions in imagepBlockingRead- true blocking call, false asynchronous call
-
readFrom
public void readFrom(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory, long[] pOrigin, long[] pRegion, boolean pBlockingRead)Reads from a CoreMem buffer into a nD region of this image.- Parameters:
pContiguousMemory- CoreMem bufferpOrigin- origin in imagepRegion- region dimensions in imagepBlockingRead- true blocking call, false asynchronous call
-
readFrom
public void readFrom(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory, boolean pBlockingRead)Reads from a CoreMem contiguous buffer into this image.- Specified by:
readFromin interfaceClearCLImageInterface- Parameters:
pContiguousMemory- CoreMem bufferpBlockingRead- true blocking call, false asynchronous call
-
readFrom
public void readFrom(net.haesleinhuepf.clij.coremem.fragmented.FragmentedMemoryInterface pFragmentedMemory, long[] pOrigin, long[] pRegion, boolean pBlockingRead)Reads from a CoreMem fragmented buffer into a nD region of this image. Each fragment corresponds to a single XY 2D plane (for XYZ 3D images) or a single X 1D line (for XY 2D images).- Parameters:
pFragmentedMemory- CoreMem fragmented bufferpOrigin- origin in imagepRegion- region dimensions in imagepBlockingRead- true blocking call, false asynchronous call
-
readFrom
public void readFrom(net.haesleinhuepf.clij.coremem.fragmented.FragmentedMemoryInterface pFragmentedMemory, boolean pBlockingRead)Reads from a CoreMem fragmented buffer into this image.- Parameters:
pFragmentedMemory- CoreMem fragmented bufferpBlockingRead- true blocking call, false asynchronous call
-
readFrom
public void readFrom(Buffer pBuffer, long[] pOrigin, long[] pRegion, boolean pBlockingRead)
Reads from a NIO buffer into a nD region of this image.- Parameters:
pBuffer- NIO bufferpOrigin- origin in imagepRegion- region dimensions in imagepBlockingRead- true blocking call, false asynchronous call
-
readFrom
public void readFrom(Buffer pBuffer, boolean pBlockingRead)
Reads from a NIO buffer into this image.- Specified by:
readFromin interfaceClearCLImageInterface- Parameters:
pBuffer- NIO bufferpBlockingRead- true blocking call, false asynchronous call
-
readFrom
public net.haesleinhuepf.clij.coremem.offheap.OffHeapMemory readFrom(byte[] pByteArray, boolean pBlockingRead)Reads from a Java byte array into this image.- Parameters:
pByteArray- byte arraypBlockingRead- true blocking call, false asynchronous call- Returns:
- temp offheap memory object used to transfer the data.
-
readFrom
public net.haesleinhuepf.clij.coremem.offheap.OffHeapMemory readFrom(char[] pCharArray, boolean pBlockingRead)Reads from a Java char array into this image.- Parameters:
pCharArray- char arraypBlockingRead- true blocking call, false asynchronous call- Returns:
- temp offheap memory object used to transfer the data.
-
readFrom
public net.haesleinhuepf.clij.coremem.offheap.OffHeapMemory readFrom(short[] pShortsArray, boolean pBlockingRead)Reads from a Java short array into this image.- Parameters:
pShortsArray- short arraypBlockingRead- true blocking call, false asynchronous call- Returns:
- temp offheap memory object used to transfer the data.
-
readFrom
public net.haesleinhuepf.clij.coremem.offheap.OffHeapMemory readFrom(int[] pIntArray, boolean pBlockingRead)Reads from a Java int array into this image.- Parameters:
pIntArray- int arraypBlockingRead- true blocking call, false asynchronous call- Returns:
- temp offheap memory object used to transfer the data.
-
readFrom
public net.haesleinhuepf.clij.coremem.offheap.OffHeapMemory readFrom(long[] pLongArray, boolean pBlockingRead)Reads from a Java long array into this image.- Parameters:
pLongArray- long arraypBlockingRead- true blocking call, false asynchronous call- Returns:
- temp offheap memory object used to transfer the data.
-
readFrom
public net.haesleinhuepf.clij.coremem.offheap.OffHeapMemory readFrom(float[] pFloatArray, boolean pBlockingRead)Reads from a Java float array into this image.- Parameters:
pFloatArray- float arraypBlockingRead- true blocking call, false asynchronous call- Returns:
- temp offheap memory object used to transfer the data.
-
readFrom
public net.haesleinhuepf.clij.coremem.offheap.OffHeapMemory readFrom(double[] pDoubleArray, boolean pBlockingRead)Reads from a Java double array into this image.- Parameters:
pDoubleArray- double arraypBlockingRead- true blocking call, false asynchronous call- Returns:
- temp offheap memory object used to transfer the data.
-
getContext
public ClearCLContext getContext()
Returns the context for this image.- Specified by:
getContextin interfaceClearCLMemInterface- Returns:
- context
-
getImageType
public ImageType getImageType()
Returns image type- Returns:
- image type
-
getChannelOrder
public ImageChannelOrder getChannelOrder()
Returns image type- Returns:
- image type
-
getChannelDataType
public ImageChannelDataType getChannelDataType()
Returns image channel type- Returns:
- channel type
-
isNormalized
public boolean isNormalized()
Returns whether this image is normalized (values between 0 and 1)- Returns:
- true if normalized, false otherwise
-
isSigned
public boolean isSigned()
Returns whether this image data type has a sign- Returns:
- true if signed, false otherwise
-
isInteger
public boolean isInteger()
Returns whether this image data type is integer- Returns:
- true if integer, false otherwise
-
isFloat
public boolean isFloat()
Returns whether this image data type is float- Returns:
- true if float, false otherwise
-
getNativeType
public net.haesleinhuepf.clij.coremem.enums.NativeTypeEnum getNativeType()
Description copied from interface:ClearCLImageInterfaceReturns native type- Specified by:
getNativeTypein interfaceClearCLImageInterface- Returns:
- native type
-
getNumberOfChannels
public long getNumberOfChannels()
Description copied from interface:ClearCLImageInterfaceReturns the number of channels in this image- Specified by:
getNumberOfChannelsin interfaceClearCLImageInterface- Returns:
- number of channels
-
getDimensions
public long[] getDimensions()
Returns this image dimensions.- Specified by:
getDimensionsin interfaceClearCLImageInterface- Returns:
- dimensions
-
getSizeInBytes
public long getSizeInBytes()
- Specified by:
getSizeInBytesin interfacenet.haesleinhuepf.clij.coremem.interfaces.SizedInBytes
-
setName
public void setName(String name)
- Specified by:
setNamein interfaceClearCLImageInterface
-
getName
public String getName()
- Specified by:
getNamein interfaceClearCLImageInterface
-
toString
public String toString()
- Overrides:
toStringin classClearCLMemBase
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceClearCLImageInterface- Specified by:
closein classClearCLBase
-
-