Filled Shape Border Scanning for Fast RLE Vector Conversion
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current methods for converting filled shapes to Run Length Encoded (RLE) vectors are process-intensive, particularly for complex shapes with hundreds of thousands of points, resulting in excessive time due to O(n^2) complexity.
Innovation Solution
A method and system that create a virtual pixel array for the filled shape, determine its border, and generate RLE groups by scanning and storing pixel-type values, reducing complexity to O(n) by initiating, extending, and terminating shape RLE groups, and optionally clipping the shape with a virtual clip array to form a clipped RLE vector.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If standard RLE conversion methods are used on filled shapes, then conversion accuracy is maintained, but processing time becomes excessive due to O(n^2) complexity
Solution Approach 1:
The filled shape is segmented into border lines and border line elements, which are then processed to generate RLE groups. This segmentation approach reduces the complexity from O(n^2) to O(n) by breaking down the conversion process into manageable components that can be processed more efficiently.
Solution Approach 2:
The border of the filled shape is extracted and processed separately to generate the RLE vector. By focusing only on the border elements rather than all pixels, the conversion process achieves O(n) complexity while maintaining accuracy, as the border contains all necessary information to reconstruct the shape.
2Loss of information
If complex filled shapes with hundreds of thousands of points are converted using current methods, then complete shape representation is achieved, but processing complexity remains O(n^2)
Solution Approach 1:
The shape is divided into border lines composed of border line elements, each corresponding to a single pixel. This segmentation allows the system to process only the essential boundary information rather than all interior pixels, reducing processing complexity to O(n) while preserving complete shape representation.
Solution Approach 2:
A virtual pixel array is created as a simplified representation of the filled shape, where only border pixels are marked. This virtual copy contains all necessary shape information in a compact form that can be processed efficiently to generate RLE vectors without requiring O(n^2) operations.
3Area of stationary object
If clipping is applied to filled shapes before conversion, then display region optimization is achieved, but additional processing steps are required
Solution Approach 1:
The filled shape is clipped to the display region before the RLE conversion process begins. By performing this clipping operation in advance, the subsequent conversion only needs to process the visible portion of the shape, optimizing the display region without adding significant complexity to the overall workflow.
Data Source
AI summary
A method and system for converting a filled shape to a run length encoded RLE vector is disclosed. The method includes creating a virtual pixel array of pixel cells corresponding to a graphical array of pixels comprising the filled shape. The method includes determining a border on the virtual pixel array corresponding to the filled shape, storing a pixel-type value within each pixel cell that corresponds to a border line element within the pixel, and creating a shape RLE group corresponding to a line of pixels aligned along a first axis of the virtual pixel array. Once created, the position and length of the shape RLE group is stored as an RLE vector. The method for clipping filled shapes is also disclosed, which includes converting a clipping region to a clip RLE group, then comparing the clip RLE group to the shape RLE group, forming a clipped image RLE vector.


