1- __version__ = "11.2.50.6511 "
1+ __version__ = "11.4.10.6625 "
22
33if __package__ or "." in __name__ :
44 from .core import *
@@ -672,6 +672,48 @@ def __init__(self, rows: int = -1, columns: int = -1, layer_number: int = -1):
672672
673673
674674_DynamsoftBarcodeReader .CAztecDetails_register (AztecDetails )
675+ class ECISegment :
676+ """
677+ Represents the Extended Channel Interpretation (ECI) information within a barcode.
678+
679+ Attributes:
680+ eci_value (int): ECI assignment number as defined by ISO/IEC 15424.
681+ charset_encoding (str): Charset encoding name defined by IANA (e.g. "UTF-8", "ISO-8859-1").
682+ start_index (int): Start index of this ECI segment in the decoded barcode bytes.
683+ length (int): Length (in bytes) of this segment within the decoded barcode bytes.
684+ """
685+ _thisown = property (
686+ lambda x : x .this .own (), lambda x , v : x .this .own (v ), doc = "The membership flag"
687+ )
688+ eci_value : int = property (
689+ _DynamsoftBarcodeReader .CECISegment_eciValue_get ,
690+ _DynamsoftBarcodeReader .CECISegment_eciValue_set ,
691+ doc = "ECI assignment number as defined by ISO/IEC 15424." ,
692+ )
693+ charset_encoding : str = property (
694+ _DynamsoftBarcodeReader .CECISegment_charsetEncoding_get ,
695+ _DynamsoftBarcodeReader .CECISegment_charsetEncoding_set ,
696+ doc = "Charset encoding name defined by IANA (e.g. \" UTF-8\" , \" ISO-8859-1\" )." ,
697+ )
698+ start_index : int = property (
699+ _DynamsoftBarcodeReader .CECISegment_startIndex_get ,
700+ _DynamsoftBarcodeReader .CECISegment_startIndex_set ,
701+ doc = "Start index of this ECI segment in the decoded barcode bytes." ,
702+ )
703+ length : int = property (
704+ _DynamsoftBarcodeReader .CECISegment_length_get ,
705+ _DynamsoftBarcodeReader .CECISegment_length_set ,
706+ doc = "Length (in bytes) of this segment within the decoded barcode bytes." ,
707+ )
708+ def __init__ (self ):
709+ _DynamsoftBarcodeReader .Class_init (
710+ self , _DynamsoftBarcodeReader .new_CECISegment ()
711+ )
712+
713+ __destroy__ = _DynamsoftBarcodeReader .delete_CECISegment
714+
715+
716+ _DynamsoftBarcodeReader .CECISegment_register (ECISegment )
675717
676718class BarcodeResultItem (CapturedResultItem ):
677719 """
@@ -689,6 +731,8 @@ class BarcodeResultItem(CapturedResultItem):
689731 get_details(self) -> BarcodeDetails: Gets the details of the decoded barcode result.
690732 is_dpm(self) -> bool: Gets whether the decoded barcode is a DPM code.
691733 is_mirrored(self) -> bool: Gets whether the decoded barcode is mirrored.
734+ get_eci_segments_count(self) -> int: Gets the number of ECI segments in the barcode.
735+ get_eci_segment(self, index: int) -> ECISegment: Gets the ECI segment at the specified index.
692736 """
693737 _thisown = property (
694738 lambda x : x .this .own (), lambda x , v : x .this .own (v ), doc = "The membership flag"
@@ -796,7 +840,41 @@ def is_mirrored(self) -> bool:
796840 """
797841 return _DynamsoftBarcodeReader .CBarcodeResultItem_IsMirrored (self )
798842
843+ def get_eci_segments_count (self ) -> int :
844+ """
845+ Gets the number of ECI segments in the barcode.
846+
847+ Returns:
848+ The count of ECI segments. Returns 0 if no ECI information is present.
849+ """
850+ return _DynamsoftBarcodeReader .CBarcodeResultItem_GetECISegmentsCount (self )
851+
852+ def get_eci_segment (self , index : int ) -> ECISegment :
853+ """
854+ Gets the ECI segment at the specified index.
855+
856+ Args:
857+ index: The zero-based index of the ECI segment to retrieve.
799858
859+ Returns:
860+ An ECISegment object, or None if the index is out of range.
861+ """
862+ return _DynamsoftBarcodeReader .CBarcodeResultItem_GetECISegment (self , index )
863+
864+ def get_eci_segments (self ) -> List [ECISegment ]:
865+ """
866+ Gets all the ECI segments in the barcode.
867+
868+ Returns:
869+ A list of ECISegment objects.
870+ """
871+ count = self .get_eci_segments_count ()
872+ result = []
873+ for i in range (count ):
874+ eci = self .get_eci_segment (i )
875+ if eci is not None :
876+ result .append (eci )
877+ return result
800878_DynamsoftBarcodeReader .CBarcodeResultItem_register (BarcodeResultItem )
801879
802880class DecodedBarcodesResult (CapturedResultBase ):
@@ -923,8 +1001,42 @@ def set_confidence(self, confidence: int) -> None:
9231001 def set_location (self , location : Quadrilateral ) -> int :
9241002 return _DynamsoftBarcodeReader .CDecodedBarcodeElement_SetLocation (self , location )
9251003
1004+ def get_eci_segments_count (self ) -> int :
1005+ """
1006+ Gets the number of ECI segments in the barcode.
1007+
1008+ Returns:
1009+ The count of ECI segments. Returns 0 if no ECI information is present.
1010+ """
1011+ return _DynamsoftBarcodeReader .CDecodedBarcodeElement_GetECISegmentsCount (self )
1012+
1013+ def get_eci_segment (self , index : int ) -> ECISegment :
1014+ """
1015+ Gets the ECI segment at the specified index.
1016+
1017+ Args:
1018+ index(int): The zero-based index of the ECI segment to retrieve.
1019+
1020+ Returns:
1021+ An ECISegment object, or None if the index is out of range.
1022+ """
1023+ return _DynamsoftBarcodeReader .CDecodedBarcodeElement_GetECISegment (self , index )
1024+
1025+ def get_eci_segments (self ) -> List [ECISegment ]:
1026+ """
1027+ Gets all the ECI segments in the barcode.
1028+
1029+ Returns:
1030+ A list of ECISegment objects.
1031+ """
1032+ count = self .get_eci_segments_count ()
1033+ result = []
1034+ for i in range (count ):
1035+ eci = self .get_eci_segment (i )
1036+ if eci is not None :
1037+ result .append (eci )
1038+ return result
9261039
927- # Register CDecodedBarcodeElement in _DynamsoftBarcodeReader:
9281040_DynamsoftBarcodeReader .CDecodedBarcodeElement_register (DecodedBarcodeElement )
9291041class ExtendedBarcodeResult (DecodedBarcodeElement ):
9301042 _thisown = property (lambda x : x .this .own (), lambda x , v : x .this .own (v ), doc = "The membership flag" )
0 commit comments