fromValue static method

PixelFormat fromValue(
  1. int value
)

Creates an enumeration value from int. param value The int value. return The created PixelFormat.

Implementation

static PixelFormat fromValue(int value) {
    	switch (value) {
      	case 0:
        	return PixelFormat.undefined;
      	case 10:
        	return PixelFormat.grayscale8Bits;
      	case 20:
        	return PixelFormat.grayscale16Bits;
      	case 25:
        	return PixelFormat.grayscaleFloat;
      	case 30:
        	return PixelFormat.bgr24Bits;
      	case 31:
        	return PixelFormat.rgb24Bits;
      	case 32:
        	return PixelFormat.bgra;
      	case 33:
        	return PixelFormat.rgba;
      	case 40:
        	return PixelFormat.nv12;
      	case 41:
        	return PixelFormat.i420;
      	case 42:
        	return PixelFormat.yuy2;
      	case 43:
        	return PixelFormat.yv12;
    default:
        	throw Exception("Unable to find the specified enum value for $value");
    	}
  	}