Character rotation method, control device, readable storage medium and terminal equipment
By splitting and replacing the matrix elements of the target characters in the LVGL display framework, the problem of difficult text rotation under the chip is solved with poor computing power, and the screen fluency and cost reduction effect is achieved.
Patent Information
- Application Number
- CN202311085843.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-25
- Publication Date
- 2025-03-04
AI Technical Summary
Under the conditions of using chips with poor computing power and not supporting GPUs, the default display direction of the LVGL display frame is 90 degrees different from the required display direction, resulting in difficult text rotation, low frame rate and stuttering of the interface.
By obtaining the LVGL original matrix of the target character, splitting its high and low four bits, generating a replacement matrix, and displaying it using the LVGL display framework, thereby realizing the rotation of the text.
While maintaining the default display direction of the screen, text rotation under the LVGL display frame is realized, ensuring screen fluency and reducing costs.
Smart Images

Figure CN119557023A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of terminal display technology, and specifically provides a text rotation method, a control device, a readable storage medium and a terminal device. Background Art
[0002] When developing terminal products with screens, sometimes it is necessary to select chips with average computing power in order to achieve the required functions while maintaining costs. The screen selection can also reduce costs to a certain extent. When the chip has poor computing power and does not support GPU (graphics processing unit), the display framework generally selected is LVGL (Light and Versatile Graphics Library). When the LVGL display framework is applied, the default display direction of the screen differs by 90 degrees from the required display direction, and if the screen itself does not support rotation, the text needs to be rotated 90 degrees to achieve correct display.
[0003] Accordingly, the art needs a new text rotation solution to solve the above problem. Summary of the invention
[0004] In order to overcome the above-mentioned defects, the present invention is proposed to provide a solution or at least partially solve the problem of how to realize text rotation in the LVGL display framework while maintaining the default display direction of the screen.
[0005] In a first aspect, the present invention provides a method for rotating a character, the method comprising:
[0006] According to the target character to be processed, obtaining the LVGL original matrix of the target character;
[0007] Splitting the upper four bits and the lower four bits of each element in the LVGL original matrix to obtain a split matrix of the target character;
[0008] According to the split matrix, obtaining a replacement matrix of the target character;
[0009] The target character is displayed according to the replacement matrix and the LVGL display framework, thereby realizing the rotation of the target character.
[0010] In a technical solution of the above-mentioned character rotation method, obtaining a replacement matrix of the target character according to the split matrix includes:
[0011] Transpose and flip the split matrix to obtain a mirror matrix of the target character;
[0012] Every two adjacent elements in each row of the mirror matrix are merged to obtain a replacement matrix for the target character.
[0013] In a technical solution of the above-mentioned character rotation method, the step of transposing and flipping the split matrix to obtain a mirror matrix of the target character includes:
[0014] Performing a transposition operation on the split matrix to obtain a transposed matrix of the target character;
[0015] The transposed matrix is flipped upside down to obtain a mirror image matrix of the target character.
[0016] In a technical solution of the above-mentioned character rotation method, merging every two adjacent elements in each row of the mirror matrix to obtain a replacement matrix of the target character includes:
[0017] For each row of the mirror matrix, every two adjacent elements in the current row are divided into a group;
[0018] The first element in each group of adjacent elements is used as the upper four bits, and the second element in each group of adjacent elements is used as the lower four bits, so as to obtain a replacement matrix of the target character;
[0019] The number of rows of the replacement matrix and the mirror matrix is the same, the number of elements in each row of the replacement matrix is half the number of elements in the corresponding row of the mirror matrix, and each group of adjacent elements includes c (2i-1)j and c 2ij , the corresponding element of the replacement matrix is d ij .
[0020] In a technical solution of the above-mentioned character rotation method, the high four bits and the low four bits of each element in the LVGL original matrix are split to obtain the split matrix of the target character, including:
[0021] For each row of the LVGL original matrix, the upper four bits and the lower four bits of each element of the current row are split and used as two elements of the current row of the split matrix respectively;
[0022] The number of rows of the LVGL original matrix and the split matrix is the same, the number of elements in each row of the split matrix is twice the number of elements in the corresponding row of the LVGL original matrix, and the elements of the LVGL original matrix are a ij , the split matrix is ij The corresponding two elements are b (2i-1)j and b 2ij .
[0023] In a technical solution of the above-mentioned text rotation method, the step of obtaining the LVGL original matrix of the target character according to the target character to be processed includes:
[0024] Perform text modulo on the target character to be processed to obtain LVGL original modulo data;
[0025] Based on the LVGL original modulo data, an LVGL original matrix of the target character is constructed.
[0026] In a technical solution of the above-mentioned text rotation method, the text modulus is performed on the target character to be processed to obtain the LVGL original modulus data, including:
[0027] Based on the LVGL modulo tool, text modulo is performed on the target character to be processed to obtain the LVGL original modulo data.
[0028] In a second aspect, a control device is provided, which includes at least one processor and at least one storage device, wherein the storage device is suitable for storing multiple program codes, and the program codes are suitable for being loaded and run by the processor to execute the text rotation method described in any one of the technical solutions of the above-mentioned text rotation method.
[0029] In a third aspect, a computer-readable storage medium is provided, wherein a plurality of program codes are stored therein, wherein the program codes are suitable for being loaded and run by a processor to execute the text rotation method described in any one of the technical solutions of the above-mentioned text rotation method.
[0030] In a fourth aspect, a terminal device is provided, the terminal device supports the LVGL display framework, and the terminal device includes the control device in the above-mentioned control device technical solution.
[0031] The above one or more technical solutions of the present invention have at least one or more of the following Beneficial effects:
[0032] In the technical solution of the present invention, the present invention obtains the LVGL original matrix of the target character according to the target character to be processed, splits the upper four bits and the lower four bits of each element in the LVGL original matrix, obtains the split matrix of the target character, obtains the replacement matrix of the target character according to the split matrix, and displays the target character according to the replacement matrix and the LVGL display framework, thereby realizing the rotation of the target character. Through the above configuration, the present invention can realize the text rotation under the LVGL display framework while maintaining the default display direction of the screen, and even if a chip with general computing power (such as a chip using an RTOS system) is used, the screen can be rotated while ensuring the smoothness of the screen, and the cost can be effectively reduced while ensuring the display effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The disclosure of the present invention will become more easily understood with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present invention. Among them:
[0034] Figure 1 is a schematic flow chart of main steps of a method for rotating text according to an embodiment of the present invention;
[0035] Figure 2 is a schematic flow chart of main steps of a method for rotating text according to an implementation of an embodiment of the present invention;
[0036] Figure 3 is a schematic diagram of an interface of an LVGL mold taking tool according to an implementation of an embodiment of the present invention;
[0037] Figure 4 It is a schematic diagram of the display effect of a target character before and after rotation according to an example of an embodiment of the present invention. DETAILED DESCRIPTION
[0038] Some embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.
[0039] In the description of the present invention, "module" and "processor" may include hardware, software or a combination of the two. A module may include hardware circuits, various suitable sensors, communication ports, and memories, and may also include software parts, such as program codes, or a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor, or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware, or a combination of the two. Non-temporary computer-readable storage media include any suitable medium that can store program codes, such as a magnetic disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, and the like. The term "A and / or B" means all possible combinations of A and B, such as only A, only B, or A and B. The term "at least one A or B" or "at least one of A and B" has a similar meaning to "A and / or B", and may include only A, only B, or A and B. The singular terms "one" and "the" may also include plural forms.
[0040] Here we first explain some terms involved in the present invention.
[0041] LVGL (Light and Versatile Graphics Library) is a lightweight embedded graphics library. It provides everything you need to create embedded GUIs, with easy-to-use graphic elements, beautiful visual effects, and low memory usage.
[0042] Real-time Operating System (RTOS) refers to an operating system that can accept and process external events or data at a sufficiently fast speed when they occur, and the processing results can control the production process or respond quickly to the processing system within a specified time, dispatch all available resources to complete real-time tasks, and control all real-time tasks to run in a coordinated manner. Providing timely response and high reliability are its main features.
[0043] Linux, the full name of GNU / Linux, is a UNIX-like operating system that is free to use and freely disseminated. It is a multi-user, multi-tasking, multi-threaded and multi-CPU operating system based on POSIX. It supports 32-bit and 64-bit hardware and can run major Unix tool software, applications and network protocols. Linux inherits the network-centric design concept of Unix and is a multi-user network operating system with stable performance.
[0044] Android is a free and open source Linux distribution based on the Linux kernel (excluding GNU components). It is mainly used in mobile devices such as smartphones and tablets, and is led and developed by Google and the Open Handset Alliance in the United States.
[0045] A graphics processing unit (GPU), also known as a display core, visual processor, or display chip, is a microprocessor that is specifically used to perform image and graphics-related calculations on personal computers, workstations, game consoles, and some mobile devices (such as tablets, smart phones, etc.).
[0046] Frame rate is the frequency (rate) at which bitmap images, called frames, appear continuously on a display. The term also applies to film and video cameras, computer graphics, and motion capture systems. Frame rate can also be called frame frequency and is expressed in Hertz (Hz).
[0047] In the process of developing and selecting products with screens, being able to reduce product costs while achieving the required functions will bring certain advantages to product sales to a certain extent. Currently, most products with screens are implemented based on Linux and Android systems. These two systems are difficult to develop and have high requirements for chip resources, resulting in relatively high development costs.
[0048] In comparison, using RTOS system for development will greatly reduce the development difficulty, and RTOS system requires relatively few system resources, which can reduce costs to a certain extent. The commonly used display framework based on RTOS system is LVGL framework, which has low requirements for chip resources, rich display effects and development materials, and can achieve the required display effect in a short time.
[0049] There are two ways to rotate the screen of the LVGL display framework. One is to directly modify the display direction settings provided by the LVGL underlying layer. However, this method requires high chip computing power. The chip computing power corresponding to the RTOS system is poorer than that of Android and Linux, and it does not have a GPU. There are certain disadvantages in processing screen rotation based on this method, and the frame rate of the screen after rotation is low, resulting in screen freeze.
[0050] Another way to rotate the screen is to not change the underlying display direction of LVGL, but to rotate the display controls when designing the UI. The advantage of this method is that the designed UI is displayed directly without conversion and without the need for additional chip computing power. However, the biggest difficulty of this rotation method is the rotation of the text display direction. Other controls, such as buttons and picture displays, can be rotated directly, but the text display is different. The LVGL display framework itself is equipped with a text modulus tool, but this tool needs to provide the corresponding font library to modulus the required text. After the text is rotated, it is displayed at 90 degrees. Currently, there is no font library that displays at 90 degrees, so direct modulus is difficult.
[0051] In order to solve the problems of low frame rate and interface freeze caused by a chip using an RTOS system when processing screen rotation, the present invention provides a new text rotation method.
[0052] See attached Figure 1 , Figure 1 FIG. 1 is a flow chart showing the main steps of a method for rotating text according to an embodiment of the present invention. Figure 1 As shown, the text rotation method in the embodiment of the present invention mainly includes the following steps S101 to S104.
[0053] Step S101: According to the target character to be processed, the LVGL original matrix of the target character is obtained.
[0054] In this embodiment, the LVGL original matrix of the target character may be acquired according to the target character to be processed.
[0055] In one implementation, step S101 may further include the following steps S1011 and S1012:
[0056] Step S1011: Perform text modulo on the target character to be processed to obtain LVGL original modulo data.
[0057] In this embodiment, please refer to the attached Figure 3 , Figure 3 FIG. 1 is a schematic diagram of an interface of an LVGL mold taking tool according to an implementation of an embodiment of the present invention. Figure 3 As shown, you can use the LVGL modulo tool to obtain LVGL original modulo data. You can set the font name through Name, set the font size through Size, select the font file through the TTF / WOFF option, enter the target character in Symbols, and click Convert to obtain the LVGL original modulo data.
[0058] Step S1012: constructing the LVGL original matrix of the target character based on the LVGL original modulo data.
[0059] In this embodiment, the LVGL original matrix of the target character can be constructed based on the LVGL original modulo data, that is, the LVGL original modulo data can be converted into the LVGL original matrix according to the width and height of the target character.
[0060] Step S102: Split the upper four bits and the lower four bits of each element in the LVGL original matrix to obtain a split matrix of the target character.
[0061] In this embodiment, the elements of the LVGL original matrix may be split into upper four bits and lower four bits to obtain a split matrix of the target character.
[0062] In one implementation, step S102 may be further configured as follows:
[0063] For each row of the LVGL original matrix, the upper four bits and lower four bits of each element of the current row are split and used as the two elements of the current row of the split matrix respectively; the number of rows of the LVGL original matrix and the split matrix is the same, and the number of elements in each row of the split matrix is twice the number of elements in the corresponding row of the LVGL original matrix. The elements of the LVGL original matrix are a ij , split matrix and a ij The corresponding two elements are b (2i-1)j and b 2ij .
[0064] In this embodiment, the upper four bits and lower four bits of each LVGL original matrix element can be split, and the split elements form a split matrix. For example, if the LVGL original matrix is a 15×8 matrix, then the split matrix is a 15×16 matrix.
[0065] Step S103: Obtain a replacement matrix for the target character according to the split matrix.
[0066] In this embodiment, a replacement matrix of the target character may be generated according to the split matrix.
[0067] In one implementation, step S103 may include the following steps S1031 and S1032:
[0068] Step S1031: performing transposition and flipping operations on the split matrix to obtain a mirror matrix of the target character.
[0069] In this implementation, step S1031 may further include the following steps S10311 and S10312:
[0070] Step S10311: performing a transposition operation on the split matrix to obtain a transposed matrix of the target character.
[0071] Step S10312: Flip the transposed matrix upside down to obtain a mirror matrix of the target character.
[0072] In this implementation, a transposition operation may be performed on the split matrix to obtain a transposed matrix, and then the transposed matrix may be flipped upside down to obtain a mirror matrix.
[0073] Step S1032: merge every two adjacent elements in each row of the mirror matrix to obtain a replacement matrix for the target character.
[0074] In this implementation, step S1032 may further include the following steps S10321 and S10322:
[0075] Step S10321: For each row of the mirror matrix, divide every two adjacent elements in the current row into a group.
[0076] Step S10322: The first element in each group of adjacent elements is used as the upper four bits, and the second element in each group of adjacent elements is used as the lower four bits, so as to obtain a replacement matrix of the target character; wherein the replacement matrix has the same number of rows as the mirror matrix, the number of elements in each row of the replacement matrix is half the number of elements in the corresponding row of the mirror matrix, and each group of adjacent elements includes c (2i-1)j and c 2ij , the corresponding element of the replacement matrix is d ij .
[0077] In this implementation, two adjacent elements in each row of the mirror matrix may be combined as an element in the replacement matrix, thereby obtaining the replacement matrix.
[0078] Step S104: displaying the target character according to the replacement matrix and the LVGL display framework, thereby realizing the rotation of the target character.
[0079] In this implementation, the LVGL original matrix may be replaced with a replacement matrix, and displayed based on the LVGL display framework, which displays the effect of the target character being rotated 90 degrees counterclockwise.
[0080] Based on the above steps S101 - S104, in the embodiment of the present invention, according to the target character to be processed, the LVGL original matrix of the target character is obtained, the high four bits and the low four bits of each element in the LVGL original matrix are split to obtain the split matrix of the target character, according to the split matrix, the replacement matrix of the target character is obtained, and according to the replacement matrix and the LVGL display framework, the display of the target character is performed, so as to realize the rotation of the target character. Through the above configuration method, the embodiment of the present invention can realize the rotation of the text under the LVGL display framework on the premise of keeping the default display direction of the screen. Even for a chip with general computing power (such as a chip using the RTOS system), it can ensure the smoothness of the screen while realizing the screen rotation, and can effectively reduce the cost while ensuring the display effect.
[0081] Taking the character "ju" in Founder Lanting Hei as an example of the target character, the text rotation method of the present invention will be further described below.
[0082] First, perform modulo operation on the target character, with the font size being 16. The obtained LVGL original modulo data is as follows, a total of 120 bytes:
[0083] The converted character information is as follows, with the character width and height being 16 and 15 respectively.
[0084] {.bitmap_index = 4670,.adv_w = 256,.box_w = 16,.box_h = 15,.ofs_x = 0,.ofs_y = -2},
[0085] The LVGL original modulo data can be regarded as a 15×8 matrix, that is, the LVGL original matrix, as shown below:
[0086] Split the high four bits and the low four bits of the LVGL original matrix to obtain a 15×16 split matrix, as shown below:
[0087] Since the display direction on the screen side needs to be rotated 90 degrees counterclockwise, the split matrix needs to be transposed to obtain the transposed matrix, as shown below:
[0088] After obtaining the transposed matrix, the data display direction is left - right mirror image. At this time, the transposed matrix needs to be flipped up and down to obtain the mirror matrix, as shown below:
[0089] Since the first step in the matrix operation process is to disassemble the upper four bits and the lower four bits of the LVGL original matrix, after the data conversion is completed, the data needs to be merged left and right to obtain the replacement matrix (when the number of row elements of the mirror matrix is odd, the lower four bits of the last element of the replacement matrix can be filled with 0), as shown below:
[0090] Use the replacement matrix as the modulo data to replace the original LVGL modulo data, and then use the LVGL display framework to display it. At this time, the target character can be rotated 90 degrees counterclockwise. For details, please refer to the attached Figure 4 , Figure 4 1 is a schematic diagram of the display effect of a target character before and after rotation according to an example of an embodiment of the present invention. Figure 4 As shown, the left side is the original target character, and the right side is the rotated target character.
[0091] In one embodiment, please refer to the attached Figure 2 , Figure 2 FIG. 1 is a flow chart showing the main steps of a method for rotating text according to an embodiment of the present invention. Figure 2 As shown, the text rotation method may include the following steps S201 to S207:
[0092] Step S201: Use the LVGL modulo tool to perform text modulo on the target character to obtain a target font file (LVGL original modulo number).
[0093] In this embodiment, step S201 is similar to the method described in step S1011 and will not be described again for simplicity.
[0094] Step S202: Process the modulo target character according to the width w and height h of the target character to obtain an h×(w / 2) LVGL original matrix.
[0095] In this embodiment, step S202 is similar to the method described in step S1012 and will not be described again for simplicity.
[0096] Step S203: Decompose the divided LVGL original matrix to obtain an h×w split matrix A.
[0097] In this embodiment, step S203 is similar to the method described in step S102, and for the sake of simplicity, it will not be repeated here.
[0098] Step S204: performing matrix transposition on the split matrix A to obtain a w×h transposed matrix B.
[0099] In this embodiment, step S204 is similar to the method described in step S10311, and for the sake of simplicity, it is not repeated here.
[0100] Step S205: Perform an upside-down flip operation on the transposed matrix B to obtain a w×h mirror matrix C.
[0101] In this embodiment, step S205 is similar to the method described in step S10312, and for the sake of simplicity, it is not repeated here.
[0102] Step S206: merge the mirror matrix C to obtain a final replacement matrix, which is the processed data matrix.
[0103] In this embodiment, step S206 is similar to the method described in step S1032 and will not be described again for simplicity.
[0104] Step S207: Replace the processed data matrix into the initial text library file for use.
[0105] In this embodiment, step S207 is similar to the method described in step S104, and for the sake of simplicity, it is not repeated here.
[0106] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effects of the present invention, different steps do not have to be performed in such an order. They can be performed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present invention.
[0107] It is understood by those skilled in the art that the present invention implements all or part of the processes in the method of the above embodiment, and can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program code. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.
[0108] Furthermore, the present invention also provides a control device. In an embodiment of a control device according to the present invention, the control device includes a processor and a storage device, the storage device can be configured to store a program for executing the text rotation method of the above method embodiment, and the processor can be configured to execute the program in the storage device, which includes but is not limited to the program for executing the text rotation method of the above method embodiment. For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The control device can be a control device device formed by various electronic devices.
[0109] In the embodiment of the present invention, the control device may be a control device device formed by various electronic devices. In some possible implementations, the control device may include multiple storage devices and multiple processors. The program for executing the text rotation method of the above method embodiment may be divided into multiple subprograms, each of which may be loaded and run by a processor to execute different steps of the text rotation method of the above method embodiment. Specifically, each subprogram may be stored in different storage devices, and each processor may be configured to execute the programs in one or more storage devices to jointly implement the text rotation method of the above method embodiment, that is, each processor executes different steps of the text rotation method of the above method embodiment, to jointly implement the text rotation method of the above method embodiment.
[0110] The above-mentioned multiple processors may be processors deployed on the same device. For example, the above-mentioned control device may be a high-performance device composed of multiple processors, and the above-mentioned multiple processors may be processors configured on the high-performance device. In addition, the above-mentioned multiple processors may also be processors deployed on different devices. For example, the above-mentioned control device may be a server cluster, and the above-mentioned multiple processors may be processors on different servers in the server cluster.
[0111] Furthermore, the present invention also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present invention, the computer-readable storage medium can be configured to store a program for executing the text rotation method of the above method embodiment, and the program can be loaded and run by the processor to implement the above text rotation method. For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The computer-readable storage medium can be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present invention is a non-temporary computer-readable storage medium.
[0112] Furthermore, the present invention also provides a terminal device. In an embodiment of the terminal device according to the present invention, the terminal device can support the LVGL display framework, and the terminal device includes the control device in the above control device embodiment.
[0113] In one implementation, the terminal device may be a display device with a screen.
[0114] Further, it should be understood that since the setting of each module is only for illustrating the functional units of the device of the present invention, the physical devices corresponding to these modules may be the processor itself, or a part of the software in the processor, a part of the hardware, or a part of the combination of software and hardware. Therefore, the number of each module in the figure is only schematic.
[0115] Those skilled in the art will appreciate that the modules in the device can be adaptively split or merged. Such splitting or merging of specific modules will not cause the technical solution to deviate from the principle of the present invention, and therefore, the technical solutions after splitting or merging will fall within the protection scope of the present invention.
[0116] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
Claims
1. A method for rotating text, characterized in that: The method comprises: According to the target character to be processed, obtaining the LVGL original matrix of the target character; Splitting the upper four bits and the lower four bits of each element in the LVGL original matrix to obtain a split matrix of the target character; According to the split matrix, obtaining a replacement matrix of the target character; The target character is displayed according to the replacement matrix and the LVGL display framework, thereby realizing the rotation of the target character.
2. The character rotation method according to claim 1, characterized in that: The step of obtaining a replacement matrix of the target character according to the splitting matrix includes: Transpose and flip the split matrix to obtain a mirror matrix of the target character; Every two adjacent elements in each row of the mirror matrix are merged to obtain a replacement matrix for the target character.
3. The character rotation method according to claim 2, characterized in that: The step of transposing and flipping the split matrix to obtain a mirror matrix of the target character includes: Performing a transposition operation on the split matrix to obtain a transposed matrix of the target character; The transposed matrix is flipped upside down to obtain a mirror image matrix of the target character.
4. The character rotation method according to claim 2, characterized in that: The step of merging every two adjacent elements in each row of the mirror matrix to obtain a replacement matrix of the target character includes: For each row of the mirror matrix, every two adjacent elements in the current row are divided into a group; The first element in each group of adjacent elements is used as the upper four bits, and the second element in each group of adjacent elements is used as the lower four bits, so as to obtain a replacement matrix of the target character; The number of rows of the replacement matrix and the mirror matrix is the same, the number of elements in each row of the replacement matrix is half the number of elements in the corresponding row of the mirror matrix, and each group of adjacent elements includes c (2i-1)j and c 2ij , the corresponding element of the replacement matrix is d ij .
5. The character rotation method according to claim 1, characterized in that: The step of splitting the upper four bits and the lower four bits of each element in the LVGL original matrix to obtain the split matrix of the target character includes: For each row of the LVGL original matrix, the upper four bits and the lower four bits of each element of the current row are split and used as two elements of the current row of the split matrix respectively; The number of rows of the LVGL original matrix and the split matrix is the same, the number of elements in each row of the split matrix is twice the number of elements in the corresponding row of the LVGL original matrix, and the elements of the LVGL original matrix are a ij , the split matrix is ij The corresponding two elements are b (2i-1)j and b 2ij .
6. The character rotation method according to claim 1, characterized in that: The step of obtaining the LVGL original matrix of the target character according to the target character to be processed includes: Perform text modulo on the target character to be processed to obtain LVGL original modulo data; Based on the LVGL original modulo data, an LVGL original matrix of the target character is constructed.
7. The character rotation method according to claim 6, characterized in that: The method of performing text modulo on the target character to be processed to obtain LVGL original modulo data includes: Based on the LVGL modulo tool, text modulo is performed on the target character to be processed to obtain the LVGL original modulo data.
8. A control device, comprising at least one processor and at least one storage device, wherein the storage device is suitable for storing a plurality of program codes, characterized in that: The program code is suitable for being loaded and run by the processor to execute the text rotation method according to any one of claims 1 to 7.
9. A computer-readable storage medium storing a plurality of program codes, characterized in that: The program code is suitable for being loaded and run by a processor to execute the text rotation method according to any one of claims 1 to 7.
10. A terminal device, characterized in that: The terminal device supports the LVGL display framework, and the terminal device includes the control device according to claim 8.
Citation Information
Patent Citations
Synchronous display method and device, storage medium and electronic device
CN109766163A
Encoding and decoding methods and devices, electronic equipment and storage medium
CN116257146A
Bit map image rotation method
JP2005178033A
Apparatus and method for rotating on-screen displayfonts
KR1020020041199A
Apparatus for high speed image rotation
US5081700A