Struct rxing::oned::Code39Writer
source · pub struct Code39Writer;Expand description
This object renders a CODE39 code as a {@link BitMatrix}.
@author erik.barbara@gmail.com (Erik Barbara)
Trait Implementations§
source§impl Default for Code39Writer
impl Default for Code39Writer
source§fn default() -> Code39Writer
fn default() -> Code39Writer
Returns the “default value” for a type. Read more
source§impl OneDimensionalCodeWriter for Code39Writer
impl OneDimensionalCodeWriter for Code39Writer
source§fn encode_oned(&self, contents: &str) -> Result<Vec<bool>>
fn encode_oned(&self, contents: &str) -> Result<Vec<bool>>
Encode the contents to boolean array expression of one-dimensional barcode.
Start code and end code should be included in result, and side margins should not be included. Read more
fn getSupportedWriteFormats(&self) -> Option<Vec<BarcodeFormat>>
source§fn encode_oned_with_hints(
&self,
contents: &str,
_hints: &EncodingHintDictionary
) -> Result<Vec<bool>>
fn encode_oned_with_hints( &self, contents: &str, _hints: &EncodingHintDictionary ) -> Result<Vec<bool>>
Can be overwritten if the encode requires to read the hints map. Otherwise it defaults to {@code encode}.
@param contents barcode contents to encode
@param hints encoding hints
@return a {@code boolean[]} of horizontal pixels (false = white, true = black)
source§fn renderRXingResult(
code: &[bool],
width: i32,
height: i32,
sidesMargin: u32
) -> Result<BitMatrix>
fn renderRXingResult( code: &[bool], width: i32, height: i32, sidesMargin: u32 ) -> Result<BitMatrix>
@return a byte array of horizontal pixels (0 = white, 1 = black)
source§fn checkNumeric(contents: &str) -> Result<()>
fn checkNumeric(contents: &str) -> Result<()>
@param contents string to check for numeric characters
@throws IllegalArgumentException if input contains characters other than digits 0-9.
source§fn appendPattern<T: TryInto<usize> + Copy>(
target: &mut [bool],
pos: usize,
pattern: &[T],
startColor: bool
) -> u32
fn appendPattern<T: TryInto<usize> + Copy>( target: &mut [bool], pos: usize, pattern: &[T], startColor: bool ) -> u32
@param target encode black/white pattern into this array
@param pos position to start encoding at in {@code target}
@param pattern lengths of black/white runs to encode
@param startColor starting color - false for white, true for black
@return the number of elements added to target.
fn getDefaultMargin(&self) -> u32
source§impl Writer for Code39Writer
impl Writer for Code39Writer
source§fn encode(
&self,
contents: &str,
format: &BarcodeFormat,
width: i32,
height: i32
) -> Result<BitMatrix, Exceptions>
fn encode( &self, contents: &str, format: &BarcodeFormat, width: i32, height: i32 ) -> Result<BitMatrix, Exceptions>
Encode a barcode using the default settings. Read more
source§fn encode_with_hints(
&self,
contents: &str,
format: &BarcodeFormat,
width: i32,
height: i32,
hints: &EncodingHintDictionary
) -> Result<BitMatrix, Exceptions>
fn encode_with_hints( &self, contents: &str, format: &BarcodeFormat, width: i32, height: i32, hints: &EncodingHintDictionary ) -> Result<BitMatrix, Exceptions>
@param contents The contents to encode in the barcode
@param format The barcode format to generate
@param width The preferred width in pixels
@param height The preferred height in pixels
@param hints Additional parameters to supply to the encoder
@return {@link BitMatrix} representing encoded barcode image
@throws WriterException if contents cannot be encoded legally in a format
Auto Trait Implementations§
impl RefUnwindSafe for Code39Writer
impl Send for Code39Writer
impl Sync for Code39Writer
impl Unpin for Code39Writer
impl UnwindSafe for Code39Writer
Blanket Implementations§
§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
§impl<T> ConvUtil for T
impl<T> ConvUtil for T
§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.§impl<Src> TryFrom<Src> for Src
impl<Src> TryFrom<Src> for Src
§impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
§impl<Src> ValueFrom<Src> for Src
impl<Src> ValueFrom<Src> for Src
§fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
Convert the given value into an exactly equivalent representation.