我无法在Camera2中将ImageReader
检索到的图像ImageReader.OnImageAvailableListener
进行缩放,而不会损失图像质量。
private final ImageReader.OnImageAvailableListener mOnImageAvailableListener = new ImageReader.OnImageAvailableListener() {
@Override
public void onImageAvailable(ImageReader reader) {
Log.d(TAG, "onImageAvailable: called.");
if (!mIsImageAvailable) {
mCapturedImage = reader.acquireLatestImage();
Log.d(TAG, "onImageAvailable: captured image width: " + mCapturedImage.getWidth());
Log.d(TAG, "onImageAvailable: captured image height: " + mCapturedImage.getHeight());
mIsImageAvailable=true;
final Activity activity = getActivity();
if (activity != null) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
Glide.with(activity).load(mCapturedImage).into(ivStillShot);
showStillShotContainer();
}
});
}
}
}
};
我想在Camera2中将ImageReader
检索到的图像放大ImageReader.OnImageAvailableListener
,而又不损失图像质量。