Image processing method and device
By creating a cross-platform graphics library rendering pipeline on mobile devices, receiving and applying shader files to render images, it solves the problem of inconsistent rendering effects between iOS and Android systems, achieving cross-platform functional consistency and improving user experience. .
Patent Information
- Application Number
- CN202111134150.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-27
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2041-09-27
AI Technical Summary
There are large differences in the support of local special effects rendering capabilities of mobile devices, resulting in inconsistent rendering effects between iOS and Android systems, affecting the user experience.
By creating a cross-platform graphics library rendering pipeline, receive shader files from the client, and use these files to render the image to be processed, obtain the rendering bitmap and send it to the client.
It achieves cross-platform functional consistency, reduces development costs, improves flexibility, meets custom rendering needs, and provides a high-quality user experience.
Smart Images

Figure CN113870411B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of client development. More specifically, the present disclosure relates to a method and device for image processing. Background Art
[0002] The continuous improvement of the hardware computing power of mobile devices makes it possible to add complex special effects to images on the client side. Similarly, designers will add more special rendering effects to product designs to enrich product pages. However, the current mainstream mobile platforms iOS and Android are limited by system differences, and there are large differences in the support for local special effect rendering capabilities. Generally speaking, the iOS system supports better. This causes inconsistencies in product implementation on both ends. This inconsistency is specifically divided into two types: one end system supports a certain effect, while the other end does not; both ends support it, but the final rendering effect is quite different. Either one will have a negative impact on the user experience. Summary of the invention
[0003] An exemplary embodiment of the present disclosure is to provide a method and apparatus for image processing to at least solve the image processing problems in the related art, but may not solve any of the above problems.
[0004] According to an exemplary embodiment of the present disclosure, there is provided a method for image processing, comprising: creating a cross-platform graphics library rendering pipeline; receiving at least one shader file from a client, wherein each shader file in the at least one shader file comprises one or more rendering effects; rendering a bitmap of an image to be processed by using the cross-platform graphics library rendering pipeline using the at least one shader file to obtain a rendered bitmap; and sending the rendered bitmap to the client.
[0005] Optionally, the cross-platform graphics library rendering pipeline may be a cross-platform rendering pipeline based on OpenGL ES.
[0006] Optionally, the step of rendering the bitmap of the image to be processed using the at least one shader file through the cross-platform graphics library rendering pipeline may include: obtaining the texture of the image to be processed from the bitmap of the image to be processed through the video memory; and applying the at least one shader file to the texture of the image to be processed through the cross-platform graphics library rendering pipeline.
[0007] Optionally, the at least one shader file may be set with a rendering order, and one or more rendering effects included in each shader file may be set with a rendering order.
[0008] Optionally, the at least one shader file may be common to clients of different systems.
[0009] Optionally, the at least one shader file may be customized and input by a user on the client side.
[0010] Optionally, the step of creating a cross-platform graphics library rendering pipeline may include: creating a cross-platform graphics library rendering pipeline based on the life cycle of image processing; initializing the created cross-platform graphics library rendering pipeline, wherein, after the rendering bitmap is sent to the client, the image processing method may also include: destroying the cross-platform graphics library rendering pipeline.
[0011] Optionally, the at least one shader file may include one or more groups of shader files, the picture to be processed may include one or more pictures, and the correspondence between the shader files in the at least one shader file and the pictures in the picture to be processed may be that each picture in the one or more pictures corresponds to a group of shader files in the one or more groups of shader files, wherein the step of rendering the bitmap of the picture to be processed using the at least one shader file through the cross-platform graphics library rendering pipeline may include: updating the shader file in the cross-platform graphics library rendering pipeline according to the correspondence; and using the updated shader file to render the bitmap of the picture in the picture to be processed corresponding to the updated shader file.
[0012] Optionally, the graphics processing component may provide a universal interface for being called by clients of different systems.
[0013] Optionally, the client may be an iOS system client or an Android system client.
[0014] According to an exemplary embodiment of the present disclosure, there is provided an image processing apparatus, comprising: a pipeline creation unit, configured to create a cross-platform graphics library rendering pipeline; a shader receiving unit, configured to receive at least one shader file from a client, wherein each shader file in the at least one shader file comprises one or more rendering effects; a bitmap rendering unit, configured to render a bitmap of an image to be processed using the at least one shader file through the cross-platform graphics library rendering pipeline to obtain a rendered bitmap; and a sending unit, configured to send the rendered bitmap to the client.
[0015] Optionally, the cross-platform graphics library rendering pipeline may be a cross-platform rendering pipeline based on OpenGL ES.
[0016] Optionally, the bitmap rendering unit may be configured to: obtain the texture of the image to be processed from the bitmap of the image to be processed through the video memory; and apply the at least one shader file to the texture of the image to be processed through the cross-platform graphics library rendering pipeline.
[0017] Optionally, the at least one shader file may be set with a rendering order, and one or more rendering effects included in each shader file may be set with a rendering order.
[0018] Optionally, the at least one shader file may be common to clients of different systems.
[0019] Optionally, the at least one shader file may be customized and input by a user on the client side.
[0020] Optionally, the pipeline creation unit can be configured to: create a cross-platform graphics library rendering pipeline based on the life cycle of image processing; initialize the created cross-platform graphics library rendering pipeline, wherein the image processing device also includes a pipeline destruction unit, configured to: destroy the cross-platform graphics library rendering pipeline after the rendering bitmap is sent to the client.
[0021] Optionally, the at least one shader file may include one or more groups of shader files, the picture to be processed may include one or more pictures, and the correspondence between the shader files in the at least one shader file and the pictures in the picture to be processed may be that each picture in the one or more pictures corresponds to a group of shader files in the one or more groups of shader files, wherein the bitmap rendering unit may be configured to: update the shader files in the cross-platform graphics library rendering pipeline according to the correspondence; and use the updated shader files to render the bitmap of the picture in the picture to be processed corresponding to the updated shader files.
[0022] Optionally, the graphics processing device may provide a universal interface for being called by clients of different systems.
[0023] Optionally, the client may be an iOS system client or an Android system client.
[0024] According to an exemplary embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a picture processing method according to an exemplary embodiment of the present disclosure.
[0025] According to an exemplary embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor of an electronic device, the electronic device executes the picture processing method according to the exemplary embodiment of the present disclosure.
[0026] According to an exemplary embodiment of the present disclosure, a computer program product is provided, including a computer program / instruction. When the computer program / instruction is executed by a processor, the image processing method according to the exemplary embodiment of the present disclosure is implemented.
[0027] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0028] 1. Since OpenGL ES supports cross-platform and shaders are universal, the same rendering requirement only needs to be developed once, thereby reducing development costs and ensuring consistent functions across platforms;
[0029] 2. High flexibility, meeting custom rendering needs, and enabling effect combination or superposition to provide users with a high-quality experience.
[0030] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0032] Figure 1 An exemplary system architecture is shown in which exemplary embodiments of the present disclosure may be applied.
[0033] Figure 2 A flowchart of a picture processing method according to an exemplary embodiment of the present disclosure is shown.
[0034] Figure 3 An example of the operation flow of the client and the graphics processing component in the process of processing an image is shown.
[0035] Figure 4 An example showing how shader files are combined on the client side.
[0036] Figure 5 A block diagram illustrating a picture processing apparatus according to an exemplary embodiment of the present disclosure is shown.
[0037] Figure 6 is a block diagram of an electronic device 600 according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0038] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0039] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation methods described in the following examples do not represent all implementation methods consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims.
[0040] It should be noted that the phrase "at least one of the items" in the present disclosure includes three types of parallel situations: "any one of the items", "a combination of any number of the items", and "all of the items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "executing at least one of step 1 and step 2" which means the following three parallel situations: (1) executing step 1; (2) executing step 2; (3) executing step 1 and step 2.
[0041] In the related technologies, GPUImage is encapsulated based on GLView on the iOS side and has good support; however, the corresponding Android side does not support it well, the interface is not friendly, and the functions supported by both sides are inconsistent. There is still a phenomenon that some effects are supported by iOS but not by Android. RenderScript is a set of native graphics APIs provided by the Android operating system, which can complete the rendering of complex effects at a lower cost, but its performance is not as good as OpenGL ES, and it only supports Android, which does not meet the cross-platform requirements.
[0042] Next, we will refer to Figures 1 to 6 A picture processing method and apparatus according to exemplary embodiments of the present disclosure are described in detail.
[0043] Figure 1 An exemplary system architecture 100 is shown in which exemplary embodiments of the present disclosure may be applied.
[0044] like Figure 1As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc. Users can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages (e.g., image processing requests), etc. Various image applications may be installed on the terminal devices 101, 102, 103. The terminal devices 101, 102, 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices with display screens that can display, process, edit, etc. images, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, etc. When the terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above, and can be implemented as multiple software or software modules (for example, to provide distributed services), or as a single software or software module. No specific limitation is made here.
[0045] The terminal devices 101, 102, 103 may be installed with an image acquisition device (eg, a camera) to capture images.
[0046] The server 105 may be a server that provides various services, such as a background server that provides support for image applications installed on the terminal devices 101 , 102 , and 103 .
[0047] It should be noted that the server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, used to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0048] It should be noted that the image processing method provided in the embodiments of the present disclosure is usually executed by a terminal device, but can also be executed by a server, or can also be executed by a terminal device and a server in collaboration. Accordingly, the image processing device can be set in the terminal device, in the server, or in both the terminal device and the server.
[0049] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers, and the present disclosure has no limitation on this.
[0050] Figure 2A flowchart of a picture processing method according to an exemplary embodiment of the present disclosure is shown. Figure 2 The image processing method in the embodiment can be applied to the graphics processing component. The graphics processing component can use, for example, but not limited to, C++ to write a cross-platform rendering pipeline software development kit (SDK) based on OpenGL ES to provide a unified high-performance rendering capability for both iOS and Android terminals. Both iOS and Android terminals can encapsulate the interfaces provided by the underlying layer respectively. In an exemplary embodiment of the present disclosure, the graphics processing component can provide a universal interface for clients of different systems to call. The client can be an iOS system client or an Android system client. Figure 3 An example of the operation flow of the client and the graphics processing component (or SDK) in the process of processing an image is shown.
[0051] Reference Figure 2 , in step S201, a cross-platform graphics library rendering pipeline is created.
[0052] In an exemplary embodiment of the present disclosure, the cross-platform graphics library rendering pipeline may be a cross-platform rendering pipeline based on OpenGL ES.
[0053] In an exemplary embodiment of the present disclosure, when creating a cross-platform graphics library rendering pipeline, the cross-platform graphics library rendering pipeline may be first created based on the life cycle of image processing, and then the created cross-platform graphics library rendering pipeline may be initialized.
[0054] When the client receives an image processing request, Figure 3 As shown, the SDK initialization interface is called. When the graphics processing component is based on the OpenGL ES graphics framework, the SDK will initialize the required GL context environment at this step, and create a GL rendering pipeline in the current environment. The GL rendering pipeline can be an off-screen rendering pipeline. In addition, a special management class can be initialized to manage the shader files that will be passed in later.
[0055] In step S202, at least one shader file is received from a client, wherein each of the at least one shader file includes one or more rendering effects.
[0056] In an exemplary embodiment of the present disclosure, the at least one shader file may be set with a rendering order, and one or more rendering effects included in each shader file may be set with a rendering order.
[0057] In an exemplary embodiment of the present disclosure, the at least one shader file is common to clients of different systems, so that the same rendering requirement only needs to be developed once, which reduces development costs and ensures consistent functionality across platforms.
[0058] In an exemplary embodiment of the present disclosure, the at least one shader file can be customized and input by the user on the client side, so that it is highly flexible and meets customized rendering requirements, and can realize effect combination or superposition, providing users with a high-quality experience.
[0059] like Figure 3 As shown in the figure, after the user sets a custom shader file on the client, the shader file is passed to the SDK. After receiving the shader file passed by the client, the SDK will update the shader file that is effectively bound in the GL rendering pipeline for subsequent rendering. The client supports the combination of multiple shader files, and these shader files will be processed linearly in the GL rendering pipeline, and the effects will be rendered to the image in sequence. Figure 4 An example showing how shader files are combined on the client side. Figure 4 The shader file shown includes a vertex shader and a fragment shader.
[0060] In step S203, the bitmap of the image to be processed is rendered using the at least one shader file through a cross-platform graphics library rendering pipeline to obtain a rendered bitmap.
[0061] In an exemplary embodiment of the present disclosure, when the bitmap of the picture to be processed is rendered using the at least one shader file through a cross-platform graphics library rendering pipeline, the texture of the picture to be processed can be first obtained from the bitmap of the picture to be processed through the video memory, and then the at least one shader file can be applied to the texture of the picture to be processed through the cross-platform graphics library rendering pipeline.
[0062] In an exemplary embodiment of the present disclosure, the at least one shader file may include one or more groups of shader files, the picture to be processed may include one or more pictures, and the correspondence between the shader files in the at least one shader file and the pictures in the picture to be processed may be that each picture in the one or more pictures corresponds to a group of shader files in the one or more groups of shader files. In this case, when the at least one shader file is used to render the bitmap of the picture to be processed through the cross-platform graphics library rendering pipeline, the shader file in the cross-platform graphics library rendering pipeline may be first updated according to the correspondence, and then the updated shader file may be used to render the bitmap of the picture in the picture to be processed corresponding to the updated shader file.
[0063] For example, the bitmap of the image to be processed (i.e., the original bitmap) is input by the client. A bitmap is input in response to one request, and multiple requests can be made. If multiple bitmaps are passed in, these bitmaps will be processed in serial order and returned. After the SDK receives the original bitmap: the bitmap currently in memory is passed into the video memory through the glTexImage2D interface and a texture is generated; the obtained texture is passed into the current rendering pipeline; the texture is rendered using the shader file in the GL rendering pipeline. If there are multiple sets of shader files, the multiple bitmaps are processed sequentially; the rendered bitmap content is read from the video memory into the memory through the glReadPixel interface, and returned to the client. In other words, in the gaps between multiple bitmaps passed in by the client, such as Figure 3 As shown, step 2 can be repeatedly performed to update the shader file in the pipeline in real time to obtain different rendering effects.
[0064] In step S204, the rendered bitmap is sent to the client.
[0065] In an exemplary embodiment of the present disclosure, after the rendering bitmap is sent to the client, the cross-platform graphics library rendering pipeline may be destroyed.
[0066] For example, when the client no longer needs to render more images, it calls the destroy interface to notify the SDK to destroy resources. The SDK will then recycle the recycled objects, destroy the current rendering pipeline, and the GL context environment.
[0067] The above has been combined Figures 1 to 4 The picture processing method according to the exemplary embodiment of the present disclosure is described. Figure 5 A picture processing apparatus and units thereof according to an exemplary embodiment of the present disclosure are described.
[0068] Figure 5 A block diagram illustrating a picture processing apparatus according to an exemplary embodiment of the present disclosure is shown.
[0069] Reference Figure 5 The image processing device includes a pipeline creation unit 51, a shader receiving unit 52, a bitmap rendering unit 53 and a sending unit 54.
[0070] The pipeline creation unit 51 is configured to create a cross-platform graphics library rendering pipeline.
[0071] In an exemplary embodiment of the present disclosure, the cross-platform graphics library rendering pipeline may be a cross-platform rendering pipeline based on OpenGL ES.
[0072] In an exemplary embodiment of the present disclosure, the pipeline creation unit 51 may be configured to: create a cross-platform graphics library rendering pipeline based on the life cycle of image processing; and initialize the created cross-platform graphics library rendering pipeline.
[0073] The shader receiving unit 52 is configured to receive at least one shader file from a client. Here, each shader file in the at least one shader file includes one or more rendering effects.
[0074] In an exemplary embodiment of the present disclosure, the at least one shader file may be set with a rendering order, and one or more rendering effects that may be included in each shader file may be set with a rendering order.
[0075] In an exemplary embodiment of the present disclosure, the at least one shader file may be common to clients of different systems.
[0076] In an exemplary embodiment of the present disclosure, the at least one shader file may be customized and input by a user on the client side.
[0077] In an exemplary embodiment of the present disclosure, the client may be an iOS system client or an Android system client.
[0078] The bitmap rendering unit 53 is configured to render the bitmap of the to-be-processed picture using the at least one shader file through the cross-platform graphics library rendering pipeline to obtain a rendered bitmap.
[0079] In an exemplary embodiment of the present disclosure, the bitmap rendering unit 53 may be configured to: obtain the texture of the image to be processed from the bitmap of the image to be processed through the video memory; and apply the at least one shader file to the texture of the image to be processed through the cross-platform graphics library rendering pipeline.
[0080] In an exemplary embodiment of the present disclosure, the at least one shader file may include one or more groups of shader files, the picture to be processed may include one or more pictures, and the correspondence between the shader files in the at least one shader file and the pictures in the picture to be processed may be that each picture in the one or more pictures corresponds to a group of shader files in the one or more groups of shader files. In this case, the bitmap rendering unit 53 may be configured to: update the shader files in the cross-platform graphics library rendering pipeline according to the correspondence; and use the updated shader files to render the bitmap of the picture in the picture to be processed corresponding to the updated shader files.
[0081] The sending unit 54 is configured to send the rendering bitmap to the client.
[0082] In an exemplary embodiment of the present disclosure, a graphics processing device may provide a universal interface for being called by clients of different systems.
[0083] In an exemplary embodiment of the present disclosure, the image processing apparatus may further include a pipeline destroying unit (not shown) configured to destroy the cross-platform graphics library rendering pipeline after the rendering bitmap is sent to the client.
[0084] Regarding the device in the above embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.
[0085] The above has been combined Figure 5 The picture processing device according to the exemplary embodiment of the present disclosure is described. Figure 6 An electronic device according to an exemplary embodiment of the present disclosure is described.
[0086] Figure 6 is a block diagram of an electronic device 600 according to an exemplary embodiment of the present disclosure.
[0087] Reference Figure 6 The electronic device 600 includes at least one memory 601 and at least one processor 602, wherein the at least one memory 601 stores a set of computer executable instructions, and when the computer executable instruction set is executed by the at least one processor 602, a method for image processing according to an exemplary embodiment of the present disclosure is performed.
[0088] In an exemplary embodiment of the present disclosure, the electronic device 600 may be a PC, a tablet device, a personal digital assistant, a smart phone, or other device capable of executing the above-mentioned instruction set. Here, the electronic device 600 is not necessarily a single electronic device, but may also be any device or circuit collection capable of executing the above-mentioned instructions (or instruction sets) individually or in combination. The electronic device 600 may also be part of an integrated control system or system manager, or may be configured as a portable electronic device interconnected with a local or remote (e.g., via wireless transmission) interface.
[0089] In the electronic device 600, the processor 602 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller or a microprocessor. As an example and not limitation, the processor may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.
[0090] The processor 602 may execute instructions or codes stored in the memory 601, which may also store data. Instructions and data may also be sent and received over a network via a network interface device, which may employ any known transmission protocol.
[0091] The memory 601 may be integrated with the processor 602, for example, by placing RAM or flash memory within an integrated circuit microprocessor or the like. In addition, the memory 601 may include a separate device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The memory 601 and the processor 602 may be operatively coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the processor 602 can read files stored in the memory.
[0092] In addition, the electronic device 600 may further include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the electronic device 600 may be connected to each other via a bus and / or a network.
[0093] According to an exemplary embodiment of the present disclosure, a computer-readable storage medium including instructions is also provided, such as a memory 601 including instructions, and the above instructions can be executed by a processor 602 of an apparatus 600 to complete the above method. Alternatively, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0094] According to an exemplary embodiment of the present disclosure, a computer program product may also be provided. The computer program product includes a computer program / instruction. When the computer program / instruction is executed by a processor, the method for image processing according to the exemplary embodiment of the present disclosure is implemented.
[0095] The above has been referred to Figures 1 to 6 The picture processing method and apparatus according to the exemplary embodiments of the present disclosure are described. However, it should be understood that: Figure 5 The image processing device and its units shown in the figure may be respectively configured as software, hardware, firmware or any combination of the above items to perform specific functions. Figure 6 The electronic device shown in is not limited to including the components shown above, but some components may be added or deleted as needed, and the above components may also be combined.
[0096] According to the image processing method and device disclosed in the present invention, a cross-platform graphics library rendering pipeline is first created, at least one shader file is received from a client, wherein each shader file in the at least one shader file includes one or more rendering effects, and then the at least one shader file is used to render the bitmap of the image to be processed through the cross-platform graphics library rendering pipeline to obtain the rendered bitmap, and the rendered bitmap is sent to the client, thereby reducing development costs, ensuring cross-platform functional consistency, and providing users with a high-quality experience.
[0097] In addition, according to the image processing method and device disclosed in the present invention, a color filter file customized by a user on the client side can be received, the development flexibility is high, custom rendering requirements can be met, and effect combination or superposition can be achieved.
[0098] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0099] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A picture processing method, applied to a graphics processing component, characterized in that: The image processing method comprises: Create a cross-platform graphics library rendering pipeline; receiving at least one shader file from a client, wherein each shader file of the at least one shader file includes one or more rendering effects; Rendering the bitmap of the image to be processed by using the at least one shader file through the cross-platform graphics library rendering pipeline to obtain a rendered bitmap; sending the rendered bitmap to the client, The at least one shader file includes one or more groups of shader files, the picture to be processed includes one or more pictures, and the correspondence between the shader files in the at least one shader file and the pictures in the picture to be processed is that each picture in the one or more pictures corresponds to a group of shader files in the one or more groups of shader files, The step of rendering the bitmap of the image to be processed by using the at least one shader file through the cross-platform graphics library rendering pipeline includes: According to the corresponding relationship, updating the shader file in the cross-platform graphics library rendering pipeline; The updated shader file is used to render a bitmap of a picture corresponding to the updated shader file in the picture to be processed.
2. The image processing method according to claim 1, characterized in that: The cross-platform graphics library rendering pipeline is a cross-platform rendering pipeline based on OpenGL ES.
3. The image processing method according to claim 1, characterized in that: The step of rendering the bitmap of the image to be processed by using the at least one shader file through the cross-platform graphics library rendering pipeline includes: Obtain the texture of the image to be processed from the bitmap of the image to be processed through the video memory; The at least one shader file is applied to a texture of the image to be processed through the cross-platform graphics library rendering pipeline.
4. The image processing method according to claim 1, characterized in that: The at least one shader file is set with a rendering order, and one or more rendering effects included in each shader file are set with a rendering order.
5. The image processing method according to claim 1, characterized in that: The at least one shader file is common to clients of different systems.
6. The image processing method according to claim 1, characterized in that: The at least one shader file is customized and input by a user on the client side.
7. The image processing method according to claim 1, characterized in that: The steps to create a cross-platform graphics library rendering pipeline include: Create a cross-platform graphics library rendering pipeline based on the image processing life cycle; Initialize the created cross-platform graphics library rendering pipeline. Wherein, after the rendering bitmap is sent to the client, the image processing method further includes: Destroys the cross-platform graphics library rendering pipeline.
8. The image processing method according to claim 1, characterized in that: The graphics processing component provides a common interface for being called by clients of different systems.
9. The image processing method according to claim 8, characterized in that: The client is an iOS system client or an Android system client.
10. A picture processing device, characterized in that: include: A pipeline creation unit, configured to create a cross-platform graphics library rendering pipeline; A shader receiving unit is configured to receive at least one shader file from a client, wherein each shader file in the at least one shader file includes one or more rendering effects; A bitmap rendering unit is configured to render a bitmap of the image to be processed using the at least one shader file through the cross-platform graphics library rendering pipeline to obtain a rendered bitmap; and a sending unit, configured to send the rendered bitmap to the client, The at least one shader file includes one or more groups of shader files, the picture to be processed includes one or more pictures, and the correspondence between the shader files in the at least one shader file and the pictures in the picture to be processed is that each picture in the one or more pictures corresponds to a group of shader files in the one or more groups of shader files, Among them, the bitmap rendering unit is configured as: According to the corresponding relationship, updating the shader file in the cross-platform graphics library rendering pipeline; The updated shader file is used to render a bitmap of a picture corresponding to the updated shader file in the picture to be processed.
11. The image processing device according to claim 10, characterized in that: The cross-platform graphics library rendering pipeline is a cross-platform rendering pipeline based on OpenGL ES.
12. The image processing device according to claim 10, characterized in that: The bitmap rendering unit is configured as: Obtain the texture of the image to be processed from the bitmap of the image to be processed through the video memory; The at least one shader file is applied to a texture of the image to be processed through the cross-platform graphics library rendering pipeline.
13. The image processing device according to claim 10, characterized in that: The at least one shader file is set with a rendering order, and one or more rendering effects included in each shader file are set with a rendering order.
14. The image processing device according to claim 10, characterized in that: The at least one shader file is common to clients of different systems.
15. The image processing device according to claim 10, characterized in that: The at least one shader file is customized and input by a user on the client side.
16. The image processing device according to claim 10, characterized in that: The pipeline creation unit is configured as: Create a cross-platform graphics library rendering pipeline based on the image processing life cycle; Initialize the created cross-platform graphics library rendering pipeline. The image processing device further includes a pipeline destroying unit configured to: After the rendering bitmap is sent to the client, the cross-platform graphics library rendering pipeline is destroyed.
17. The image processing device according to claim 10, characterized in that: The image processing device provides a universal interface for being called by clients of different systems.
18. The image processing device according to claim 17, characterized in that: The client is an iOS system client or an Android system client.
19. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the image processing method as described in any one of claims 1 to 9.
20. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor of an electronic device, the electronic device executes the image processing method as claimed in any one of claims 1 to 9.
21. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the image processing method according to any one of claims 1 to 1-9 is implemented.
Citation Information
Patent Citations
Shader data processing method, shader data processing device, storage medium and electronic device
CN109893855A
Coloring data processing method and device based on game engine and electronic equipment
CN111813380A