Wallpaper processing method, electronic equipment and storage medium

By distorting the flat wallpaper using spherical lens parameters on electronic devices, spherical wallpaper is solved, and the problem of being unable to dynamically generate spherical wallpaper in the existing technology is solved, and the richness and flexibility of wallpaper display is improved.

CN119668480AActive Publication Date: 2025-03-21WUHAN XINGJI MEIZU TECH CO LTD

Patent Information

Application Number
CN202510149155.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-11
Publication Date
2025-03-21
Estimated Expiration
2045-02-11

AI Technical Summary

Technical Problem

The existing technology cannot dynamically generate spherical wallpapers, resulting in the content of the wallpaper being displayed inflexibly.

Method used

By implementing a wallpaper processing method on an electronic device, distorting the texture coordinates of the flat wallpaper using the parameters of the spherical lens to generate a spherical wallpaper, and display the wallpaper in the sub-display area.

Benefits of technology

It realizes dynamic conversion from flat wallpaper to spherical wallpaper, improves the richness and flexibility of wallpaper display, and enhances visual impact.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119668480A_ABST
    Figure CN119668480A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and provides a wallpaper processing method, electronic equipment and a storage medium, and the method comprises the steps: responding to a screen turn-off instruction triggered in a first interface of the electronic equipment, and obtaining first wallpaper displayed in the first interface of the electronic equipment, the first wallpaper is displayed in a main display area of the electronic equipment; second wallpaper is displayed in a sub-display area of the electronic device, the content of the second wallpaper is displayed by mapping the first wallpaper from the main display area to the sub-display area, and the sub-display area is located in the main display area. According to the method, the electronic equipment and the storage medium provided by the invention, dynamic conversion from the first wallpaper to the second wallpaper is realized, and the richness and flexibility of wallpaper display are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a wallpaper processing method, an electronic device and a storage medium. Background Art

[0002] As an important part of the personalized interface of smart terminals, the design and technical implementation of wallpaper have always attracted widespread attention from users.

[0003] At present, the realization of the spherical wallpaper function has met the user's demand for personalized and dynamic wallpaper to a certain extent. This spherical wallpaper function is mainly realized by playing pre-made videos, lacks dynamic generation capabilities, and cannot flexibly change the display content of the spherical wallpaper. Summary of the invention

[0004] The present application provides a wallpaper processing method, an electronic device and a storage medium, so as to solve the defect that spherical wallpaper cannot be dynamically generated in the related art.

[0005] The present application provides a wallpaper processing method, which is applied to electronic equipment, including: In response to triggering a screen-off instruction on a first interface of the electronic device, acquiring a first wallpaper displayed on the first interface of the electronic device, wherein the first wallpaper is displayed in a main display area of ​​the electronic device; and A second wallpaper is displayed in the sub-display area of ​​the electronic device, wherein the content of the second wallpaper is presented by mapping the first wallpaper from the main display area to the sub-display area, and the sub-display area is located in the main display area.

[0006] According to a wallpaper processing method provided by the present application, the first interface is a lock screen interface or a main display interface, the first wallpaper is a plane wallpaper of the lock screen interface or the main display interface, the main display area corresponds to the complete display area of ​​the electronic device, the second wallpaper is a spherical wallpaper under the screen-off interface, and the sub-display area is a display area located within the main display area; The displaying of the second wallpaper in the sub-display area of ​​the electronic device comprises: Acquire a first lens parameter of a spherical lens used for converting the spherical wallpaper, wherein the spherical lens corresponds to the sub-display area; Based on the first lens parameters, the texture coordinates of the plane wallpaper are distorted to obtain first distorted coordinates of the texture coordinates mapped to the spherical lens; Generate the spherical wallpaper based on mapping the texture coordinates to the first distortion coordinates under the spherical lens; A first process of converting the flat wallpaper to the spherical wallpaper is displayed in the sub-display area of ​​the electronic device.

[0007] According to a wallpaper processing method provided by the present application, the first lens parameters include a center offset, a distortion radius, and a distortion strength of the spherical lens, the center offset and the distortion strength increase as the electronic device changes from a lock screen interface or a main display interface to a screen-off interface, and the distortion radius decreases as the electronic device changes from a lock screen interface or a main display interface to a screen-off interface; The step of performing distortion processing on the texture coordinates of the plane wallpaper based on the first lens parameter to obtain first distortion coordinates of the texture coordinates mapped to the spherical lens includes: Determining a current center position of the spherical lens based on an initial center position of the spherical lens, the center offset, and an aspect ratio of the main display area of ​​the electronic device; Establishing a vector pointing to the texture coordinate based on the current center position; Calculating a vector scaling factor of the vector based on the vector, the distortion strength, and a distortion scaling factor determined by the distortion radius; The vector is scaled using the vector scaling factor, and based on the scaled vector and the current center position, a first distortion coordinate of the texture coordinate mapped to the spherical lens is determined.

[0008] According to a wallpaper processing method provided by the present application, the distortion scaling coefficient is related to the smaller one of the distortion radius and the radius threshold.

[0009] According to a wallpaper processing method provided by the present application, the step of calculating the vector scaling factor of the vector based on the vector, the distortion intensity and the distortion scaling coefficient determined by the distortion radius includes: determining an intensity scaling factor for the texture coordinate based on the vector and the distortion intensity; A vector scaling factor for the vector is determined based on an intensity scaling factor for the texture coordinate and a distortion scaling factor determined by the distortion radius.

[0010] According to a wallpaper processing method provided by the present application, before determining the texture coordinates based on the scaled vector and the current center position and mapping them to the first distorted coordinates under the spherical lens, the method further includes: Determining a width scaling factor of the texture coordinates in a width direction of the main display area based on an aspect ratio of the main display area of ​​the electronic device; Based on the width scaling factor, the component of the texture coordinate in the width direction of the main display area is adjusted.

[0011] According to a wallpaper processing method provided by the present application, the current center position of the spherical lens is determined based on the initial center position of the spherical lens, the center offset, and the aspect ratio of the main display area of ​​the electronic device, including: Based on the aspect ratio of the main display area of ​​the electronic device, determining a width scaling factor of the center position coordinate of the spherical lens in the width direction of the main display area; Taking the center point of the main display area as the initial center position of the spherical lens, and determining a candidate center position of the spherical lens based on the initial center position of the spherical lens and the center offset of the spherical lens; Based on the width scaling factor, the component of the candidate center position in the width direction of the main display area is adjusted to obtain the current center position of the spherical lens.

[0012] According to a wallpaper processing method provided by the present application, the first lens parameter also includes a rotation angle, and the rotation angle changes periodically as the electronic device changes from a lock screen interface or a main display interface to a screen-off interface; The step of mapping the texture coordinates to first distorted coordinates under the spherical lens to generate the spherical wallpaper comprises: Based on the center offset of the spherical lens and the rotation angle, translating and rotating the first distorted coordinates to obtain current spherical coordinates; Based on the current spherical coordinates, a spherical wallpaper at the current moment is generated.

[0013] According to a wallpaper processing method provided by the present application, the first distorted coordinates are translated and rotated based on the center offset of the spherical lens and the rotation angle to obtain the current spherical coordinates, including: Mapping the first distorted coordinates from a first interval to a second interval; Based on the center offset, the first distorted coordinates in the second interval are translated to obtain translated second distorted coordinates; offsetting the translated second distorted coordinates to obtain offset second distorted coordinates, wherein the offset degree is determined according to a deviation between a rotation center and the current center position; Adjusting the texture coordinate density of the offset second distorted coordinates in the width direction of the main display area using the aspect ratio of the main display area of ​​the electronic device to obtain third distorted coordinates; Rotating the third distorted coordinates based on the rotation angle to obtain rotated third distorted coordinates; Restoring the texture coordinate density of the rotated third distorted coordinates in the width direction of the main display area and canceling the offset of the rotated third distorted coordinates; The third distorted coordinates after the texture coordinate density is restored and the offset is canceled are mapped back to the first interval to obtain the current spherical coordinates.

[0014] A wallpaper processing method provided in the present application also includes: A shadow is superimposed on the spherical wallpaper based on the shadow texture coordinates corresponding to the spherical lens.

[0015] A wallpaper processing method provided in the present application also includes: Based on the center offset of the spherical lens and the shadow rotation angle, the original shadow texture coordinates corresponding to the spherical lens are offset and rotated to obtain the shadow texture coordinates.

[0016] According to a wallpaper processing method provided by the present application, based on the center offset of the spherical lens and the shadow rotation angle, the original shadow texture coordinates corresponding to the spherical lens are offset and rotated to obtain the shadow texture coordinates, including: Mapping the original shadow texture coordinates from the first interval to a third interval, and translating the shadow texture coordinates in the third interval based on the center offset of the spherical lens to obtain shadow translation coordinates; Scaling the shadow translation coordinates based on the aspect ratio of the main display area of ​​the electronic device and the distortion radius of the spherical lens to obtain shadow scaling coordinates; Based on the shadow rotation angle, the shadow scaling coordinates are rotated to obtain shadow rotation coordinates; The shadow rotation coordinates are mapped back to the first interval to obtain the shadow texture coordinates.

[0017] According to a wallpaper processing method provided by the present application, the shadow is superimposed on the spherical wallpaper based on the shadow texture coordinates corresponding to the spherical lens, including: Based on the first distorted coordinates, sampling color information from the texture image of the plane wallpaper; Based on the shadow texture coordinates, sampling shadow intensity information from a shadow texture corresponding to the spherical lens; Based on the shadow intensity information and the shadow ratio, the color information and black are mixed; The shadow ratio increases as the electronic device changes from the lock screen interface or the main display interface to the screen off interface.

[0018] According to a wallpaper processing method provided by the present application, sampling color information from the texture image of the plane wallpaper based on the first distorted coordinates includes: Based on the first distorted coordinates, sampling original color information from the blurred texture image of the plane wallpaper; Based on the shadow ratio, the saturation of the original color information is adjusted to obtain the color information.

[0019] According to a wallpaper processing method provided by the present application, the texture coordinates of the plane wallpaper are distorted based on the first lens parameters to obtain first distorted coordinates of the texture coordinates mapped to the spherical lens, including: Based on the first lens parameters, the texture coordinates of the blurred texture image of the plane wallpaper are distorted to obtain first distorted coordinates of the texture coordinates mapped to the spherical lens; The blur radius used for the blurring process increases as the electronic device changes from the lock screen interface or the main display interface to the screen off interface.

[0020] According to a wallpaper processing method provided by the present application, the step of obtaining a first lens parameter of a spherical lens used to convert the spherical wallpaper includes: Obtaining a first lens parameter under the current animation progress from a parameter range corresponding to the animation progress of converting the plane wallpaper into the spherical wallpaper; The step of generating the spherical wallpaper comprises: Generate a spherical wallpaper under the current animation progress.

[0021] A wallpaper processing method provided in the present application also includes: In response to triggering a screen-on instruction on a screen-off interface of the electronic device, obtaining second lens parameters, wherein the second lens parameters include a center offset, a distortion radius, and a distortion strength of the spherical lens, the center offset and the distortion strength decrease as the electronic device changes from the screen-off interface to the lock screen interface or the main display interface, and the distortion radius increases as the electronic device changes from the screen-off interface to the lock screen interface or the main display interface; A second process of converting the spherical wallpaper to the flat wallpaper is displayed in the sub-display area of ​​the electronic device.

