Skip to content

sort_contours_xldSortContoursXldSortContoursXldsort_contours_xldsort_contours_xld🔗

Short description🔗

sort_contours_xldSortContoursXldSortContoursXldsort_contours_xldsort_contours_xld — Sort contours with respect to their relative position.

Signature🔗

sort_contours_xld( xld_cont Contours, out xld_cont SortedContours, string SortMode, string Order, string RowOrCol )void SortContoursXld( const HObject& Contours, HObject* SortedContours, const HTuple& SortMode, const HTuple& Order, const HTuple& RowOrCol )static void HOperatorSet.SortContoursXld( HObject contours, out HObject sortedContours, HTuple sortMode, HTuple order, HTuple rowOrCol )def sort_contours_xld( contours: HObject, sort_mode: str, order: str, row_or_col: str ) -> HObject

Herror sort_contours_xld( const Hobject Contours, Hobject* SortedContours, const char* SortMode, const char* Order, const char* RowOrCol )

Herror T_sort_contours_xld( const Hobject Contours, Hobject* SortedContours, const Htuple SortMode, const Htuple Order, const Htuple RowOrCol )

HXLDCont HXLDCont::SortContoursXld( const HString& SortMode, const HString& Order, const HString& RowOrCol ) const

HXLDCont HXLDCont::SortContoursXld( const char* SortMode, const char* Order, const char* RowOrCol ) const

HXLDCont HXLDCont::SortContoursXld( const wchar_t* SortMode, const wchar_t* Order, const wchar_t* RowOrCol ) const (Windows only)

HXLDCont HXLDCont.SortContoursXld( string sortMode, string order, string rowOrCol )

Description🔗

The operator sort_contours_xldSortContoursXld sorts the contours with respect to their relative position. RowOrColrowOrColrow_or_col specifies the sorting criteria: 'row'"row" sorts the contours with respect to the row coordinate of their position first and, if the row coordinates are identical, with respect to the column coordinate. In contrast, 'column'"column" sorts contours according to the column coordinate first. SortModesortModesort_mode defines the position of a contour by individual reference points. The following parameter values are available:

  • 'upper_left'"upper_left": The position is determined by the upper left corner of the surrounding rectangle.

  • 'upper_right'"upper_right": The position is determined by the upper right corner of the surrounding rectangle.

  • 'lower_left'"lower_left": The position is determined by the lower left corner of the surrounding rectangle.

  • 'lower_right'"lower_right": The position is determined by the lower right corner of the surrounding rectangle.

  • 'character'"character": The position is determined by the upper left corner of the surrounding rectangle. In contrast to 'upper_left'"upper_left", the contours are also sorted according to the remaining coordinate, if they overlap in the direction of the coordinate which is specified by the parameter RowOrColrowOrColrow_or_col.

The parameter Orderorderorder determines whether the sorting order is increasing or decreasing: using 'true'"true" the order will be increasing, using 'false'"false" the order will be decreasing.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Contourscontourscontours (input_object) xld_cont-array → objectHObjectHXLDContHObjectHobject

Contours to be sorted.

SortedContourssortedContourssorted_contours (output_object) xld_cont-array → objectHObjectHXLDContHObjectHobject *

Sorted contours.

SortModesortModesort_mode (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Kind of sorting.

Default: 'upper_left'"upper_left"
List of values: 'character', 'lower_left', 'lower_right', 'upper_left', 'upper_right'"character", "lower_left", "lower_right", "upper_left", "upper_right"

Orderorderorder (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Increasing or decreasing sorting order.

Default: 'true'"true"
List of values: 'false', 'true'"false", "true"

RowOrColrowOrColrow_or_col (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Sorting first with respect to row, then to column.

Default: 'row'"row"
List of values: 'column', 'row'"column", "row"

Result🔗

If the parameters are correct, the operator sort_contours_xldSortContoursXld returns the value 2 (H_MSG_TRUE). Otherwise an exception will be raised.

Combinations with other operators🔗

Combinations

See also

sort_regionSortRegion

Module🔗

Foundation