Class ClearCLBuffer

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected String name  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void copyTo​(ClearCLBuffer pDstBuffer, boolean pBlockingCopy)
      Copies this OpenCl buffer into another OpenCl buffer of same length.
      void copyTo​(ClearCLBuffer pDstBuffer, long[] pOriginInSrcBuffer, long[] pOriginInDstBuffer, long[] pRegion, boolean pBlockingCopy)
      Copies a 3D region of this OpenCl buffer into a 3D region of same dimensions of another OpenCl buffer.
      void copyTo​(ClearCLBuffer pDstBuffer, long pOffsetInSrcBuffer, long pOffsetInDstBuffer, long pLengthInElements, boolean pBlockingCopy)
      Copies a linear region of this OpenCl buffer into a linear region of same length of another OpenCl buffer.
      void copyTo​(ClearCLHostImageBuffer pClearCLHostImage, boolean pBlockingCopy)
      Copies this image into a host image.
      void copyTo​(ClearCLImage pDstImage, boolean pBlockingCopy)
      Copies this OpenCl buffer to an OpenCl image.
      void copyTo​(ClearCLImage pDstImage, long pOffsetInSrcBuffer, long[] pDstOrigin, long[] pDstRegion, boolean pBlockingCopy)
      Copies a 3D region of this OpenCl buffer into a 3D region of same dimensions of an OpenCl image.
      void fill​(byte[] pPattern, boolean pBlockingFill)
      Fills the buffer with a given byte pattern.
      void fill​(byte[] pPattern, long pOffsetInBuffer, long pLengthInBuffer, boolean pBlockingFill)
      Fills the buffer with a given byte pattern, from a given starting offset, and for a certain length.
      void fill​(byte pByte, boolean pBlockingFill)
      Fills the buffer with a given byte.
      ClearCLContext getContext()
      Returns ClearCL context associated to this OpenCL mem object.
      long[] getDimensions()
      Returns this image dimensions.
      long getLength()
      Returns length in elements, an element is composed of potentially several channels and is certainly not equal to the size in bytes!
      String getName()  
      net.haesleinhuepf.clij.coremem.enums.NativeTypeEnum getNativeType()
      Returns data type.
      long getNumberOfChannels()
      Returns the number of channels in this image
      long getSizeInBytes()
      Returns the size in bytes.
      void readFrom​(Buffer pBuffer, boolean pBlockingRead)
      Reads from a linear region of a NIO buffer into this OpenCl buffer.
      void readFrom​(Buffer pBuffer, long[] pSourceOrigin, long[] pDestinationOrigin, long[] pRegion, boolean pBlockingRead)
      Reads from a 3D region of a NIO buffer into a 3D region of this OpenCl buffer.
      void readFrom​(Buffer pBuffer, long pOffsetInBuffer, long pLengthInBuffer, boolean pBlockingRead)
      Reads from a linear region of a NIO buffer into this OpenCl buffer.
      void readFrom​(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory, boolean pBlockingRead)
      Reads from a linear region of a CoreMem buffer into this OpenCl buffer.
      void readFrom​(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory, long[] pSourceOrigin, long[] pDestinationOrigin, long[] pRegion, boolean pBlockingRead)
      Reads from a 3D region of a CoreMem buffer into a 3D region of this OpenCl buffer.
      void readFrom​(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory, long pOffsetInBuffer, long pLengthInBuffer, boolean pBlockingRead)
      Reads from a linear region of a CoreMem buffer into this OpenCl buffer.
      void setName​(String name)  
      String toString()  
      void writeTo​(Buffer pBuffer, boolean pBlockingWrite)
      Writes a NIO buffer into this OpenCl buffer.
      void writeTo​(Buffer pBuffer, long[] pSourceOrigin, long[] pDestinationOrigin, long[] pRegion, boolean pBlockingWrite)
      Writes to a 3D region of a NIO buffer into a 3D region of this OpenCl buffer.
      void writeTo​(Buffer pBuffer, long pOffsetInBuffer, long pLengthInBuffer, boolean pBlockingWrite)
      Writes a linear region of a NIO buffer into this OpenCl buffer.
      void writeTo​(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory, boolean pBlockingWrite)
      Writes the contents of this OpenCl buffer into CoreMem buffer.
      void writeTo​(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory, long[] pSourceOrigin, long[] pDestinationOrigin, long[] pRegion, boolean pBlockingWrite)
      Writes to a 3D region of a CoreMem buffer into a 3D region of this OpenCl buffer.
      void writeTo​(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory, long pOffsetInBuffer, long pLengthInBuffer, boolean pBlockingWrite)
      Writes the contents of this OpenCl buffer into a linear region of a CoreMem buffer.
    • Field Detail

    • Method Detail

      • fill

        public void fill​(byte pByte,
                         boolean pBlockingFill)
        Fills the buffer with a given byte.
        Parameters:
        pByte - byte to fill buffer with
        pBlockingFill - true blocking call, false asynchronous call
      • fill

        public void fill​(byte[] pPattern,
                         boolean pBlockingFill)
        Fills the buffer with a given byte pattern.
        Parameters:
        pPattern - pattern as a sequence of bytes
        pBlockingFill - true blocking call, false asynchronous call
      • fill

        public void fill​(byte[] pPattern,
                         long pOffsetInBuffer,
                         long pLengthInBuffer,
                         boolean pBlockingFill)
        Fills the buffer with a given byte pattern, from a given starting offset, and for a certain length. This call can be required to block until operation is finished.
        Parameters:
        pPattern - pattern as a sequence of bytes
        pOffsetInBuffer - offset in buffer in elements
        pLengthInBuffer - length in buffer in elements
        pBlockingFill - true blocking call, false asynchronous call
      • copyTo

        public void copyTo​(ClearCLBuffer pDstBuffer,
                           boolean pBlockingCopy)
        Copies this OpenCl buffer into another OpenCl buffer of same length.
        Specified by:
        copyTo in interface ClearCLImageInterface
        Parameters:
        pDstBuffer - destination buffer
        pBlockingCopy - true blocking call, false asynchronous call
      • copyTo

        public void copyTo​(ClearCLBuffer pDstBuffer,
                           long pOffsetInSrcBuffer,
                           long pOffsetInDstBuffer,
                           long pLengthInElements,
                           boolean pBlockingCopy)
        Copies a linear region of this OpenCl buffer into a linear region of same length of another OpenCl buffer.
        Parameters:
        pDstBuffer - destination buffer
        pOffsetInSrcBuffer - source buffer offset in elements
        pOffsetInDstBuffer - destination buffer offset in elements
        pLengthInElements - copy length in elements
        pBlockingCopy - true blocking call, false asynchronous call
      • copyTo

        public void copyTo​(ClearCLBuffer pDstBuffer,
                           long[] pOriginInSrcBuffer,
                           long[] pOriginInDstBuffer,
                           long[] pRegion,
                           boolean pBlockingCopy)
        Copies a 3D region of this OpenCl buffer into a 3D region of same dimensions of another OpenCl buffer.
        Parameters:
        pDstBuffer - destination buffer
        pOriginInSrcBuffer - source buffer origin
        pOriginInDstBuffer - destination buffer origin
        pRegion - region to copy
        pBlockingCopy - true blocking call, false asynchronous call
      • copyTo

        public void copyTo​(ClearCLImage pDstImage,
                           boolean pBlockingCopy)
        Copies this OpenCl buffer to an OpenCl image.
        Specified by:
        copyTo in interface ClearCLImageInterface
        Parameters:
        pDstImage - destination image
        pBlockingCopy - true blocking call, false asynchronous call
      • copyTo

        public void copyTo​(ClearCLImage pDstImage,
                           long pOffsetInSrcBuffer,
                           long[] pDstOrigin,
                           long[] pDstRegion,
                           boolean pBlockingCopy)
        Copies a 3D region of this OpenCl buffer into a 3D region of same dimensions of an OpenCl image.
        Parameters:
        pDstImage - destination image
        pOffsetInSrcBuffer - source buffer offset in elements
        pDstOrigin - destination origin
        pDstRegion - destination region
        pBlockingCopy - true blocking call, false asynchronous call
      • copyTo

        public void copyTo​(ClearCLHostImageBuffer pClearCLHostImage,
                           boolean pBlockingCopy)
        Copies this image into a host image.
        Parameters:
        pClearCLHostImage - host image.
        pBlockingCopy - true blocking call, false asynchronous call
      • writeTo

        public void writeTo​(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory,
                            boolean pBlockingWrite)
        Writes the contents of this OpenCl buffer into CoreMem buffer.
        Specified by:
        writeTo in interface ClearCLImageInterface
        Parameters:
        pContiguousMemory - destination CoreMem buffer
        pBlockingWrite - true blocking call, false asynchronous call
      • writeTo

        public void writeTo​(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory,
                            long pOffsetInBuffer,
                            long pLengthInBuffer,
                            boolean pBlockingWrite)
        Writes the contents of this OpenCl buffer into a linear region of a CoreMem buffer.
        Parameters:
        pContiguousMemory - destination CoreMem buffer
        pOffsetInBuffer - offset in destination buffer in elements
        pLengthInBuffer - length to write in elements
        pBlockingWrite - true blocking call, false asynchronous call
      • writeTo

        public void writeTo​(Buffer pBuffer,
                            boolean pBlockingWrite)
        Writes a NIO buffer into this OpenCl buffer.
        Specified by:
        writeTo in interface ClearCLImageInterface
        Parameters:
        pBuffer - destination NIO buffer
        pBlockingWrite - true blocking call, false asynchronous call
      • writeTo

        public void writeTo​(Buffer pBuffer,
                            long pOffsetInBuffer,
                            long pLengthInBuffer,
                            boolean pBlockingWrite)
        Writes a linear region of a NIO buffer into this OpenCl buffer.
        Parameters:
        pBuffer - destination NIO buffer
        pOffsetInBuffer - offset in destination buffer in elements
        pLengthInBuffer - length to write in elements
        pBlockingWrite - true blocking call, false asynchronous call
      • readFrom

        public void readFrom​(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory,
                             boolean pBlockingRead)
        Reads from a linear region of a CoreMem buffer into this OpenCl buffer.
        Specified by:
        readFrom in interface ClearCLImageInterface
        Parameters:
        pContiguousMemory - source NIO buffer
        pBlockingRead - true blocking call, false asynchronous call
      • readFrom

        public void readFrom​(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory,
                             long pOffsetInBuffer,
                             long pLengthInBuffer,
                             boolean pBlockingRead)
        Reads from a linear region of a CoreMem buffer into this OpenCl buffer.
        Parameters:
        pContiguousMemory - source CoreMem buffer
        pOffsetInBuffer - offset in source buffer in elements
        pLengthInBuffer - length to read in elements
        pBlockingRead - true blocking call, false asynchronous call
      • readFrom

        public void readFrom​(Buffer pBuffer,
                             boolean pBlockingRead)
        Reads from a linear region of a NIO buffer into this OpenCl buffer.
        Specified by:
        readFrom in interface ClearCLImageInterface
        Parameters:
        pBuffer - source NIO buffer
        pBlockingRead - true blocking call, false asynchronous call
      • readFrom

        public void readFrom​(Buffer pBuffer,
                             long pOffsetInBuffer,
                             long pLengthInBuffer,
                             boolean pBlockingRead)
        Reads from a linear region of a NIO buffer into this OpenCl buffer.
        Parameters:
        pBuffer - source NIO buffer
        pOffsetInBuffer - offset in source buffer in elements
        pLengthInBuffer - length to read in elements
        pBlockingRead - true blocking call, false asynchronous call
      • writeTo

        public void writeTo​(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory,
                            long[] pSourceOrigin,
                            long[] pDestinationOrigin,
                            long[] pRegion,
                            boolean pBlockingWrite)
        Writes to a 3D region of a CoreMem buffer into a 3D region of this OpenCl buffer.
        Parameters:
        pContiguousMemory - destination CoreMem buffer
        pSourceOrigin - origin in destination buffer
        pDestinationOrigin - origin in source buffer
        pRegion - region to write
        pBlockingWrite - true blocking call, false asynchronous call
      • writeTo

        public void writeTo​(Buffer pBuffer,
                            long[] pSourceOrigin,
                            long[] pDestinationOrigin,
                            long[] pRegion,
                            boolean pBlockingWrite)
        Writes to a 3D region of a NIO buffer into a 3D region of this OpenCl buffer.
        Parameters:
        pBuffer - destination NIO buffer
        pSourceOrigin - origin in source buffer
        pDestinationOrigin - origin in destination buffer
        pRegion - region to write
        pBlockingWrite - true blocking call, false asynchronous call
      • readFrom

        public void readFrom​(net.haesleinhuepf.clij.coremem.ContiguousMemoryInterface pContiguousMemory,
                             long[] pSourceOrigin,
                             long[] pDestinationOrigin,
                             long[] pRegion,
                             boolean pBlockingRead)
        Reads from a 3D region of a CoreMem buffer into a 3D region of this OpenCl buffer.
        Parameters:
        pContiguousMemory - source CoreMem buffer
        pSourceOrigin - origin in source buffer
        pDestinationOrigin - origin in destination buffer
        pRegion - region to read
        pBlockingRead - true blocking call, false asynchronous call
      • readFrom

        public void readFrom​(Buffer pBuffer,
                             long[] pSourceOrigin,
                             long[] pDestinationOrigin,
                             long[] pRegion,
                             boolean pBlockingRead)
        Reads from a 3D region of a NIO buffer into a 3D region of this OpenCl buffer.
        Parameters:
        pBuffer - source NIO buffer
        pSourceOrigin - origin in source buffer
        pDestinationOrigin - origin in destination buffer
        pRegion - region to read
        pBlockingRead - true blocking call, false asynchronous call
      • getNativeType

        public net.haesleinhuepf.clij.coremem.enums.NativeTypeEnum getNativeType()
        Returns data type.
        Specified by:
        getNativeType in interface ClearCLImageInterface
        Returns:
        data type
      • getLength

        public long getLength()
        Returns length in elements, an element is composed of potentially several channels and is certainly not equal to the size in bytes!
        Returns:
        length in elements
      • getSizeInBytes

        public long getSizeInBytes()
        Returns the size in bytes.
        Specified by:
        getSizeInBytes in interface net.haesleinhuepf.clij.coremem.interfaces.SizedInBytes
        Returns:
        size in bytes