[0022] The present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the wallpaper processing method described above is implemented.

[0023] The present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the wallpaper processing method described in any one of the above is implemented.

[0024] The present application also provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the wallpaper processing method described above is implemented.

[0025] The wallpaper processing method, electronic device and storage medium provided in the present application realize dynamic conversion from the first wallpaper to the second wallpaper by mapping the first wallpaper from the main display area to the sub-display area to obtain and display the second wallpaper, thereby improving the richness and flexibility of wallpaper display. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the present application or related technologies, the following is a brief introduction to the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0027] Figure 1 A schematic diagram of the structure of a terminal provided in an embodiment of the present application.

[0028] Figure 2 This is one of the flow charts of the wallpaper processing method provided in the embodiment of the present application.

[0029] Figure 3 A schematic diagram of the first process of converting a flat wallpaper into a spherical wallpaper provided in an embodiment of the present application.

[0030] Figure 4 A schematic diagram of a process for displaying a spherical wallpaper in a sub-display area provided in an embodiment of the present application.

[0031] Figure 5 It is a flowchart of the distortion processing provided in the embodiment of the present application.

[0032] Figure 6 This is a schematic diagram of the original shadow texture provided in an embodiment of the present application.

[0033] Figure 7 It is a flowchart of Gaussian blur provided in an embodiment of the present application.

[0034] Figure 8 This is the second flow chart of the wallpaper processing method provided in the embodiment of the present application.

[0035] Fig. 9 It is a schematic diagram of a spherical wallpaper with superimposed shadows provided in an embodiment of the present application.

[0036] Fig.10 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0038] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first" and "second" are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally represents that the objects associated with each other are in an "or" relationship.

[0039] As an important part of the personalized interface of smart terminals, the design and technical implementation of wallpaper have always attracted widespread attention from users.

[0040] At present, some manufacturers have launched spherical wallpaper functions, which to a certain extent meet the user's demand for personalized and dynamic wallpapers. This spherical wallpaper function is mainly achieved by playing pre-made videos, and the video content mainly shows the translation, rotation, scaling and other operations on spherical objects, such as planets or other spherical objects. These operations all belong to the category of linear transformation, that is, the pixels in the video image are transformed according to a fixed linear relationship, thereby achieving a simple dynamic effect.

[0041] Although the existing spherical wallpaper function has achieved certain breakthroughs in visual effects, it still has certain limitations.

[0042] Specifically, existing implementation solutions for spherical wallpapers mainly rely on pre-made video files, lack the ability to further process or dynamically generate video content, and cannot flexibly change the display content of the spherical wallpaper.

[0043] Moreover, although linear transformation can achieve basic image transformation, it is obviously insufficient in simulating the complex light and shadow effects and object shape changes in the real world. Since only linear transformation operations are used, the dynamic effects of wallpaper are relatively simple and lack sufficient diversity and depth.

[0044] To this end, the present application provides a wallpaper processing method, which performs nonlinear distortion processing on the texture coordinates of a flat wallpaper based on a spherical lens to achieve the conversion from a flat wallpaper to a spherical wallpaper, thereby greatly improving the flexibility and richness of the images contained in the spherical wallpaper. Moreover, compared with the conversion method of linear transformation, the texture image of the flat wallpaper can be mapped to a spherical model with more three-dimensionality and depth through nonlinear distortion, so as to enhance the visual impact of the spherical wallpaper on the viewer.

[0045] The wallpaper processing method provided in the embodiments of the present application can be applied to electronic devices, specifically to mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA) and other terminals. It can also be applied to databases, servers and service response systems based on terminal artificial intelligence. The embodiments of the present application do not impose any restrictions on the specific types of terminals.

[0046] For example, the terminal can be a station (STAION, ST) in a WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a computer, a laptop computer, a handheld communication device, a handheld computing device, and / or other devices for communicating on a wireless system and a next-generation communication system, such as a mobile terminal in a 5G network, a mobile terminal in a future evolved Public Land Mobile Network (PLMN) or a mobile terminal in a future evolved Non-terrestrial Network (NTN), etc.

[0047] As an example but not limitation, when the terminal is a wearable device, the wearable device can also be a general term for wearable devices that are developed by applying wearable technology to intelligently design daily wearables, such as gloves, watches, AR (Augmented Reality) head-mounted display devices, VR (Virtual Reality) head-mounted display devices or MR (Mixed Reality) head-mounted display devices equipped with far-field communication modules and / or near-field communication modules.

[0048] In some embodiments, the terminal may be a Figure 1 The mobile phone 100 of the hardware structure shown in FIG. Figure 1 As shown, the mobile phone 100 may specifically include: a radio frequency (RF) circuit 110, a memory 120, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a short-range wireless communication module 170, a processor 180, and a power supply 190. Those skilled in the art will appreciate that Figure 1 The structure of the mobile phone 100 shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0049] Combine the following Figure 1 A detailed introduction to the various components of the mobile phone: The RF circuit 110 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 180 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the RF circuit 110 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, and the wireless communication can include global system for mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), new radio (new radio, NR), GNSS, FM, low-orbit satellite connection and / or IR technology, etc. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS), etc.

[0050] The memory 120 can be used to store software programs and modules. The processor 180 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 120. The memory 120 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as pictures, audio data, phone books, etc.), etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Specifically, the memory 120 may store pictures taken by an electronic device or downloaded via a wireless network.

[0051] The input unit 130 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone 100. Specifically, the input unit 130 may include a touch panel 131 and other input devices 132. The touch panel 131, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 131 or near the touch panel 131 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 131 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 180, and can receive and execute the command sent by the processor 180. In addition, the touch panel 131 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 131, the input unit 130 may also include other input devices 132. Specifically, other input devices 132 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.

[0052] The display unit 140 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 140 may include a display panel 141. Optionally, the display panel 141 may be configured in the form of a liquid crystal display (LCD), a light emitting diode (LED), an organic light emitting diode (OLED), an active-matrix organic light emitting diode (AMOLED), etc. Further, the touch panel 131 may cover the display panel 141. When the touch panel 131 detects a touch operation on or near it, it is transmitted to the processor 180 to determine the type of touch event. Subsequently, the processor 180 provides a corresponding visual output on the display panel 141 according to the type of touch event. Although in Figure 1 In the embodiment, the touch panel 131 and the display panel 141 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 131 and the display panel 141 can be integrated to realize the input and output functions of the mobile phone.

[0053] The mobile phone 100 may also include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 141 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.

[0054] The audio circuit 160, the speaker 161, and the microphone 162 can provide an audio interface between the user and the mobile phone. The audio circuit 160 can transmit the received audio data to the speaker 161 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 162 converts the collected sound signal into an electrical signal, which is received by the audio circuit 160 and converted into audio data, and then the audio data is output to the processor 180 for processing, and then sent to another electronic device through the RF circuit 110, or the audio data is output to the memory 120 for further processing.

[0055] Communication technologies such as Wi-Fi, Bluetooth, and Near Field Communication (NFC) belong to short-range wireless transmission technologies. The mobile phone can help users send and receive emails, browse web pages, access streaming media, etc. through the short-range wireless communication module 170, which provides users with wireless broadband Internet access. The above-mentioned short-range wireless communication module 170 may include a Wi-Fi chip, a Bluetooth chip, and an NFC chip. The Wi-Fi chip can realize the function of Wi-Fi Direct connection between the mobile phone 100 and other electronic devices, and can also make the mobile phone 100 work in an AP mode (Access Point mode) that can provide wireless access services and allow other wireless devices to access, or work in a STA mode (Station mode) that can connect to an AP but does not accept wireless devices to access, thereby establishing point-to-point communication between the mobile phone 100 and other Wi-Fi devices.

