CN110349243A - Image processing method, device, electronic equipment and storage medium - Google Patents

Image processing method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110349243A
CN110349243A CN201910637251.3A CN201910637251A CN110349243A CN 110349243 A CN110349243 A CN 110349243A CN 201910637251 A CN201910637251 A CN 201910637251A CN 110349243 A CN110349243 A CN 110349243A
Authority
CN
China
Prior art keywords
image data
processed
compressed textures
image
graphics processor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910637251.3A
Other languages
Chinese (zh)
Other versions
CN110349243B (en
Inventor
李森林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201910637251.3A priority Critical patent/CN110349243B/en
Publication of CN110349243A publication Critical patent/CN110349243A/en
Application granted granted Critical
Publication of CN110349243B publication Critical patent/CN110349243B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the present application discloses a kind of image processing method, device, electronic equipment and storage medium, wherein method includes: by receiving image processing commands, the image data to be processed of a variety of compressed textures formats is obtained according to image processing commands, the type information of graphics processor is obtained again, according to the type information in the image data to be processed of a variety of compressed textures formats selection target image data to be processed, target image data to be processed is finally input to the graphics processor, to carry out image rendering.During making image procossing, it is capable of the compressed textures format of the selection image data of active, improves efficiency when image procossing.

Description

Image processing method, device, electronic equipment and storage medium
Technical field
This application involves electronic technology fields, and in particular to a kind of image processing method, device, electronic equipment and storage are situated between Matter.
Background technique
In existing image processing techniques, compressed textures processing is carried out to image generally by Unity3D device, Texture2D format can be right in Texture2D config option required for Unity3D device can be converted to picture Different compressed textures formats is arranged in different platforms, for example iOS platform is arranged to PVRTC4, and Android platform is arranged to ETC1 etc..
But before handling image, need to generate specified compression of images texture format, in different GPU In type, the compressed textures format of the specified different types of image of input is needed otherwise not support the hard grain of image in GPU In the case where managing format, phenomena such as game picture is abnormal will lead to.
Summary of the invention
The embodiment of the present application provides a kind of image processing method, device, electronic equipment and storage medium.Wherein described image Processing method can be improved the efficiency to image procossing.
In order to solve the above technical problems, present applicant proposes following technical schemes:
In a first aspect, the embodiment of the present application provides a kind of image processing method, wherein described image processing method includes:
Image processing commands are received, the image to be processed of a variety of compressed textures formats is obtained according to described image process instruction Data;
Obtain the type information of graphics processor;
According to the type information, selection target waits locating in the image data to be processed of a variety of compressed textures formats Manage image data;
Target image data to be processed is input to the graphics processor, to carry out image rendering.
Second aspect, the embodiment of the present application provide a kind of image processing apparatus, and wherein described image processing unit includes:
First obtains module, for receiving image processing commands, obtains a variety of hard grains according to described image process instruction Manage the image data to be processed of format;
Second obtains module, for obtaining the type information of graphics processor;
Selecting module, for according to the type information in the image data to be processed of a variety of compressed textures formats Selection target image data to be processed;
Rendering module, for target image data to be processed to be input to the graphics processor, to carry out image Rendering.
The third aspect, the embodiment of the present application provide a kind of electronic equipment, including memory, processor and are stored in storage On device and the computer program that can run on a processor, the processor realize above-mentioned image processing method when executing described program Step in method.
Fourth aspect, the embodiment of the present application provide a kind of storage medium, are stored thereon with computer program, the calculating Machine program realizes the step in above-mentioned image processing method when being executed by processor.
In the embodiment of the present application, by receiving image processing commands, a variety of compressed textures are obtained according to image processing commands The image data to be processed of format, then the type information of graphics processor is obtained, according to the type information in a variety of pressures Selection target image data to be processed in the image data to be processed of contracting texture format, finally by target picture number to be processed According to the graphics processor is input to, to carry out image rendering.To keep the memory occupied when image procossing lower, image rendering Image quality it is higher, improve efficiency when image procossing.
Detailed description of the invention
In order to more clearly explain the technical solutions in the embodiments of the present application, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, the drawings in the following description are only some examples of the present application, for For those skilled in the art, without creative efforts, it can also be obtained according to these attached drawings other attached Figure.
Fig. 1 is the first pass schematic diagram of image processing method provided by the embodiments of the present application.
Fig. 2 is the second procedure schematic diagram of image processing method provided by the embodiments of the present application.
Fig. 3 is the first structure diagram of image processing apparatus provided by the embodiments of the present application.
Fig. 4 is the second structural schematic diagram of image processing apparatus provided by the embodiments of the present application.
Fig. 5 is the structural schematic diagram of electronic equipment provided by the embodiments of the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on Embodiment in the application, those skilled in the art's every other implementation obtained without creative efforts Example, shall fall in the protection scope of this application.
In the following description, the specific embodiment of the application will refer to the step as performed by one or multi-section computer And symbol illustrates, unless otherwise stating clearly.Therefore, these steps and operation will have to mention for several times is executed by computer, this paper institute The computer execution of finger includes by representing with the computer processing unit of the electronic signal of the data in a structuring pattern Operation.This operation is converted at the data or the position being maintained in the memory system of the computer, reconfigurable Or in addition change the running of the computer in mode known to the tester of this field.The maintained data structure of the data For the provider location of the memory, there is the specific feature as defined in the data format.But the application principle is with above-mentioned text Word illustrates that be not represented as a kind of limitation, this field tester will appreciate that plurality of step and behaviour as described below Also it may be implemented in hardware.
Term " first ", " second " and " third " in the application etc. are for distinguishing different objects, rather than for retouching State particular order.In addition, term " includes " and " having " and their any deformations, it is intended that cover and non-exclusive include. Such as contain series of steps or module process, method, system, product or equipment be not limited to listed step or Module, but some embodiments further include the steps that not listing or module or some embodiments further include for these processes, Method, product or equipment intrinsic other steps or module.
The embodiment of the present application provides a kind of image processing method, device, electronic equipment and storage medium.It carries out individually below It is described in detail.
Image processing method in the application is suitable for the electricity such as smart phone, computer, smart television, intelligent wearable device Sub- equipment is in the range that the application is protected using the electronic equipment of image processing method in the application.
Referring to Fig. 1, Fig. 1 is the first pass schematic diagram of image processing method provided by the embodiments of the present application.The figure As processing method can be improved the efficiency to image procossing.Described image processing method the following steps are included:
In a step 101, receive image processing commands, according to image processing commands obtain a variety of compressed textures formats to Handle image data.
When playing games, or when seeing video, when loading webpage etc., require to handle image.At this point, can give birth to At image processing commands, electronic equipment is handled according to image data of the image processing commands to input.
In some embodiments, the image data of input can be original image, for example, common PNG, JPG, BMP, GIF etc. Format, the image data of these formats cannot pass through GPU (graphics processor) processing, need CPU (central processing unit) will Its solution is pressed into bitmap (bitmap), and the image data to be processed of corresponding texture format then can be obtained according to bitmap, such as Then the formats such as R5G6B5, A4R4G4B4, A1R5G5B5, R8G8B8, A8R8G8B8 again input these image datas to be processed Image rendering is carried out to graphics processor.
In some embodiments, the image data of input is also possible to the image data by compressed textures, such as ETC1, ETC2, PVRTC, ASTC, DXT etc. compress the image data of texture format, the picture number of available a variety of compressed textures formats According to as image data to be processed.
It should be noted that the image data of a variety of compressed textures formats can be the figure that electronic equipment is locally stored As data, for example, the single machine downloaded on an electronic device is outstanding
In a step 102, the type information of graphics processor is obtained.
Different manufacturers, graphics processor are also different, for example, the graphics processor of the Adreno series of high pass is it Exclusive GPU type, alternatively, the Bay Trail series plot processing of the tall and handsome Tegra series plot processor reached, Intel Device etc..
The type information of graphics processor is different, and the compressed textures format for the image data supported is also naturally different, example Such as, the image data of PVRTC compressed textures format can be used the electronic equipment of PowerVR series plot processor to support, The image data of ASTC compressed textures format can be used the electronic equipment of Adreno series plot processor to support.
In step 103, according to type information in the image data to be processed of a variety of compressed textures formats selection target Image data to be processed.
The image data to be processed for getting a variety of compressed textures formats such as ETC1, ETC2, PVRTC, ASTC, DXT it Afterwards, the compressed textures format that the graphics processor can be selected to be supported according to the type information of graphics processor, then The image data to be processed for the compressed textures format that graphics processor is supported is selected as target image data to be processed.
For example, the graphics processor of electronic equipment supports the picture number of these three compressed textures formats of ETC1, ETC2, ASTC According to the image data of ETC1, ETC2, ASTC in image data to be processed these three compressed textures formats being selected as mesh Mark image data to be processed.If the graphics processor of electronic equipment only supports a kind of this picture number of compressed textures format of ETC1 According to then selecting the image data of ETC1 compressed textures format as target image data to be processed.
At step 104, target image data to be processed is input to graphics processor, to carry out image rendering.
It, can be in the picture number for wherein selecting a kind of compressed textures format after choosing target image data to be processed It according to being input in graphics processor, handles graphics processor to image data, finally realizes image rendering.
For example, if the graphics processor of current electronic device is the Bay of the tall and handsome Tegra series or Intel reached Trail series, then use DXT texture recognition algorithm, takes out compressed textures data, directly gives GPU drafting.
It, can be with if the graphics processor of current electronic device is that can support the image data of a variety of compressed textures formats The composite factors such as image quality, speed, duration according to drawing image select target image data to be processed, after selection Destination image data and being input in image processor is rendered.
In conclusion the image processing method provided in the embodiment of the present application, by receiving image processing commands, according to figure As process instruction obtains the image data to be processed of a variety of compressed textures formats, then obtain the type information of graphics processor, root According to the type information in the image data to be processed of a variety of compressed textures formats selection target image data to be processed, Target image data to be processed is finally input to the graphics processor, to carry out image rendering.To make at image The memory occupied when reason is lower, and the image quality of image rendering is higher, improves efficiency when image procossing.
Referring to Fig. 2, Fig. 2 is the second procedure schematic diagram of image processing method provided by the embodiments of the present application, the figure As processing method can be improved the efficiency to image procossing.Described image processing method the following steps are included:
In step 201, receive image processing commands, according to image processing commands obtain a variety of compressed textures formats to Handle image data.
In the processing to image, the image data of available a variety of compressed textures formats, such as ETC1, ETC2, The image data of the compression texture format such as PVRTC, ASTC, DXT.
Wherein, different compressed textures formats has different characteristics, for example, ETC1 compressed textures format is a kind of standard Picture compression texture format, ETC1 only supports RGB channel, do not support alpha transparent channel;ETC2 compressed textures format is one The picture compression texture format of kind standard, ETC2 also support alpha transparent channel other than supporting RGB channel.ASTC hard grain The electronic equipment for managing the available high pass Adreno series plot processor of format supports that PVRTC compressed textures format can obtain To using the electronic equipment of PowerVR series plot processor to support.
The image data to be processed of a variety of compressed textures formats can be obtained by image processing commands, wherein figure to be processed It is locally stored as data can be electronic equipment, is also possible to cloud storage.
In step S202, control graphics processor, which generates, shows interface.
Before handling image data to be processed, need to obtain the type letter of the graphics processor of electronic equipment Breath.
At this point it is possible to which controlling graphics processor generates a displaying interface, it is transparent that this shows that interface can be, and prevents The user visual field is blocked, poor user experience is caused.
For example, in the electronic equipment for carrying android system, it can be by the Java API that Android is provided come real The acquisition of existing graphics processor type information, specifically, being to obtain graphics process type information, OpenGL by OpenGL Be for render 2D, 3D vector graphics across language, cross-platform application programming interface.It can be by realizing one GLSurfaceView.Renderer interface, and renderer (renderer) is arranged into a GLSurfaceView, then Being mounted to an Activity, (application component, provides a screen, and user can be used to interaction to complete a certain Business), wherein hanging over an Activity can be understood as an interface in an Android, this interface be can be set It is transparent.
In step 203, the parameter information for showing interface is obtained, is believed according to the type that parameter information obtains graphics processor Breath.
For example, the type letter of graphics processor can be got from above-mentioned GLSurfaceView.Renderer interface Breath.The type information of graphics processor can also be obtained from the system information of electronic equipment signature.
In step S204, the accessible compressed textures picture number of the graphics processor is obtained according to type information According to.
The compressed textures format that different types of graphics processor is supported is also different, for example, PVRTC compressed textures format Image data the electronic equipment of PowerVR series plot processor can be used to support, the figure of ASTC compressed textures format As data can be used the electronic equipment of Adreno series plot processor to support.
The hard grain for the compressed textures format that electronic equipment graphics processor can be supported can be obtained according to type information Manage image data.
In step 205, priority is arranged to the accessible compressed textures image data of different compressed textures formats.
It is understood that the graphics processor of electronic equipment can support the image data of a variety of compressed textures formats, Graphics processor has difference to duration, the efficiency of the image real time transfer of different compressed textures formats, to different hard grains Picture effect after managing the image real time transfer of format also has difference.
For example, the speed that can be handled according to compressed textures data of the graphics processor to different compressed textures formats The priority of compressed textures image data is set, and processing speed is faster, the priority of corresponding compressed textures image data is got over It is high.The display effect of picture is after compressed textures image data can also being handled according to graphics processor come to compressed textures picture number According to setting priority, image quality is better, and the priority of corresponding compressed textures graph data is higher.
It in some embodiments, can also basis in the case that graphics processor can support a variety of compressed textures formats Situation is arranged the priority of compressed textures data when to image procossing, for example, when playing games, needs when game is just opened Loading velocity is fast, at this time can according to graphics processor to the processing speed of compressed textures image data come to compressed textures image Priority is arranged in data, after entering game, needs image quality higher in game, at this time can be according to the image quality of output come to compression Priority is arranged in texture image data, in the different phase of game running, can be selected using the priority that various criterion is formulated Select target image data to be processed.
In step 206, judged in image data to be processed according to type information with the presence or absence of accessible compressed textures Image data.
After to image processor accessible compressed textures image data, priority is set, it can be determined that figure to be processed As whether there is the accessible compressed textures image data of graphics processor in data.
If being entered step in image data to be processed there are the accessible compressed textures image data of graphics processor In 207.
If the accessible compressed textures image data of graphics processor is not present in image data to be processed, enter step In 209.
In step 207, according to priority in image data to be processed selection target image data to be processed.
It is understood that can be according to the accessible compressed textures image data of graphics processor, in image to be processed The target image data to be processed for selecting graphics processor that can support in data.
For example, the graphics processor of electronic equipment supports the picture number of these three compressed textures formats of ETC1, ETC2, ASTC According to the image data of ETC1, ETC2, ASTC in image data to be processed these three compressed textures formats being selected as mesh Mark image data to be processed.If the graphics processor of electronic equipment only supports a kind of this picture number of compressed textures format of ETC1 According to then selecting the image data of ETC1 compressed textures format as target image data to be processed.
Priority can also be set according to the rank of the compressed textures format of graphics processor support, for example, carrying Android system electronic equipment supports both compressed textures formats of ETC2 and ETC1, then the image of ETC2 compressed textures format Data-level setting is higher, because then illustrating the graphics processor branch of electronic equipment in the case where electronic equipment supports ETC2 OpenGL 3.0 is held, OpenGL is one and calls convenient bottom 3D shape library, and the corresponding version of OpenGL3.0 must compare OpenGL2.0 version is more comprehensive, if in the case where the graphics processor of electronic equipment does not support 3.0 OpenGL, Zhi Nengxuan The image data for selecting ETC1 compressed textures format is higher priority, because supporting ETC1 compressed textures lattice in graphics processor In the case where formula, graphics processor must support 2.0 version of OpenGL.
In a step 208, according to priority in image data to be processed selection target image data to be processed.
The image data of the higher compressed textures format of priority can be chosen, it is to be processed to be set to target Image data.For example, the rank of priority is 10, the image data to be processed by priority higher than 5 is selected as target processing figure As data, it can the image data to be processed that priority is higher than preset threshold is chosen for target image data to be processed.
The image data to be processed that highest priority can also directly be chosen is target image data to be processed.
In step 209, target image data to be processed is input to graphics processor to carry out image rendering.
Target image data to be processed is input to graphics processor, image processor adopts target image data to be processed With corresponding recognizer, the image data for taking out corresponding compressed textures format, which is input in graphics processor, is drawn, To carry out image rendering.
For example, if current device graphics processor is the Bay Trail system of the tall and handsome Tegra series or Intel reached Column then use DXT texture recognition algorithm, take out compressed textures data, directly give GPU drafting.
If entering step 210 in image data to be processed and there is no the compressed textures format that graphics processor is supported In, raw image data is obtained according to image processing commands.
It is understood that the image data of input can be original image, for example, the lattice such as common PNG, JPG, BMP, GIF Formula, the image data of these formats cannot pass through GPU (graphics processor) processing, need CPU (central processing unit) by its Solution is pressed into bitmap (bitmap), and the image data to be processed of corresponding texture format then can be obtained according to bitmap, such as The formats such as R5G6B5, A4R4G4B4, A1R5G5B5, R8G8B8, A8R8G8B8.
In step 211, raw image data is input to graphics processor and carries out image rendering.
For example, the file of R5G6B5 format needs to occupy 512KB capacity (512* for the texture picture of a 512*512 512*2/1024), for the formatted file of R8G8B8A8, then need to occupy the capacity of 1MB.If it is 1024*1024's Texture picture, then the formatted file of R5G6B5 and R8G8B8A8 is respectively necessary for the capacity of 2MB and 4MB.
Although the image texture data in original image is directly input to graphics processor to handle, handle shared when image Memory source is more, but can to avoid the image to be processed for not supporting all compressed textures formats due to electronic equipment and Caused application program is operating abnormally.
In conclusion, by image processing commands, obtaining the to be processed of a variety of compressed textures formats in the embodiment of the present application Then image data controls graphics processor and generates displaying interface, obtains the parameter information for showing interface, obtained according to parameter information The type information for taking image processor obtains the accessible compressed textures image data of graphics processor according to type information, right Priority is arranged in the compressed textures image data of different compressed textures formats.
If there are accessible compressed textures image datas in image data to be processed, according to priority to be processed Selection target compressing image data to be processed in image data, by target image data to be processed be input to graphics processor with into Row image rendering;If the accessible compressed textures image data of graphics processor, basis are not present in image data to be processed Image processing commands obtain original image, and raw image data is input to graphics processor and carries out image rendering.
Image processing method as described in this application is capable of the compressed textures format of the selection image data of active, and to it Selection processing is carried out, keeps the memory source occupied when image procossing lower, also improves efficiency when image procossing.
Correspondingly, the embodiment of the present application also provides the image processing apparatus of correspondence image processing method.Referring to Fig. 3, Fig. 3 is the first structure diagram of image processing apparatus provided by the embodiments of the present application.Described image processing unit includes: first It obtains module 310, second and obtains module 320, selecting module 330 and rendering module 340.
First obtains module 310, for receiving image processing commands, obtains a variety of compressions according to described image process instruction The image data to be processed of texture format.
In the processing to image, the image data of available a variety of compressed textures formats, such as ETC1, ETC2, The image data of the compression texture format such as PVRTC, ASTC, DXT.
Wherein, different compressed textures formats has different characteristics, for example, ETC1 compressed textures format is a kind of standard Picture compression texture format, ETC1 only supports RGB channel, do not support alpha transparent channel;ETC2 compressed textures format is one The picture compression texture format of kind standard, ETC2 also support alpha transparent channel other than supporting RGB channel.ASTC hard grain The electronic equipment for managing the available high pass Adreno series plot processor of format supports that PVRTC compressed textures format can obtain To using the electronic equipment of PowerVR series plot processor to support.
First acquisition module 310 can obtain the picture number to be processed of a variety of compressed textures formats by image processing commands According to being also possible to cloud storage wherein image data to be processed can be what electronic equipment was locally stored.
Second obtains module 320, for obtaining the type information of graphics processor.
Different manufacturers, graphics processor are also different, for example, the graphics processor of the Adreno series of high pass is it Exclusive GPU type, alternatively, the Bay Trail series plot processing of the tall and handsome Tegra series plot processor reached, Intel Device etc..
The type information of graphics processor is different, and the compressed textures format for the image data supported is also naturally different, example Such as, the image data of PVRTC compressed textures format can be used the electronic equipment of PowerVR series plot processor to support, The image data of ASTC compressed textures format can be used the electronic equipment of Adreno series plot processor to support.
In addition, referring to Figure 4 together, Fig. 4 is the second structural representation of image processing apparatus provided by the embodiments of the present application Figure.Wherein, the second acquisition module 320 includes that interface generates submodule 321 and type acquisition submodule 322.
Interface generates submodule 321, generates displaying interface for controlling the graphics processor, the displaying interface is Bright interface.
Before handling image data to be processed, need to obtain the type letter of the graphics processor of electronic equipment Breath.
Interface, which generates submodule 321 and can control graphics processor, generates a displayings interface, this displaying interface can be with Be it is transparent, prevent from blocking the user visual field, cause poor user experience.
For example, in the electronic equipment for carrying android system, it can be by the Java API that Android is provided come real The acquisition of existing graphics processor type information, specifically, being to obtain graphics process type information, OpenGL by OpenGL Be for render 2D, 3D vector graphics across language, cross-platform application programming interface.It can be by realizing one GLSurfaceView.Renderer interface, and renderer (renderer) is arranged into a GLSurfaceView, then Being mounted to an Activity, (application component, provides a screen, and user can be used to interaction to complete a certain Business), wherein hanging over an Activity can be understood as an interface in an Android, this interface be can be set It is transparent.
Type acquisition submodule 322 is obtained for obtaining the parameter information for showing interface according to the parameter information The type information of described image device.
Type acquisition submodule 322 can get graphics process from above-mentioned GLSurfaceView.Renderer interface The type information of device.The type information of graphics processor can also be obtained from the system information of electronic equipment signature.
Selecting module 330, for according to the type information a variety of compressed textures formats picture number to be processed According to middle selection target image data to be processed.
The image data to be processed for getting a variety of compressed textures formats such as ETC1, ETC2, PVRTC, ASTC, DXT it Afterwards, the compressed textures format that the graphics processor can be selected to be supported according to the type information of graphics processor, then The image data to be processed for the compressed textures format that graphics processor is supported is selected as target image data to be processed.
For example, the graphics processor of electronic equipment supports the picture number of these three compressed textures formats of ETC1, ETC2, ASTC According to the image data of ETC1, ETC2, ASTC in image data to be processed these three compressed textures formats being selected as mesh Mark image data to be processed.If the graphics processor of electronic equipment only supports a kind of this picture number of compressed textures format of ETC1 According to then selecting the image data of ETC1 compressed textures format as target image data to be processed.
Referring to Fig. 4, selecting module 330 includes acquisition submodule 331 and selection submodule 332.
Acquisition submodule 331, for obtaining the accessible compressed textures of graphics processor according to the type information Graph data.
The compressed textures format that different types of graphics processor is supported is also different, for example, PVRTC compressed textures format Image data the electronic equipment of PowerVR series plot processor can be used to support, the figure of ASTC compressed textures format As data can be used the electronic equipment of Adreno series plot processor to support.
Acquisition submodule 331 can obtain the compressed textures that electronic equipment graphics processor can be supported according to type information The compressed textures image data of format.
Submodule 332 is selected, is used for according to the accessible compressed textures image data in the picture number to be processed According to middle selection target image data to be processed.
Submodule 332 is selected to be specifically used for the accessible compressed textures image data to different compressed textures formats Priority is set;According to the priority in the image data to be processed selection target image data to be processed.
The graphics processor of electronic equipment can support the image data of a variety of compressed textures formats, and graphics processor is not to Duration, efficiency with the image real time transfer of compressed textures format have difference, to the picture number of different compressed textures formats According to treated, picture effect also has difference.
For example, the speed that can be handled according to compressed textures data of the graphics processor to different compressed textures formats The priority of compressed textures image data is set, and processing speed is faster, the priority of corresponding compressed textures image data is got over It is high.The display effect of picture is after compressed textures image data can also being handled according to graphics processor come to compressed textures picture number According to setting priority, image quality is better, and the priority of corresponding compressed textures graph data is higher.
Rendering module 340, for target image data to be processed to be input to the graphics processor, to carry out figure As rendering.
After choosing target image data to be processed, rendering module 340 can select a kind of compressed textures wherein The image data of format is input in graphics processor, handles graphics processor to image data, finally realizes image Rendering.
For example, if the graphics processor of current electronic device is the Bay of the tall and handsome Tegra series or Intel reached Trail series, then use DXT texture recognition algorithm, takes out compressed textures data, directly gives GPU drafting.
It, can be with if the graphics processor of current electronic device is that can support the image data of a variety of compressed textures formats The composite factors such as image quality, speed, duration according to drawing image select target image data to be processed, after selection Destination image data and being input in image processor is rendered.
Referring to Fig. 4, image processing apparatus further includes judgment module 350.Judgment module 350 is used to be believed according to the type Breath judges in the image data to be processed with the presence or absence of the accessible compressed textures image data.
If selecting module 350 judges in image data to be processed there are the accessible compressed textures image data, Rendering module 340 can be handled target image data to be processed.
If selecting module 350 judges that the accessible compressed textures image data is not present in image data to be processed, Raw image data is then obtained according to described image process instruction, the raw image data is input to the graphics processor Carry out image rendering.
In conclusion, by image processing commands, obtaining the to be processed of a variety of compressed textures formats in the embodiment of the present application Then image data controls graphics processor and generates displaying interface, obtains the parameter information for showing interface, obtained according to parameter information The type information for taking image processor obtains the accessible compressed textures image data of graphics processor according to type information, right Priority is arranged in the compressed textures image data of different compressed textures formats.
If there are accessible compressed textures image datas in image data to be processed, according to priority to be processed Selection target compressing image data to be processed in image data, by target image data to be processed be input to graphics processor with into Row image rendering;If the accessible compressed textures image data of graphics processor, basis are not present in image data to be processed Image processing commands obtain original image, and raw image data is input to graphics processor and carries out image rendering.
Image processing method as described in this application is capable of the compressed textures format of the selection image data of active, and to it Selection processing is carried out, keeps the memory source occupied when image procossing lower, also improves efficiency when image procossing.
Correspondingly, the embodiment of the present application also provides a kind of electronic equipment, referring to Fig. 5, Fig. 5 is that the embodiment of the present application provides Electronic equipment structural schematic diagram.
Electronic equipment 400 includes: display unit 401, input unit 402, memory 403, central processing unit 405, power supply The components such as 404 and sensor 406.It will be understood by those skilled in the art that electronic devices structure shown in figure is not constituted pair The restriction of electronic equipment may include perhaps combining certain components or different components than illustrating more or fewer components Arrangement.Wherein:
Display unit 401 can be used for showing information input by user or the information and electronic equipment that are supplied to user Various graphical user interface, these graphical user interface can be made of figure, text, icon, video and any combination thereof. Display unit 401 may include display panel, optionally, can use liquid crystal display (LCD, Liquid Crystal Display), the forms such as Organic Light Emitting Diode (OLED, Organic Light-Emitting Diode) configure display surface Plate.Further, touch sensitive surface can cover display panel, after touch sensitive surface detects touch operation on it or nearby, Central processing unit 404 is sent to determine the type of touch event, subsequent central processing unit 404 exists according to the type of touch event Corresponding visual output is provided on display panel.Although touch sensitive surface and display panel are as two independent portions in Fig. 5 Part realizes input and input function, but in some embodiments it is possible to touch sensitive surface and display panel is integrated and realize Output and input function.
Input unit 402 can be used for receiving the number or character information of input, and generate and user setting and function Control related keyboard, mouse, operating stick, optics or trackball signal input.Specifically, in a specific embodiment In, input unit 402 may include touch sensitive surface and other input equipments.Touch sensitive surface, also referred to as touch display screen or touching Control plate, collect user on it or nearby touch operation (such as user using any suitable object such as finger, stylus or Operation of the attachment on touch sensitive surface or near touch sensitive surface), and corresponding connection dress is driven according to preset formula It sets.Optionally, touch sensitive surface may include both touch detecting apparatus and touch controller.Wherein, touch detecting apparatus is examined The touch orientation of user is surveyed, and detects touch operation bring signal, transmits a signal to touch controller;Touch controller from Touch information is received on touch detecting apparatus, and is converted into contact coordinate, then gives central processing unit 404, and can be received Order that central processing unit 404 is sent simultaneously is executed.Furthermore, it is possible to using resistance-type, condenser type, infrared ray and surface sound The multiple types such as wave realize touch sensitive surface.In addition to touch sensitive surface, input unit 402 can also include other input equipments.Specifically Ground, other input equipments can include but is not limited to physical keyboard, function key (such as volume control button, switch key etc.), One of trace ball, mouse, operating stick etc. are a variety of.
Memory 403 can be used for storing software program and module, and processor 404 is stored in memory 403 by operation Software program and module, thereby executing various function application and data processing.Memory 404 can mainly include storage journey Sequence area and storage data area, wherein storing program area can the (ratio of application program needed for storage program area, at least one function Such as sound-playing function, image player function) etc.;Storage data area, which can be stored, uses created number according to electronic equipment According to (such as audio data, phone directory etc.) etc..In addition, memory 403 may include high-speed random access memory, can also wrap Include nonvolatile memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts. Correspondingly, memory 403 can also include Memory Controller, to provide processor 404 and input unit 402 to memory 403 access.
Electronic equipment further includes the power supply 405 (such as battery) powered to all parts, it is preferred that power supply can pass through electricity Management system and central processing unit 404 are logically contiguous, thus by power-supply management system realize management charging, electric discharge and The functions such as power managed.Power supply 405 can also include one or more direct current or AC power source, recharging system, electricity The random components such as source fault detection circuit, power adapter or inverter, power supply status indicator.
Electronic equipment may also include at least one sensor 406, such as optical sensor, pressure sensor, motion sensor And other sensors.Specifically, optical sensor may include ambient light sensor and proximity sensor, wherein ambient light sensing Device can adjust the brightness of display panel according to the light and shade of ambient light, and proximity sensor can be moved in one's ear in electronic equipment When, close display panel and/or backlight.As a kind of motion sensor, gravity accelerometer can detect all directions The size of upper (generally three axis) acceleration, can detect that size and the direction of gravity, can be used to identify mobile phone posture when static Application (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (for example pedometer, strikes Hit) etc.;Other biographies such as gyroscope, barometer, hygrometer, thermometer, infrared sensor for can also configure as electronic equipment Sensor, details are not described herein.
Although being not shown, electronic equipment can also include camera, bluetooth module etc., and details are not described herein.Specifically at this In embodiment, the central processing unit 404 in electronic equipment can be according to following instruction, by one or more application program The corresponding executable file of process be loaded into memory 403, and be stored in memory by central processing unit 404 to run Application program in 403, to realize various functions:
Image processing commands are received, the image to be processed of a variety of compressed textures formats is obtained according to described image process instruction Data;
Obtain the type information of graphics processor;
According to the type information, selection target waits locating in the image data to be processed of a variety of compressed textures formats Manage image data;
Target image data to be processed is input to the graphics processor, to carry out image rendering.
It will appreciated by the skilled person that all or part of the steps in the various methods of above-described embodiment can be with It is completed by instructing, or relevant hardware is controlled by instruction to complete, which can store computer-readable deposits in one In storage media, and is loaded and executed by processor.
For this purpose, the embodiment of the present application provides a kind of storage medium, wherein being stored with a plurality of instruction, which can be processed Device is loaded, to execute the step in any image processing method provided by the embodiment of the present application.For example, the instruction can To execute following steps:
Image processing commands are received, the image to be processed of a variety of compressed textures formats is obtained according to described image process instruction Data;
Obtain the type information of graphics processor;
According to the type information, selection target waits locating in the image data to be processed of a variety of compressed textures formats Manage image data;
Target image data to be processed is input to the graphics processor, to carry out image rendering.
The specific implementation of above each operation can be found in the embodiment of front, and details are not described herein.
Wherein, which may include: read-only memory (ROM, Read Only Memory), random access memory Body (RAM, Random Access Memory), disk or CD etc..
By the instruction stored in the storage medium, can execute at any image provided by the embodiment of the present application Step in reason method, it is thereby achieved that achieved by any image processing method provided by the embodiment of the present application Beneficial effect is detailed in the embodiment of front, and details are not described herein.
Above to a kind of image processing method, device, electronic equipment and storage medium provided by the embodiment of the present application into It has gone and has been discussed in detail, specific examples are used herein to illustrate the principle and implementation manner of the present application, the above implementation The explanation of example is merely used to help understand the present processes and its core concept;Meanwhile for those skilled in the art, according to According to the thought of the application, there will be changes in the specific implementation manner and application range, in conclusion the content of the present specification It should not be construed as the limitation to the application.

Claims (11)

1. a kind of image processing method, which is characterized in that the described method includes:
Image processing commands are received, the picture number to be processed of a variety of compressed textures formats is obtained according to described image process instruction According to;
Obtain the type information of graphics processor;
According to the type information in the image data to be processed of a variety of compressed textures formats selection target figure to be processed As data;
Target image data to be processed is input to the graphics processor, to carry out image rendering.
2. image processing method according to claim 1, which is characterized in that it is described according to the type information described more Selection target image data to be processed in the image data to be processed of kind compressed textures format, comprising:
The accessible compressed textures graph data of graphics processor is obtained according to the type information;
According to the accessible compressed textures image data in the image data to be processed selection target image to be processed Data.
3. image processing method according to claim 2, which is characterized in that described according to the accessible compressed textures Image data selection target image data to be processed in the image data to be processed, comprising:
Priority is arranged to the accessible compressed textures image data of different compressed textures formats;
According to the priority in the image data to be processed selection target image data to be processed.
4. image processing method according to claim 2, which is characterized in that according to the accessible compressed textures figure As data are in the image data to be processed before selection target image data to be processed, the method also includes:
Judged in the image data to be processed according to the type information with the presence or absence of the accessible compressed textures image Data;
If it is not, then obtaining raw image data according to described image process instruction;
The raw image data is input to the graphics processor and carries out image rendering.
5. image processing method according to claim 1, which is characterized in that the type letter for obtaining graphics processor Breath, comprising:
It controls the graphics processor and generates displaying interface, the displaying interface is transparent interface;
Obtain the parameter information for showing interface;
The type information of described image device is obtained according to the parameter information.
6. a kind of image processing apparatus, which is characterized in that described device includes:
First obtains module, for receiving image processing commands, obtains a variety of compressed textures lattice according to described image process instruction The image data to be processed of formula;
Second obtains module, for obtaining the type information of graphics processor;
Selecting module, for being selected in the image data to be processed of a variety of compressed textures formats according to the type information Target image data to be processed;
Rendering module, for target image data to be processed to be input to the graphics processor, to carry out image rendering.
7. image processing apparatus according to claim 6, which is characterized in that the selecting module includes:
Acquisition submodule, for obtaining the accessible compressed textures figure number of graphics processor according to the type information According to;
Submodule is selected, for selecting in the image data to be processed according to the accessible compressed textures image data Target image data to be processed;
The selection submodule is specifically used for:
Priority is arranged to the accessible compressed textures image data of different compressed textures formats;
According to the priority in the image data to be processed selection target image data to be processed.
8. image processing apparatus according to claim 6, which is characterized in that described device further include:
Judgment module, for being judged in the image data to be processed according to the type information with the presence or absence of described accessible Compressed textures image data;
When the judgment module judging result is no, the rendering module is used to be obtained according to described image process instruction original The raw image data is input to the graphics processor and carries out image rendering by image data.
9. image processing apparatus according to claim 6, which is characterized in that described second, which obtains module, includes:
Interface generates submodule, generates displaying interface for controlling the graphics processor, the displaying interface is transparent interface;
Type acquisition submodule obtains the figure according to the parameter information for obtaining the parameter information for showing interface As the type information of device.
10. a kind of electronic equipment characterized by comprising
The memory for being stored with executable program code, the processor coupled with the memory;
The processor calls the executable program code stored in the memory, executes as claim 1 to 5 is any The step in image processing method described in.
11. a kind of storage medium, which is characterized in that the storage medium is stored with a plurality of instruction, and described instruction is suitable for processor It is loaded, the step in 1 to 5 described in any item image processing methods is required with perform claim.
CN201910637251.3A 2019-07-15 2019-07-15 Image processing method, device, electronic equipment and storage medium Active CN110349243B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910637251.3A CN110349243B (en) 2019-07-15 2019-07-15 Image processing method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910637251.3A CN110349243B (en) 2019-07-15 2019-07-15 Image processing method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110349243A true CN110349243A (en) 2019-10-18
CN110349243B CN110349243B (en) 2023-10-20

Family

ID=68175386

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910637251.3A Active CN110349243B (en) 2019-07-15 2019-07-15 Image processing method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110349243B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023116794A1 (en) * 2021-12-21 2023-06-29 Lei Xu Method for compressing and reconstructing texture, audio, and video

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106408634A (en) * 2015-07-29 2017-02-15 三星电子株式会社 Texture processing apparatus and method
WO2017045540A1 (en) * 2015-09-14 2017-03-23 阿里巴巴集团控股有限公司 Picture processing method, apparatus, terminal device, and system for smart terminal
CN108460822A (en) * 2017-02-15 2018-08-28 上海银河数娱网络科技有限公司 Texture Processing Methods and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106408634A (en) * 2015-07-29 2017-02-15 三星电子株式会社 Texture processing apparatus and method
WO2017045540A1 (en) * 2015-09-14 2017-03-23 阿里巴巴集团控股有限公司 Picture processing method, apparatus, terminal device, and system for smart terminal
CN108460822A (en) * 2017-02-15 2018-08-28 上海银河数娱网络科技有限公司 Texture Processing Methods and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
韩立敏等: "图形处理器流水线数据压缩技术研究综述", 《计算机应用研究》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023116794A1 (en) * 2021-12-21 2023-06-29 Lei Xu Method for compressing and reconstructing texture, audio, and video

Also Published As

Publication number Publication date
CN110349243B (en) 2023-10-20

Similar Documents

Publication Publication Date Title
US11941766B2 (en) Image processing apparatus, image processing method, and program
CN108595237A (en) A kind of method and terminal of display content
CN107402667A (en) Electronic equipment comprising display
CN109976930A (en) Detection method, system and the storage medium of abnormal data
CN106933468A (en) A kind of user interface switching method and terminal
CN108846274A (en) A kind of safe verification method, device and terminal
CN109871246A (en) A kind of message display method and terminal device
CN110489025A (en) Interface display method and terminal device
CN108763317A (en) A kind of auxiliary chooses the method and terminal device of picture
CN109917995A (en) A kind of object processing method and terminal device
CN110032473A (en) Data guard method, device, electronic equipment and system
CN110134652A (en) Recovery method, device, electronic equipment and the storage medium of cache file
CN108259761A (en) A kind of image pickup method and terminal
CN109829070A (en) A kind of image lookup method and terminal device
CN109816679A (en) A kind of image processing method and terminal device
CN109857354A (en) A kind of interface display method and terminal device
CN108196781A (en) The display methods and mobile terminal at interface
CN109993711A (en) A kind of image processing method and terminal device
CN110162234A (en) A kind of application control method and terminal device
CN112306332B (en) Method, device and equipment for determining selected target and storage medium
CN110349243A (en) Image processing method, device, electronic equipment and storage medium
CN110058686A (en) A kind of control method and terminal device
CN109117037A (en) A kind of method and terminal device of image procossing
CN107924285A (en) Electronic equipment and its operating method
CN109857292A (en) A kind of object displaying method and terminal device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant