This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean isPermissionGranted() | |
{ | |
boolean res = false; | |
if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED | |
&& ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED | |
&& ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED | |
/*&& ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED*/) | |
{ | |
res = true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Goal: Save YUV_420_888 from Camera2 API to png file in the most efficient way [Uses ScriptIntrinsicYuvToRGB] | |
// The following currently produce black image. | |
// a quick solution will be to use bitmap. | |
private void saveRenderScript(Image newImage, Context i_Context) | |
{ | |
final Image image = newImage; | |
byte[] RGBBytes = ImageUtil.YUV_420_888_toRGBBytesIntrinsics(newImage, i_Context); |