[0056] The processor 180 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 120, and calling data stored in the memory 120, it executes various functions of the mobile phone and processes data, thereby monitoring the mobile phone as a whole. Optionally, the processor 180 may include one or more processing units; optionally, the processor 180 may include, for example, an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural-network processing unit (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors.

[0057] The mobile phone 100 also includes a power source 190 (such as a battery) for supplying power to various components. Preferably, the power source can be logically connected to the processor 180 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.

[0058] The mobile phone 100 may further include a camera. Optionally, the camera may be located at the front or rear of the mobile phone, which is not limited in the present embodiment.

[0059] Figure 2One of the flowcharts of the wallpaper processing method provided in the embodiment of the present application is applied to the electronic device as described above in this article, and the method includes: Step 210: In response to triggering a screen-off instruction on a first interface of the electronic device, obtaining a first wallpaper displayed on the first interface of the electronic device, wherein the first wallpaper is displayed in a main display area of ​​the electronic device.

[0060] For example, the electronic device may be the aforementioned mobile phone 100, see Figure 3 As shown in the four interfaces AD in the figure, it shows a schematic diagram of changing from a flat wallpaper of the lock screen interface to a spherical wallpaper of the screen-off interface provided by an embodiment of the present application. Among them, the main display area 310 can refer to the area included in the display panel 141 of the mobile phone 100, that is, the area (or also called a screen or window) that the mobile phone 100 can provide visual effects for the user. In some examples, the display panel 141 can also be set on the back of the mobile phone 100. In this case, the main display area 310 can also refer to the display area on the back of the mobile phone 100.

[0061] In some examples, the first interface may be the lock screen interface or the main display interface of the mobile phone 100. The main display interface refers to the interface that the mobile phone 100 enters from, for example, the lock screen interface or the screen-off interface. In the main display interface, the mobile phone 100 may arrange and display icons of installed applications, smart cards, or other suitable display contents. In the main display interface, the user may open the application through instructions to implement various functions such as calling, paying, shooting, and socializing. The first wallpaper is a flat wallpaper displayed in the lock screen interface or the main display interface. The first wallpaper displayed in the above two interfaces may be the same wallpaper or different wallpapers. A flat wallpaper indicates that the first wallpaper is a two-dimensional image and may be displayed in the main display area 310, for example, see Figure 3 As shown in A in FIG. 1 , the first display interface is the lock screen interface of the mobile phone 100 at this time, and a lock screen wallpaper is displayed on the lock screen interface.

[0062] The screen-off instruction may be a touch instruction, a voice instruction, a gesture instruction or other suitable instruction. For example, the screen-off instruction instructs the mobile phone 100 to change from the lock screen interface to the screen-off interface, or the screen-off instruction instructs the mobile phone 100 to change from the main display interface to the screen-off interface. Figure 3 In the lock screen interface shown in A, touch the "Screen Off" button below to change from the lock screen interface to the screen off interface.

[0063] Step 220: Display a second wallpaper in the sub-display area of ​​the electronic device, wherein the content of the second wallpaper is the first wallpaper mapped from the main display area to the sub-display area, and the sub-display area is located in the main display area.

[0064] In an example, the second wallpaper is a spherical wallpaper in the screen-off interface. The spherical wallpaper can be a two-dimensional image presenting a sphere. The sub-display area is a spherical area located in the main display area and is used to display the spherical wallpaper. The content of the spherical wallpaper is presented after being mapped from the main display area to the sub-display area according to the first wallpaper.

[0065] See also Figure 3 As shown in the BD interface in FIG, the sub-display area 320a, the sub-display area 320b and the sub-display area 320c are partial display areas within the main display area 310, that is, the main display area 310 is a complete display area of ​​the mobile phone 100 that can present visual effects, and the sub-display areas (320a, 320b, 320c) can change with the change process from the lock screen interface to the screen-off interface. For example, with the change process from the lock screen interface or the main display interface to the screen-off interface, the proportion of the sub-display area (320a, 320b, 320c) occupying the main display area 310 becomes smaller and the sub-display area (320a, 320b, 320c) tends to be spherical or circular.

[0066] It should be noted that the second wallpaper can be wallpaper of other shapes, such as non-rectangular wallpaper, such as oval wallpaper or irregular wallpaper, and the sub-display area can also be a corresponding non-rectangular area, such as an oval area or an irregular area to display the second wallpaper. The description of the second wallpaper and the display shape of the sub-display area does not constitute a limitation of the present application.

[0067] Continue to see Figure 3 As shown in AD, it shows the process of an exemplary mobile phone 100 of the present application changing from a lock screen interface to a screen-off interface. Figure 3 A in FIG. 1 shows a possible lock screen interface of the mobile phone 100, which includes, for example, a lock screen wallpaper, a time plug-in, and other plug-ins or touch icons that provide functions. Figure 3 In the lock screen interface shown in A, if a screen off command is received, for example, a touch command at the "screen off" icon is received or a voice command is received to instruct the screen off, the mobile phone 100 will display the screen off interface as the lock screen interface changes to the screen off interface. Figure 3 The BD interface in the image processing unit, that is, the lock screen wallpaper will be changed from the main display area 310 to the sub-display area (320a, 320b, 320c) for display, that is, the content of the lock screen wallpaper will be mapped from the main display area 310 to the sub-display area (320a, 320b, 320c), thereby displaying a distorted wallpaper effect in the sub-display area (320a, 320b, 320c). Figure 3 D in the figure shows the final sub-display area 320c and the final display form of the second wallpaper in the screen-off interface in this example. Figure 3The sub-display area of ​​​​center AD shows the first process of converting from a flat wallpaper to a spherical wallpaper.

[0068] In the method provided in the embodiment of the present application, by mapping the first wallpaper from the main display area to the sub-display area to obtain and display the second wallpaper, dynamic conversion from the first wallpaper to the second wallpaper is achieved, thereby improving the richness and flexibility of wallpaper display.

[0069] Figure 4 The following is a flow chart of displaying a spherical wallpaper in a sub-display area according to an embodiment of the present application. Figure 4 As shown, displaying the second wallpaper in the sub-display area of ​​the electronic device may include the following steps: step 410, step 420, step 430, and step 440. The method flow steps are only a possible implementation of the present application.

[0070] Step 410: Obtain a first lens parameter of a spherical lens used for converting the spherical wallpaper, wherein the spherical lens corresponds to the sub-display area.

[0071] The process of displaying a spherical wallpaper in a sub-display area provided in the embodiment of the present application is intended to achieve the conversion between a flat wallpaper and a spherical wallpaper, which can be specifically embodied as a conversion from a flat wallpaper to a spherical wallpaper, or as a conversion from a spherical wallpaper to a flat wallpaper. It should be noted that the flat wallpaper described herein can be, for example, a processor of an electronic device that fits a texture image to a virtual model and renders it into a rectangular two-dimensional image, which is configured to be displayed in, for example, a window of an electronic device, thereby providing the user with a rich visual effect; the spherical wallpaper described herein is obtained by rendering the texture coordinates of the texture image of the flat wallpaper after mapping them to a spherical model, and the spherical model usually only occupies part of the display area of ​​the window, for example, it is displayed in the center of the window. It can be understood that the models of the above-mentioned flat wallpaper and spherical wallpaper can be three-dimensional or two-dimensional, which does not constitute a limitation of the present application. For example, Figure 3 BD in FIG. 1 shows a schematic diagram of a spherical wallpaper provided in an embodiment of the present application. Figure 3 In the BD, there is a spherical surface with a visual effect, and the visual effect is determined by the shape of the spherical model and the texture image mapped to the spherical model.

[0072] In order to achieve the conversion from flat wallpaper to spherical wallpaper, it is necessary to apply the parameters of the spherical lens to perform nonlinear distortion processing on the texture coordinates of the flat wallpaper, thereby establishing a mapping relationship between the distorted texture coordinates and the spherical lens model, so that the spherical lens model and the distorted texture coordinates match, and the spherical lens model is rendered to present the effect of texture mapping. In order to ensure that the distortion processing based on the spherical lens can meet the expected effect of the spherical wallpaper, the first lens parameter of the spherical lens can be determined first.

[0073] Here, the first lens parameter of the spherical lens is the parameter of the spherical lens (or spherical lens model) used by the spherical wallpaper. The first lens parameter describes the lens characteristics of the spherical lens. The first lens parameter determines the effect of the distortion processing of the texture coordinates. The first lens parameter may specifically include parameters such as the center offset, distortion radius, and distortion intensity of the spherical lens, and may also include parameters such as the rotation angle of the spherical lens, which are not specifically limited in the embodiments of the present application.

[0074] It can be understood that the spherical lenses described herein need to correspond to the aforementioned sub-display areas ( 320 a , 320 b , 320 c ) in order to perform display in the aforementioned sub-display areas.

[0075] Step 420: Based on the first lens parameters, the texture coordinates of the plane wallpaper are distorted to obtain first distorted coordinates of the texture coordinates under the spherical lens.

[0076] Specifically, the texture image of a flat wallpaper can be a one-dimensional, two-dimensional or three-dimensional image. This article uses the texture image as a two-dimensional rectangular image for illustrative purposes, which is configured to add details of a model (such as a two-dimensional model or a three-dimensional model). The model is usually represented by multiple triangles consisting of vertices (regardless of whether the model is a two-dimensional model or a three-dimensional model, it is represented by three-dimensional coordinates) and edges. Each vertex needs to be associated with a texture coordinate (that is, the three-dimensional vertex coordinate corresponds to the two-dimensional texture coordinate) to indicate which part of the texture image the vertex should be sampled from, so that the two-dimensional texture image can be pasted onto the surface of the model.

[0077] The flat wallpaper described in this article has a corresponding texture image, and a first mapping relationship is established between the texture image and the first model of the flat wallpaper, so that each texture coordinate of the texture image corresponds to each vertex coordinate of the first model, and when the texture image is attached to the first model, it is rendered on the window of the electronic device to generate the above-mentioned flat wallpaper. For the present application, under the action of the first lens parameter of the spherical lens (or the second model, the spherical lens model) of the spherical wallpaper, the texture coordinates of the texture image will be distorted, and the texture coordinates obtained by the nonlinear distortion are recorded as the first distortion coordinates in the embodiment of the present application. It can be understood that the first distortion coordinates are to map the texture coordinates of the texture image of the flat wallpaper to the texture coordinates under the spherical lens, that is, to establish a second mapping relationship between the texture coordinates of the texture image and the spherical lens, so that the texture image can be completely attached to the spherical lens.

[0078] Here, the distortion processing may specifically be a process of mapping each texture coordinate of the texture image to a spherical lens by applying a transformation function determined based on the first lens parameter of the spherical lens. It may also be understood as a process of mapping the texture coordinate grid (e.g., a rectangular coordinate grid) of the texture image to a spherical grid.

[0079] It should be noted that the distortion processing refers to a nonlinear operation on the texture coordinates, so as to achieve the effect described in this article of converting a rectangular flat wallpaper into other shapes such as circular, elliptical or other special-shaped wallpapers.

[0080] Step 430: Generate the spherical wallpaper based on mapping the texture coordinates to the first distortion coordinates under the spherical lens.

[0081] Specifically, after obtaining the first distortion coordinates, each texture coordinate of the plane wallpaper texture image can be directly mapped to the corresponding first distortion coordinates, thereby establishing a mapping relationship between the texture image and the spherical lens, that is, establishing a mapping relationship between the vertex coordinates of the spherical lens and the first distortion coordinates of the texture image, and using the corresponding first distortion coordinates to sample from the texture image when rendering the spherical lens to obtain a spherical pattern in the spherical wallpaper, thereby generating the spherical wallpaper.

[0082] Step 440: Display the first process of converting the flat wallpaper to the spherical wallpaper in the sub-display area of ​​the electronic device.

[0083] See also Figure 3 According to AD and the above corresponding description, after a spherical wallpaper is generated, the generated spherical wallpaper can be displayed in the corresponding sub-display area (320a, 320b, 320c) to implement the above first process.

[0084] In an embodiment of the present application, nonlinear distortion processing is performed on the texture coordinates of a flat wallpaper based on a spherical lens to achieve conversion from a flat wallpaper to a spherical wallpaper, which greatly improves the flexibility and richness of the images contained in the spherical wallpaper. Moreover, compared with the conversion method of linear transformation, the texture image of the flat wallpaper can be mapped to a spherical model with more three-dimensionality and depth through nonlinear distortion, so as to enhance the visual impact of the spherical wallpaper on the viewer.

[0085] It should be noted that each implementation method of the present application can be freely combined, the order can be changed, or it can be executed separately, and does not need to rely on or depend on a fixed execution order.

[0086] It should be noted that for electronic devices, the lock screen and the off screen are two different display states. Among them, the lock screen interface refers to the interface displayed by the electronic device when it is not unlocked. The lock screen interface usually contains elements such as time, date, notification information, and may have some quick operation buttons, such as camera, flashlight, etc. When the electronic device is in the lock screen interface, the user needs to unlock the electronic device by entering a password, fingerprint, facial recognition, etc. to enter the main interface or use other functions.

[0087] In the lock screen interface, the user can trigger the electronic device to turn off the screen, or the electronic device can automatically turn off the screen when the user stays on the lock screen interface for a period of time and does not operate the electronic device. Here, the screen off means that the main display area of ​​the electronic device displays less content than the lock screen interface, so as to save power and extend the battery life of the electronic device.

[0088] Here, the screen off command triggered on the lock screen interface can be issued by the user by pressing the power button of the electronic device, or touching the screen off shortcut key on the main display area of ​​the electronic device, or it can be automatically triggered by the electronic device when no user operation is received for a long time. The embodiments of the present application do not make specific limitations on this.

[0089] When a screen-off command is detected in the lock screen interface, a response can be given to the screen-off command. The response method here is to obtain the first lens parameter of the spherical lens, thereby realizing the conversion from the flat wallpaper displayed in the lock screen interface to the spherical wallpaper displayed in the screen-off interface.

[0090] It can be understood that the above content does not mean that the wallpaper processing method described in this article must be applied to the change process from the lock screen interface to the screen off interface. The wallpaper processing method described in this article can also be applied to the change process from the main display interface to the screen off interface, or the change process from other suitable display interfaces to the screen off interface.

[0091] In some embodiments, the first lens parameters include a center offset, a distortion radius, and a distortion intensity of the spherical lens, the center offset and the distortion intensity increase as the electronic device changes from a lock screen interface or a main display interface to a screen-off interface, and the distortion radius decreases as the electronic device changes from a lock screen interface or a main display interface to a screen-off interface.

[0092] Among them, the center offset of the spherical lens refers to the degree of offset between the optical axis and the mechanical axis of the spherical lens, including translation or tilt. In the nonlinear distortion processing based on the spherical lens, the size of the center offset determines the degree of tilt or offset of the flat wallpaper.

[0093] The distortion radius is usually used to describe the degree and range of image distortion when a spherical lens is used for imaging. That is, the distortion radius can reflect the distribution range of nonlinear distortion processing in a flat wallpaper. The larger the distortion radius, the more extensive the nonlinear distortion processing is, and the more obvious the distortion is at the edge of the flat wallpaper.

[0094] Distortion intensity is used to quantify the degree of image distortion when imaging with a spherical lens. In nonlinear distortion processing, the greater the distortion intensity, the greater the degree of change in the image shape and proportion of the flat wallpaper.

[0095] For the case where the screen-off command triggers the transformation from a flat wallpaper to a spherical wallpaper, during the process of converting from a flat wallpaper to a spherical wallpaper, the value of the first lens parameter can change according to the progress of the electronic device changing from the lock screen interface or the main display interface displaying the flat wallpaper to the screen-off interface displaying the spherical wallpaper, so as to achieve a dynamic effect of gradual wallpaper image change.

[0096] In this process, the center offset and the distortion intensity increase as the electronic device changes from the lock screen interface or the main display interface to the screen-off interface, that is, the closer to the final screen-off interface, the higher the offset of the nonlinear distortion for the flat wallpaper, the greater the intensity of the nonlinear distortion for the flat wallpaper, and the more obvious the deformation of the flat wallpaper. For example, in this process, the center offset of the spherical lens can gradually move from the center of the main display area (0.5, 0.5) to (0.5, 0.165), and the distortion intensity can change from 0 to 40.9.

[0097] In addition, during this process, the distortion radius decreases as the electronic device changes from the lock screen interface or the main display interface to the screen-off interface, that is, the closer to the final screen-off interface, the smaller the distortion radius of the nonlinear distortion of the flat wallpaper, and the clearer the edge of the spherical pattern in the converted spherical wallpaper. For example, during this process, the distortion radius of the spherical lens can change from 1.3 to 0.22.

[0098] In this case, Figure 5 is a flow chart of distortion processing provided by the embodiment of the present application. Figure 5 As shown, in step 420, based on the first lens parameters, the texture coordinates of the plane wallpaper are distorted to obtain the first distorted coordinates of the texture coordinates mapped to the spherical lens, including step 421, step 422, step 423 and step 424.

[0099] Step 421: Determine the current center position of the spherical lens based on the initial center position of the spherical lens, the center offset, and the aspect ratio of the main display area of ​​the electronic device.

[0100] Specifically, in the process of converting flat wallpaper into spherical wallpaper, the center offset of the spherical lens changes with the progress of the change. Therefore, it is necessary to determine the center position of the spherical lens at the current progress, that is, the current center position, based on the currently determined value of the center offset.

[0101] Here, the current center position is determined based on the initial center position of the spherical lens, the center offset and the aspect ratio of the main display area of ​​the electronic device. The specific determination method may be to apply the aspect ratio of the main display area to calculate the scaling factor of the texture coordinates of the center position coordinates of the spherical lens in the width or height direction of the main display area, and calculate the center position when it is not adapted to the aspect ratio of the main display area in combination with the initial center position of the spherical lens and the center offset, and then adjust the center position based on the scaling factor in the width or height direction of the main display area, thereby obtaining the current center position.

[0102] Step 422: Establish a vector pointing to the texture coordinate based on the current center position.

[0103] Specifically, after obtaining the current center position, a vector of texture coordinates pointing from the current center position of the spherical lens to the texture image of the flat wallpaper can be established. Assuming that the current center position is center and the texture coordinates are uv, the vector dire established here can be expressed as follows: vec2 dire = uv – center; Here, the vector dire may represent the direction of each texture coordinate relative to the current position center of the spherical lens, that is, the distortion center.

[0104] In addition, when calculating uv-center, the distance between uv and center can be calculated. If the distance is greater than the distortion radius, the final rendering color can be directly returned to black. That is, if the distance is greater than the distortion radius, nonlinear distortion can be directly omitted for this texture coordinate.

[0105] Step 423: Calculate a vector scaling factor of the vector based on the vector, the distortion intensity and a distortion scaling coefficient determined by the distortion radius.

[0106] Specifically, the distortion scaling factor is used to enhance or weaken the distortion effect, and may be determined by the distortion radius. Furthermore, the distortion scaling factor is generally inversely proportional to the distortion radius, that is, the larger the distortion radius, the smaller the distortion scaling factor.

[0107] The intensity scaling factor of the texture coordinates of the flat wallpaper can be determined by combining the vector determined in step 422 and the distortion intensity in the first lens parameter. The intensity scaling factor is used to reflect the initial change in the vector modulus after distortion. After obtaining the intensity scaling factor, the intensity scaling factor and the distortion scaling factor can be combined to calculate the vector scaling factor of the vector.

[0108] The vector scaling factor here is used to reflect the effect of nonlinear distortion on vectors.

[0109] Step 424: scale the vector using the vector scaling factor, and determine the first distortion coordinates of the texture coordinates mapped to the spherical lens based on the scaled vector and the current center position.

[0110] Specifically, after obtaining the vector scaling factor, the vector scaling factor can be multiplied by the vector to achieve scaling of the vector, thereby obtaining the scaled vector. On this basis, the scaled vector can be added to the current center position to achieve a center offset for the scaled vector, thereby mapping the texture coordinates of the texture image of the flat wallpaper to the texture coordinates under the spherical lens, and obtaining the first distortion coordinates.

[0111] Here, assuming that the vector scaling factor is pho2, the vector is dire, and the current center position is center, the first distortion coordinate uv1 can be represented as the following form: ; in, By making the length of the vector dire change, and the direction of the vector remains unchanged, that is, distortion occurs. Adding it with the center on this basis ensures that the obtained uv1 is the coordinate of the center reference point.

[0112] In some embodiments, prior to step 420, further includes: Based on the aspect ratio of the main display area of ​​the electronic device, a width scaling factor of the texture coordinates in the width direction of the main display area is determined; Based on the width scaling factor, the components of the texture coordinates in the width direction of the main display area are adjusted.

[0113] Specifically, assuming that the aspect ratio of the main display area of ​​the electronic device is u_aspect, after obtaining the aspect ratio u_aspect, the width scaling factor of the texture coordinates in the width direction of the main display area can be calculated, which is denoted as scale. Here, the variable definition for the width scaling factor scale can be expressed as: vec2 scale = vec2(1.0, 1.0 / u_aspect); Here, in the calculation of the width scaling factor scale, its x component is 1.0 (the horizontal scale is not changed), and the y component is 1.0 / u_aspect, which is used to adjust the texture coordinates in the vertical direction. The width scaling factor can adjust the texture coordinates of the texture image of the flat wallpaper to match the aspect ratio of the main display area.

[0114] After obtaining the width scaling factor, in order to ensure that the changes in the texture coordinates per unit distance in the horizontal and vertical directions of the flat wallpaper are the same, so that the shape of the image obtained after nonlinear distortion is spherical, it is necessary to adjust the components of the texture coordinates of the texture image of the flat wallpaper in the width direction of the main display area based on the width scaling factor, and the texture coordinate densities of the adjusted texture coordinates in the horizontal and numerical directions are consistent.

[0115] Here, the adjustment of the component of the texture coordinates of the texture image of the flat wallpaper in the width direction of the main display area can be expressed as follows: ; Here, v_originUV is the original texture coordinate without adjustment, and uv is the texture coordinate after adjustment. In specific implementation, the above formula can also be understood as dividing the y component of the original texture coordinate v_originUV by u_aspect to obtain the texture coordinate uv after adjustment.

[0116] Accordingly, after step 420 is completed and the first distorted coordinate uv1 is obtained, uv1 / scale may be calculated to restore the texture coordinate density of the first distorted coordinate in the vertical direction.

[0117] In some embodiments, in step 421, determining the current center position of the spherical lens based on the initial center position of the spherical lens, the center offset, and the aspect ratio of the main display area of ​​the electronic device includes: Based on the aspect ratio of the main display area of ​​the electronic device, determining a width scaling factor of the center position coordinate of the spherical lens in the width direction of the main display area; Taking the center point of the main display area as the initial center position of the spherical lens, and determining a candidate center position of the spherical lens based on the initial center position of the spherical lens and the center offset of the spherical lens; Based on the width scaling factor, the component of the candidate center position in the width direction of the main display area is adjusted to obtain the current center position of the spherical lens.

[0118] Specifically, assuming that the aspect ratio of the main display area of ​​the electronic device is u_aspect, after obtaining the aspect ratio u_aspect, the width scaling factor of the center position coordinate of the spherical lens in the width direction of the main display area can be calculated, which is denoted as scale. Here, the variable definition for the width scaling factor scale can be expressed as: vec2 scale = vec2(1.0, 1.0 / u_aspect); Here, in the calculation of the width scaling factor scale, its x component is 1.0 (without changing the horizontal scale), and the y component is 1.0 / u_aspect, which is used to adjust the texture coordinates in the vertical direction. The width scaling factor can adjust the coordinates of the spherical lens to match the aspect ratio of the main display area.

[0119] Assuming that the initial center position of the spherical lens is the center point of the main display area, which is recorded as vec2(0.5) here, and the center offset of the spherical lens is u_lens_translate, the candidate center position of the spherical lens can be determined by combining the two, that is, the center offset can be offset on the basis of the initial center position to obtain the candidate center position. The candidate center position obtained in this way is the center position that does not match the aspect ratio of the main display area, which can be expressed as (vec2(0.5) -u_lens_translate).

[0120] After obtaining the width scaling factor and the candidate center position, the component of the candidate center position in the width direction of the main display area can be adjusted based on the width scaling factor, thereby obtaining the current center position of the spherical lens. Here, the current center position is recorded as center, which can be specifically expressed as: ; Here, the candidate center position (vec2(0.5) - u_lens_translate) is multiplied by the width scaling factor scale, thereby scaling the candidate center position in the width direction, so that the current center position obtained thereby can adapt to the aspect ratio of the main display area.

[0121] In some embodiments, the distortion scaling factor is associated with the smaller of the distortion radius and a radius threshold.

[0122] Specifically, in step 423, the distortion scaling factor may be determined based on the distortion radius. Furthermore, in order to avoid the distortion scaling factor being too small due to the distortion radius being too large and to ensure that the overall distortion effect is within an acceptable range, a radius threshold may be set, where the radius threshold is the maximum value of the acceptable distortion radius.

[0123] Therefore, the smaller one can be determined from the distortion radius and the radius threshold, and the distortion scaling factor can be calculated based on the value of the smaller one. For example, assuming that the radius threshold is 0.5 and the distortion radius is u_lens_radius, the distortion scaling factor u_distort_scale can be expressed as follows: u_distort_scale=0.25 / min(u_lens_radius, 0.5).

[0124] In some embodiments, in step 423, the calculating the vector scaling factor of the vector based on the vector, the distortion intensity and the distortion scaling coefficient determined by the distortion radius includes: determining an intensity scaling factor for the texture coordinate based on the vector and the distortion intensity; A vector scaling factor for the vector is determined based on an intensity scaling factor for the texture coordinate and a distortion scaling factor determined by the distortion radius.

[0125] Specifically, for the texture coordinates of the texture image of the flat wallpaper, the intensity scaling factor of the spherical lens when performing nonlinear distortion on the texture coordinates can be calculated by combining the vector of the current center position of the spherical lens pointing to the texture coordinates and the distortion strength of the spherical lens. In the specific calculation, the square of the vector modulus can be calculated, and the square of the vector modulus can be multiplied by the distortion strength to reflect the influence of the distortion strength on the vector modulus, and then the intensity scaling factor of the texture coordinates can be determined based on this, which can be specifically expressed as follows: ; Where pho1 is the intensity scaling factor, u_distort_strength is the distortion strength, and dot(dire, dire) calculates the dot product of the vector dire and itself, which is equivalent to the square of the modulus of the dire vector. 1.0 is the initial value of the intensity scaling factor, and this value increases as decreases with the increase of .

[0126] From the above formula, we can see that the smaller the value of pho1, the more obvious the distortion effect. When performing nonlinear distortion processing on the texture coordinates of a texture image, this usually means that the pixel at the current center position will be more strongly affected by the distortion.

[0127] After obtaining the intensity scaling factor, the intensity scaling factor can be combined with the distortion scaling factor to calculate the vector scaling factor, which can be specifically expressed as follows: ; Where pho2 is the vector scaling factor, pho1 is the intensity scaling factor, and u_distort_scale is the distortion scaling factor. pho1 + 1.0 ensures that even if pho1 is 0 (indicating the strongest distortion effect), pho2 will not become 0, thus avoiding the error of dividing by 0 or infinite distortion effect when pho2 is used as the denominator later. On this basis, (pho1 + 1.0) is multiplied by u_distort_scale to further adjust the intensity of the distortion effect according to the distortion radius.

[0128] In some embodiments, the first lens parameter also includes a rotation angle, and the rotation angle changes periodically as the electronic device changes from a lock screen interface or a main display interface to a screen-off interface.

[0129] Specifically, in order to further enhance the dynamic effect of the spherical wallpaper, a rotation angle can be added to the first lens parameter. The rotation angle here can realize the rotation of the first distortion coordinates mapped from the texture coordinates to the spherical lens, and the rotation angles at different times can be different and present a periodic change, thereby realizing the rotation effect of the spherical surface in the spherical wallpaper during the transition from the lock screen interface or the main display interface to the screen-off interface, as well as in the screen-off interface. For example, the rotation angle can change periodically from 0° to 360° over time. In addition, in order to enhance the rotation effect, the center offset of the spherical lens can be coordinated, and the center offset of the spherical lens can also change in the above process, for example, from (0,0) to (0,0.335).

[0130] Accordingly, in step 430, the step of mapping the texture coordinates to the first distorted coordinates under the spherical lens to generate the spherical wallpaper includes: Based on the center offset of the spherical lens and the rotation angle, translating and rotating the first distorted coordinates to obtain current spherical coordinates; Based on the current spherical coordinates, a spherical wallpaper at the current moment is generated.

[0131] Specifically, after the first distorted coordinates are obtained, the first distorted coordinates can be translated and rotated based on the center offset and rotation angle of the spherical lens, thereby obtaining coordinates after translation and rotation, which are recorded as current spherical coordinates.

[0132] After obtaining the current spherical coordinates, the mapping relationship between the texture image and the spherical lens can be established, that is, the mapping relationship between the vertex coordinates of the spherical lens and the current spherical coordinates of the texture image can be established. When rendering the spherical lens, the corresponding current spherical coordinates are used to sample from the texture image, thereby obtaining the spherical pattern in the spherical wallpaper at the current moment, and then generating the spherical wallpaper at the current moment, thereby realizing the conversion from flat wallpaper to spherical wallpaper.

[0133] It can be understood that the translation and rotation of the first distortion coordinates here can also be understood as the translation and rotation of the spherical lens. After the nonlinear distortion processing, the translation and rotation of the spherical lens can be more easily adjusted.

[0134] In some embodiments, in step 430, translating and rotating the first distorted coordinates based on the center offset of the spherical lens and the rotation angle to obtain current spherical coordinates includes: Mapping the first distorted coordinates from a first interval to a second interval; Based on the center offset, the first distorted coordinates in the second interval are translated to obtain translated second distorted coordinates; offsetting the translated second distorted coordinates to obtain offset second distorted coordinates, wherein the offset degree is determined according to a deviation between a rotation center and the current center position; Adjusting the texture coordinate density of the offset second distorted coordinates in the width direction of the main display area using the aspect ratio of the main display area of ​​the electronic device to obtain third distorted coordinates; Rotating the third distorted coordinates based on the rotation angle to obtain rotated third distorted coordinates; Restoring the texture coordinate density of the rotated third distorted coordinates in the width direction of the main display area and canceling the offset of the rotated third distorted coordinates; The third distorted coordinates after the texture coordinate density is restored and the offset is canceled are mapped back to the first interval to obtain the current spherical coordinates.

[0135] Specifically, first, after obtaining the first distorted coordinates, the first distorted coordinates can be mapped from the first interval to the second interval, where the first interval represents a value range interval of a commonly used texture coordinate system, and the second interval represents an interval with a symmetric value range. For example, the first interval can be [0, 1], and the second interval can be [-1, 1]. The process of mapping the first distorted coordinates from the first interval to the second interval can be expressed as: ; Among them, uv is the first distorted coordinate in the first interval, and uv1 is the first distorted coordinate in the second interval. A mapping from [0,1] to [-1,1] is implemented.

[0136] After the interval mapping is completed, the first distorted coordinates in the second interval can be translated based on the center offset, thereby obtaining the translated first distorted coordinates, which are recorded as the translated second distorted coordinates uv2, which can be specifically expressed as follows: ; Among them, u_lens_translate is the center offset, scale is the width scaling factor, and the calculation method of scale can be seen above, so it will not be repeated here. The translation transformation for spherical lenses is implemented.

[0137] After obtaining the second distorted coordinates after translation, the second distorted coordinates after translation can be offset based on the deviation between the rotation center and the current center position, thereby obtaining the offset second distorted coordinates, which can be specifically expressed as follows: vec2 uv2' = uv2 – offset; Among them, uv2' is the second distortion coordinate after offset, offset is the deviation, specifically the offset from the rotation center to the distortion center. If offset=vec2(0.0), it means that the rotation center and the distortion center coincide. If the rotation center coincides with the distortion center (that is, the lens center), the color of the distortion center will remain unchanged, which will result in a relatively monotonous appearance. Considering this situation, the rotation center and the distortion center are usually set not to coincide.

[0138] In the above formula, uv2 – offset realizes the offset of the rotation center, so that the rotation center and the lens center do not coincide with each other, thereby enhancing the dynamic visual effect.

[0139] After obtaining the offset second distorted coordinates, the aspect ratio of the main display area of ​​the electronic device can be used to adjust the texture coordinate density of the offset second distorted coordinates in the width direction of the main display area, thereby obtaining the third distorted coordinates. Here, the width scaling factor scale can be determined based on the aspect ratio of the main display area of ​​the electronic device, and then the texture coordinate density adjustment in the width direction is achieved by multiplying the scale with the offset second distorted coordinates, which can be specifically expressed as follows: ; Among them, uv3 is the third distortion coordinate. By adjusting the texture coordinate density in the vertical direction, the texture coordinate density of uv3 can be kept consistent in the horizontal and vertical directions to avoid becoming an ellipse during rotation.

[0140] After obtaining the third distorted coordinates, the third distorted coordinates can be rotated based on the rotation angle to obtain the rotated third distorted coordinates. Here, the rotated third distorted coordinates can be expressed as follows: vec2 uv3' = rotateAngle(uv3, -u_lens_rotate); Among them, uv3' is the third distorted coordinate after rotation. rotateAngle represents the rotation function, and u_lens_rotate represents the rotation angle.

[0141] Subsequently, the texture coordinate density of the rotated third distorted coordinates can be restored in the width direction of the main display area based on the width scaling factor scale. In addition, the offset of the rotated third distorted coordinates can be canceled based on the offset offset during the offset. Specifically, it can be expressed as follows: vec2 uv4 = uv3' / scale; vec2 uv5 = uv4 + offset; Among them, uv4 is the third distorted coordinate after the texture coordinate density is restored, and uv5 is the third distorted coordinate after the texture coordinate density is restored and the offset is canceled.

[0142] After that, the texture coordinate density can be restored and the third distorted coordinate after the offset is canceled can be mapped back to the first interval, and the coordinate after being mapped back to the first interval is used as the current spherical coordinate. Specifically, it can be expressed as follows: vec2 uv6 = (uv5+ 1.0) / 2.0; Among them, uv6 is the current spherical coordinate obtained. Here, (uv5+ 1.0) / 2.0 realizes the mapping from [-1,1] to [0,1].

[0143] In some embodiments, the wallpaper processing method further includes: A shadow is superimposed on the spherical wallpaper based on the shadow texture coordinates corresponding to the spherical lens.

[0144] Specifically, a three-dimensional shadow effect can be added to the spherical lens, so that the spherical pattern on the spherical wallpaper can present a more realistic visual effect. In order to achieve the shadow effect, a shadow can be superimposed on the spherical pattern in the spherical wallpaper based on the spherical wallpaper obtained by the distortion processing based on the spherical lens.

[0145] Here, the shadow texture coordinates corresponding to the spherical lens are the coordinates on the texture image of the shadow image adapted to the spherical lens. After determining the shadow texture coordinates corresponding to the spherical lens, the shadow can be superimposed at the corresponding position on the spherical wallpaper based on the shadow texture coordinates to achieve a three-dimensional shadow effect.

[0146] In some embodiments, the wallpaper processing method further includes: Based on the center offset of the spherical lens and the shadow rotation angle, the original shadow texture coordinates corresponding to the spherical lens are offset and rotated to obtain the shadow texture coordinates.

[0147] Specifically, in order to achieve the three-dimensional shadow effect of the spherical pattern, the original shadow texture coordinates corresponding to the spherical lens can be offset and rotated in combination with the center offset of the spherical lens and the shadow rotation angle, so that the shadow texture coordinates obtained after the offset and rotation can adapt to the offset and rotation of the spherical lens itself, thereby ensuring that the shadow texture can cover the distorted lens.

[0148] Here, the original shadow texture is a texture image of a preset shadow image, such as Figure 6 is a schematic diagram of the original shadow texture provided by the embodiment of the present application, such as Figure 6 As shown, the original shadow texture can be a texture image of a spherical shadow image, in which the values ​​of the RGB channels are all 0 (indicating black), and the value of the a channel indicates the shadow intensity. The larger the value, the greater the ratio of the black shadow added to the corresponding pixel position of the lens. The original shadow texture coordinates are the texture coordinates of the original shadow texture.

[0149] Based on the center offset of the spherical lens, the original shadow texture coordinates can be translated, and based on the shadow rotation angle, the original shadow texture coordinates can be rotated. By combining the two, the shadow texture coordinates can be obtained to facilitate shadow superposition.

[0150] In some embodiments, the step of offsetting and rotating the original shadow texture coordinates corresponding to the spherical lens based on the center offset of the spherical lens and the shadow rotation angle to obtain the shadow texture coordinates includes: Mapping the original shadow texture coordinates from the first interval to a third interval, and translating the shadow texture coordinates in the third interval based on the center offset of the spherical lens to obtain shadow translation coordinates; Scaling the shadow translation coordinates based on the aspect ratio of the main display area of ​​the electronic device and the distortion radius of the spherical lens to obtain shadow scaling coordinates; Based on the shadow rotation angle, the shadow scaling coordinate is rotated to obtain the shadow rotation coordinate; The shadow rotation coordinates are mapped back to the first interval to obtain the shadow texture coordinates.

[0151] Specifically, for the original shadow texture coordinates, the first interval can be mapped to the third interval, where the first interval represents the value range interval of the commonly used texture coordinate system, and the third interval represents the interval with a symmetric value range. For example, the first interval can be [0, 1], and the third interval can be [-0.5, 0.5]. The process of mapping the original shadow texture coordinates from the first interval to the third interval can be expressed as: vec2 uv1 = uv - 0.5; Here, uv is the original shadow texture coordinate in the first interval, uv1 is the original shadow texture coordinate in the third interval, and uv - 0.5 realizes the mapping from [0, 1] to [-0.5, 0.5]. By mapping the original shadow texture coordinate to the third interval, the rotation center and the scaling center of the original shadow texture coordinate can be moved to the center of the main display area.

[0152] Subsequently, the shadow texture coordinate uv1 in the third interval can be translated based on the center offset of the spherical lens, thereby obtaining the shadow translation coordinates, which can be specifically expressed as: vec2 uv2 = uv1 + u_lens_translate; Here, uv2 is the shadow translation coordinate, and u_lens_translate is the center offset. After this step of translation, the rotation center and zoom center of the shadow translation coordinates are no longer the center of the main display area.

[0153] Next, the shadow translation coordinates can be scaled based on the aspect ratio of the main display area of ​​the electronic device and the distortion radius of the spherical lens, thereby ensuring that the scaled shadow coordinates obtained after scaling will not be stretched or deformed when displayed on the main display area. The shadow scaling coordinates can be specifically expressed as: ; Among them, uv3 is the shadow scaling coordinate, u_aspect is the aspect ratio of the main display area, and u_lens_radius is the distortion radius of the lens. u_aspect / u_lens_radius represents the scaling factor in the horizontal direction, and 1.0 / u_lens_radius represents the scaling factor in the vertical direction. Scaling uv2 in the horizontal and vertical directions can prevent the shadow texture from being stretched and deformed. For example, if the original shadow texture is a square image, if it is aligned with the four corners of the main display area, the original shadow texture will be stretched and deformed, so the horizontal component needs to be multiplied by u_aspect.

[0154] Subsequently, the shadow scaling coordinates can be rotated based on the shadow rotation angle, and the resulting shadow rotation coordinates can be expressed as: vec2 uv4 = rotateAngle(uv3, u_shadow_rotate); Among them, uv4 means the shadow rotation coordinate, rotateAngle means the rotation function, and u_shadow_rotate means the shadow rotation angle. By rotating uv3, the rotation effect of the shadow texture can be achieved.

[0155] After obtaining the shadow rotation coordinates, the shadow rotation coordinates can be mapped back to the first interval, that is, the shadow texture coordinates are obtained, and the shadow texture coordinates can be expressed as: vec2 uv5 = uv4 + 0.5; Among them, uv5 is the shadow texture coordinates, and uv4 + 0.5 can realize the mapping from [-0.5, 0.5] to [0, 1], thereby avoiding the shadow texture from offset.

[0156] It should be noted that since the translation, rotation, and scaling transformations involved in the above steps are all linear transformations and will not change the linear properties of the original shadow texture coordinates, a vertex shader can be applied to perform the above steps to improve the generation efficiency of the spherical wallpaper.

[0157] In some embodiments, the shadows are superimposed on the spherical wallpaper based on the shadow texture coordinates corresponding to the spherical lens, including: Based on the first distortion coordinates, color information is sampled from the texture image of the flat wallpaper; Based on the shadow texture coordinates, shadow intensity information is sampled from the shadow texture corresponding to the spherical lens; The color information and black are mixed based on the shadow intensity information and the shadow ratio; The shadow ratio increases as the electronic device changes from the lock screen interface or the main display interface to the screen off interface.

[0158] Specifically, after generating the spherical wallpaper, based on the mapping relationship between the vertex coordinates of the spherical lens corresponding to the spherical pattern in the spherical wallpaper and the first distortion coordinates of the texture image of the plane wallpaper, color information can be sampled from the texture image of the plane wallpaper using the first distortion coordinates, thereby obtaining the color information of each coordinate in the spherical pattern mapped in the texture image of the plane wallpaper.

[0159] In addition, the shadow texture coordinates can be applied to sample the shadow intensity information corresponding to the shadow texture coordinates from the shadow texture corresponding to the spherical lens. Specifically, it can be expressed as: float shadow = texture(u_shadowTex, v_shadowUV).a; In the formula, shadow is the shadow intensity information, u_shadowTex is the shadow texture, v_shadowUV is the shadow texture coordinate, texture is the texture sampling function, its input is (texture, texture coordinate), texture(u_shadowTex, v_shadowUV).a means that the sampled value is the a channel, that is, the shadow intensity.

[0160] After the color information and the shadow intensity information are obtained, the color information and black may be mixed based on the shadow intensity information and the shadow ratio, thereby achieving a shadow superposition effect.

[0161] Here, the shadow ratio may be gradually increased as the transition from the lock screen interface or the main display interface to the screen off interface progresses. That is, the closer to the screen off interface, the higher the shadow ratio may be, which may be specifically manifested as a gradual change from 0 to 1.

[0162] Furthermore, based on the shadow intensity information and the shadow ratio, the color information and black are mixed, which can be expressed as follows: ; Among them, color2 is the color information after the shadow is superimposed. Through the mix function, the color information color1 can be mixed with black vec3 (0.0) according to the shadow intensity shadow and the shadow ratio u_shadow_rate. The mix function can be expressed as , where A is color1, B is black, and x is In this way, the greater the shadow intensity (closer to 1), the closer the color2 after the superimposed shadow is to black, thus simulating the shadow effect.

[0163] In some embodiments, sampling color information from the texture image of the planar wallpaper based on the first distorted coordinates includes: Based on the first distorted coordinates, sampling original color information from the blurred texture image of the plane wallpaper; Based on the shadow ratio, the saturation of the original color information is adjusted to obtain the color information.

[0164] Specifically, before sampling the color information of the texture image of the flat wallpaper, the texture image of the flat wallpaper may be blurred to obtain a blurred texture image. Here, the blurring may be performed by Gaussian blurring or other blurring algorithms, such as mean filtering, bilateral filtering, etc.

[0165] After that, the first distorted coordinates can be first obtained, and the color information can be sampled from the texture image of the flat wallpaper after the blurring process, thereby obtaining the original color information of the first distorted coordinates in the texture image after the blurring process, which can be specifically expressed as follows: vec3 blurColor = texture(u_blurTex, uv).rgb; The original color information is blurColor, the blurred image is u_blurTex, and the first distortion surface coordinates are uv. texture is a texture sampling function, whose input is (texture, texture coordinates). texture(u_blurTex, uv).rgb means that the values ​​of the r, g, and b channels are sampled.

[0166] After obtaining the original color information, the saturation of the original color information can be adjusted based on the shadow ratio so that the saturation of the original color information can better fit the shadow effect. Here, the original color information after saturation adjustment can be used as the final sampled color information, which can be specifically expressed as follows: ; Here, color1 is the color information, blurColor is the original color information, u_shadow_rate is the shadow ratio, adjustSaturation is the saturation adjustment function, and the saturation increase here is .

[0167] The input of the saturation adjustment function adjustSaturation is (color, adjustment intensity), and the output is the color after saturation adjustment. It can be understood that for the saturation adjustment function, the color difference between its input and output depends on the adjustment intensity in the input.

[0168] Furthermore, in the process of adjusting the saturation of a color based on the saturation adjustment function, the input color can be weighted on the three different channels of red, green, and blue, and the weighted adjusted color can be converted into grayscale, and then the input color and the converted grayscale can be weighted according to the input adjustment intensity as the final output color after saturation adjustment. The weights of the weighting on the three channels of red, green, and blue can be set manually, for example, according to the different sensitivities of the human eye to light of different wavelengths (i.e., different colors). Specifically, in view of the fact that the human eye is most sensitive to green, second to red, and least sensitive to blue, the weights of the three channels of red, green, and blue can be set to (0.2125, 0.7154, 0.0721) respectively.

[0169] In some embodiments, in step 420, the distortion processing is performed on the texture coordinates of the plane wallpaper based on the first lens parameters to obtain the first distortion coordinates of the texture coordinates mapped to the spherical lens, including: Based on the first lens parameters, the texture coordinates of the blurred texture image of the plane wallpaper are distorted to obtain first distorted coordinates of the texture coordinates mapped to the spherical lens; The blur radius used for the blurring process increases as the electronic device changes from the lock screen interface or the main display interface to the screen off interface.

[0170] Specifically, in the process of converting from a flat wallpaper to a spherical wallpaper, the texture image of the flat wallpaper can be first blurred to obtain a blurred texture image, and then the texture coordinates of the blurred texture image can be distorted to obtain the first distorted coordinates mapped under the spherical lens.

[0171] When blurring the texture image of a flat wallpaper, it can be achieved based on the blur radius. The blur radius here is a parameter that determines the scale of the blur algorithm. The blur radius determines the range of influence of surrounding pixels on the central pixel when blurring the texture image of the flat wallpaper. The size of the blur radius can directly determine the effect and intensity of the blurring process.

[0172] In order to further enhance the dynamic effect of the spherical wallpaper, the blur radius can be gradually increased when the electronic device changes from the lock screen interface or the main display interface to the screen-off interface, that is, the closer to the screen-off interface, the stronger the blur effect of the texture image of the flat wallpaper. For example, when changing from the lock screen interface or the main display interface to the screen-off interface, the value of the blur radius can gradually change from 0 to 22.

[0173] For example, a flat wallpaper texture image can be blurred based on Gaussian blur. Here, Gaussian blur is a blur algorithm widely used in the industry, and its working principle is based on convolution operation. The algorithm updates the color value of each pixel by calculating the weighted average of the pixels around it. These weights used for weighted averaging are determined by a Gaussian function, and these sets of weights are called convolution kernels (also called Gaussian kernels). The Gaussian kernel can well simulate the degree of influence of each pixel in the image neighborhood on the currently processed pixel, that is, the closer the distance between the pixels, the greater the influence. In short, Gaussian blur performs a convolution operation on the image through the convolution kernel generated by the Gaussian function to achieve a blurring effect.

[0174] The Gaussian function can be expressed as follows: In the formula, x and y are the integer distances from the current position to the center of the convolution kernel. for Gaussian value of is the standard deviation, The larger the value, the more short and fat the image will be; on the contrary, The smaller the value, the taller and thinner the image appears.

[0175] By constructing a Gaussian kernel, the Gaussian value at each position in the Gaussian kernel can be calculated, and the Gaussian blur of the image can be achieved through convolution operation. In the Gaussian blur algorithm, the width of the Gaussian kernel is twice the blur radius plus 1. When the width of the Gaussian kernel is known, Gaussian blur can be performed.

[0176] For example, Figure 7 is a schematic diagram of the Gaussian blur process provided in the embodiment of the present application, such as Figure 7 As shown, for The image can be obtained by The convolution kernel is used to perform convolution operation, thereby realizing Gaussian blur of the central pixel. It should be noted that in order to ensure that the blurred image does not become darker, the elements in the Gaussian kernel need to be normalized, that is, all elements are divided by their weighted sum to ensure that the normalized weighted sum is 1.

[0177] In addition, during the Gaussian blurring process, when pixels at the edge position participate in the convolution operation, if the texture coordinates of the pixels participating in the convolution are less than 0, they are taken as 0, and if they are greater than 1, they are taken as 1. If the texture coordinates are out of bounds, the pixels at the edge position (that is, the pixels closest to the convolution area) are taken to participate in the convolution, thereby ensuring that the width and height pixel values ​​of the texture are not changed after the blurring process.

[0178] In some embodiments, in step 410, obtaining the first lens parameter of the spherical lens used for converting the spherical wallpaper includes: Obtaining a first lens parameter under the current animation progress from a parameter range corresponding to the animation progress of converting the plane wallpaper into the spherical wallpaper; The current animation progress referred to here is the specific progress at the current moment in the animation process of converting from a flat wallpaper to a spherical wallpaper. It is understandable that in the animation process of converting from a flat wallpaper to a spherical wallpaper, different animation progresses may correspond to different first lens parameters. In order to enable the first lens parameters corresponding to different animation progresses to present a continuous and dynamic visual effect in the application of converting a flat wallpaper to a spherical wallpaper, the parameter range of each parameter in the first lens parameters may be set in advance for the entire animation process. It is understandable that in the animation process, the parameter values ​​of the first lens parameters corresponding to all animation progresses are within the parameter range.

[0179] For example, in the animation process of converting from a flat wallpaper to a spherical wallpaper, the center offset u_lens_translate of the spherical lens can change from (0,0) to (0,0.335); the distortion radius u_lens_radius can change from 1.3 to 0.22; the distortion strength u_distort_strength can change from 0 to 40.9; the rotation angle u_lens_rotate of the spherical lens can change periodically from 0° to 360° over time; the blur radius blurRadius of the blur processing can change from 0 to 22; The rotation angle of the shadow texture u_shadow_rotate can change from -149 to 0; the shadow ratio u_shadow_rate can change from 0 to 1.

[0180] Accordingly, in step 430, the generating of the spherical wallpaper includes: Generate a spherical wallpaper under the current animation progress.

[0181] That is, the spherical wallpaper obtained by distorting the first lens parameters under the current animation progress is the spherical wallpaper under the current animation progress. In the animation process of converting from a flat wallpaper to a spherical wallpaper, each animation progress corresponds to the first lens parameters and also corresponds to the spherical wallpaper obtained by the distortion. Therefore, in the animation process of converting from a flat wallpaper to a spherical wallpaper, each animation progress corresponds to a different spherical wallpaper, and by sequentially displaying the spherical wallpaper under each animation progress, the visual effect of the dynamic transformation from a flat wallpaper to a spherical wallpaper can be achieved.

[0182] Based on any of the above embodiments, the method further includes: Based on the spherical wallpaper at each animation progress in the animation process, the animation of converting from the flat wallpaper to the spherical wallpaper is rendered.

[0183] Specifically, in order to achieve the dynamic visual effect of transitioning from a flat wallpaper to a spherical wallpaper, the spherical wallpaper under each animation process can be rendered based on the execution order of each animation progress in the animation process, thereby obtaining an animation video that can reflect the gradual change from a flat wallpaper, to the spherical wallpaper through each animation process, to the spherical wallpaper of the last animation process. By playing the animation video, the user can be provided with a dynamic visual experience of transitioning from a flat wallpaper to a spherical wallpaper.

[0184] Here, animation rendering can be implemented based on OpenGL ES (Open Graphics Library for Embedded Systems). OpenGL ES is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. It can realize the generation of spherical wallpapers and animations for each animation progress. Specifically, the spherical wallpaper under each animation progress can be rendered in onDrawFrame of GLSerfaceView.Renderer.

[0185] Moreover, when rendering the wallpaper conversion animation based on OpenGL ES, the thread in OpenGL ES can be responsible for modifying the parameters under each animation progress, such as the center offset u_lens_translate, distortion radius u_lens_radius, distortion strength u_distort_strength of the spherical lens, the rotation angle u_lens_rotate of the spherical lens, the blur radius blurRadius of the blur processing, the rotation angle u_shadow_rotate and shadow ratio u_shadow_rate of the shadow texture, etc., thereby realizing the rendering of the spherical wallpaper under each animation progress, and then obtaining the animation of converting from a flat wallpaper to a spherical wallpaper.

[0186] In some embodiments, the method further comprises: In response to triggering a screen-on instruction on a screen-off interface of the electronic device, obtaining second lens parameters, wherein the second lens parameters include a center offset, a distortion radius, and a distortion strength of the spherical lens, the center offset and the distortion strength decrease as the electronic device changes from the screen-off interface to the lock screen interface or the main display interface, and the distortion radius increases as the electronic device changes from the screen-off interface to the lock screen interface or the main display interface; A second process of converting the spherical wallpaper to the flat wallpaper is displayed in the sub-display area of ​​the electronic device.

[0187] Specifically, in the off-screen interface, the user can trigger the electronic device to light up the main display area, and the electronic device enters the lock screen state, or can directly enter the main display interface from the off-screen interface. Here, the screen-on command triggered in the off-screen interface can be issued by the user by pressing the power button of the electronic device.

[0188] When a screen-on command is detected in the screen-off interface, a response can be made to the screen-on command. The response method here is to obtain the second lens parameters of the spherical lens, thereby realizing the conversion from the spherical wallpaper displayed in the screen-off interface to the flat wallpaper displayed in the lock screen interface or the main display interface.

[0189] It can be understood that the second lens parameters referred to here are consistent with the parameter types included in the first lens parameters in the above embodiment, and, like the first lens parameters, the second lens parameters are also used to implement nonlinear distortion processing of texture coordinates of the texture image of the flat wallpaper. What is different from the first lens parameters is that the first lens parameters are applied in the conversion process from the lock screen interface or the main display interface to the screen-off interface, and the second lens parameters are applied in the conversion process from the screen-off interface to the lock screen interface or the main display interface, and, specifically, in the conversion process from the lock screen interface or the main display interface to the screen-off interface, the change trend of each parameter in the first lens parameters is opposite to the change trend of each parameter in the second lens parameters in the conversion process from the screen-off interface to the lock screen interface or the main display interface.

[0190] For example, in the animation process of converting from a spherical wallpaper to a flat wallpaper, the center offset u_lens_translate of the spherical lens can change from (0,0.335) to (0,0); the distortion radius u_lens_radius can change from 0.22 to 1.3; the distortion strength u_distort_strength can change from 40.9 to 0; the rotation angle u_lens_rotate of the spherical lens can change periodically from 360° to 0° over time; the blur radius blurRadius of the blur processing can change from 22 to 0; the rotation angle u_shadow_rotate of the shadow texture can change from 0 to -149; the shadow ratio u_shadow_rate can change from 1 to 0.

[0191] Based on the second lens parameters, the texture coordinates of the texture image of the plane wallpaper are nonlinearly distorted to obtain the second distorted coordinates, so as to map the texture coordinates to the corresponding second distorted coordinates, thereby establishing a mapping relationship between the texture image and the spherical lens, that is, establishing a mapping relationship between the vertex coordinates of the spherical lens and the second distorted coordinates of the texture image, and using the corresponding second distorted coordinates to sample from the texture image when rendering the spherical lens to obtain a spherical pattern in the spherical wallpaper, thereby realizing the generation of spherical wallpaper, thereby gradually realizing the transition process from spherical wallpaper to plane wallpaper, which is consistent with the process of performing nonlinear distortion processing on the texture coordinates of the texture image of the plane wallpaper based on the first lens parameters in the above embodiment to obtain spherical wallpaper, thereby gradually realizing the transition process from plane wallpaper to spherical wallpaper, and will not be repeated here.

[0192] In some embodiments, Figure 8 This is a second flow chart of the wallpaper processing method provided in the embodiment of the present application. Figure 8 As shown, the method may include the following steps: First, blur the texture image of the flat wallpaper: The blurring process here may be Gaussian blurring, and a blurred texture image of the flat wallpaper may be obtained through Gaussian blurring.

[0193] Secondly, perform a linear transformation on the shadow texture coordinates: Linear transformation operations such as offset, rotation, and scaling transformation may be performed on the original shadow texture, thereby obtaining the shadow texture coordinates required for subsequent superposition with the spherical pattern in the spherical wallpaper.

[0194] Then, nonlinear distortion is performed based on a spherical lens: The texture coordinates of the blurred texture image can be nonlinearly distorted based on the lens parameters of the spherical lens, so that the texture coordinates are mapped to the spherical lens grid, that is, the distorted coordinates are obtained.

[0195] Next, a linear transformation is performed based on a spherical lens: After obtaining the distorted coordinates, linear transformations such as translation and rotation are performed on the spherical lens to obtain the distorted coordinates after translation and rotation. Based on the distorted coordinates after translation and rotation, sampling is performed from the blurred texture image to obtain a spherical pattern, thereby generating a similar Figure 3 Spherical wallpaper shown.

[0196] Finally, add shadow overlay: Based on the shadow texture coordinates, the shadow texture image can be superimposed on the spherical pattern of the spherical wallpaper to obtain a similar Fig. 9 Spherical wallpaper with shadows superimposed is shown.

[0197] Fig.10 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.10 As shown, the electronic device may include: a processor 1010, a communication interface 1020, a memory 1030 and a communication bus 1040, wherein the processor 1010, the communication interface 1020 and the memory 1030 communicate with each other through the communication bus 1040. The processor 1010 may call the logic instructions in the memory 1030 to execute the wallpaper processing method, which includes: In response to triggering a screen-off instruction on a first interface of the electronic device, acquiring a first wallpaper displayed on the first interface of the electronic device, wherein the first wallpaper is displayed in a main display area of ​​the electronic device; and A second wallpaper is displayed in the sub-display area of ​​the electronic device, wherein the content of the second wallpaper is presented by mapping the first wallpaper from the main display area to the sub-display area, and the sub-display area is located in the main display area.

[0198] In addition, the logic instructions in the above-mentioned memory 1030 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0199] On the other hand, the present application also provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the wallpaper processing method provided by the above methods, the method includes: In response to triggering a screen-off instruction on a first interface of the electronic device, acquiring a first wallpaper displayed on the first interface of the electronic device, wherein the first wallpaper is displayed in a main display area of ​​the electronic device; and A second wallpaper is displayed in the sub-display area of ​​the electronic device, wherein the content of the second wallpaper is presented by mapping the first wallpaper from the main display area to the sub-display area, and the sub-display area is located in the main display area.

