This question has answer in C++. Is there any way to do the same or to invoke the code from Java/Android side?
Combining two YV12 image buffers into a single side-by-side image
What is this code analogues in java/kotlin?
BYTE* source = buffer;
BYTE* destination = convertBuffer3D;
This memcpy function ( taken from c++ reference memcopy ) has any analogues?
void * memcpy ( void * destination, const void * source, size_t num );
Why you dont use the one of the Java array copy, the System.arraycopy
or the class method java.util.Arrays.copyOf
.
byte[] source_arr = {0,1,2};
byte[] dest_arr = Arrays.copyOf(source_arr , source_arr.length);
arraycopy
u can use the arraycopy. see oracle docs arraycopy
public static void arraycopy(Object src,
int srcPos,
Object dest,
int destPos,
int length)
since java have no unsigned char
or c++ byte
data type like. the only way i know to achieve similar data type (BYTE
) c++ like is by downcasting integer type to byte:
int var = 128;
byte _BYTE = (byte)128;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With