mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-27 21:02:35 +00:00
port block pair
This commit is contained in:
@@ -14,24 +14,24 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.zxing.qrcode.encoder;
|
pub struct BlockPair {
|
||||||
|
data_bytes: Vec<u8>,
|
||||||
final class BlockPair {
|
error_correction_bytes: Vec<u8>,
|
||||||
|
}
|
||||||
private final byte[] dataBytes;
|
|
||||||
private final byte[] errorCorrectionBytes;
|
impl BlockPair {
|
||||||
|
pub fn new(data: Vec<u8>, error_correction: Vec<u8>) -> Self {
|
||||||
BlockPair(byte[] data, byte[] errorCorrection) {
|
Self {
|
||||||
dataBytes = data;
|
data_bytes: data,
|
||||||
errorCorrectionBytes = errorCorrection;
|
error_correction_bytes: error_correction,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public byte[] getDataBytes() {
|
|
||||||
return dataBytes;
|
pub fn getDataBytes(&self) -> &[u8] {
|
||||||
}
|
&self.data_bytes
|
||||||
|
}
|
||||||
public byte[] getErrorCorrectionBytes() {
|
|
||||||
return errorCorrectionBytes;
|
pub fn getErrorCorrectionBytes(&self) -> &[u8] {
|
||||||
}
|
&self.error_correction_bytes
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
mod qr_code;
|
mod qr_code;
|
||||||
mod byte_matrix;
|
mod byte_matrix;
|
||||||
|
mod block_pair;
|
||||||
|
|
||||||
pub use qr_code::*;
|
pub use qr_code::*;
|
||||||
pub use byte_matrix::*;
|
pub use byte_matrix::*;
|
||||||
|
pub use block_pair::*;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod QRCodeTestCase;
|
mod QRCodeTestCase;
|
||||||
|
|||||||
Reference in New Issue
Block a user