[0200] On the other hand, the present application further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the wallpaper processing method provided by the above methods is implemented, and the method includes: In response to triggering a screen-off instruction on a first interface of the electronic device, acquiring a first wallpaper displayed on the first interface of the electronic device, wherein the first wallpaper is displayed in a main display area of ​​the electronic device; and A second wallpaper is displayed in the sub-display area of ​​the electronic device, wherein the content of the second wallpaper is presented by mapping the first wallpaper from the main display area to the sub-display area, and the sub-display area is located in the main display area.

[0201] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0202] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.

[0203] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A wallpaper processing method, applied to electronic equipment, characterized in that: include: In response to triggering a screen-off instruction on a first interface of the electronic device, acquiring a first wallpaper displayed on the first interface of the electronic device, wherein the first wallpaper is displayed in a main display area of ​​the electronic device; and A second wallpaper is displayed in the sub-display area of ​​the electronic device, wherein the content of the second wallpaper is presented by mapping the first wallpaper from the main display area to the sub-display area, and the sub-display area is located in the main display area.

2. The wallpaper processing method according to claim 1, characterized in that: The first interface is a lock screen interface or a main display interface, the first wallpaper is a flat wallpaper of the lock screen interface or the main display interface, the main display area corresponds to the complete display area of ​​the electronic device, the second wallpaper is a spherical wallpaper under the screen-off interface, and the sub-display area is a display area located within the main display area; The displaying of the second wallpaper in the sub-display area of ​​the electronic device comprises: Acquire a first lens parameter of a spherical lens used for converting the spherical wallpaper, wherein the spherical lens corresponds to the sub-display area; Based on the first lens parameters, the texture coordinates of the plane wallpaper are distorted to obtain first distorted coordinates of the texture coordinates mapped to the spherical lens; Generate the spherical wallpaper based on mapping the texture coordinates to the first distortion coordinates under the spherical lens; A first process of converting the flat wallpaper to the spherical wallpaper is displayed in the sub-display area of ​​the electronic device.

