public class CameraImageUtils
Util methods to process Camera images
public static CameraImageUtils INSTANCE
Util methods to process Camera images
@JvmStatic
@Nullable
public static kotlin.Array[] imageToJpegByteArray(@NotNull
androidx.camera.core.ImageProxy image)
android.media.Image to JPEG byte array.
@JvmStatic
@NotNull
public static kotlin.Array[] cropByteArray(@NotNull
kotlin.Array[] data,
@Nullable
android.graphics.Rect cropRect)
Crops byte array with given android.graphics.Rect.
public boolean isAspectRatioValid(@Nullable
android.util.Rational aspectRatio)
True if the given aspect ratio is meaningful.
public boolean isAspectRatioValid(@NotNull
android.util.Size sourceSize,
@Nullable
android.util.Rational aspectRatio)
True if the given aspect ratio is meaningful and has effect on the given size.
@JvmStatic
@Nullable
public static android.graphics.Rect computeCropRectFromAspectRatio(@NotNull
android.util.Size sourceSize,
@NotNull
android.util.Rational aspectRatio)
Calculates crop rect with the specified aspect ratio on the given size. Assuming the rect is at the center of the source.
@JvmStatic
@NotNull
public static android.util.Rational rotate(@NotNull
android.util.Rational rational,
int rotation)
Rotate rational by rotation value, which inverse it if the degree is 90 or 270.
rational - Rational to be rotated.rotation - Rotation value being applied.@JvmStatic
@NotNull
public static kotlin.Array[] bitmapToNv21(@NotNull
android.graphics.Bitmap src,
int width,
int height)
Converts Android Bitmap image to NV21 format