Display method and related apparatus
By converting the image when the screen direction changes to make it consistent with the direction after the screen rotates, the screen splitting problem when the screen refreshes after the screen rotates, and the image refresh effect without splitting is achieved.
Patent Information
- Application Number
- PCT/CN2024/093794
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-18
- Filing Date
- 2024-05-17
- Publication Date
- 2025-02-27
AI Technical Summary
After the screen rotates, because the pixel data of the image is inconsistent with the direction of the readout when writing to the image display memory, the screen may be split when refreshing the screen.
When the screen direction changes, the host obtains the corresponding conversion function, converts the original image, obtains the target image, and writes it to the image display memory of the display driver chip to make the writing and reading directions consistent.
By making the writing and reading directions of the image display memory consistent, the screen splitting problem when the screen is refreshed after the screen is rotated, ensuring that there is no splitting phenomenon when the screen is refreshed.
Smart Images

Figure CN2024093794_27022025_PF_FP_ABST
Abstract
Description
A display method and related device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on August 18, 2023, with application number 2023110516294 and application name “A display method and related device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of image display technology, and in particular to a display method and related devices. Background Art
[0003] Thin film transistor-liquid crystal displays (TFT-LCDs) are often used for image display in handheld devices and other applications, and images are often displayed rotated. Currently, most common TFT-LCD driver chips have a built-in hardware rotation function, which allows the screen to rotate by configuring other internal registers.
[0004] However, when the screen is rotated, the directions in which the pixel data of the image is written into and read from the graphic random access memory (G-RAM) are inconsistent, resulting in a phenomenon of image fragmentation when the screen is refreshed.
[0005] Therefore, how to solve the problem of screen fragmentation when refreshing the screen due to screen rotation has become a key research topic.
[0006] Summary of the Invention
[0007] The embodiments of the present application provide a display method and related devices, which can solve the problem of screen fragmentation when the screen is refreshed due to screen rotation.
[0008] In a first aspect, an embodiment of the present application provides a display method, which is applied to a display system, wherein the display system includes a host, a display driver chip, and a screen that are communicatively connected in sequence. The display method includes:
[0009] When a first change occurs in the direction of the screen, the host obtains a first conversion function corresponding to the first change, and converts the original image according to the first conversion function to obtain a target image;
[0010] The host writes the target image into the image display memory of the display driver chip;
[0011] The display driver chip reads the target image from the image display memory and displays it on the screen.
[0012] In a second aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the method of the above-mentioned first aspect and any possible implementation method when executing the computer program.
[0013] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, which is used to store a computer program (also referred to as code, or instructions); when the computer program is run on a computer, the method of the above-mentioned first aspect and any possible implementation method is implemented.
[0014] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes: a computer program (also referred to as code, or instructions); when the computer program is run, it enables the computer to execute the method of the above-mentioned first aspect and any possible implementation method.
[0015] In a fifth aspect, an embodiment of the present application provides a display system, comprising: a host, a display driver chip, and a screen that are communicatively connected in sequence;
[0016] When a first change occurs in the direction of the screen, the host is configured to obtain a first conversion function corresponding to the first change, and convert the original image according to the first conversion function to obtain a target image;
[0017] The host is further configured to write the target image into the image display memory of the display driver chip;
[0018] The display driver chip is used to read the target image from the image display memory and display it on the screen;
[0019] The screen is used to display the target image.
[0020] Optionally, the first change and its corresponding first conversion function may be as described in the above-mentioned first aspect and any possible implementation method, and are not described in detail here.
[0021] In addition, in the process of executing the method described in the first aspect and any possible embodiment, the process of sending information and / or receiving information in the above method can be understood as the process of the processor outputting information and / or the process of the processor receiving input information. When outputting information, the processor can output the information to the transceiver (or communication interface, or sending module) so that it can be transmitted by the transceiver. After the information is output by the processor, it may also need to undergo other processing before it reaches the transceiver. Similarly, when the processor receives input information, the transceiver (or communication interface, or sending module) receives the information and inputs it into the processor. Furthermore, after the transceiver receives the information, the information may need to undergo other processing before it is input into the processor.
[0022] Based on the above principles, for example, the sending of information mentioned in the above method can be understood as the processor outputting information. For another example, the receiving of information can be understood as the processor receiving input information.
[0023] Optionally, for the operations such as transmission, sending and receiving involved in the processor, if there is no special explanation, or if they do not conflict with their actual functions or internal logic in the relevant description, they can be more generally understood as processor output, reception, input and other operations.
[0024] Optionally, in the process of executing the method described in the first aspect and any possible embodiment, the processor may be a processor specifically used to execute these methods, or a processor that executes these methods by executing computer instructions in a memory, such as a general-purpose processor. The memory may be a non-transitory memory, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or may be separately provided on different chips. The embodiments of the present application do not limit the type of memory and the configuration of the memory and the processor.
[0025] In a possible implementation, the at least one memory is located outside the device.
[0026] In yet another possible implementation, the at least one memory is located within the device.
[0027] In another possible implementation, part of the at least one memory is located inside the device, and another part of the memory is located outside the device.
[0028] In this application, the processor and the memory may also be integrated into one device, that is, the processor and the memory may also be integrated together.
[0029] In an embodiment of the present application, when the display panel changes direction, before transmitting the image data to the video memory, the original image is first subjected to the same direction change, and then the image data after the direction change is transmitted to the video memory, so that the direction in which the image data is written to the video memory is the same as the direction in which the image data is read, thereby solving the problem of screen fragmentation when the screen is refreshed due to screen rotation. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In order to better describe and illustrate the embodiments of the present application, one or more drawings may be referred to. The additional details or examples used to describe the drawings should not be considered as limiting the scope of the disclosed invention, the embodiments and / or examples currently described, and any of the best modes of these inventions currently understood.
[0031] FIG1A is a schematic diagram of a display effect provided by an embodiment of the present application;
[0032] FIG1B is a schematic diagram of a display effect provided by an embodiment of the present application;
[0033] FIG2 is a schematic diagram of the architecture of a communication system provided in an embodiment of the present application;
[0034] FIG3A is a schematic diagram of a display effect provided by an embodiment of the present application;
[0035] FIG3B is a schematic diagram of a display effect provided by an embodiment of the present application;
[0036] FIG4 is a schematic diagram of a display effect provided by an embodiment of the present application;
[0037] FIG5 is a schematic diagram of a flow chart of a display method provided in an embodiment of the present application;
[0038] 6A to 6H are schematic diagrams showing changes in the orientation of a display image according to an embodiment of the present application;
[0039] 7A to 7H are schematic diagrams showing changes in the orientation of a display image according to an embodiment of the present application;
[0040] FIG8 is a schematic diagram of a process for displaying image direction changes according to an embodiment of the present application;
[0041] 9A to 9H are schematic diagrams showing changes in the direction of a display image according to an embodiment of the present application. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solutions and advantages of this application clearer, the embodiments of this application will be described below in conjunction with the drawings in the embodiments of this application.
[0043] The terms "first" and "second" in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to the process, method, product, or device.
[0044] The “embodiment” mentioned herein means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It can be understood explicitly and implicitly by those skilled in the art that in the various embodiments of the present application, unless otherwise specified and there is a logical conflict, the terms and / or descriptions between the various embodiments are consistent and can be referenced to each other, and the technical features in different embodiments can be combined to form a new embodiment according to their inherent logical relationship.
[0045] It should be understood that in the present application, "at least one (item)" refers to one or more, "more than one" refers to two or more, "at least two (items)" refers to two or three and more than three, and "and / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0046] It should be noted that in this application, "indication" can include direct indication, indirect indication, explicit indication, and implicit indication. When describing that a certain indication information is used to indicate A, it can be understood that the indication information carries A, directly indicates A, or indirectly indicates A.
[0047] In this application, the information indicated by the indication information is referred to as the information to be indicated. In specific implementations, there are many ways to indicate the information to be indicated. For example, but not limited to, the information to be indicated can be directly indicated, such as the information to be indicated itself or an index of the information to be indicated. The information to be indicated can also be indirectly indicated by indicating other information, where the other information is associated with the information to be indicated. Alternatively, only a portion of the information to be indicated can be indicated, while the rest of the information to be indicated is known or agreed upon in advance. For example, the indication of specific information can be achieved by using a pre-agreed (e.g., protocol-specified) order of the various information, thereby reducing indication overhead to a certain extent. The information to be indicated can be sent as a whole or divided into multiple sub-information and sent separately. The transmission period and / or transmission timing of these sub-information can be the same or different. The specific transmission method is not limited in this application. The transmission period and / or transmission timing of these sub-information can be pre-defined, for example, according to a protocol, or can be configured by the transmitting device sending configuration information to the receiving device.
[0048] It should be noted that in this application, "send" can be understood as "output" and "receive" can be understood as "input". "Send information to A", where "to A" only indicates the direction of information transmission, A is the destination, and does not limit "sending information to A" to direct transmission on the air interface. "Sending information to A" includes sending information directly to A, and also includes sending information indirectly to A through a transmitter, so "sending information to A" can also be understood as "outputting information to A". Similarly, "receiving information from A" indicates that the source of the information is A, including receiving information directly from A, and also including receiving information indirectly from A through a receiver, so "receiving information from A" can also be understood as "inputting information from A".
[0049] This application provides a display method for use in the field of image display technology, such as image display on a thin film transistor-liquid crystal display (TFT-LCD). To more clearly describe the solution of this application, the following first introduces some knowledge related to image display.
[0050] In handheld devices and other fields, TFT-LCDs are often used for image display, and images are often rotated. Currently, most common TFT-LCD driver chips have a built-in hardware rotation function, which can be used to rotate the screen display by configuring other internal registers.
[0051] However, when the screen is rotated, the directions in which the pixel data of the image is written into and read from the graphic random access memory (G-RAM) are inconsistent, resulting in a phenomenon of image fragmentation when the screen is refreshed.
[0052] Please refer to FIG. 1A , which is a schematic diagram of a display effect provided by an embodiment of the present application.
[0053] As shown in FIG1A , when the display panel is rotated 90° clockwise, a diagonally split screen is displayed when the screen is refreshed. The display area is divided into a yellow area, a yellow-blue gradient area, and a blue area along the dotted lines, arranged in sequence from the upper left area to the lower right area.
[0054] Please refer to FIG. 1B , FIG. 1A is a schematic diagram of a display effect provided by an embodiment of the present application.
[0055] As shown in FIG1B , when the display panel is rotated 180° clockwise, a vertically split screen is displayed when the screen is refreshed. As shown in (1) in FIG1B , the display area is split along the dotted line into a yellow area and a blue area, which are arranged in sequence from top to bottom; as shown in (2) in FIG1B , the display area is split along the dotted line into a yellow area and a blue area, which are arranged in sequence from top to bottom.
[0056] The aforementioned screen rotation-induced image tearing problem, which occurs when the screen refreshes, has only been addressed in some main control chips that support hardware controllers for image rotation, such as those with image signal processors (ISPs). However, not all main control chips include such controllers. Therefore, resolving this issue has become a key research topic.
[0057] Please refer to FIG2 , which is a schematic diagram of the architecture of a communication system provided in an embodiment of the present application.
[0058] As shown in FIG2 , the communication system includes a host chip (Host) and a display screen.
[0059] Among them, the main control chip (Host) includes RAM, the display screen includes G-RAM and a display panel (Panel), and the display screen can specifically be a TFT-LCD, which is not limited in the embodiment of the present application.
[0060] G-RAM is used to cache image data transmitted from the host chip (Host) through the serial / parallel port, and the controller continuously and cyclically reads image data from G-RAM in the form of image stream or video stream and refreshes it to the display panel for display.
[0061] Although the TFT-LCD driver chip itself has a hardware rotation function, the writing and reading directions of the G-RAM inside the screen are inconsistent after rotation, resulting in obvious vertical or diagonal fragmentation on the screen.
[0062] Please refer to FIG. 3A , which is a schematic diagram of a display effect provided by an embodiment of the present application.
[0063] Figure 3A shows the difference in the writing and retrieving directions of the G-RAM inside the screen driver chip when rotated 90°. The solid arrows in Figure 3A indicate the direction image data is written to the GRAM, while the dashed arrows in Figure 3A indicate the direction image data is retrieved from the GRAM. Because the writing and retrieving directions are perpendicular to each other, the screen may experience diagonal image tearing during refresh.
[0064] Please refer to FIG. 3B , which is a schematic diagram of a display effect provided by an embodiment of the present application.
[0065] Figure 3B shows the difference in the writing and retrieving directions of the G-RAM inside the screen driver chip when rotated 180°. The solid arrows in Figure 3B indicate the direction in which image data is written to the GRAM, while the dashed arrows in Figure 3B indicate the direction in which image data is retrieved from the GRAM. Because the writing and retrieving directions are vertically opposite, the G-RAM reads image data from top to bottom, while new image data is updated from bottom to top. The writing and retrieving operations are close to each other. At some point, these two operations will overlap, resulting in a vertically split image, which can cause the screen to experience vertical splitting during refresh.
[0066] To address the aforementioned issue of screen tearing during refresh caused by screen rotation, it's necessary to ensure that the image data written to and read from the G-RAM are in the same direction. This can be addressed by rotating the image data in the host chip before transferring it to the TFT-LCD's G-RAM.
[0067] Please refer to FIG4 , which is a schematic diagram of a display effect provided by an embodiment of the present application.
[0068] As shown in Figure 4, for a 90° rotation, the main control chip first rotates the image data before transferring it to the TFT-LCD's G-RAM. The solid arrows in Figure 4 indicate the direction image data is written to the GRAM, while the dashed arrows in Figure 4 indicate the direction image data is retrieved from the GRAM. Because G-RAM writes and reads image data in the same direction (both from top to bottom), there is no tearing when the screen is refreshed.
[0069] It is understandable that to ensure that there is no tearing when the screen is refreshed, it is also necessary to enable the frame synchronization function and ensure that the storage rate of the G-RAM is greater than the withdrawal rate.
[0070] It is understood that the display method shown in FIG4 can be implemented in the following two ways:
[0071] One is that the main control chip has an LCD controller, ISP controller, etc. with image rotation function, which can be handed over to the hardware controller to realize the "hard" rotation of the image, and then the rotated data is transmitted to the TFT-LCD;
[0072] The other is suitable for the main control chip without image rotation function, which uses software algorithm to perform "soft" rotation on the image and then transmits the rotated data to the TFT-LCD.
[0073] Accordingly, an embodiment of the present application provides a display method, which is described below in conjunction with FIG5 .
[0074] Please refer to FIG5 , which is a flow chart of a display method provided in an embodiment of the present application. The display method is applied to the field of image display technology, such as image display on a TFT-LCD. The display method is applied to a display system, which includes a host, a display driver chip, and a screen that are sequentially communicatively connected. The display method includes but is not limited to the following steps:
[0075] S501: When a first change occurs in the direction of the screen, the host obtains a first conversion function corresponding to the first change, and converts the original image according to the first conversion function to obtain a target image.
[0076] S502: The host writes the target image into the image display memory of the display driver chip.
[0077] S503: The display driver chip reads the target image from the image display memory and displays it on the screen.
[0078] It is understood that the display driver chip in the embodiment of the present application is a processor / chip that can be used to execute computer-executable instructions, and the embodiment of the present application is not limited to this. Optionally, the display driver chip can specifically include the G-RAM shown in Figure 2 above, which is used to participate in the execution of the display method in the embodiment of the present application to solve the problem of screen fragmentation when the screen is refreshed due to screen rotation.
[0079] It is understood that the host in the embodiment of the present application is a device equipped with a processor / chip that can be used to execute computer-executable instructions, and can also be a processor / chip that can be used to execute computer-executable instructions, and the embodiment of the present application is not limited to this. Optionally, the host can be the main control chip (Host) in Figure 2 above, which is used to execute the display method in the embodiment of the present application to solve the problem of screen fragmentation when the screen is refreshed due to screen rotation.
[0080] In the embodiment of the present application, since the direction change of the original image is the same as the direction change of the screen, the direction in which the target image is written to the image display memory of the display driver chip is also the same as the direction in which the target image is read from the image display memory. Therefore, even if the direction of the screen changes, there will no longer be a phenomenon of screen fragmentation when the screen is refreshed, which can solve the problem of screen fragmentation when the screen is refreshed due to screen rotation.
[0081] It is understandable that for a TFT-LCD screen, the basic functions that the software needs to implement are driving functions such as drawing dots, drawing lines, drawing windows (such as rectangles and other graphics), and transmitting patterns, while the direction change function (such as rotation, mirroring, etc.) is nested in these functions to achieve the principle of "direction change first, then transmission".
[0082] In this way, in addition to the original function of drawing points, lines, windows (rectangles), and patterns, operations on direction changes (rotation, mirroring, etc.) of coordinate points, line segment endpoints, pattern windows (rectangles), pattern data, etc. are added, thereby realizing new functions of drawing points, lines, windows (rectangles), and patterns with software direction change (rotation, mirroring, etc.) functions.
[0083] The following will use the examples of clockwise rotation of coordinate points, line segments, windows (rectangles), and patterns by 90°, 180°, and 270°, as well as vertical mirroring and mirrored rotation by 90°, 180°, and 270° to explain in detail the implementation principle of transforming the original image into the target image.
[0084] Example 1: Direction change of coordinate points.
[0085] If the original image is a coordinate point, the first change is a 90° clockwise rotation, and the first conversion function corresponds to x1=y2, y1=lcd_h-1-x2;
[0086] Alternatively, the first change is a 180° clockwise rotation, and the first conversion function corresponds to x1=lcd_w-1-x2, y1=lcd_h-1-y2;
[0087] Alternatively, the first change is a clockwise rotation of 270°, and the first conversion function corresponds to: x1=lcd_w-1-y2, y1=x2;
[0088] Alternatively, the first change is a mirror image, and the first conversion function corresponds to: x1=x2, y1=lcd_h-1-y2;
[0089] Alternatively, the first change is a mirror image and a 90° clockwise rotation, and the first conversion function corresponds to: x1=y2, y1=x2;
[0090] Alternatively, the first change is a mirror image and a 180° clockwise rotation, and the first conversion function corresponds to: x1=lcd_w-1-x2, y1=y2;
[0091] Alternatively, the first change is a mirror image and a 270° clockwise rotation, and the first conversion function corresponds to: x1=lcd_w-1-y2, y1=lcd_h-1-x2;
[0092] Among them, x1 is the horizontal coordinate of the first coordinate point in the original image, y1 is the vertical coordinate of the first coordinate point in the original image, x2 is the horizontal coordinate of the second coordinate point in the target image, y2 is the vertical coordinate of the second coordinate point in the target image, lcd_w is the width of the screen resolution, lcd_h is the height of the screen resolution, and the second coordinate point is the coordinate point corresponding to the first coordinate point after the first change.
[0093] In an embodiment of the present application, if the original image is a coordinate point, when the direction of the screen undergoes a first change, no matter what the specific circumstances of the first change are (for example, clockwise rotation of 90°, clockwise rotation of 180°, clockwise rotation of 270°, mirroring, mirroring and clockwise rotation of 90°, mirroring and clockwise rotation of 180°, mirroring and clockwise rotation of 270°, etc.), there is a first conversion function corresponding to the first change. The first conversion function is a conversion relationship between the coordinate point in the original image (i.e., the first coordinate point) and the coordinate point in the target image (i.e., the second coordinate point). Therefore, the original image is converted according to the first conversion function according to the first conversion function to obtain the target image, so that the direction in which the target image is written to the image display memory of the display driver chip is the same as the direction in which it is read. Even if the direction of the screen changes, there is no longer any screen tearing when the screen is refreshed, thereby solving the problem of screen tearing when the screen is refreshed due to screen rotation.
[0094] Optionally, the specific implementation may be as follows:
[0095] Obtain a first coordinate point in the original image and a second coordinate point in the target image, where the second coordinate point is the coordinate point corresponding to the first coordinate point after the direction of the original image changes;
[0096] A coordinate transformation relationship is determined based on the first coordinate point and the second coordinate point.
[0097] It is understandable that, based on the change in screen orientation, the coordinate points on the original image are changed in the same direction to obtain the corresponding coordinate points on the target image, and the coordinate transformation relationship is determined based on the coordinate points before and after the orientation change. For example, a first coordinate point in the original image is obtained, and a second coordinate point corresponding to the first coordinate point in the target image obtained after the orientation change of the original image is obtained, and the coordinate transformation relationship is determined based on the first coordinate point and the second coordinate point. Through the embodiments of the present application, the image data corresponding to the target image can be determined.
[0098] It's easy to understand that rotating a coordinate point can be thought of as rotating a screen 90°. To determine the position of a point on the screen, we first need to find the original, unrotated position of that point. Specifically, we can use the coordinates (x2, y2) of the point on the target screen to find the coordinates (x1, y1) of the corresponding point on the original screen. Knowing this correspondence allows us to derive a rotation algorithm for the coordinate point.
[0099] The following further illustrates the direction change of the coordinate points in conjunction with Table 1 and FIG. 6A to FIG. 6H .
[0100] Among them, (x2, y2) is the coordinate point passed to the new drawing function after the screen is rotated. The coordinates of the original drawing function actually written into the corresponding function are (x1, y1). lcd_w and lcd_h are the width and height of the TFT-LCD resolution.
[0101] Table 1
[0102] Example 2: Direction change of a line segment.
[0103] If the original image is a line segment, the first change is a 90° clockwise rotation, and the first conversion function corresponds to: x1=y2, y1=lcd_h-1-x2;
[0104] Alternatively, the first change is a 180° clockwise rotation, and the first conversion function corresponds to: x1=lcd_w-1-x2, y1=lcd_h-1-y2;
[0105] Alternatively, the first change is a clockwise rotation of 270°, and the first conversion function corresponds to: x1=lcd_w-1-y2, y1=x2;
[0106] Alternatively, the first change is a mirror image, and the first conversion function corresponds to: x1=x2, y1=lcd_h-1-y2;
[0107] Alternatively, the first change is a mirror image and a 90° clockwise rotation, and the first conversion function corresponds to: x1=y2, y1=x2;
[0108] Alternatively, the first change is a mirror image and a 180° clockwise rotation, and the first conversion function corresponds to: x1=lcd_w-1-x2, y1=y2;
[0109] Alternatively, the first change is a mirror image and a 270° clockwise rotation, and the first conversion function corresponds to: x1=lcd_w-1-y2, y1=lcd_h-1-x2;
[0110] Among them, x1 is the horizontal coordinate of the first coordinate point on the first line segment in the original image, y1 is the vertical coordinate of the first coordinate point on the first line segment in the original image, x2 is the horizontal coordinate of the second coordinate point on the second line segment in the target image, y2 is the vertical coordinate of the second coordinate point on the second line segment in the target image, lcd_w is the width of the screen resolution, lcd_h is the height of the screen resolution, the second line segment is the line segment corresponding to the first line segment after the first change, and the second coordinate point on the second line segment is the coordinate point corresponding to the first coordinate point on the first line segment after the first change.
[0111] In an embodiment of the present application, if the original image is a line segment, when the direction of the screen undergoes a first change, no matter what the specific situation of the first change is (for example, clockwise rotation of 90°, clockwise rotation of 180°, clockwise rotation of 270°, mirroring, mirroring and clockwise rotation of 90°, mirroring and clockwise rotation of 180°, mirroring and clockwise rotation of 270°, etc.), there is a first conversion function corresponding to the first change. The first conversion function is a conversion relationship between the coordinate point of the line segment in the original image (i.e., the first coordinate point on the first line segment) and the coordinate point of the line segment in the target image (i.e., the second coordinate point on the second line segment). Therefore, the original image is converted according to the first conversion function according to the first conversion function to obtain the target image, so that the direction in which the target image is written to the image display memory of the display driver chip is the same as the direction in which it is read. Even if the direction of the screen changes, there is no longer any screen tearing when the screen is refreshed, thereby solving the problem of screen tearing when the screen is refreshed due to screen rotation.
[0112] Optionally, the specific implementation may be as follows:
[0113] Obtaining the endpoint coordinates of a first line segment in the original image and the endpoint coordinates of a second line segment in the target image, where the second line segment is the line segment corresponding to the first line segment after the direction of the original image changes;
[0114] A coordinate conversion relationship is determined based on the endpoint coordinates of the first line segment and the endpoint coordinates of the second line segment.
[0115] It is understandable that, based on the change in screen orientation, the line segments on the original image are changed in the same direction to obtain the corresponding line segments on the target image, and the coordinate transformation relationship is determined based on the line segments before and after the orientation change. For example, the endpoint coordinates of the first line segment in the original image are obtained, and the endpoint coordinates of the corresponding second line segment in the target image obtained after the orientation change of the first line segment are obtained, and the coordinate transformation relationship is determined based on the endpoint coordinates of the first line segment and the endpoint coordinates of the second line segment. Through the embodiments of the present application, the image data corresponding to the target image can be determined.
[0116] It is understandable that the rotation of the line segment can be converted into the rotation of the starting / ending coordinate points. The starting coordinate point (x s1 ,y s1 )The coordinate point after rotation (x s2 ,y s2 ), and the ending coordinate point (x e1 ,y e1 )The coordinate point after rotation (x e2 ,y e2 Since only the coordinate points are rotated, the method and principle are consistent with those described in the first embodiment, so they will not be described here in detail.
[0117] Example 3: Change of direction of the window (rectangle).
[0118] If the original image is a rectangular window, the first change is a 90° clockwise rotation, and the first conversion function corresponds to: x1=y2, y1=lcd_h-x2-w2, w1=h2, h1=w2;
[0119] Alternatively, the first change is a 180° clockwise rotation, and the first conversion function corresponds to: x1=lcd_w-x2-w2, y1=lcd_h-y2-h2, w1=w2, h1=h2;
[0120] Alternatively, the first change is a clockwise rotation of 270°, and the first conversion function corresponds to: x1=lcd_w-y2-h2, y1=x2, w1=h2, h1=w2;
[0121] Alternatively, the first change is a mirror image, and the first conversion function corresponds to: x1=x2, y1=lcd_h-y2-h2, w1=w2, h1=h2;
[0122] Alternatively, the first change is a mirror image and a 90° clockwise rotation, and the first conversion function corresponds to: x1=lcd_w-y2-h2, y1=lcd_h-x2-w2, w1=h2, h1=w2;
[0123] Alternatively, the first change is a mirror image and rotated 180° clockwise, and the first conversion function corresponds to: x1=lcd_w-x2-w2, y1=y2, w1=w2, h1=h2;
[0124] Alternatively, the first change is a mirror image and a 270° clockwise rotation, and the first conversion function corresponds to: x1=y2, y1=x2, w1=h2, h1=w2;
[0125] Among them, x1 is the horizontal coordinate of the first coordinate point on the first window in the original image, y1 is the vertical coordinate of the first coordinate point on the first window in the original image, x2 is the horizontal coordinate of the second coordinate point on the second window in the target image, y2 is the vertical coordinate of the second coordinate point on the second window in the target image, w1 is the width of the first window, h1 is the height of the first window, w2 is the width of the second window, h2 is the height of the second window, lcd_w is the width of the screen resolution, lcd_h is the height of the screen resolution, the second window is the window corresponding to the first window after the first change, and the second coordinate point on the second window is the coordinate point corresponding to the first coordinate point on the first window after the first change.
[0126] In an embodiment of the present application, if the original image is a rectangular window, when the direction of the screen undergoes a first change, no matter what the specific circumstances of the first change are (for example, clockwise rotation of 90°, clockwise rotation of 180°, clockwise rotation of 270°, mirroring, mirroring and clockwise rotation of 90°, mirroring and clockwise rotation of 180°, mirroring and clockwise rotation of 270°, etc.), there is a first conversion function corresponding to the first change. The first conversion function is a conversion relationship between the coordinate point of the rectangular window in the original image (i.e., the first coordinate point on the first window) and the coordinate point of the rectangular window in the target image (i.e., the second coordinate point on the second window). Therefore, the original image is converted according to the first conversion function according to the first conversion function to obtain the target image, so that the direction in which the target image is written to the image display memory of the display driver chip is the same as the direction in which it is read. Even if the direction of the screen changes, there is no longer any screen tearing when the screen is refreshed, thereby solving the problem of screen tearing when the screen is refreshed due to screen rotation.
[0127] Optionally, the specific implementation may be as follows:
[0128] Obtaining the starting point coordinates and size information of a first window in the original image, and the starting point coordinates and size information of a second window in the target image, where the second window is the window corresponding to the first window after the direction of the original image changes;
[0129] A coordinate conversion relationship is determined based on the starting point coordinates and size information of the first window and the starting point coordinates and size information of the second window in the target image.
[0130] It is understandable that, according to the change in the direction of the screen, the window on the original image is changed in the same direction to obtain the corresponding window on the target image, and the coordinate transformation relationship is determined based on the window before and after the direction change. For example, the starting coordinate point and size information of the first window in the original image are obtained, and the starting coordinate point and size information of the second window corresponding to the target image obtained after the starting coordinate point and size information of the first window are obtained along with the direction change of the original image, and the coordinate transformation relationship is determined based on the starting coordinate point and size information of the first window and the starting coordinate point and size information of the second window. Through the embodiment of the present application, the image data corresponding to the target image can be determined.
[0131] It's understandable that TFT-LCD rectangle rotation is essentially window rotation, primarily regarding the starting coordinates and the width and height. After the screen is rotated, the window position must be converted to its pre-rotation position, i.e., the window position before rotation.
[0132] The following further illustrates the direction change of the line segment with reference to Table 2 and FIG. 7A to FIG. 7H .
[0133] Where (x1, y1) is the starting coordinate point before rotation, w1 and h1 are the width and height before rotation, (x2, y2) is the starting coordinate point after rotation, w2 and h2 are the width and height after rotation; lcd_w and lcd_h are the width and height of the TFT-LCD resolution, respectively.
[0134] Table 2
[0135] Example 4: Direction change of image.
[0136] If the original image is an irregular pattern, the first change is a 90° clockwise rotation, and the first conversion function corresponds to: x2 = h-1 - y1, y2 = x1;
[0137] Alternatively, the first change is a 180° clockwise rotation, and the first conversion function corresponds to: x2=w-1-x1, y2=h-1-y1;
[0138] Alternatively, the first change is a clockwise rotation of 270°, and the first conversion function corresponds to: x2=y1, y2=w-1-x1;
[0139] Alternatively, the first change is a mirror image, and the first conversion function corresponds to: x2=x1, y2=h-1-y1;
[0140] Alternatively, the first change is a mirror image and a 90° clockwise rotation, and the first conversion function corresponds to: x2=y1, y2=x1;
[0141] Alternatively, the first change is a mirror image and a 180° clockwise rotation, and the first conversion function corresponds to: x2=w-1-x1, y2=y1;
[0142] Alternatively, the first change is a mirror image and a 270° clockwise rotation, and the first conversion function corresponds to: x2=h-1-y1, y2=w-1-x1;
[0143] Among them, x1 is the horizontal coordinate of the first pixel point in the original image, y1 is the vertical coordinate of the first pixel point in the original image, x2 is the horizontal coordinate of the second pixel point in the target image, y2 is the vertical coordinate of the second pixel point in the target image, w is the width of the original image, h is the height of the original image, and the second pixel point is the pixel point corresponding to the first pixel point after the first change.
[0144] In an embodiment of the present application, if the original image is an irregular pattern, when the direction of the screen undergoes a first change, no matter what the specific circumstances of the first change are (for example, clockwise rotation of 90°, clockwise rotation of 180°, clockwise rotation of 270°, mirroring, mirroring and clockwise rotation of 90°, mirroring and clockwise rotation of 180°, mirroring and clockwise rotation of 270°, etc.), there is a first conversion function corresponding to the first change. The first conversion function is a conversion relationship between a pixel point in the original image (i.e., a first pixel point) and a pixel point in the target image (i.e., a second pixel point). Therefore, the original image is converted according to the first conversion function according to the first conversion function to obtain the target image, so that the direction in which the target image is written to the image display memory of the display driver chip is the same as the direction in which it is read. Even if the direction of the screen changes, there is no longer any screen tearing when the screen is refreshed, thereby solving the problem of screen tearing when the screen is refreshed due to screen rotation.
[0145] Optionally, the specific implementation may be as follows:
[0146] Obtain a first pixel point in the original image and a second pixel point in the target image, where the second pixel point is the pixel point corresponding to the first pixel point after the direction of the original image changes;
[0147] A coordinate transformation relationship is determined based on the first pixel point and the second pixel point.
[0148] It is understandable that, according to the change in the direction of the screen, the pixels on the original image are changed in the same direction to obtain the corresponding pixels on the target image, and the coordinate transformation relationship is determined based on the pixels before and after the direction change. For example, the first pixel in the original image is obtained, and the corresponding second pixel in the target image obtained after the first pixel changes with the original image, and the coordinate transformation relationship is determined based on the first pixel and the second pixel. Through the embodiment of the present application, the image data corresponding to the target image can be determined.
[0149] It can be understood that the rotation of the pattern is simply the rotation of all pixels of the pattern according to the length and height of the pattern itself, which has nothing to do with the screen. The correspondence between the rotated pattern and the pattern before the rotation can be directly obtained.
[0150] First, the coordinates of a pixel in the original pattern are calculated, and the coordinates of the pixel corresponding to the rotated pattern are calculated to obtain the correspondence between the pixels before and after the rotation. Then, all the pixels in the original pattern are transformed one by one to obtain the new rotated pattern.
[0151] Please refer to FIG8 for details, which is a schematic diagram of a process of displaying image direction changes according to an embodiment of the present application.
[0152] Figure 8 shows the image rotation algorithm. First, assume the image's starting coordinates are (0, 0). When the ordinate is no less than the image height, the transformation of all pixels in the entire image is complete. When the ordinate is less than the image height, the horizontal coordinate (x) is incremented from 0 and the pixels are transformed one by one. When the horizontal coordinate (x) is no less than the image width, the ordinate is incremented by 1, and the horizontal coordinate (x) is incremented from 0 again and the pixels are transformed one by one. This continues until all pixels in the entire image have been transformed, resulting in the new rotated pattern.
[0153] The following further illustrates the direction change of the image with reference to Table 3 and FIG. 9A to FIG. 9H .
[0154] The corresponding relationship between the coordinates (x2, y2) of a pixel point in the new image after rotation and the coordinates (x1, y1) before rotation is shown in Table 3 below, where w and h are the width and height of the image, respectively.
[0155] Table 3
[0156] It should be understood that the above-mentioned embodiments 1 to 4, as well as Tables 1 to 3, are merely illustrations of several possible embodiments and should not be used to limit the embodiments of the present application. Embodiments obtained by reasonable deformation or supplementation based on the above-mentioned embodiments and direction changes all fall within the scope of protection of the embodiments of the present application.
[0157] According to the method provided in an embodiment of the present application, an embodiment of the present application also provides an electronic device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the method shown in Figure 5 above when executing the computer program.
[0158] According to the method provided in the embodiment of the present application, the embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program runs on one or more processors, the method shown in Figure 5 can be implemented.
[0159] According to the method provided in the embodiment of the present application, the embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program runs on a processor, it can implement the method shown in Figure 5 above.
[0160] The embodiment of the present application further provides a display system, which includes: a host, a display driver chip, and a screen that are communicatively connected in sequence;
[0161] When the direction of the screen undergoes a first change, the host is configured to obtain a first conversion function corresponding to the first change, and convert the original image according to the first conversion function to obtain a target image;
[0162] The host is further configured to write the target image into the image display memory of the display driver chip;
[0163] The display driver chip is used to read the target image from the image display memory and display it on the screen;
[0164] The screen is used to display the target image.
[0165] Optionally, the first change and its corresponding first conversion function may be implemented as described in any of the embodiments of FIG. 5 , and are not described in detail here.
[0166] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by hardware associated with a computer program. The computer program can be stored in a computer-readable storage medium. When executed, the computer program can include the processes described in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing computer program code, such as read-only memory (ROM) or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A display method, using a display system, wherein the display system comprises a host, a display driver chip and a screen that are sequentially connected in communication, and the display method comprises: When a first change occurs in the direction of the screen, the host obtains a first conversion function corresponding to the first change, and converts the original image according to the first conversion function to obtain a target image; The host writes the target image into the image display memory of the display driver chip; The display driver chip reads the target image from the image display memory and displays it through the screen.
2. The method according to claim 1, characterized in that When the original image is a coordinate point, the first change is a 90° clockwise rotation, and the first conversion function corresponds to x1=y2, y1=lcd_h-1-x2; Alternatively, the first change is a clockwise rotation of 180°, and the first conversion function corresponds to x1=lcd_w-1-x2, y1=lcd_h-1-y2; Alternatively, the first change is a clockwise rotation of 270°, and the first conversion function corresponds to: x1=lcd_w-1-y2, y1=x2; Alternatively, the first change is a mirror image, and the first conversion function corresponds to: x1=x2, y1=lcd_h-1-y2; Alternatively, the first change is a mirror image and a 90° clockwise rotation, and the first conversion function corresponds to: x1=y2, y1=x2; Alternatively, the first change is a mirror image and rotated 180° clockwise, and the first conversion function corresponds to: x1=lcd_w-1-x2, y1=y2; Alternatively, the first change is a mirror image and rotated 270° clockwise, and the first conversion function corresponds to: x1=lcd_w-1-y2, y1=lcd_h-1-x2; Among them, x1 is the horizontal coordinate of the first coordinate point in the original image, y1 is the vertical coordinate of the first coordinate point in the original image, x2 is the horizontal coordinate of the second coordinate point in the target image, y2 is the vertical coordinate of the second coordinate point in the target image, lcd_w is the width of the resolution of the screen, lcd_h is the height of the resolution of the screen, and the second coordinate point is the coordinate point corresponding to the first coordinate point after the first change.
3. The method according to claim 1, characterized in that: When the original image is a line segment, the first change is a 90° clockwise rotation, and the first conversion function corresponds to: x1=y2, y1=lcd_h-1-x2; Alternatively, the first change is a clockwise rotation of 180°, and the first conversion function corresponds to: x1=lcd_w-1-x2, y1=lcd_h-1-y2; Alternatively, the first change is a clockwise rotation of 270°, and the first conversion function corresponds to: x1=lcd_w-1-y2, y1=x2; Alternatively, the first change is a mirror image, and the first conversion function corresponds to: x1=x2, y1=lcd_h-1-y2; Alternatively, the first change is a mirror image and a 90° clockwise rotation, and the first conversion function corresponds to: x1=y2, y1=x2; Alternatively, the first change is a mirror image and rotated 180° clockwise, and the first conversion function corresponds to: x1=lcd_w-1-x2, y1=y2; Alternatively, the first change is a mirror image and rotated 270° clockwise, and the first conversion function corresponds to: x1=lcd_w-1-y2, y1=lcd_h-1-x2; Among them, x1 is the horizontal coordinate of the first coordinate point on the first line segment in the original image, y1 is the vertical coordinate of the first coordinate point on the first line segment in the original image, x2 is the horizontal coordinate of the second coordinate point on the second line segment in the target image, y2 is the vertical coordinate of the second coordinate point on the second line segment in the target image, lcd_w is the width of the resolution of the screen, lcd_h is the height of the resolution of the screen, the second line segment is the line segment corresponding to the first line segment after the first change, and the second coordinate point on the second line segment is the coordinate point corresponding to the first coordinate point on the first line segment after the first change.
4. The method according to claim 1, characterized in that: When the original image is a rectangular window, the first change is a 90° clockwise rotation, and the first conversion function corresponds to: x1=y2, y1=lcd_h-x2-w2, w1=h2, h1=w2; Alternatively, the first change is a clockwise rotation of 180°, and the first conversion function corresponds to: x1=lcd_w-x2-w2, y1=lcd_h-y2-h2, w1=w2, h1=h2; Alternatively, the first change is a clockwise rotation of 270°, and the first conversion function corresponds to: x1=lcd_w-y2-h2, y1=x2, w1=h2, h1=w2; Alternatively, the first change is a mirror image, and the first conversion function corresponds to: x1=x2, y1=lcd_h-y2-h2, w1=w2, h1=h2; Alternatively, the first change is a mirror image and rotated 90° clockwise, and the first conversion function corresponds to: x1=lcd_w-y2-h2, y1=lcd_h-x2-w2, w1=h2, h1=w2; Alternatively, the first change is a mirror image and rotated 180° clockwise, and the first conversion function corresponds to: x1=lcd_w-x2-w2, y1=y2, w1=w2, h1=h2; Alternatively, the first change is a mirror image and rotated 270° clockwise, and the first conversion function corresponds to: x1=y2, y1=x2, w1=h2, h1=w2; Among them, the x1 is the horizontal coordinate of the first coordinate point on the first window in the original image, the y1 is the vertical coordinate of the first coordinate point on the first window in the original image, the x2 is the horizontal coordinate of the second coordinate point on the second window in the target image, the y2 is the vertical coordinate of the second coordinate point on the second window in the target image, the w1 is the width of the first window, the h1 is the height of the first window, the w2 is the width of the second window, the h2 is the height of the second window, the lcd_w is the width of the resolution of the screen, the lcd_h is the height of the resolution of the screen, the second window is the window corresponding to the first window after the first change, and the second coordinate point on the second window is the coordinate point corresponding to the first coordinate point on the first window after the first change.
5. The method according to claim 1, characterized in that: When the original image is an irregular pattern, the first change is a 90° clockwise rotation, and the first conversion function corresponds to: x2=h-1-y1, y2=x1; Alternatively, the first change is a clockwise rotation of 180°, and the first conversion function corresponds to: x2=w-1-x1, y2=h-1-y1; Alternatively, the first change is a clockwise rotation of 270°, and the first conversion function corresponds to: x2=y1, y2=w-1-x1; Alternatively, the first change is a mirror image, and the first conversion function corresponds to: x2=x1, y2=h-1-y1; Alternatively, the first change is a mirror image and a 90° clockwise rotation, and the first conversion function corresponds to: x2=y1, y2=x1; Alternatively, the first change is a mirror image and rotated 180° clockwise, and the first conversion function corresponds to: x2=w-1-x1, y2=y1; Alternatively, the first change is a mirror image and rotated 270° clockwise, and the first conversion function corresponds to: x2=h-1-y1, y2=w-1-x1; Among them, x1 is the horizontal coordinate of the first pixel point in the original image, y1 is the vertical coordinate of the first pixel point in the original image, x2 is the horizontal coordinate of the second pixel point in the target image, y2 is the vertical coordinate of the second pixel point in the target image, w is the width of the original image, h is the height of the original image, and the second pixel point is the pixel point corresponding to the first pixel point after the first change.
6. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 5 when executing the computer program.
7. A computer-readable storage medium, the computer-readable storage medium being used to store instructions or computer programs; when the instructions or the computer program are executed, the method according to any one of claims 1 to 5 is implemented.
8. A display system comprising: A host, a display driver chip and a screen that are connected in communication in sequence; When a first change occurs in the direction of the screen, the host is used to obtain a first conversion function corresponding to the first change, and convert the original image according to the first conversion function to obtain a target image; The host is also used to write the target image into the image display memory of the display driver chip; The display driver chip is used to read the target image from the image display memory and display it through the screen; The screen is used to display the target image.
Citation Information
Patent Citations
Method and system for regulating picture of liquid crystal display
CN103366705A
Smart watch picture display control method and system, smart watch and medium
CN113281983A
Display method and related device
CN117008861A
Portable electronic apparatus, display direction converting method and recording medium
CN1534589A
Method for reducing or eliminating tearing effect of an image on a display of wearable computing device
US11705082B1