3. The wallpaper processing method according to claim 2, characterized in that: The first lens parameters include a center offset, a distortion radius, and a distortion strength of the spherical lens, wherein the center offset and the distortion strength increase as the electronic device changes from a lock screen interface or a main display interface to an off-screen interface, and the distortion radius decreases as the electronic device changes from a lock screen interface or a main display interface to an off-screen interface; The step of performing distortion processing on the texture coordinates of the plane wallpaper based on the first lens parameter to obtain first distortion coordinates of the texture coordinates mapped to the spherical lens includes: Determining a current center position of the spherical lens based on an initial center position of the spherical lens, the center offset, and an aspect ratio of the main display area of ​​the electronic device; Establishing a vector pointing to the texture coordinate based on the current center position; Calculating a vector scaling factor of the vector based on the vector, the distortion strength, and a distortion scaling factor determined by the distortion radius; The vector is scaled using the vector scaling factor, and based on the scaled vector and the current center position, a first distortion coordinate of the texture coordinate mapped to the spherical lens is determined.

4. The wallpaper processing method according to claim 3, characterized in that: The distortion scaling factor is associated with the smaller of the distortion radius and a radius threshold.

5. The wallpaper processing method according to claim 3, characterized in that: The calculating, based on the vector, the distortion intensity and the distortion scaling coefficient determined by the distortion radius, a vector scaling factor of the vector comprises: determining an intensity scaling factor for the texture coordinate based on the vector and the distortion intensity; A vector scaling factor for the vector is determined based on an intensity scaling factor for the texture coordinate and a distortion scaling factor determined by the distortion radius.

