Filled Shape RLE Conversion Using Border Scanlines
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current methods for converting complex filled shapes to Run Length Encoded (RLE) vectors are process-intensive and require excessive time, particularly for shapes with hundreds of thousands of points, exhibiting a complexity of O(n^2).
Innovation Solution
A method and system that determine a border around the shape, define pixels defining the border for creating a shape RLE group, and convert data into an RLE vector, reducing complexity from O(n^2) to O(n).
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If standard RLE conversion methods are used on complex filled shapes, then conversion accuracy is maintained, but processing time becomes excessive and complexity reaches O(n^2)
Solution Approach 1:
The patent segments the filled shape into multiple horizontal scanlines, processing each scanline independently to generate RLE vectors. This divides the complex O(n^2) problem into multiple simpler O(n) subproblems, maintaining accuracy while dramatically reducing processing time for shapes with hundreds of thousands of points.
Solution Approach 2:
The patent performs preliminary actions by first determining the bounding box of the shape, then organizing points into scanlines before conversion. This pre-processing step structures the data in a way that enables efficient single-pass RLE conversion, avoiding repeated computations that cause O(n^2) complexity.
2Loss of information
If standard conversion methods process filled shapes with hundreds of thousands of points, then complete shape data is captured, but computational complexity reaches O(n^2)
Solution Approach 1:
The patent segments the shape data into horizontal scanlines, processing each line independently. This segmentation maintains complete shape information while reducing computational complexity from O(n^2) to O(n) by avoiding redundant calculations across the entire shape for each point.
Solution Approach 2:
The patent transforms the 2D shape processing problem into a series of 1D scanline processing problems. By organizing points into horizontal rows and processing each row independently, the method reduces dimensional complexity while preserving complete shape data through systematic scanline traversal.
Data Source
Figure 1
Figure 2A
Figure 2B
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 (212) of pixel cells corresponding to a graphical array (208) of pixels (216) comprising the filled shape. The method includes determining a border (200) 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 (222) within the pixel, and creating a shape RLE group corresponding to a line of pixels (216) 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.