Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the recitation of an element by the phrase "comprising an … …" does not exclude the presence of additional like elements in the process, method, article, or apparatus that comprises the element, and further, where similarly-named elements, features, or elements in different embodiments of the disclosure may have the same meaning, or may have different meanings, that particular meaning should be determined by their interpretation in the embodiment or further by context with the embodiment.
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It should be noted that, the method for processing the screen image of the curve angle is applied to the curve angle screen assembly, the center of the curve is used as the origin of the coordinate system, the curve arc of the curve angle can be placed in the first quadrant of the plane coordinate system for convenience of illustration, and the pixel grid intersected with the curve arc is the target pixel grid, but the application is not limited to performing similar processing in other quadrants.
It will be appreciated that on a cut line of a curved arc, there will be two intersections per row or column for the target pixel grid to be cut on an elliptical screen. Alternatively, in each row of the target pixel cell of the first quadrant, the first intersection point may be an upper intersection point, and the second intersection point may be a lower intersection point. Similarly, in each column of the target pixel grid of the first quadrant, the first intersection point may be a left intersection point, and the second intersection point may be a right intersection point.
The curve can be a rounded corner curve, an elliptic curve, a perfect curve, a Fermat curve and other various curve types which conform to the definition of a mathematical function. For convenience of explaining the technical solution of the present application, the following embodiments are explained and illustrated based on a convex elliptic curve angle screen as an example, and each row of target pixel cells in an elliptic cutting line of a first quadrant is taken as a calculation object. For concave curve screens, other types of curves, or calculation targets of each column of target pixel grids, the following processing scheme principles of the embodiments may be referred to. In other embodiments, the processing idea of the present application can also be applied to other quadrants and to each column of the target pixel grid as the processing object. It is within the scope of the present application to refer to the following embodiments and to make simple adjustments or changes to the corresponding technical solutions.
Based on the mathematical principle, an elliptical arc corresponds to an ellipse, i.e. the major and minor axes and the center of the ellipse can be determined from the elliptical arc, and therefore, based on the elliptical arc cut line, the major and minor axes and the center of the ellipse in which the elliptical arc cut line is located can be determined. Wherein, the central coordinate is the coordinate of the ellipse center where the ellipse arc cutting line is positioned. The oval arc cutting line is the contour line of the oval fillet of the display screen, is located at the oval arc edge of the display screen and is used for defining the oval arc edge of the display area of the display screen. Before chamfering or grooving the display screen, the shape of the cutting line can be designed in advance, and if the chamfering is required to be an elliptic arc-shaped chamfering or grooving is required to be an elliptic arc-shaped, the used elliptic arc-shaped cutting line can be designed.
First embodiment
The application firstly provides a screen image processing method of a curve angle.
In one embodiment, the method for processing the screen image includes the steps of, with a center of a curve as an origin of a coordinate system, placing a curve arc of a curve angle in a plane coordinate system, and with a pixel cell intersected with the curve arc as a target pixel cell:
in response to the first intersection point coordinate and the second intersection point coordinate of the acquired curve arc and each row or each column of target pixel grids, calculating the gray coefficient of each target pixel grid according to the first intersection point coordinate and the second intersection point coordinate of each row or each column of target pixel grids; and processing the image data according to the gray coefficient of the target pixel grid.
FIG. 1 is a diagram of an elliptical corner screen and an edge pixel grid according to an embodiment of the present application.
Referring to fig. 1, in an embodiment, the o point is a coordinate system origin, x and y correspond to an x axis and a y axis of a plane coordinate axis, respectively, and a first quadrant includes a plurality of pixel grids with equal size in a coordinate system formed by the origin o, the x axis and the y axis. The method selects an elliptical fillet with a major axis of 16 pixel units and a minor axis of 11 pixel units as an example, the elliptical fillet is placed in a first quadrant, the center of the ellipse is coincided with a point o, and an elliptical arc r placed in the elliptical fillet of the first quadrant is obtained. The area formed by the elliptic arc r and the coordinate axis in the first quadrant is the light-emitting area of the screen, and the pixel grid intersected with the elliptic arc r is the target pixel grid and represents the cutting edge. In other embodiments, the ellipse angles may be placed in other quadrants as well.
With continued reference to fig. 1, in an embodiment, a1, a2, a3, a4, a5, a6, a7, b1, b2, b3, b4, c1, c2, d1, d2, d3, e1, e2, f1, f2, g1, h1, h2, i1, j1, and k1 are target pixels.
It is to be understood that, when each line of the target pixel grid is the processing object, the upper intersection point coordinates and the lower intersection point coordinates may be selected. When each column of target pixel grids is taken as a processing object, the right intersection point coordinate and the left intersection point coordinate can be selected.
Fig. 2 is a flowchart of a screen image processing method according to a first embodiment of the present application.
Referring to fig. 2, an exemplary screen image processing method includes:
s10: responsive to acquiring the upper and lower intersection abscissa coordinates of the curved arc and each row of the target pixel grid.
And calculating the horizontal axis coordinate of the upper intersection point and the horizontal axis coordinate of the lower intersection point of each line of target pixel grids according to a formula of a curve equation.
S20: and calculating the gray coefficient of each target pixel grid according to the upper intersection point horizontal axis coordinate and the lower intersection point horizontal axis coordinate of each line of target pixel grid.
The gamma, which may also be called a gradient coefficient, may be the ratio of the area of each target pixel grid that is not cut to the total area. The degree of color gradient after the target pixel grid, namely the image is cut can be clearly represented. The ratio of the uncut area to the total area in each pixel grid can be calculated by the upper intersection point horizontal axis coordinate and the lower intersection point horizontal axis coordinate of the intersection of the arc line of the curve and each row of target pixel grids.
S30: and processing the image data according to the gray coefficient of the target pixel grid.
The display brightness of each pixel grid on the screen is adjusted and controlled by the magnitude of the driving current, and the driving current is the current output to each pixel grid by the driving component of the pixel grid. At the edge of the screen, in order to smooth the brightness and eliminate the color cast phenomenon, each edge pixel grid respectively corresponds to a gray coefficient for optimizing the brightness. Generally, the gray scale factor for optimizing luminance is different when the area ratio is different.
In the embodiment, the gray coefficient of each target pixel grid is calculated through the first intersection point coordinate and the second intersection point coordinate of the target pixel grid, so that the gray coefficient of each target pixel grid can be quickly obtained, the phenomena of sawtooth and color cast generated after curve angle cutting are eliminated, and the purpose of saving cost is achieved.
In an embodiment, the step of calculating the gamma of each target pixel cell according to the first intersection point coordinate and the second intersection point coordinate of each row or each column of the target pixel cell may include:
performing straight line connection from a first intersection point to a second intersection point of each row or each column of target pixel grid area to obtain a fitting line segment; calculating a first area of each pixel grid which is not cut by the fitted line segment; and calculating the ratio of the first area to the total area of each pixel grid to obtain the gray coefficient of the target pixel grid.
FIG. 3 is a flowchart illustrating a method for calculating a gamma of a target pixel grid according to the embodiment of FIG. 2.
Referring to fig. 3, the screen image processing method illustratively executes S20: the step of calculating the gray coefficient of each target pixel grid according to the upper intersection point horizontal axis coordinate and the lower intersection point horizontal axis coordinate of each line of target pixel grids comprises the following steps:
s21: and (3) performing linear connection from the upper intersection point to the lower intersection point of each line of target pixel grid area to obtain a fitting line segment.
S22: a first area of each pixel grid not cut by the fitted line segment is calculated.
S23: and calculating the ratio of the first area to the total area of each pixel grid to obtain the gray coefficient of the target pixel grid.
Referring to fig. 1, in an embodiment, the upper intersection point B of the first row of target pixel cells a 1-a 7 is connected to the lower intersection point a by a straight line to obtain a fitting line segment AB. The lower left corner of the target pixel grid area in the first row is point C. And forming a triangle ABC by the fitting line segment AB and the target pixel grid area on the side close to the origin of coordinates, and calculating the first area of the triangle ABC not cut in each target pixel grid. Exemplarily, in the target pixel cell a7, assuming that the side length of each pixel cell is 1, the first area which is not cut can be calculated to be 0.033 in combination with the similar property of the triangle, and since the total area of each pixel cell is 1, the gamma of the target pixel cell a7 is 0.033. According to the similarity principle of triangles, the gray coefficients of the target pixel grids from a1 to a6 can be calculated.
In this embodiment, the side length of each target pixel grid is set to 1, but the side length of the target pixel grid is not limited to 1 unit, and may be 2 units, 3 units, or other random values greater than 0, and at this time, the total area of each target pixel grid may be calculated according to a square area formula. As can be understood, for a convex curve, the area that is not cut is on the side of the parting line near the origin of the coordinate system; and for the concave curve, the area which is not cut is positioned at the side of the parting line far away from the origin of the coordinate system.
FIG. 4 is a schematic diagram illustrating a first area of each target pixel cell calculated according to the embodiment of FIG. 3.
Referring to fig. 4, in an embodiment, the screen image processing method performs step S22: the step of calculating the first area of each pixel cell not cut by the fitted line segment includes a plurality of combination cases. In the target pixel grid of the nth row, the side length of each pixel grid region is set to be 1, wherein N is a positive integer.
Referring to combination 1 in fig. 4, when the horizontal axis coordinates of the upper intersection point and the lower intersection point of the curved arc and the nth row are both integers, the uncut first area of each target pixel grid in the nth row is calculated according to the similarity of the triangles.
Referring to combination 2 in fig. 4, when the horizontal axis coordinate of the upper intersection point of the curve arc and the nth row is an integer and the horizontal axis coordinate of the lower intersection point is not an integer, a decimal part of the horizontal axis coordinate of the lower intersection point is obtained, and a first area of each target pixel lattice in the nth row that is not cut is calculated according to the similarity between the decimal part of the horizontal axis coordinate of the lower intersection point and the triangle.
Illustratively, referring to fig. 1, in the target pixel grid of the 11 th row, when the abscissa x1 of the upper intersection point B is an integer when 0 is calculated according to the ellipse formula, and the abscissa x2 of the lower intersection point a is not an integer when 6.666, the two legs of the right triangle ABC are 1 and 6.666 respectively, and then the total area of the right triangle ABC can be calculated according to the right triangle area formula. The similarity of the triangle and the fractional part of the horizontal axis coordinate of the lower intersection point a is acquired to calculate the first area of each pixel lattice of 11 rows.
Referring to combination 3 in fig. 4, when the horizontal axis coordinate of the upper intersection point of the curve arc and the nth row is not an integer and the horizontal axis coordinate of the lower intersection point is an integer, the decimal part of the horizontal axis coordinate of the upper intersection point is obtained, and the uncut first area of each target pixel lattice of the nth row is calculated according to the rectangular area formula, the decimal part of the horizontal axis coordinate of the upper intersection point, and the similarity of the triangle.
Referring to combination 4 in fig. 4, when the curve arc and the horizontal axis coordinate of the upper intersection point and the horizontal axis coordinate of the lower intersection point of the nth row are not integers, a decimal part of the horizontal axis coordinate of the upper intersection point and a decimal part of the horizontal axis coordinate of the lower intersection point are obtained, and then a first area of each target pixel lattice of the nth row, which is not cut, is calculated according to a rectangular area formula, the decimal part of the horizontal axis coordinate of the upper intersection point, the decimal part of the horizontal axis coordinate of the lower intersection point and the similarity of the triangle.
For example, referring to fig. 1, when the horizontal axis coordinate x1 of the upper intersection point of the elliptical arc and the target pixel grid in the 10 th row is not an integer 6.666 and the horizontal axis coordinate x2 of the lower intersection point is not an integer 9.199, a decimal part rem (x1) of the horizontal axis coordinate of the upper intersection point is 0.666 and a decimal part rem (x2) of the horizontal axis coordinate of the lower intersection point is 0.199 are obtained, a rectangular area 0.666 in the target pixel grid of b1 is obtained according to the decimal part of the horizontal axis coordinate of the upper intersection point and a rectangular area formula, a trapezoidal area 0.246 in the target pixel grid of b1 is obtained according to the similarity between the decimal part of the horizontal axis coordinate of the lower intersection point and a triangle, the last two areas are added to obtain a first area 0.912 of the target pixel grid of b1, and a first area of each pixel grid of the 10 th row which is not cut is obtained according to the similarity of the triangle.
For cutting of each line, the fitted straight line segment and each line of cut target pixel grids are combined into three shapes of a triangle, a trapezoid and a rectangle by adopting a fitting mode of replacing a curve with the straight line segment, and then a mathematical formula is combined to accurately combine and calculate a first area of each target pixel grid which is not cut, so that the gray coefficient of each target pixel grid is obtained.
In one embodiment, the screen image processing method performs S30: the step of processing the image data according to the gamma of the target pixel grid comprises:
and rounding the product of multiplying each gray coefficient by the smoothing order to obtain a coefficient storage number and writing the coefficient storage number into a memory. The rounding may be upward rounding, upward rounding with a fraction discarded, or rounded.
The smoothing order represents the smoothness level of screen edge lighting, and all gamma values are normalized to 4 bits for the convenience of hardware storage, so that the smoothness can be divided into 16 levels at most.
In the round-down embodiment, the gamma of each target pixel bin is multiplied by 16, the resulting product-discarded decimal is rounded down and the selected integer is stored in memory so that the processed gamma value is in the middle of [0, 15 ].
Illustratively, when the gamma of a target pixel cell a7 is 0.033, multiplying 0.033 by 16 yields a product of 0.528, rounding down to 0, which can be converted to 1 st binary data 0000 for storage in memory. When the system calls the gamma of a7, binary data 0000, that is, 0 in decimal, is read, and 0 is divided by 16 to obtain a quotient 0, that is, 0 is used as the actual gamma of the target pixel cell a7 to perform display driving.
Illustratively, when the gamma of a target pixel cell a1 is 0.9, 0.9 is multiplied by 16 to obtain a product 14.4, and the product is rounded down to obtain 14, which can be converted into the 15 th binary data 1110 to be stored in the memory. When the system calls the gamma of a1, binary data 1110, i.e., 14 in decimal, is read, and 14 is divided by 16 to obtain a quotient 0.875, i.e., 0.875 is used as the actual gamma of the target pixel cell a1 for display driving.
In the rounded-up embodiment, the gamma of each target pixel cell is multiplied by 16, and the resulting product is rounded up and then the integer is selected and stored in memory so that the processed gamma value is in the middle of [1, 16 ].
Illustratively, when the gamma of a target pixel cell a7 is 0.033, multiplying 0.033 by 16 yields a product of 0.528, rounding up to 1, which can be converted to 1 st binary data 0000 for storage in memory. When the system calls the gamma of a7, binary data 0000, i.e., 0 in decimal, is read, 1 is added to obtain 1, and 1 is divided by 16 to obtain quotient 0.0625, i.e., display driving is performed with 0.0625 as the actual gamma of target pixel cell a 7.
Illustratively, when the gamma of a target pixel cell a1 is 0.9, 0.9 is multiplied by 16 to obtain a product 14.4, and rounded up to obtain 15, which can be converted into the 15 th binary data 1110 to be stored in the memory. When the system calls the gamma of a1, binary data 1110 is read, i.e., 14 in decimal, and 1 is added to obtain 15, and 15 is divided by 16 to obtain a quotient 0.9375, i.e., 0.9375 is used as the actual gamma of the target pixel cell a1 for display driving.
In a round-robin embodiment, the gamma of each target pixel bin is multiplied by 15, and the resulting product is rounded and then selected as a whole and stored in memory so that the processed gamma value is in the middle of [0, 15 ].
Illustratively, when the gamma of one target pixel grid a8 is 0.39, 0.39 is multiplied by 15 to obtain a product of 5.85, rounded to 6, which can be converted into 7 th binary data 0110 to be stored in the memory. When the system calls the gamma of a7, binary data 0110, that is, decimal 6 is read, and 6 is divided by 15 to obtain a quotient 0.4, that is, display driving is performed with 0.4 as the actual gamma of the target pixel cell a 8.
Illustratively, when the gamma of one target pixel cell a9 is 0.87, 0.87 is multiplied by 15 to obtain a product 13.05, rounded to obtain 13, which can be converted into 14 th binary data 1101 to be stored in the memory. When the system calls the gamma of a9, binary data 1101, i.e., 13 in decimal, is read, and 13 is divided by 15 to obtain a quotient 0.867, i.e., display driving is performed with 0.867 as the actual gamma of the target pixel cell a 9.
In another embodiment, all gamma values can also be normalized to 5 bits, and the smoothness can be divided up to 32 levels. It should be noted that the normalization of the gamma may be 4 bits, or may be any bit data such as 5 bits, 6 bits, etc., which is not limited in this application. The smoothing order may represent a smoothness level of the screen edge lighting. The larger the smoothing order, the more accurate the stored data, and the better the light smoothing effect. The smaller the smoothing order is, the more effective the storage space can be saved.
In one embodiment, the screen image processing method includes, in performing the writing to the memory, the steps of:
in response to obtaining the coefficient storage count, a storage field is allocated for each row of the target pixel grid. Correspondingly, in the A target pixel grids in the Nth row, the number A of the target pixel grids in the Nth row and the coefficient storage number of the A target pixel grids in the Nth row are respectively written in the A +1 zone bits from the first zone bit of the storage field in the Nth row to the A +1 zone bit. Wherein N is a positive integer and A is a positive integer.
Referring to fig. 1 and table one, a storage manner of the gamma of each target pixel cell is shown in table one, and in one embodiment, a storage field is allocated to each row of target pixel cells in table one; in the 7 target pixel cells in the first row, from 8 positions from the 1 st position to the 8 th position of the storage field in the first row, the number of the target pixel cells in the first row, which is 7, and the stored coefficient numbers of the 7 target pixel cells in the first row, which are a1, a2, a3, a4, a5, a6, a7, are written, and so on for the target pixel cells in the other rows. In the process of displaying the curve angle screen, the system can directly read the number of the target pixel grids of each line, of which the gray coefficients need to be adjusted, according to the storage field of the target pixel grid of each line. The system can also quickly position the storage position of the corresponding gray coefficient according to the storage field of each row of target pixel grids, and the reading speed is increased.
Watch 1
7
|
a1
|
a2
|
a3
|
a4
|
a5
| a6
|
a7 |
|
4
|
b1
|
b2
| b3
|
b4 |
|
2
|
c1
| c2 |
|
3
|
d1
| d2
|
d3 |
|
2
|
e1
| e2 |
|
2
|
f1
| f2 |
|
1
|
g1
|
2
|
h1
| h2 |
|
1
|
l1
|
1
|
j1
|
1
|
k1
|
|
|
|
Second embodiment
On the other hand, on the basis of the first embodiment, the present application further provides a screen assembly with a curved corner, and fig. 5 is a structural diagram of the screen assembly in the second embodiment of the present application.
Referring to fig. 5, a screen assembly of a curve angle illustratively includes an image driver 10, an image processor 20, and a curve angle screen 30. The image driver 10 is used to send image data to the image processor 20 so that the image processor 20 controls the curve angle screen 30 to display the image data.
In one embodiment, the image processor 20 is configured to: taking the center of a curve as the origin of a coordinate system, placing the curve arc of a curve angle in a plane coordinate system, taking a pixel grid intersected with the curve arc as a target pixel grid, responding to the first intersection point coordinate and the second intersection point coordinate of the curve arc and each row or each column of target pixel grids, calculating the gray coefficient of each target pixel grid according to the first intersection point coordinate and the second intersection point coordinate of each row or each column of target pixel grids, and processing image data according to the gray coefficient of the target pixel grid; the curve angle screen 30 is controlled to display the processed image data.
For example, the image processor 20 may calculate the coordinates of the horizontal axis of the upper intersection point and the horizontal axis of the lower intersection point of each line of the target pixel grid according to the formula of the ellipse equation. The gamma, which may also be called a gradient coefficient, may be the ratio of the area of each target pixel grid that is not cut to the total area. The degree of color gradient after the target pixel grid, namely the image is cut can be clearly represented. The ratio of the uncut area to the total area in each pixel grid can be calculated through the upper intersection point horizontal axis coordinate and the lower intersection point horizontal axis coordinate of the intersection of the arc line of the elliptic arc and each row of target pixel grids.
The display brightness of each pixel grid on the screen is adjusted and controlled by the magnitude of the driving current, and the driving current is the current output to each pixel grid by the driving component of the pixel grid. At the edge of the screen, in order to smooth the brightness and eliminate the color cast phenomenon, each edge pixel grid respectively corresponds to a gray coefficient for optimizing the brightness. Generally, the gray scale factor for optimizing luminance is different when the area ratio is different.
The image processor 20 determines to obtain the gamma of each target pixel grid by calculating the first intersection point coordinate and the second intersection point coordinate of each row or each column of target pixel grid to control the curve angle screen 30 to display the processed image data, so as to quickly obtain the gamma of each target pixel grid, eliminate the phenomena of sawtooth and color cast generated after the curve angle is cut, and achieve the purpose of saving cost.
In one embodiment, the image processor 20 is further configured to:
performing straight line connection from a first intersection point to a second intersection point of each row or each column of target pixel grid area to obtain a fitting line segment;
calculating a first area of each pixel grid which is not cut by the fitted line segment;
and calculating the ratio of the first area to the total area of each pixel grid to obtain the gray coefficient of the target pixel grid.
Illustratively, the image processor 20 in the elliptical angular screen assembly may also be configured to: carrying out linear connection from an upper intersection point to a lower intersection point of each line of target pixel grid area to obtain a fitting line segment; calculating a first area of each pixel grid which is not cut by the fitted line segment; and calculating the ratio of the first area to the total area of each pixel grid to obtain the gray coefficient of the target pixel grid.
Referring to fig. 1, for example, the upper intersection B to the lower intersection a in the first row of target pixel cells a 1-a 7 are connected by a straight line to obtain a fitting line segment AB. The lower left corner of the target pixel grid area in the first row is point C. And forming a triangle ABC by the fitting line segment AB and the target pixel grid area on the side close to the origin of coordinates, and calculating the first area of the triangle ABC not cut in each target pixel grid. Exemplarily, in the target pixel cell a7, assuming that the side length of each pixel cell is 1, the first area which is not cut can be calculated to be 0.033 in combination with the similar property of the triangle, and since the total area of each pixel cell is 1, the gamma of the target pixel cell a7 is 0.033. According to the similarity principle of triangles, the gray coefficients of the target pixel grids from a1 to a6 can be calculated.
In this embodiment, the side length of each target pixel grid is set to 1, but the side length of the target pixel grid is not limited to 1 unit, and may be 2 units, 3 units, or other random values greater than 0, and at this time, the total area of each target pixel grid may be calculated according to a square area formula.
In one embodiment, the image processor 20 in the curve angle screen assembly is further configured to: in the target pixel grid of the Nth row, the side length of each pixel grid region is set to be 1, wherein N is a positive integer; the step of calculating a first area of each pixel grid not cut by the fitted line segment comprises:
referring to combination 1 in fig. 4, when the horizontal axis coordinates of the upper intersection point and the lower intersection point of the curved arc and the nth row are both integers, the uncut first area of each target pixel grid in the nth row is calculated according to the similarity of the triangles.
Referring to combination 2 in fig. 4, when the horizontal axis coordinate of the upper intersection point of the curve arc and the nth row is an integer and the horizontal axis coordinate of the lower intersection point is not an integer, a decimal part of the horizontal axis coordinate of the lower intersection point is obtained, and a first area of each target pixel lattice in the nth row that is not cut is calculated according to the similarity between the decimal part of the horizontal axis coordinate of the lower intersection point and the triangle.
Illustratively, referring to fig. 1, in the target pixel grid of the 11 th row, when the abscissa x1 of the upper intersection point B is an integer when 0 is calculated according to the ellipse formula, and the abscissa x2 of the lower intersection point a is not an integer when 6.666, the two legs of the right triangle ABC are 1 and 6.666 respectively, and then the total area of the right triangle ABC can be calculated according to the right triangle area formula. The decimal part rem (x2) of the abscissa of the lower intersection a is obtained as 0.666, and the first area of each pixel lattice of 11 lines can be calculated from the similarity between the decimal part of the abscissa of the lower intersection and the triangle.
Referring to combination 3 in fig. 4, when the horizontal axis coordinate of the upper intersection point of the curve arc and the nth row is not an integer and the horizontal axis coordinate of the lower intersection point is an integer, the decimal part of the horizontal axis coordinate of the upper intersection point is obtained, and the uncut first area of each target pixel lattice of the nth row is calculated according to the rectangular area formula, the decimal part of the horizontal axis coordinate of the upper intersection point, and the similarity of the triangle.
Referring to combination 4 in fig. 4, when the curve arc and the horizontal axis coordinate of the upper intersection point and the horizontal axis coordinate of the lower intersection point of the nth row are not both integers, a decimal part of the horizontal axis coordinate of the upper intersection point and a decimal part of the horizontal axis coordinate of the lower intersection point are obtained, and then a first area of each target pixel lattice of the nth row, which is not cut, is calculated according to a rectangular area formula, the decimal part of the horizontal axis coordinate of the upper intersection point, the decimal part of the horizontal axis coordinate of the lower intersection point, and the similarity of the triangle.
For example, referring to fig. 1, when the upper intersection horizontal axis coordinate x1 and the lower intersection horizontal axis coordinate x2 and 9.199 of the elliptical arc and the 10 th row are not integers, the decimal part rem (x1) of the upper intersection horizontal axis coordinate is 0.666 and the decimal part rem (x2) of the lower intersection horizontal axis coordinate is 0.199. The rectangular area 0.666 in the b1 target pixel grid can be obtained according to the decimal part of the horizontal axis coordinate of the upper intersection point and a rectangular area formula. The trapezoidal area of the b1 target pixel grid is 0.246 according to the similarity of the decimal part of the horizontal axis coordinate of the lower intersection point and the triangle, and the last two areas are added to obtain the first area of the b1 target pixel grid, namely 0.912. According to the similarity of the triangles, the first area of each target pixel grid of the 10 th row which is not cut can be further obtained.
For cutting of each line, target pixel lattices formed by the cut straight line segments and screen body pixel points are combined into three shapes of a triangle, a trapezoid, a rectangle and the like in a fitting mode that a straight line segment replaces a curve, and a first area of each target pixel lattice which is not cut can be accurately combined and calculated by combining a mathematical formula, so that the gray coefficient of each target pixel lattice is obtained.
With continued reference to fig. 5, in one embodiment, the screen assembly further includes a memory 40 connected to the image processor 20, and the image processor 20 is further configured to multiply each gamma by the integral of the smoothing order to obtain a coefficient storage number and write the coefficient storage number into the memory 40.
The smoothing order represents the level of smoothness of the screen edge lighting, and for the convenience of hardware storage, the image processor 20 may normalize all gamma values to 4 bits, and the smoothness may be divided into 16 levels at the maximum.
In the rounded-down embodiment, the gamma of each target pixel bin is multiplied by 16, the resulting product-discarded decimal is rounded down and the selected integer is stored in memory 40 such that the processed gamma value is in the middle of [0, 15 ].
Illustratively, when the gamma of a target pixel cell a7 is 0.033, multiplying 0.033 by 16 yields a product of 0.528, rounding down to 0, and the image processor 20 may convert to the 1 st binary data 0000 for storage in the memory 40. When the image processor 20 calls the gamma of a7, binary data 0000, i.e., 0 in decimal, is read, and 0 is divided by 16 to obtain a quotient 0, i.e., 0 is used as the actual gamma of the target pixel cell a7 for display driving.
Illustratively, when the gamma of a target pixel cell a1 is 0.9, 0.9 is multiplied by 16 to obtain a product 14.4, and rounded down to obtain 14, the image processor 20 may convert the data into the 15 th binary data 1110 for storage in the memory 40. When the image processor 20 calls the gamma of a1, binary data 1110, i.e., decimal 14, is read, and the quotient 0.875 is obtained by dividing 14 by 16, i.e., display driving is performed with 0.875 as the actual gamma of the target pixel cell a 1.
In the rounded-up embodiment, image processor 20 multiplies the gamma of each target pixel bin by 16, and the resulting product is rounded up and then the integer is selected and stored in memory 40 so that the processed gamma value is in the middle of [1, 16 ].
Illustratively, when the gamma of a target pixel cell a7 is 0.033, the image processor 20 multiplies 0.033 by 16 to obtain a product 0.528, rounds up to obtain 1, which may be converted to the 1 st binary data 0000 for storage in the memory 40. When the image processor 20 calls the gamma of a7, binary data 0000, i.e., 0 in decimal, is read, 1 is obtained by adding 1, and 1 is divided by 16 to obtain quotient 0.0625, i.e., display driving is performed with 0.0625 as the actual gamma of the target pixel cell a 7.
Illustratively, when the gamma of a target pixel cell a1 is 0.9, image processor 20 multiplies 0.9 by 16 to obtain a product 14.4, rounds up to 15, which may be converted to a 15 th binary data 1110 for storage in memory 40. When the image processor 20 calls the gamma of a1, the binary data 1110 is read, i.e., 14 in decimal, and then 1 is added to obtain 15, and the quotient 0.9375 is obtained by dividing 15 by 16, i.e., the actual gamma of the target pixel cell a1 is 0.9375 for display driving.
In a round-robin embodiment, image processor 20 multiplies the gamma of each target pixel bin by 15, rounds the resulting product to an integer and stores the integer in memory 40 so that the processed gamma value is in the middle of [0, 15 ].
Illustratively, when the gamma of a target pixel grid a8 is 0.39, image processor 20 multiplies 0.39 by 15 to obtain a product of 5.85, rounded to 6, which may be converted to 7 th binary data 0110 for storage in memory 40. When the image processor 20 calls the gamma of a7, binary data 0110, i.e., decimal 6, is read, and 6 is divided by 15 to obtain a quotient 0.4, i.e., display driving is performed with 0.4 as the actual gamma of the target pixel cell a 8.
Illustratively, when the gamma of one target pixel cell a9 is 0.87, 0.87 is multiplied by 15 to obtain a product 13.05, rounded to obtain 13, which can be converted into 14 th binary data 1101 to be stored in the memory. When the system calls the gamma of a9, binary data 1101, i.e., 13 in decimal, is read, and 13 is divided by 15 to obtain a quotient 0.867, i.e., display driving is performed with 0.867 as the actual gamma of the target pixel cell a 9.
In another embodiment, the image processor 20 may normalize all gamma values to 5 bits, and the smoothness may be divided up to 32 levels. It should be noted that the normalization of the gamma may be 4 bits, or may be any bit data such as 5 bits, 6 bits, etc., which is not limited in this application. The smoothing order may represent a smoothness level of the screen edge lighting. The larger the smoothing order, the more accurate the stored data, and the better the light smoothing effect. The smaller the smoothing order is, the more effective the storage space can be saved.
In one embodiment, the image processor 20 is further configured to:
in response to obtaining the coefficient storage count, a storage field is allocated for each row of the target pixel grid. Correspondingly, in the A target pixel grids in the Nth row, the number A of the target pixel grids in the Nth row and the coefficient storage number of the A target pixel grids in the Nth row are respectively written in the A +1 zone bits from the first zone bit of the storage field in the Nth row to the A +1 zone bit. Wherein N is a positive integer and A is a positive integer.
Referring to fig. 1 and table one, table one is a storage manner of the gamma of each target pixel cell. In one embodiment, the image processor 20 in table one allocates a storage field for each row of the target pixel grid; in the 7 target pixel cells in the first row, from 8 positions from the 1 st position to the 8 th position of the storage field in the first row, the number of the target pixel cells in the first row, which is 7, and the stored coefficient numbers of the 7 target pixel cells in the first row, which are a1, a2, a3, a4, a5, a6, a7, are written, and so on for the target pixel cells in the other rows. During the process of displaying the curved-angle screen, the image processor 20 may directly read the number of target pixel cells of each row whose gray scale coefficients need to be adjusted according to the storage field of the target pixel cell. The image processor 20 may also quickly locate the storage location of the corresponding gamma according to the storage field of each row of target pixel grid, so as to increase the reading speed.
Third embodiment
On the other hand, the application also provides a computer storage medium, in particular a computer program stored on the computer storage medium, wherein when the computer program is executed by a computer, the screen image processing method can be realized.
Illustratively, the steps of a computer program on a computer storage medium implementing the screen image processing method and applied to fig. 1 are as follows:
s1: and setting the side length of each pixel grid region as 1, and acquiring the horizontal axis coordinates of upper intersection points and the horizontal axis coordinates of lower intersection points of the elliptic arc r and each line of target pixel grids according to an elliptic equation and a first quadrant of a coordinate system.
S2: carrying out straight line connection from an upper intersection point to a lower intersection point of each row of target pixel grid area to obtain a fitted line segment, and calculating a first area of each pixel grid which is not cut by the fitted line segment, wherein the following four conditions exist:
when the horizontal axis coordinate of the upper intersection point and the horizontal axis coordinate of the lower intersection point of the Nth row are both integers, calculating the first area of each pixel grid of the Nth row according to the similarity of the triangles;
when the horizontal axis coordinate of the upper intersection point of the Nth row is an integer and the horizontal axis coordinate of the lower intersection point is not an integer, acquiring the decimal part of the horizontal axis coordinate of the lower intersection point, and calculating the first area of each pixel grid of the Nth row according to the similarity of the decimal part of the horizontal axis coordinate of the lower intersection point and the triangle;
when the horizontal axis coordinate of the upper intersection point of the Nth row is not an integer and the horizontal axis coordinate of the lower intersection point is an integer, acquiring the decimal part of the horizontal axis coordinate of the upper intersection point, and calculating the first area of each pixel grid of the Nth row according to a rectangular area formula, the decimal part of the horizontal axis coordinate of the upper intersection point and the similarity of a triangle;
and when the horizontal axis coordinate of the upper intersection point and the horizontal axis coordinate of the lower intersection point of the Nth row are not integers, acquiring the decimal part of the horizontal axis coordinate of the upper intersection point and the decimal part of the horizontal axis coordinate of the lower intersection point, and calculating the first area of each pixel grid of the Nth row according to a rectangular area formula, the decimal part of the horizontal axis coordinate of the upper intersection point, the decimal part of the horizontal axis coordinate of the lower intersection point and the similarity of the triangle.
S3: and calculating the ratio of the first area to the total area of each pixel grid to obtain the gray coefficient of the target pixel grid. And processing the image data according to the gray coefficient of each target pixel grid.
When the gray scale coefficients need to be stored, the integral of multiplying each gray scale coefficient by the smoothing order can be obtained, a storage field is distributed to each row of target pixel grids, and the obtained coefficient storage number is written into the memory according to the arrangement mode of 'the number of the coefficients + the number of the coefficient storage numbers'.
In the process of implementing the screen image processing method by the computer program, reference may be made to the above embodiments for related technical details, which are not described herein again.
It should be noted that the above embodiment has been explained and exemplified with each row of target pixel grids in the elliptical cut line of the first quadrant as the calculation object, and therefore, the intersection point coordinate data used is the horizontal axis coordinate of the first intersection point and the horizontal axis coordinate of the second intersection point. For other quadrants or each column of target pixel grids as the calculation object, the calculation method is actually based on the similar shape of each row of target pixel grids of the first quadrant after rotation, so the calculation method using each column of target pixel grids as the calculation object can refer to the explanation principle of the above embodiments, and when intersection point coordinate data is used, the first intersection point longitudinal axis coordinate and the second intersection point longitudinal axis coordinate can be selected for calculation, which is not described herein again.
As described above, the curve angle screen image processing method, the screen assembly and the computer storage medium provided by the application can achieve fast obtaining of the gray scale coefficient of each target pixel grid, so as to eliminate the problem of sawteeth and color cast after cutting the curve angle edge of the mobile phone screen, and effectively improve the display effect.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are included in the scope of the present application.