6. The wallpaper processing method according to claim 3, characterized in that: Before determining the texture coordinates based on the scaled vector and the current center position and mapping them to the first distorted coordinates under the spherical lens, the method further includes: Determining a width scaling factor of the texture coordinates in a width direction of the main display area based on an aspect ratio of the main display area of ​​the electronic device; Based on the width scaling factor, the component of the texture coordinate in the width direction of the main display area is adjusted.

7. The wallpaper processing method according to claim 3, characterized in that: The determining the current center position of the spherical lens based on the initial center position of the spherical lens, the center offset, and the aspect ratio of the main display area of ​​the electronic device comprises: Based on the aspect ratio of the main display area of ​​the electronic device, determining a width scaling factor of the center position coordinate of the spherical lens in the width direction of the main display area; Taking the center point of the main display area as the initial center position of the spherical lens, and determining a candidate center position of the spherical lens based on the initial center position of the spherical lens and the center offset of the spherical lens; Based on the width scaling factor, the component of the candidate center position in the width direction of the main display area is adjusted to obtain the current center position of the spherical lens.

8. The wallpaper processing method according to claim 3, characterized in that: The first lens parameter also includes a rotation angle, and the rotation angle changes periodically as the electronic device changes from a lock screen interface or a main display interface to a screen-off interface; The step of mapping the texture coordinates to first distorted coordinates under the spherical lens to generate the spherical wallpaper comprises: Based on the center offset of the spherical lens and the rotation angle, translating and rotating the first distorted coordinates to obtain current spherical coordinates; Based on the current spherical coordinates, a spherical wallpaper at the current moment is generated.

