edu.dhbw.andar.util
Class GraphicsUtil
java.lang.Object
edu.dhbw.andar.util.GraphicsUtil
public class GraphicsUtil
- extends java.lang.Object
Method Summary |
static boolean |
containsSize(java.util.List<Size> sizes,
Size size)
|
static Size |
getOptimalPreviewSize(java.util.List<Size> sizes,
int screenWidth,
int screenHeight)
Get the optimal preview size for the given screen size. |
static Size |
getSmallestSize(java.util.List<Size> sizes)
|
static java.nio.ByteBuffer |
makeByteBuffer(byte[] arr)
Make a direct NIO ByteBuffer from an array of floats |
static java.nio.ByteBuffer |
makeByteBuffer(int size)
|
static java.nio.FloatBuffer |
makeFloatBuffer(float[] arr)
Make a direct NIO FloatBuffer from an array of floats |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GraphicsUtil
public GraphicsUtil()
makeFloatBuffer
public static java.nio.FloatBuffer makeFloatBuffer(float[] arr)
- Make a direct NIO FloatBuffer from an array of floats
- Parameters:
arr
- The array
- Returns:
- The newly created FloatBuffer
makeByteBuffer
public static java.nio.ByteBuffer makeByteBuffer(byte[] arr)
- Make a direct NIO ByteBuffer from an array of floats
- Parameters:
arr
- The array
- Returns:
- The newly created FloatBuffer
makeByteBuffer
public static java.nio.ByteBuffer makeByteBuffer(int size)
getOptimalPreviewSize
public static Size getOptimalPreviewSize(java.util.List<Size> sizes,
int screenWidth,
int screenHeight)
- Get the optimal preview size for the given screen size.
- Parameters:
sizes
- screenWidth
- screenHeight
-
- Returns:
containsSize
public static boolean containsSize(java.util.List<Size> sizes,
Size size)
getSmallestSize
public static Size getSmallestSize(java.util.List<Size> sizes)