/*
 * This is one of the header files of Dynamsoft Capture Vision SDK - Document Normalizer module.
 *
 * Copyright © Dynamsoft Corporation. All rights reserved.
 */

#import <DynamsoftCaptureVisionBundle/DSIntermediateResultUnit.h>

@class DSLineSegment;

NS_ASSUME_NONNULL_BEGIN

/**
 * The DSLogicLinesUnit class represents an intermediate result unit containing logic lines.
 * It inherits from the DSIntermediateResultUnit class.
 */
NS_SWIFT_NAME(LogicLinesUnit)
@interface DSLogicLinesUnit : DSIntermediateResultUnit
/**
 * Gets the number of logic lines in the unit.
 *
 * @return Returns the number of logic lines in the unit.
 */
- (NSInteger)getCount;

/**
 * Gets a logic line at the specified index.
 *
 * @param index The index of the logic line.
 * @return Returns a pointer to the DSLineSegment object at the specified index.
 */
- (nullable DSLineSegment *)getLogicLine:(NSInteger)index;

/**
 * Get an array of LineSegment as the logic lines.
 *
 * @return Returns an array of LineSegment as the long lines.
 */
- (nullable NSArray<DSLineSegment *> *)getLogicLines;

/**
 * Removes all logic lines.
 */
- (void)removeAllLogicLines;

/**
 * Removes the logic line at the specified index.
 *
 * @param index The index of the logic line to remove.
 * @return Returns 0 if successful, otherwise returns a negative value.
 */
- (NSInteger)removeLogicLine:(NSInteger)index;

/**
 * Adds a logic line.
 *
 * @param logicLine The logic line to add.
 * @param matrixToOriginalImage The matrix to the original image (3x3 matrix).
 * @return Returns 0 if successful, otherwise returns a negative value.
 */
- (NSInteger)addLogicLine:(DSLineSegment *)logicLine matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;

/**
 * Sets the logic line at the specified index.
 *
 * @param index The index of the logic line to set.
 * @param logicLine The logic line to set.
 * @param matrixToOriginalImage The matrix to the original image (3x3 matrix).
 * @return Returns 0 if successful, otherwise returns a negative value.
 */
- (NSInteger)setLogicLine:(NSInteger)index logicLine:(DSLineSegment *)logicLine matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;
@end

NS_ASSUME_NONNULL_END