9. The wallpaper processing method according to claim 8, characterized in that: The translating and rotating the first distorted coordinates based on the center offset of the spherical lens and the rotation angle to obtain current spherical coordinates includes: Mapping the first distorted coordinates from a first interval to a second interval; Based on the center offset, the first distorted coordinates in the second interval are translated to obtain translated second distorted coordinates; offsetting the translated second distorted coordinates to obtain offset second distorted coordinates, wherein the offset degree is determined according to a deviation between a rotation center and the current center position; Adjusting the texture coordinate density of the offset second distorted coordinates in the width direction of the main display area using the aspect ratio of the main display area of ​​the electronic device to obtain third distorted coordinates; Rotating the third distorted coordinates based on the rotation angle to obtain rotated third distorted coordinates; Restoring the texture coordinate density of the rotated third distorted coordinates in the width direction of the main display area and canceling the offset of the rotated third distorted coordinates; The third distorted coordinates after the texture coordinate density is restored and the offset is canceled are mapped back to the first interval to obtain the current spherical coordinates.

10. The wallpaper processing method according to claim 2, characterized in that: Also includes: A shadow is superimposed on the spherical wallpaper based on the shadow texture coordinates corresponding to the spherical lens.

11. The wallpaper processing method according to claim 10, characterized in that: Also includes: Based on the center offset of the spherical lens and the shadow rotation angle, the original shadow texture coordinates corresponding to the spherical lens are offset and rotated to obtain the shadow texture coordinates.

