Class MatrixUtils
- java.lang.Object
-
- net.haesleinhuepf.clij.clearcl.util.MatrixUtils
-
public class MatrixUtils extends Object
- Author:
- royer
-
-
Constructor Summary
Constructors Constructor Description MatrixUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static float[]matrixToArray(Matrix4f pMatrix)Converts Matrix4f into an array that can be sent to an OpenCL kernel as a float16.static ClearCLBuffermatrixToBuffer(ClearCLContext pContext, ClearCLBuffer pClearCLBuffer, Matrix4f pMatrix)Allocates an ClearCL buffer and copies the contents of a Matrix4f to it.
-
-
-
Method Detail
-
matrixToArray
public static final float[] matrixToArray(Matrix4f pMatrix)
Converts Matrix4f into an array that can be sent to an OpenCL kernel as a float16.- Parameters:
pMatrix- matrix to convert- Returns:
- array of 16 floats representing 4x4 matrix
-
matrixToBuffer
public static ClearCLBuffer matrixToBuffer(ClearCLContext pContext, ClearCLBuffer pClearCLBuffer, Matrix4f pMatrix)
Allocates an ClearCL buffer and copies the contents of a Matrix4f to it. the buffer is newly allocated if it is not the case already or if it is of the wrong size.- Parameters:
pContext- clearcl contextpClearCLBuffer- bufferpMatrix- matrix- Returns:
- buffer
-
-