12. The wallpaper processing method according to claim 11, characterized in that: The method of offsetting and rotating the original shadow texture coordinates corresponding to the spherical lens based on the center offset of the spherical lens and the shadow rotation angle to obtain the shadow texture coordinates includes: Mapping the original shadow texture coordinates from the first interval to a third interval, and translating the shadow texture coordinates in the third interval based on the center offset of the spherical lens to obtain shadow translation coordinates; Scaling the shadow translation coordinates based on the aspect ratio of the main display area of ​​the electronic device and the distortion radius of the spherical lens to obtain shadow scaling coordinates; Based on the shadow rotation angle, the shadow scaling coordinates are rotated to obtain shadow rotation coordinates; The shadow rotation coordinates are mapped back to the first interval to obtain the shadow texture coordinates.

13. The wallpaper processing method according to claim 10, characterized in that: The step of superimposing a shadow on the spherical wallpaper based on the shadow texture coordinates corresponding to the spherical lens comprises: Based on the first distorted coordinates, sampling color information from the texture image of the plane wallpaper; Based on the shadow texture coordinates, sampling shadow intensity information from a shadow texture corresponding to the spherical lens; Based on the shadow intensity information and the shadow ratio, the color information and black are mixed; The shadow ratio increases as the electronic device changes from the lock screen interface or the main display interface to the screen off interface.

14. The wallpaper processing method according to claim 13, characterized in that: The step of sampling color information from the texture image of the plane wallpaper based on the first distorted coordinates includes: Based on the first distorted coordinates, sampling original color information from the blurred texture image of the plane wallpaper; Based on the shadow ratio, the saturation of the original color information is adjusted to obtain the color information.

15. The wallpaper processing method according to claim 2, characterized in that: The step of performing distortion processing on the texture coordinates of the plane wallpaper based on the first lens parameter to obtain first distortion coordinates of the texture coordinates mapped to the spherical lens includes: Based on the first lens parameters, the texture coordinates of the blurred texture image of the plane wallpaper are distorted to obtain first distorted coordinates of the texture coordinates mapped to the spherical lens; The blur radius used for the blurring process increases as the electronic device changes from the lock screen interface or the main display interface to the screen off interface.

16. The wallpaper processing method according to any one of claims 2 to 15, characterized in that: The step of obtaining the first lens parameter of the spherical lens used for converting the spherical wallpaper comprises: Obtaining a first lens parameter under the current animation progress from a parameter range corresponding to the animation progress of converting the plane wallpaper into the spherical wallpaper; The step of generating the spherical wallpaper comprises: Generate a spherical wallpaper under the current animation progress.

17. The wallpaper processing method according to claim 2, characterized in that: Also includes: In response to triggering a screen-on instruction on a screen-off interface of the electronic device, obtaining second lens parameters, wherein the second lens parameters include a center offset, a distortion radius, and a distortion strength of the spherical lens, the center offset and the distortion strength decrease as the electronic device changes from the screen-off interface to the lock screen interface or the main display interface, and the distortion radius increases as the electronic device changes from the screen-off interface to the lock screen interface or the main display interface; A second process of converting the spherical wallpaper to the flat wallpaper is displayed in the sub-display area of ​​the electronic device.

18. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the wallpaper processing method according to any one of claims 1 to 17 is implemented.

19. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the wallpaper processing method according to any one of claims 1 to 17 is implemented.

Citation Information

Patent Citations

  • Method and device for generating customizable dynamic graphs

    CN104574483A

  • Method and terminal for touch screen equipment background image conversion

    CN105204751A

  • Wallpaper display method, medium and electronic equipment

    CN119065755A

  • Wallpaper display method and electronic equipment

    CN119232840A

  • Graphical interface processing method and apparatus

    WO2024099206A1

Cited By

  • Electronic equipment and wallpaper display method thereof

    CN120223798A