WO2020215212A1 - 处理图层的方法和装置 - Google Patents

处理图层的方法和装置 Download PDF

Info

Publication number
WO2020215212A1
WO2020215212A1 PCT/CN2019/083913 CN2019083913W WO2020215212A1 WO 2020215212 A1 WO2020215212 A1 WO 2020215212A1 CN 2019083913 W CN2019083913 W CN 2019083913W WO 2020215212 A1 WO2020215212 A1 WO 2020215212A1
Authority
WO
WIPO (PCT)
Prior art keywords
layer
transparency
target pixel
pixels
rounded corner
Prior art date
Application number
PCT/CN2019/083913
Other languages
English (en)
French (fr)
Inventor
王安立
陈德谦
李政仲
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2019/083913 priority Critical patent/WO2020215212A1/zh
Priority to CN201980006525.7A priority patent/CN112204619B/zh
Publication of WO2020215212A1 publication Critical patent/WO2020215212A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation

Definitions

  • This application relates to the field of image processing, and more specifically, to a method and device for processing layers.
  • rounded-corner displays With the development of mobile terminal technology, more and more terminal devices adopt rounded-corner displays.
  • the four corners of the rounded-corner display can be cut into curves or arcs, and some cutouts with curved edges can also be designed on the display. Used to set user-visible components, such as front camera or earpiece. These curved positions on the terminal device can be called rounded corners.
  • the curve on the display screen is prone to appear jagged when displaying images, which affects the display effect of the screen.
  • the method of superimposing the rounded corner layer on the original layer is often used to soften the jagged phenomenon at the curve.
  • the rounded corner layer is generally a black layer. By controlling the transparency value of the pixels in the rounded corner layer, you can control whether the final image displayed in the rounded corner layer overlay area displays the content of the original layer or the black content of the rounded corner layer. .
  • the existing fillet layer access uses a packed format.
  • the present application provides a method and device for processing layers, which can realize independent access to the transparency information of target pixels in a rounded corner layer.
  • a method for processing a layer includes: reading the transparency information of the target pixel in the rounded corner layer from a first storage area in a memory, the first storage area being dedicated to storage The transparency information of the target pixel; generating the rounded corner layer according to the transparency information of the target pixel in the rounded corner layer; superimposing the rounded corner layer and at least one target layer to obtain an image to be displayed.
  • the display subsystem reads the transparency information of the target pixel in the fillet layer from a first storage area in the memory.
  • the first storage area is dedicated to storing the transparency information of the target pixel.
  • only the transparency information of the target pixel of the rounded corner layer can be saved in the first storage area in the memory. Therefore, the transparency information of the target pixel in the rounded corner layer can be accessed separately.
  • the data access mode is more flexible in the scene where the transparency information of the target pixel is taken.
  • the rounded corner layer in the embodiment of this application can be considered as an additional layer to solve the jagged phenomenon of the rounded corners of the display screen when displaying images.
  • the rounded corner layer is mainly used for the rounded corner position of the display screen. , So the rounded corner layer may not be a complete layer that matches the size of the screen.
  • the "rounded corners" in the embodiments of the present application are described with respect to the display screen, and all the curved edges on the display screen can be regarded as rounded corners (or screen rounded corners) on the display screen.
  • the color data of the pixels in the layer is used to characterize the color displayed by the pixel, and can include various chromaticity components, such as red component (R value), blue component (B value), green component (G value) or white component (W value) ), etc., each chromaticity component can be represented by a numerical value, usually from 0 to 255. Different numerical chromaticity components can represent different brightness, and various chromaticity components of different numerical values can be mixed into various colors.
  • R value red component
  • B value blue component
  • G value green component
  • W value white component
  • the transparency data of the pixels in the layer can represent the transparency of the pixel color, indicating how many pixel values should be displayed. For example, when there are two layers of foreground and background colors, the transparency of the pixels in the foreground layer can be controlled
  • the display shows whether the foreground color or the background color is displayed, or the ratio of the foreground and background colors to be mixed to display the new color, etc.
  • the degree of transparency of the pixel color can also be represented by a numerical value, which can be referred to as the transparency value of the pixel, which can also be represented by 0-255.
  • the pixels of the foreground color layer When the transparency value of the pixels of the foreground color layer is less than or equal to the first transparency threshold, when the foreground color layer and the background color layer are superimposed, the human eye cannot distinguish the difference between the color displayed on the screen and the background color (it can be considered as the screen If the foreground color is not displayed), the pixels can be considered as transparent. Such pixels can also be called transparent pixels; when the transparency value of the pixels of the foreground color layer is greater than or equal to the second transparency threshold, the foreground color layer and the background color map When the layers are superimposed, the human eyes cannot recognize the difference between the color displayed on the display screen and the foreground color (it can be considered that the display screen does not display the background color), and the pixel can be considered as opaque.
  • Such pixels are called opaque pixels in this application. If the transparency value is between the first transparency threshold and the second transparency threshold, it can indicate that the pixel is considered semi-transparent, that is, between transparent and opaque.
  • the first transparency threshold and the second transparency threshold in the embodiments of the present application may be determined according to the human eye's ability to distinguish different colors.
  • the pixel when the transparency value of the pixel of the rounded layer is less than or equal to the first transparency threshold, the pixel is a transparent pixel, and the area where the transparent pixel is located is the transparent area; the transparency value of the pixel of the rounded layer is greater than Or equal to the second transparency threshold, the pixel is an opaque pixel, and the area where the opaque pixel is located is an opaque area or a non-transparent area; the transparency value of the pixels of the rounded layer is between the first transparency threshold and the second transparency threshold ( When the intermediate value), the pixel is the transition area pixel, and the area where the transition area pixel is located is the transition area.
  • the transition area of the rounded layer is between the transparent area and the opaque area, or between two transparent areas; the transparency value of the pixels in the transition area of the rounded layer in the embodiment of the present application is Gradual.
  • the first storage area of the memory is dedicated to storing the transparency information of the target pixel, and is not used to store other information of the target pixel, that is, the transparency information of the target pixel in the rounded corner layer and the rounded corner layer
  • Other information of the target pixel in the target pixel such as the color information of the pixel, is stored separately, or the transparency information of the target pixel in the rounded corner layer is stored separately from the other information of the target pixel in the rounded corner layer, such as the color information of the pixel. of.
  • the transparency information of the target pixel in the rounded corner layer is stored separately.
  • the transparency information of the target pixel in the rounded corner layer and other information of the target pixel in the rounded corner layer are stored in the location, area or The space is separate and independent, so when reading the image data of the rounded layer, the transparency information of the target pixel in the rounded layer and the other pixels in the rounded layer can be read separately or separately. Information, there is no need to read other information such as transparency information and color information of the pixels in the rounded layer at the same time.
  • the display subsystem can read the transparency information of the target pixel of the rounded layer separately from the memory, compared to reading all the information of the pixel of the rounded layer from the memory (such as transparency information and color information) In other words, the read bandwidth required for the display subsystem to read data from the memory can be reduced, and power consumption can be reduced. Furthermore, in the storage process, if only the transparency information of the target pixel of the rounded corner layer is stored in the memory, compared to storing all the information (such as transparency information and color information) of the pixels in the rounded corner layer in the memory In terms of memory, it can also reduce the amount of image data stored in the memory of the fillet layer and reduce the bandwidth required for storage.
  • the transparency information of the target pixel in the rounded corner layer is stored in the first storage area of the memory
  • the transparency information of the target pixel in the rounded corner layer is stored in the first storage area.
  • Continuous storage for example, the first storage area in the memory stores the transparency information of all pixels in the fillet layer, then in a certain area or space of the memory (that is, the first storage area), the fillet map is continuously stored The transparency information of all pixels in the layer, and other information about the pixels that are not stored in the rounded corner layer in this area or space. Therefore, "read the transparency information of the target pixel in the rounded layer from the first storage area in the memory” can be considered as “read continuously the transparency of the target pixel in the rounded layer from the first storage area in the memory” information".
  • the transparency information of the target pixel in the rounded corner layer in the embodiment of the present application is used to indicate the transparency value of the target pixel in the rounded corner layer.
  • the memory in the embodiments of the present application mainly refers to random access memory RAM (or random access memory, internal memory, main memory, or main memory), and the on-chip memory includes registers and high-speed buffer memory (or high-speed cache). Or cache, etc.
  • the on-chip memory in the embodiment of the present application refers to a storage device integrated with a processor or processing module such as a CPU, GPU, or display subsystem on a chip, while the memory in the embodiment of the present application is located on a separate chip and is connected to the CPU, Processors or processing modules such as GPU or display subsystem are not part of the same chip.
  • the transparency information of the target pixel in the rounded corner layer includes an index of the transparency value of the target pixel, and the number of bits occupied by the index is less than that of the index. The number of bits occupied by the transparency value of the target pixel.
  • the read bandwidth in the embodiment of the present application is the bandwidth for the display subsystem to read data from the memory through the read channel.
  • the target pixels are part or all of the pixels in the rounded corner layer.
  • the target pixels include pixels in the transition area of the rounded corner layer, and the transition area is that the transparency value of the rounded corner layer is between the first The area where the pixels between the transparency threshold and the second transparency threshold are located.
  • the target pixel is a pixel in the transition area of the rounded corner layer.
  • the transition area is the main part that plays the role of diminishing the aliasing.
  • only the transparency information of the pixels in the transition area of the rounded corner layer can be saved, which can further reduce the storage amount of the rounded corner layer in the memory, thereby further The ground can save reading bandwidth and reduce power consumption.
  • the pixels in the transition area of the rounded corner layer include multiple consecutive pixels, and the index is used to indicate the transparency values of the multiple consecutive pixels.
  • the multiple consecutive pixels may be in the same row in the transition area, or in the same column in the transition area.
  • the generating the round corner layer according to the transparency information of the target pixel in the round corner layer includes: according to the information in the round corner layer The transparency information of the target pixel and the color information of the target pixel generate the rounded corner layer.
  • the color information of the target pixel is stored in a second storage area in the memory, and the second storage area and the first storage area are independent of each other, so The method further includes: reading the color information of the target pixel from the second storage area.
  • the storage area of the transparency information of the target pixel in the memory is different from the storage area of the color information of the target pixel.
  • the transparency information and color information of the target pixel can both be stored in the memory, but the display subsystem can adjust the target pixel as needed.
  • the transparency information of the pixel or the color information of the target pixel is accessed separately.
  • the display subsystem has more flexible access to the image data of the fillet layer in the memory, and during the reading process, the display subsystem can only read Taking part of the data of the target pixel of the fillet layer can reduce the reading bandwidth required to read the data from the memory.
  • the second storage area includes multiple independent sub-storage areas, and each chromaticity component in the color information of the target pixel is stored in the multiple independent sub-storage areas. In the sub-store.
  • Each chromaticity component in the color information of the target pixel can also be stored separately. Accordingly, when the display subsystem reads data from the memory, it can read at least one chromaticity component of the target pixel separately as needed.
  • the access method of the image data of the fillet layer in is more flexible.
  • the color information of the target pixel is stored in an on-chip memory, and the method further includes: acquiring the color information of the target pixel from the on-chip memory.
  • the color information of the target pixel in the rounded corner layer may not be stored in the memory, but stored in the on-chip memory, which can further reduce the storage amount of the rounded corner layer in the memory.
  • the color information of the target pixel is a preset value or a default value.
  • the color information of the target pixel belongs to a preset value or a default value pre-configured in the display subsystem.
  • the color information of the target pixel is stored in a non-volatile memory.
  • the color information of the target pixel includes the chromaticity component of one of the target pixels.
  • the display subsystem can fill the color of the pixels in the rounded layer according to the chromaticity component of the one pixel.
  • the color information of the target pixel includes one chromaticity component of one pixel in the target pixel.
  • the display subsystem can fill the color of the pixel in the rounded layer according to a chromaticity component of the one pixel.
  • a device which includes units or modules for executing each step in the method described in the first aspect or any one of the possible implementation manners of the first aspect.
  • Each module or unit can be implemented by software, hardware or a combination of software and hardware.
  • a device for processing layers including a memory and a processor, the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the device executes the first Aspect and any one of the possible implementations of the first aspect.
  • a computer program product containing instructions is provided.
  • the computer program product runs on a computer, the computer executes the method described in the first aspect or any one of the possible implementations of the first aspect.
  • a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium.
  • the instructions When the instructions are run on a computer, the computer can execute the first aspect or any one of the first aspects. The method described in the implementation mode.
  • a device including a display subsystem and a processor, the display subsystem is configured to execute the first aspect and the method in any one of the possible implementations of the first aspect, and the processor is configured to The display subsystem draws a rounded corner layer before executing the method in the first aspect and any one of the possible implementations of the first aspect, and saves the transparency information of the target pixel in the rounded corner layer in the first aspect of the memory.
  • the first storage area is dedicated to storing the transparency information of the target pixel.
  • the processor includes a CPU or GPU.
  • an apparatus including a display subsystem and a display device, the display subsystem is configured to execute the method in the first aspect and any one of the possible implementations of the first aspect, and the display device is configured to display An image to be displayed obtained by the display subsystem after executing the method in the first aspect and any one of the possible implementation manners of the first aspect.
  • FIG. 1 is a block diagram of the logical structure of a terminal device according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of the appearance of a terminal device according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of the hardware architecture of a terminal device in an embodiment of the present application for layer overlay
  • FIG. 4 is a schematic diagram of superimposing fillet layers according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of some pixels in a rounded corner layer in an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a method for processing layers according to an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a method for processing layers according to an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a method for processing layers according to another embodiment of the present application.
  • FIG. 9 is a schematic diagram of a method for processing layers according to another embodiment of the present application.
  • FIG. 10 is a schematic flowchart of a method for processing layers according to an embodiment of the present application.
  • Figure 11 is a schematic structural diagram of a device provided by an embodiment of the present application.
  • Figure 12 is a schematic structural diagram of a device provided by an embodiment of the present application.
  • the devices involved in the embodiments of this application may include handheld devices, vehicle-mounted devices, wearable devices, computing devices, or other processing devices connected to a wireless modem. It can also include user units, cellular phones, smart phones, personal digital assistants (PDA) computers, tablet computers, handheld devices (handsets), laptop computers (laptop computers) , Machine type communication (MTC) terminals, point of sales (POS), on-board computers, wireless local area networks (STAION, ST) in wireless local area networks (WLAN), which can be cordless phones, Session initiation protocol (SIP) phones, wireless local loop (WLL) stations, and next-generation communication systems, such as equipment in fifth-generation (5G) networks or future evolution Devices in the public land mobile network (PLMN) network and other devices with display screens.
  • PDA personal digital assistants
  • MTC Machine type communication
  • POS point of sales
  • STAION, ST wireless local area networks
  • WLAN wireless local area networks
  • SIP Session initiation protocol
  • WLL wireless local loop
  • the device is a terminal device as an example.
  • FIG. 1 shows a logical structure block diagram of the terminal device related to the embodiment of the present application.
  • the hardware layer of the terminal device includes a central processing unit (CPU) and/or a graphics processing unit (GPU).
  • the hardware layer of the terminal device may also include an input device, a display device, a memory, a memory controller, a display controller, and a network interface not shown in the figure.
  • the input device may be used to detect user operations and generate user operation information for indicating the user operation.
  • the input device may include but not limited to a physical keyboard, function keys (such as volume control keys, switches, etc.). Buttons, etc.), trackball, mouse, joystick, touch screen, optical mouse (optical mouse is a touch-sensitive surface that does not display visual output, or an extension of the touch-sensitive surface formed by the touch screen), etc.
  • the touch screen can include a touch sensor and a touch screen controller.
  • the touch sensor can detect the user's touch position, and send touch information to the touch screen controller after receiving it.
  • the touch screen controller receives the touch information, converts it into contact coordinates, and sends it to the CPU. At the same time, the touch screen controller can also receive commands from the CPU and execute them.
  • the display device can be used to present visual information such as user interfaces, images, or videos.
  • the display device can display information input by the user or information provided to the user and various menus of the terminal device.
  • the display device Can include displays, such as liquid crystal display (LCD), organic light emitting diode (OLED), cathode ray tube (cathode ray tube) display, holographic display, or projector Wait.
  • LCD liquid crystal display
  • OLED organic light emitting diode
  • cathode ray tube cathode ray tube
  • holographic display or projector Wait.
  • the display device in the embodiment of the present application belongs to a type of output device of a terminal device.
  • the storage device is the memory device of the computer system in the terminal equipment, which is used to store programs and data. All information in the computer, including input original data, computer programs, intermediate running results, and final running results are stored in the storage device.
  • the volatile memory in the storage device namely random access memory (RAM) is the internal memory that directly exchanges data with the CPU. It is also called main memory (referred to as main memory) or internal memory (referred to as memory), which is the terminal equipment.
  • main memory main memory
  • memory internal memory
  • the memory in the embodiments of this application mainly refers to RAM.
  • the memory can include static RAM (static random-access memory, SRAM) and dynamic RAM (dynamic random access memory, DRAM), where DRAM can also include double-rate synchronization.
  • Dynamic random access memory double data rate synchronous dynamic random access memory, DDR SDRAM, DDR for short, etc.
  • the RAM and the CPU are not integrated on the same chip, and the RAM and the CPU belong to different chips.
  • the memory controller is an important part of the computer system to control the memory and exchange data between the memory and the CPU through the memory controller, which determines the memory performance of the computer system.
  • the storage device also includes some on-chip memories such as registers, high-speed buffers (also called caches) or caches.
  • the read and write speed of this kind of memory is much faster than that of memory. But the storage content will be lost even after the power is off.
  • the on-chip memory in the embodiments of the present application is a memory integrated with a processor or processing module such as a CPU, GPU, or display subsystem on a chip, that is, the on-chip memory and the processor or processing module belong to the same chip.
  • the memory can be integrated with the CPU on a chip to become an on-chip memory.
  • the above-mentioned register is a kind of on-chip memory.
  • the register is an internal component of the CPU or integrated on the same chip as the CPU.
  • the register can be retrieved from the cache. Reading data from the area, you can also read data from the memory, the read and write speed is the fastest.
  • the above-mentioned cache or cache is also an on-chip memory.
  • the cache or cache is in the CPU or integrated with the CPU on a chip. It is located between the CPU and the memory to alleviate the contradiction of the speed mismatch between the CPU and the memory.
  • the memory can also be integrated with the GPU on a chip to become an on-chip memory, or integrated with the display subsystem (a module responsible for image processing on the chip) on a chip to become an on-chip memory, or with other processors or processing modules It is integrated on a chip to become an on-chip memory, which is not specifically limited in the embodiment of the present application.
  • a storage device integrated on a chip with a processor or processing module such as a CPU, GPU, or display subsystem may be called an on-chip memory, while the memory in the embodiment of the present application is located on a separate chip and is Processors or processing modules such as GPU or display subsystem are not part of the same chip.
  • the storage device also includes some memory that is stable in data storage and is not lost after power off, that is, non-volatile memory, such as read only memory (ROM), or flash memory (flash memory).
  • non-volatile memory such as read only memory (ROM), or flash memory (flash memory).
  • ROM read only memory
  • flash memory flash memory
  • Non-volatile memory similar to memory, is also a device outside the chip where the CPU is located, and is an independent chip.
  • the display controller can set up certain driving conditions through the command system to adjust a series of parameters or characteristics such as voltage, phase, frequency, peak value, effective value, timing, or duty cycle applied to the pixel.
  • the display varies greatly.
  • the core library layer is the core part of the operating system, including input/output services, core services, graphics device interfaces, and graphics engines that implement CPU and GPU graphics processing.
  • the graphics engine may include a 2D engine, a 3D engine, a composition, and a frame buffer.
  • the terminal device also includes a driver layer, a framework layer and an application layer.
  • the driver layer may include CPU drivers, GPU drivers, and display controller drivers.
  • the framework layer can include graphic service (graphic service), system service (system service), web service (web service), customer service (customer service), etc.; graphics service can include such as widgets and canvases. , Views, render script, etc.
  • the application layer may include a desktop (launcher), a media player (media player), and a browser (browser).
  • the hardware layer of the terminal device may include a processor (for example, a CPU and/or GPU) and a display controller (display controller). , Memory, memory controller, input device, and display device and other hardware.
  • the core library layer may include input/output service (input/output service, I/O service), core service (kernel service), graphics engine (graphic engine), etc.
  • FIG. 2 shows a schematic diagram of the appearance of a terminal device according to an embodiment of the present application.
  • 201 is the display screen of the terminal device, which can also be called a screen, and its four corners can be cut into arcs, as shown in the dashed frame 202 in the figure.
  • Part of the screen can also be removed from the display screen 201 to form a hollowed out part to meet the layout needs of components such as the front camera and earpiece.
  • the part filled with a black background in the figure is formed by removing part of the screen from the display screen 201
  • the hollowed-out part of, the hollowed-out part cannot display content.
  • the hollowed-out part can be used to set a front camera.
  • the edge of the hollowed-out part of the display screen 201 generally adopts a streamlined design, that is, the intersection of the hollowed-out part and the display screen is a curve, as shown in the dotted frame 203 in the figure.
  • the hollowed-out part on the display screen 201 may be connected to the edge of the screen, or a closed hollowed-out area may be formed on the screen.
  • the hollowed-out part may be hole-shaped.
  • the display screen 201 includes many pixels. In order to allow each individual pixel to display various colors, the pixels can be decomposed into sub-pixels of a lower level than the pixels. Usually pixels will include the three primary colors of red, green and blue. The three primary colors can express different brightness, and visually they will be mixed into the desired color. The brightness of the three primary colors can be represented by numerical values, usually from 0 to 255. Different numerical values represent different brightness. The primary colors used to represent pixels can usually be called chrominance components. In some pixel arrangements, a single pixel may include more or fewer sub-pixels. For example, some single pixels may only include sub-pixels of two of the above three primary colors, and some single pixels may not only include the above three colors. In addition to the sub-pixels, white sub-pixels can also be included. The material of the screen and the arrangement of sub-pixels are important factors that affect the display effect of the screen.
  • Figure 2 exemplarily shows two sub-pixel arrangements.
  • the arrangement of the sub-pixels of the display screen can be the RGB sub-pixel arrangement shown in the area 204, and this arrangement can also be referred to as the standard RGB arrangement.
  • the RGB sub-pixel arrangement can be applied to liquid crystal display (LCD). This arrangement is to divide a square-shaped pixel into three equal parts. Each equal part is a sub-pixel of the pixel. One equal part gives different colors.
  • the three sub-pixels form a whole, that is, a color pixel. When different colors need to be displayed, the three sub-pixels can emit light with different brightness. Since the sub-pixels are very small, visually Will be mixed into the desired color.
  • each pixel can independently display the required color, and the order of the three sub-pixels can be arbitrary, for example, it can be "red, green, blue (R, G, B)", “blue, green, red (B) , G, R)” etc.
  • the arrangement of the sub-pixels of the display screen can also be the RGBG sub-pixel arrangement as shown in the area 204', and this arrangement can also be referred to as the P arrangement or the diamond pixel arrangement.
  • the arrangement of RGBG sub-pixels can be applied to organic light-emitting diode (OLED), and a single pixel generally has only two sub-pixels of "red and green (R, G)" or "blue and green (B, G)" Point, each pixel needs to display content through the shared sub-pixels of adjacent pixels.
  • the arrangement of the sub-pixels of the display screen can also adopt other ways, such as the arrangement of RGBW sub-pixels, etc., which will not be listed here. Take the above two sub-pixel arrangements as an example. Due to the pixel arrangement, when curved edges are formed on the display screen (such as the arc at the four corners of the screen, the curve at the intersection of the hollowed-out part of the screen and the screen), When displaying images in these places, sawing phenomenon (or called the sawtooth phenomenon) will inevitably occur, which will affect the display effect of the screen and is not beautiful enough.
  • the jaggedness can be softened by superimposing a rounded corner layer on top of the original layer, and by controlling the transparency of the pixels in the rounded corner layer.
  • the process of superimposing fillet layers will be described below in conjunction with FIG. 3.
  • FIG. 3 shows a schematic diagram of the hardware architecture of a terminal device in an embodiment of the present application for layer overlay.
  • the rounded corner layer in the embodiment of the present application can be considered as an additional layer superimposed to solve the jagged phenomenon of the rounded corners of the display screen when displaying images.
  • the rounded corner layer is mainly used for the rounded corners of the display screen. Position, so the rounded corner layer may not be a complete layer that matches the size of the display.
  • the position of the “rounded corners” of the display includes not only the four corners of the display, but also the hollowed out area on the screen, which means that as long as the display has a curve on the structure, it can be regarded as the rounded corners of the display.
  • "rounded corners” not only include arcs, but also other streamlined designs, such as circles, Euler spirals, and other complex curves.
  • the hardware architecture shown in FIG. 3 mainly includes a central processing unit CPU, an image processor GPU, and a memory (in the embodiment of this application, double data rate synchronous dynamic random access memory (DDR SDRAM, DDR for short) is used as Examples are described), display sub-system (DSS), display controller (display controller), and panel (panel), etc., which are described in detail below with reference to FIG. 3.
  • the CPU in the figure is the central processing unit of the system.
  • the CPU can draw the content of the rounded corner layer and store the content of the rounded corner layer in the DDR.
  • the "content of the rounded corner layer" mentioned here can be understood as the image data of the rounded corner layer, for example, it can include color data and transparency (alpha) data of the pixels of the rounded corner layer.
  • the color data of the pixel is used to characterize the color displayed by the pixel, and can include various chromaticity components, such as red component (R value), blue component (B value), green component (G value) or white component (W value), etc.
  • Each chrominance component can be represented by a numerical value, usually from 0 to 255. Different numerical chrominance components can represent different brightness, and various chrominance components of different numerical values can be mixed into various colors.
  • the transparency data of a pixel can characterize the transparency of the pixel color and indicate how many pixel values should be displayed. For example, when there are two layers of foreground and background colors, the transparency of the pixels in the foreground layer can control the display before display. The scenery is still the background color, or the ratio of the foreground and background colors to be mixed to display the new color, etc.
  • the degree of transparency of the pixel color can also be expressed by a numerical value. This value can be called the transparency value of the pixel, and it can usually be expressed as 0-255.
  • the transparency value of the pixel is less than or equal to the first transparency threshold, the foreground layer and background color
  • the human eye cannot recognize the difference between the color displayed on the display screen and the background color (it can be considered that the display screen does not display the foreground color), and the pixel can be considered as transparent.
  • Such pixels can also be called transparent pixels;
  • a pixel can be considered as opaque, and such a pixel is called an opaque pixel in the embodiment of the present application.
  • a pixel with a transparency value between the first transparency threshold and the second transparency threshold can be considered as translucent, that is, between transparent and opaque. .
  • the content of the rounded corner layer drawn by the CPU may include the transparency of the pixels in the rounded corner layer, the chromaticity component of the color of the pixels in the rounded corner layer, etc.
  • the chrominance components include R, G, B as an example.
  • the left image of Figure 4 shows the top content and bottom content of the rounded corner layer drawn by the CPU.
  • the top content can be used to dilute the rounded corners at the upper two corners of the display and the hollowing out of the upper middle position. Part of the rounded corners appear jagged when displaying the image, and the bottom content can be used to dilute the jagged corners at the bottom two corners of the display when displaying the image.
  • the top content and bottom content of the rounded corner layer can be in two rounded corner layers respectively, the width of each rounded corner layer can match the width of the display screen, and the height can be freely set or preset by the system, such as the top content
  • the rounded corner layer can be called the top layer, and its height can be set to 85 lines; the rounded corner layer where the bottom content is located can be called the bottom layer, and its height can be set to 30 lines.
  • the CPU When the CPU stores the content of the rounded corner layer in the DDR, it can be stored in the ARGB8888 packed format. That is, when the content of the rounded corner layer is stored, for a single pixel, the transparency value of the pixel (alpha, hereinafter may be referred to as A value) occupies 8 bits (8bits) of precision, which is equivalent to occupying one byte (1byte) of memory; the red component of the pixel (hereinafter may be referred to as R value) occupies 8 bits (8bits) of precision, which is equivalent to occupying one Byte (1byte) of memory; the blue component of the pixel (hereinafter referred to as the B value) occupies an 8-bit (8bits) precision, which is equivalent to occupying one byte (1byte) of memory; the green component of the pixel (hereinafter referred to as the B value) G value) occupies 8 bits (8bits) of precision, which is equivalent to occupying 1 byte (1byte) of memory.
  • a value the transparency
  • the image data stored in the top layer 0 (layer 0) in the DDR in Figure 3 is the content of the rounded corner layer, and the image data stored in layer 0 includes the transparency value and rounded corners of the pixels in the rounded corner layer.
  • DDR can store multiple layers, and each layer can store different types of data, such as text, tables, plug-ins, or graphics.
  • the DDR in FIG. 3 stores 6 layers (layer0 to layer5). Of course, more or less layers may be stored in the DDR, which is not limited in the embodiment of the present application.
  • the graphics processor GPU can perform complex mathematical and geometric calculations and is mainly responsible for image processing.
  • the GPU can also perform the operations performed by the above CPU.
  • the GPU draws the content of the fillet layer and stores it in the DDR, and the GPU can also execute the layer.
  • Overlay processing for example, when the number of channels of the hardware display subsystem DSS is insufficient, the GPU can overlay the layers and then send them to the DSS for overlay.
  • the display subsystem DSS includes 5 read channels (RCH0 ⁇ RCH4), while the DDR stores 6 layers.
  • the number of layers is greater than the number of read channels, so it can
  • the GPU superimposes two of the layers, and then writes a layer formed after the superposition into the DDR. At this time, the layers stored in the DDR become 5, and the DSS reads 5 through 5 read channels. Layers.
  • the display subsystem DSS is a module responsible for image processing. It can read the image data of each layer from the DDR through the read channel (RCH0 ⁇ RCH4 in the figure), and calculate the data of each layer according to the layer distribution , Superimpose (overlay, OV), generate superimposed data, and finally transmit it to the panel (ie, display screen) for display.
  • the display subsystem DSS may not superimpose all the layers that it reads.
  • some layers can be selected for superimposition processing through the switch (SW) control.
  • the display controller in the display subsystem can control the display effect, for example, by instructing the system to adjust a series of parameters or characteristics such as voltage, phase, frequency, peak value, effective value, timing, or duty cycle applied to the pixel. Establish certain driving conditions to make the display change a lot. It should be noted that the bandwidth for the display subsystem to read the image data of the layer from the memory such as DDR is the read bandwidth.
  • layer 0 when there is a rounded corner layer, layer 0 (layer 0) can store the content of the rounded corner layer.
  • the content of the rounded corner layer can be as shown in Figure 4. The top content and bottom content are shown.
  • the rounded corner layer where the top content and the bottom content are located can be a black layer, that is, the chromaticity component value of each pixel in the rounded corner layer is 0 (RGB(0,0,0)), and the circle
  • the transparency value of the pixels in the corner layer can be different, and the transparency value of some of the pixels can be less than or equal to the above-mentioned first transparency threshold, and this part of the pixels are transparent pixels, such as the pixels in the white area in the top and bottom content It is a transparent pixel.
  • the pixels in the white area do not display the color of the pixel.
  • the white area including the transparent pixels can be called the transparent area; the transparency value of some pixels can be greater than or equal to the above second transparency threshold, and this part of the pixels is opaque.
  • the pixels in the black area in the top content and the bottom content are opaque pixels, and the pixels in the black area display the color of the pixel (black).
  • the black area including the opaque pixels can be called the non-transparent area (also called Opaque area).
  • the non-transparent area also called Opaque area.
  • Figure 5 exemplarily shows some pixels in the rounded corner layer.
  • the embodiment of the application assumes that the first transparency threshold is 0 and the second transparency threshold is 255.
  • the black squares on the figure can represent opaque pixels.
  • the transparency value of an opaque pixel can be 255, and the area where the opaque pixel is located is an opaque area, such as the area on the left of the line L1 in the figure; a white square on the figure can indicate a transparent pixel, and the transparency value of a transparent pixel can be 0.
  • the area where the transparent pixel is located is the transparent area, such as the area on the right side of the line L2 in the figure. Between the opaque area and the transparent area, there are some gray squares. Different degrees of gray indicate different transparency values.
  • the gray squares can represent pixels in the transition area, and the transparency value of the pixels in the transition area is an intermediate value (between 0 and 255)
  • the area where the pixels of the transition area are located can be referred to as the transition area, such as the area between the lines L1 and L2.
  • the area where the transparency value of the pixel changes from 0 to 255 or from 255 to 0 can be called the transition area.
  • the transition area is located between the transparent and opaque areas of the rounded layer. between.
  • the embodiment of the present application assumes that the first transparency threshold is 5, and pixels with a transparency value less than or equal to 5 can be considered as transparent pixels, that is, the transparency value of the pixel represented by the white square in the figure is not greater than 5, that is Yes; assuming that the second transparency threshold is 250, pixels with a transparency value greater than or equal to 250 can be considered as opaque pixels, that is, the pixels represented by the black squares in the figure have a transparency value of not less than 250; then the above gray
  • the transparency value of the pixels represented by the squares is between 5 and 250 (middle value). This part of the pixels is the transition area pixels, and the area where the gray squares are located is the transition area.
  • the black squares in Fig. 5 can also be white squares.
  • the first transparency threshold is 5 and the second transparency threshold is 250, that is to say, the transparency value of the pixels in the left area of L1 is not greater than 5, and the right of L2
  • the transparency value of the pixels in the area is not greater than 5, the area on the left of L1 and the area on the right of L2 are both transparent areas, and the pixels in the area between the two transparent areas have a transparency value between 5 and 250.
  • the pixels in this area That is, the transition area pixels, the area where the transition area pixels are located is the transition area.
  • the pixel in a rounded corner layer, as long as the transparency value of a pixel is between the first transparency threshold and the second transparency threshold, the pixel is a transition zone pixel, and the area where the transition zone pixel is located is the transition zone.
  • the transition zone can be between the transparent zone and the opaque zone, or between the two transparent zones.
  • the transparency value of the pixels in the transition area gradually changes from the first transparency threshold to the second transparency threshold or from the second transparency threshold to the first transparency threshold. It should be understood that the determination of the first transparency threshold and the second transparency threshold in the embodiment of the present application may be determined according to the human eye's ability to distinguish different colors.
  • the transparency value of the pixels of the rounded corner layer When superimposing rounded corner layers and other display layers, by controlling the transparency value of the pixels of the rounded corner layer, you can control whether the screen will finally display the black or rounded corner image of the rounded corner layer in the superimposed area of the rounded corner layer.
  • the display content of the layer below the layer, and the transparency value of several pixels in the transition area of the rounded layer is controlled to be an intermediate value, so that a smooth transition of any shape can be obtained.
  • the white area indicates that the transparency of the pixels in this area is less than or equal to the first transparency threshold.
  • the display When superimposed with other display layers, the display will display The content of the layer below the rounded corner layer does not display the black content of the rounded corner layer; the black area indicates that the transparency of the pixels in the area is greater than or equal to the second transparency threshold.
  • the display screen When superimposed with other display layers, the display screen The black content of the rounded corner layer will be displayed, but the display content of the layer under the rounded corner layer will not be displayed; there is a transition area between the white area and the black area (not shown in Figure 4).
  • the transparency value of the pixel is an intermediate value (the transparency value between the first transparency threshold and the second transparency threshold).
  • the screen When superimposed with other display layers, the screen will display the rounded corner layer and the image under the rounded corner layer.
  • the color display degree of this part of the pixel is also gradual. Pixels with larger transparency values display darker colors, and pixels with lower transparency values display colors Lighter, taking the content shown in Figure 5 as an example, the color of the pixels in the transition area shows a color gradient from black to dark gray to light gray to transparent due to the gradient of the transparency value, which can play a role in diminishing the aliasing.
  • the right image in Figure 4 shows the display effect on the display after the rounded corner layer is superimposed. If there is no hollow out part on the display screen, the effect shown in the right image is the rounded corner. The effect after the layer is superimposed. If there is a hollowed-out part on the screen corresponding to the top content, since the screen has no pixels in the hollowed-out part, the display content of the black area of the rounded layer is not displayed completely. .
  • the main effect of diminishing the jaggedness is the transparency value of the pixels in the rounded corner layer, especially the transition
  • the transparency value of the pixels in the area is gradual, which can make the color of the pixels in the transition area have a gradual effect, so that the color of the image displayed on the rounded corners of the screen has a gradual effect, which plays the role of diminishing the jaggedness.
  • the color of the layer can be black or other single color.
  • the display subsystem DSS needs to obtain the pixel values (including transparency value and color) of all pixels in the rounded layer when overlaying layers.
  • the rounded layer uses the ARGB package format to access image data, so the CPU After the rounded corner layer is drawn, the pixel values of all pixels of the rounded corner layer will be stored in the memory (such as DDR).
  • the display subsystem DSS reads the layer data, the rounded corner layer is also read through the read channel. All pixel values are read.
  • the rounded corner layer is also read through the read channel. All pixel values are read.
  • FIG. 6 shows a method for processing a layer in an embodiment of the present application, which can perform independent access to the transparency information of the pixels of the rounded corner layer. The following describes the embodiment of the present application in detail with reference to FIG. 6.
  • step S610 the display subsystem reads the transparency information of the target pixel in the fillet layer from the first storage area in the memory, and the first storage area is dedicated to storing the transparency information of the target pixel.
  • the fading of the sawtooth is mainly realized by controlling the transparency value of the pixels of the rounded corner layer, and the color of the rounded corner layer can be set to a single color, for example, the RGB of all pixels of the rounded corner layer are 0, where the R, G, and B values of each pixel are the same, or the color of the rounded corner layer is other colors with the same RGB (for example, the same color as the device housing), and the R, G, and B of each pixel The value can be different.
  • the image data of the rounded layer is stored, since all the pixels in the rounded layer have the same pixel value, it is equivalent to repeatedly storing the color information of the pixel, such as (a) in Figure 7 , That is, the A value, R value, G value, and B value of all pixels in the rounded layer are stored in the memory.
  • ARGB is stored in a packed format.
  • the A value of each pixel, R value, G value, B value are stored continuously.
  • the transparency information of the target pixel in the rounded corner layer may be stored in the first storage area in the memory dedicated to storing the transparency information of the target pixel.
  • the first storage area of the memory is dedicated to storing the transparency information of the target pixel, and is not used to store other information of the target pixel, that is, the transparency information of the target pixel in the rounded corner layer and the rounded corner layer
  • Other information of the target pixel in the target pixel such as the color information of the pixel, is stored separately, or the transparency information of the target pixel in the rounded corner layer is stored separately from the other information of the target pixel in the rounded corner layer, such as the color information of the pixel. of.
  • the transparency information of the target pixel in the rounded corner layer is stored separately.
  • the transparency information of the target pixel in the rounded corner layer and other information of the target pixel in the rounded corner layer are stored in the location, area or The space is separate and independent. Therefore, when reading the image data of the rounded corner layer, the transparency information of the target pixel in the rounded corner layer and the target pixel in the rounded corner layer can be read separately or separately. Other information, there is no need to read other information such as transparency information and color information of the target pixel in the rounded layer at the same time.
  • the transparency information of the target pixel in the rounded corner layer in the embodiment of the present application is stored in the first storage area in the memory
  • the transparency information of the target pixel in the rounded corner layer is continuously stored in the first storage area.
  • the first storage area in the memory stores the transparency information of all the pixels in the rounded corner layer, then in a certain area or space of the memory (that is, the first storage area), the rounded corner layer is continuously stored The transparency information of all pixels in the area or space, other information of the pixels that are not stored in the rounded corner layer.
  • the storage device involved in the embodiments of the present application may include memory and on-chip memory, where the on-chip memory may include at least one of a cache memory (also referred to as a cache), a register, or a cache, and is integrated with a processor or a processing module On one chip.
  • the memory is independent of the chip where the processor or processing module is located.
  • the "transparency information of the target pixel in the rounded corner layer" in the embodiment of the present application is used to indicate the transparency value of the target pixel in the rounded corner layer.
  • the transparency information of the target pixel in the rounded corner layer in the first storage area in the memory there are many ways to store the transparency information of the target pixel in the rounded corner layer in the first storage area in the memory.
  • only the transparency information of the target pixel in the rounded corner layer may be stored in the memory, and the area used for storing the transparency information of the target pixel in the memory is the first storage area.
  • the color information of the target pixel in the rounded corner layer can be stored in the on-chip memory (such as a register or cache) after the rounded corner layer is drawn, or the color information of the target pixel can be configured as a preset value or default value.
  • the preset value or the default value may be a value that has been stored in a non-volatile memory, such as a flash memory.
  • the preset value or default value may also be a value pre-configured in the display subsystem, so that the display subsystem can obtain the preset value or default value. For example, you can store only the transparency value of the target pixel in the fillet layer in the memory.
  • the figure schematically shows the storage space of the memory, and the transparency value and chroma component value of the target pixel in the rounded corner layer are no longer stored together , Only the transparency value of the target pixel of the rounded layer is stored in the memory. Accordingly, the display subsystem can read the transparency value of the target pixel separately when reading the image data of the rounded layer from the memory. When accessing the transparency value of the target pixel in the fillet layer, there is no need to access the color information of the target pixel in the fillet layer in the memory, so that the transparency information of the target pixel in the fillet layer can be accessed separately.
  • the area (ie, the first storage area) in which the transparency value of the target pixel in the rounded corner layer can be stored separately can also be referred to as the A plane.
  • the image data of the rounded corner layer is stored When, you can only store the transparency value of the target pixel in the rounded corner layer in the A plane, without storing the color components of the target pixel in the rounded corner layer (such as R, G, B values, etc.), compared to (a)
  • the storage format can reduce 3/4 of the memory.
  • the image data of the rounded layer is stored in the memory, only the target pixel transparency value can be stored, and when the image data of the rounded layer is read from the memory, only read
  • the transparency value of the target pixel stored in the A plane can be reduced by 3/4 of the storage bandwidth and read bandwidth respectively. Further, the read content of the rounded layer is reduced, and the read bandwidth of the display subsystem is reduced, thereby reducing the power Consumption.
  • the storage process of the transparency value of the target pixel in the rounded corner layer may be as follows: store the transparency value of each pixel in the target pixel in the rounded corner layer in the A plane, where The storage position of the transparency value of the target pixel in the rounded corner layer on the A plane is continuous. It should be understood that the continuous storage location of the target pixel's transparency value in the A plane may be continuous logical addresses and/or continuous physical addresses.
  • the color information of the target pixel in the rounded corner layer can be stored in an on-chip memory such as a register, a buffer, or a high-speed storage device after the rounded corner layer is drawn.
  • the color of the rounded corner layer can be a single color such as black, or a color consistent with the appearance of the device, such as blue, or gold, etc.
  • the color of the target pixel in the rounded corner layer can be The same, so the color information (such as RGB value) of a pixel in the target pixel can be stored in the on-chip memory; if the chromaticity components of each pixel in the target pixel are also the same, then the target pixel can also be stored in the on-chip memory A certain chrominance component value (for example, any one of R value, G value, or B value) of a pixel in.
  • the color information of the target pixel in the rounded corner layer can also be a preset value or default value stored in a non-volatile memory such as ROM or flash.
  • the display subsystem can directly read the color information from the non-volatile memory.
  • the preset value or default value can also be that every time the device is powered on, the CPU runs the computer program to configure the preset value or default value from the non-volatile memory to the register or buffer to display the subsystem Then get the value from the register or buffer.
  • the color information of the target pixel in the rounded corner layer can be set when the device leaves the factory, or it can be user-defined.
  • the color information of the target pixel is written into the non-volatile memory; when the user customizes the color information of the target pixel, the user can operate on the input device, such as outputting the customized value, and the input device generates instructions for use.
  • the user-defined value of the user operation information or instruction after the CPU executes the instruction, the user-defined value can be stored in the non-volatile memory.
  • the display subsystem can automatically obtain the preset value or default value after the device is powered on for subsequent processing.
  • a 24-bit color buffer can be used to set the chromaticity component R, G, and B values of one of the pixels in the rounded layer, each of which Each chrominance component value occupies 8bits of memory.
  • the data in the 24-bits color buffer can be stored by the CPU after drawing the rounded corner layer, or the CPU can configure the preset value stored in the non-volatile memory. If the transparency value of each pixel occupies 8bits of memory, if only the transparency value of the target pixel in the fillet layer is stored in the memory, it is equivalent to each pixel occupies 8bits of memory, that is, BBP (bytes per pixel) is 1.
  • the memory is only 1/4, which reduces the memory by 3/4, and the rounded layer is read from the memory.
  • the target pixels stored on the A plane may be all pixels in the rounded corner layer or some pixels in the rounded corner layer.
  • both the transparency information of the target pixel in the rounded corner layer and the color information of the target pixel in the rounded corner layer can be stored in the memory, wherein the transparency information of the target pixel is stored in the first storage in the memory. Area, the color information of the target pixel is stored in the second storage area in the memory, and the first storage area and the second storage area are independent of each other. It should be understood that the first storage area and the second storage area are independent of each other can be understood as the first storage area and the second storage area are different storage areas in logical space and/or physical space, in other words, in the rounded layer The transparency information of the target pixel and the color information of the target pixel in the rounded corner layer are stored in different storage areas in the memory.
  • the transparency information of the pixels in the rounded corner layer and the color information of the pixels in the rounded corner layer are stored separately.
  • the chrominance component of the target pixel including the red component R value, the green component G value, and the blue component B value as an example, for example, the transparency value plane and the RGB plane (planar) can be stored in a separate format.
  • the separate The area where the transparency value of the target pixel in the rounded corner layer is stored (that is, the first storage area) can also be called A plane, and the area where the chroma component of the target pixel in the rounded corner layer is stored (that is, the second storage area) ) Is called the RGB plane.
  • the transparency value of the target pixel in the rounded layer can be stored in the A plane (that is, the first storage area) .
  • the color components of the target pixels in the rounded layer are stored in the RGB plane (ie, the second storage area), that is, the R value, G value, and B value of each pixel in the target pixel are continuously stored on the RGB plane.
  • the second storage area may also include a plurality of independent sub-storage areas, and each chroma component in the color information of the target pixel is stored in the multiple independent sub-storage areas, wherein each chroma component is associated with a plurality of independent sub-storage areas.
  • the sub-storage areas have a one-to-one correspondence.
  • the transparency value of the target pixel in the rounded corner layer and the red component, blue component, and green component of the target pixel in the rounded corner layer can be separately Stored in the A plane, R plane, G plane and B plane, where the R plane can be understood as the area where the red component of the target pixel color in the rounded corner layer is stored separately, and the G plane can be understood as the rounded corners are stored separately.
  • the area of the green component (green) in the color of the target pixel in the layer, the B plane can be understood as an area that separately stores the blue component (blue) in the color of the target pixel in the rounded corner layer, where R plane and G plane
  • the and B planes can be understood as different sub-storage areas of the second storage area.
  • each chromaticity component in the color information of the target pixel in the rounded corner layer can be stored independently or separately in the memory.
  • the transparency value of the target pixel in the rounded corner layer stored in the memory may be the transparency value of all or part of the pixels
  • the chromaticity component value of the target pixel in the rounded corner layer stored in the memory It can be the chrominance component value of all or part of the pixels.
  • the color of the rounded corner layer can be changed, when storing the image data of the rounded corner layer, in addition to storing the transparency value of the target pixel in the rounded corner layer separately in the first memory in the memory.
  • the color components of the target pixel in the rounded layer such as the R value, G value, and B value, can also be stored separately or together.
  • the color of the rounded corner layer is monochromatic (that is, all the pixels in the rounded corner layer have the same color, which means that the color components of all pixels are the same)
  • the color information of only one pixel such as RGB value
  • the bandwidth required to store the RGB value of one pixel of the target pixel in the memory is negligible, so the image of the rounded corner layer
  • the bandwidth required to store data in the memory is approximately equal to the bandwidth required to store only the transparency value of the target pixel of the rounded layer in the memory.
  • the memory can be reduced by 3/4.
  • the transparency value of the target pixel in the layer and the RGB value of a pixel can reduce the storage bandwidth and read bandwidth by about 3/4, respectively. Furthermore, the read content of the rounded layer is reduced, and the display subsystem reads The bandwidth is reduced, which can reduce power consumption.
  • the target pixel in the rounded corner layer is a single color and the chromaticity components of each pixel are the same, such as RGB(0,0,0), you can also store only the target pixel in the second storage area in the memory A certain chrominance component of a pixel in can further reduce the access bandwidth of the rounded layer and reduce power consumption.
  • the display subsystem reads the image data of the fillet layer from the memory, and can still read the image data stored in each plane separately as needed, without reading all the image data at the same time
  • the memory is not reduced compared to the storage format in (a)
  • the read bandwidth can be reduced when the display subsystem reads data from the memory, thereby reducing power consumption.
  • the image data of the rounded corner layer when storing the image data of the rounded corner layer, it includes, but is not limited to, storing the A/R/G/B value of the target pixel in the rounded corner layer in each One plane, that is, a total of four planes, as shown in Figure 7 (d), or the A/RGB values of the pixels in the rounded layer are stored in one plane, that is, a total of two planes, as shown in Figure 7. (c) Of course, it can also be another number of planes, as long as the transparency values of the pixels in the rounded corner layer are independently stored in one plane (that is, the first storage area).
  • the embodiment of the present application only takes the color information of the target pixel in the rounded corner layer including the chromaticity components of R, G, and B as an example for description.
  • the target pixel in the rounded corner layer The color information of may include other chromaticity components, for example, white W, etc., but the method of storing image data of the rounded layer in the embodiment of the present application is also applicable.
  • the transparency information of the target pixel in the rounded corner layer stored in the memory includes the transparency value of the target pixel in the rounded corner layer.
  • the transparency value of the target pixel in the rounded corner layer It can also be replaced by the index of the transparency value of the target pixel in the rounded corner layer.
  • only the index of the transparency value of the target pixel in the rounded corner layer may be stored in the memory, and the number of bits occupied by the index is smaller than the number of bits occupied by the transparency value of the target pixel.
  • the target pixels can be all pixels in the rounded corner layer, in other words, the index of the transparency value of all the pixels in the rounded corner layer can be stored in the memory.
  • FIG. 8 shows a schematic diagram of a method for processing layers.
  • an index with a memory occupation of 3 bits can be used to indicate the transparency value of a pixel with a memory occupation of 8 bits.
  • Figure 8 shows some pixels in the rounded layer.
  • the first transparency threshold is set to 0 and the second transparency threshold is set to 255 in the embodiment of the present application.
  • the transparency of the pixels in the white area in Figure 8 A value of 0 means the transparent area of the rounded layer, and the transparency value of the pixels in the black area is 255, which means the opaque area of the rounded layer, which is represented by the gray area between the black and white areas It is the transition area of the rounded layer.
  • the transparency value of the pixel is between 0 and 255.
  • the transparency value of the pixel can be stored in hexadecimal, and the transparency value of the pixel can be represented by a decimal value of 0 ⁇ 255.
  • the decimal value can be converted to a hexadecimal value for storage.
  • the color on the picture is
  • the transparency value of a black pixel is 255, which can be expressed as 0xFF in hexadecimal, which means that the pixel is completely opaque;
  • the transparency value of a white pixel in the picture is 0, which can be expressed as 0x00 in hexadecimal, which means that the pixel is completely Transparent;
  • the transparency value of the gray pixels on the picture is between 0 and 255.
  • the transparency values of the gray pixels of different depths are different, indicating that the degree of transparency of the pixels is different.
  • the pixels in the gray part are the transition area mentioned above
  • the transparency value of the pixel in the transition zone is 216, which can be expressed as 0xD8 in hexadecimal notation.
  • Figure 8 shows several transparency values of pixels in the transition zone, expressed in hexadecimal such as 0xE8, 0xD8, 0xC8 and so on.
  • the table on the right in FIG. 8 is a table of the correspondence relationship (or mapping relationship) between the transparency value of the pixels in the rounded layer and the transparency value index.
  • the index of the transparency value of all pixels in the rounded corner layer is stored in the memory. Accordingly, when the display subsystem reads the image data of the rounded corner layer from the memory, it can only read the circle The index of the transparency value of all pixels in the corner layer, and then according to the corresponding relationship between the transparency value of the pixel and the index of the transparency value of the pixel, the transparency value of all the pixels of the rounded corner layer is obtained.
  • the transparency value index of the pixel in the rounded corner layer it can be that after the CPU draws the content of the rounded corner layer, first, according to the corresponding relationship between the transparency value of the pixel and the index of the transparency value of the pixel, the rounded corner The transparency value of the pixel in the layer is converted to the index of the transparency value, and then stored in the memory.
  • the transparency values of the pixels from left to right are 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xD8, 0xE8, 0xD8, 0xC8,
  • the index of the transparency value of the row pixel occupies a total of 27bits of memory.
  • the memory is only 3/8 of the transparency value of the second row of pixels, which is greatly reduced.
  • the index 111b, 111b, 111b, 111b, 111b, 010b, 011b, 010b, 001b of the second row of pixels is read, according to the transparency of the pixel
  • the transparency value of the second row of pixels can be obtained as 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xD8, 0xE8, 0xD8, 0xC8, read the transparency value of the second row of pixels
  • the bandwidth of the index is only 3/8 of the bandwidth for reading the transparency value of the second row of pixels.
  • the index with a smaller memory footprint to indicate the transparency value of the pixel with a larger memory
  • the transparency information of the target pixel can be accessed separately, and the storage amount of the rounded corner layer in the memory can be reduced, which reduces the memory for the rounded corner layer storage, and at the same time reduces the storage bandwidth and read bandwidth, thereby reducing the power Consumption.
  • how many bits are used to express the index of the transparency value in the embodiment of the present application can be determined according to the number of different transparency values involved in the rounded corner layer. For example, if there are 14 different transparency values in the rounded corner layer, you can choose to use 4 bits to express the index of the transparency value. Compared with the storage method of the transparency value of the pixel occupying 8 bits of memory, the memory is reduced. Bandwidth is reduced and power consumption is reduced. It should also be understood that the method of using an index that occupies a smaller memory to indicate the transparency value of a pixel that occupies a larger memory in the embodiments of the present application can also be applied to the storage of the chrominance component of the pixel, which will not be described in detail here. .
  • the target pixel may include pixels in the transition area of the rounded layer.
  • the target pixel is the transition area pixel of the rounded layer.
  • the transition area in the rounded layer may be stored in the memory.
  • the index of the transparency value of the pixel may be stored in the memory.
  • a black pixel in the image indicates that the pixel is completely opaque
  • a white pixel indicates that the pixel is completely transparent
  • a gray square between black and white indicates that the pixel is between transparent and white.
  • the area where the gray pixels are located is the transition area of the rounded layer.
  • the pixels located in the transition area can be called transition area pixels. In the realization of fading jagged, it is mainly the pixels in the transition area that soften the jagged. Therefore, when storing the image data of the rounded layer, you can only store the index of the transparency value of the pixels in the transition area of the rounded layer.
  • one index indicates the transparency value of one pixel.
  • one index may also indicate the transparency value of multiple pixels.
  • the multiple pixels are continuous.
  • an index occupying 2 bits of memory can be used to indicate the transparency values of multiple pixels occupying 8 bits of memory.
  • Figure 9 shows some pixels of the rounded layer.
  • the first transparency threshold is set to 0 and the second transparency threshold is set to 255 in this embodiment of the application.
  • the transparency values of the pixels in the white area in Figure 9 are 0, which means the transparent area of the rounded layer
  • the transparency value of the pixels in the black area is 255, which means the opaque area of the rounded layer
  • the gray area between the black and white areas is The transition area of the rounded layer. In the transition area, the transparency value of the pixel is between 0 and 255.
  • the transparency value of the pixel can be stored in hexadecimal, and the transparency value of the pixel can be represented by a decimal value of 0 ⁇ 255.
  • the decimal value can be converted to a hexadecimal value for storage.
  • the color on the picture is
  • the transparency value of a black pixel is 255, which can be expressed as 0xFF in hexadecimal, which means that the pixel is completely opaque;
  • the transparency value of a white pixel in the picture is 0, which can be expressed as 0x00 in hexadecimal, which means that the pixel is completely Transparent;
  • the transparency value of the gray pixels on the graph is between 0 and 255, and the transparency values of the gray pixels of different depths are different, which means that the transparency of the pixels is different.
  • the figure shows several transparency values of pixels, which can be expressed in hexadecimal such as 0xE8, 0xD8, 0xC8, etc.
  • the area where the gray pixels on the picture are located is the transition area of the rounded layer.
  • Figure 9 (a) shows some pixels that transition from the opaque area to the transparent area, and (b) shows the transition from the transparent area. Part of the pixels to the transparent area.
  • the upper table in FIG. 9 is a table of the correspondence relationship (or mapping relationship) between the transparency value of the pixels in the rounded layer layer and the transparency value index.
  • the index of the transparency value of the transition zone pixels in the rounded corner layer is stored in the memory. Accordingly, when the image data of the rounded corner layer is read from the memory, only the rounded corner layer can be read According to the index of the transparency value of the transition area pixel in the pixel, the transparency value of the transition area pixel of the rounded layer is obtained according to the corresponding relationship between the transparency value of the pixel and the index of the transparency value of the pixel.
  • the rounded corner Before storing the transparency value index of the pixel in the rounded corner layer, it can be that after the CPU draws the content of the rounded corner layer, first, according to the corresponding relationship between the transparency value of the pixel and the index of the transparency value of the pixel, the rounded corner The transparency values of multiple pixels in the layer are converted into corresponding indexes and then stored in the memory.
  • an index may be used to indicate the transparency value of multiple consecutive pixels in the transition area.
  • an index may indicate the transparency value of a row or column of pixels in the transition area.
  • the transparency values of pixels in the transition zone in (a) are 0xD8, 0xE8, 0xD8, 0xC8, and 10b can be used to indicate these four consecutive pixels ( That is, the transparency value of the transparency mode I) shown in the figure, that is, when storing the first row of pixels in the transition area in the memory, only 10b, the index of the transparency value of the first row of pixels in the transition area is stored in the memory A total of 2 bits are occupied.
  • the memory is only 1/16 of the transparency value of the first row of pixels in the transition area.
  • the index 10b of the transparency value of the pixels in the first row of the transition area is read.
  • the transparency value of the first row of pixels in the transition area can be obtained as 0xD8, 0xE8, 0xD8, 0xC8, and the bandwidth of reading the index of the transparency value of the first row of pixels in the transition area is only to read the transparency value of the first row of pixels in the transition area Therefore, by using an index with a smaller memory footprint to indicate the transparency value of multiple pixels occupying a larger memory, not only can the transparency information of the target pixel of the rounded layer be accessed separately, but also The storage capacity of the fillet layer in the memory can be reduced, and the read bandwidth can be reduced, thereby reducing power consumption.
  • the transparency values of the pixels in the transition zone in (b) are 0xC8, 0xD8, 0xE8, 0xD8, and 01b can be used to express these four consecutive pixels (that is, the transparency mode II shown in the figure), that is, in the memory
  • the transparency index of the pixels in the first row of the transition area occupies a total of 2 bits, compared to the 32 bits (4bytes) when the transparency value of the pixels in the first row of the transition area is stored. ), the memory only stores 1/16 of the transparency value of the first row of pixels in the transition area.
  • an index is used to express the transparency value of a row or column of pixels in the transition area, which is equivalent to expressing the transition area of a rounded layer with a fixed transparency mode, which can further reduce memory and reduce power consumption.
  • the pixels of the transition area shown in FIG. 9 are only exemplary.
  • the pixel pattern of each row of the transition area may be the same as the pixel pattern of the first row and the second row of the transition area.
  • the transparency value of each row of pixels in the area pixels can be expressed by the same index; of course, the pixel pattern of each row of the transition area may not be exactly the same, so the transparency value of each row of pixels can correspond to an index; this embodiment of the application You can also use an index to indicate the transparency value of some continuous pixels in a row or column of pixels in the transition area; in addition, you can also combine the methods of Figure 8 and Figure 9 to store the transparency value of the pixels in the transition area, that is, the part of the transition area The transparency value of the pixel in the row or column is expressed by an index, and the transparency values of the remaining individual different pixels can correspond to an index respectively.
  • the method refers to the above-listed examples, which will not be detailed here.
  • the target pixel may be all pixels of the rounded layer, where a row or column of pixels in the transition area corresponds to an index, the transparency value of a transparent pixel corresponds to an index, and the transparency value of an opaque pixel corresponds to an index.
  • 00b can be used to represent the transparency value of a transparent pixel
  • 11b can be used to represent the transparency value of an opaque pixel.
  • the transparency value of the transparent pixel is stored as 00b, and the transparency value of the opaque pixel
  • the transparency value storage 11b stores the transparency value of the pixels in the transition area from the transparent area to the opaque area 01b, and stores the transparency value of the pixels in the transition area from the opaque area to the transparent area 10b.
  • the transparency value of the corresponding pixel is obtained according to the corresponding relationship between the index and the transparency value of the pixel. It should be understood that the transition area of the rounded layer layer can also be located between two transparent areas, and the method of using an index to indicate the transparency values of multiple consecutive pixels in the transition area is also applicable, and will not be repeated here.
  • the transparency information of all pixels of the rounded corner layer can be saved, and at the same time, the storage memory of the rounded corner layer can be reduced by the storage of the pixel transparency value index, and the read bandwidth can be reduced, thereby reducing power consumption.
  • the transparency value of the pixel changes regularly.
  • the transparency value of the pixels in the first column of the transition area is 0xE8, 0xD8, 0xC8 , 0xB8, the transparency value of the pixel in the second column is 0xD8, 0xC8, 0xB8, the transparency value of the pixel in the third column is 0xC8, 0xB8, and the transparency value of the pixel in the fourth column is 0xB8.
  • the index 01b corresponds to the transparency values of the four pixels 0xE8, 0xD8, 0xC8, and 0xB8.
  • the transparency value of each column of pixels is stored as 01b, but when reading the transparency value of the four columns of pixels, the index 01b of the pixel in the first column is read, and accordingly, the The transparency value of the pixel in the first column is restored to 0xE8, 0xD8, 0xC8, 0xB8, read the index 01b of the pixel in the second column, and correspondingly, restore the transparency value of the pixel in the second column to 0xD8, 0xC8, 0xB8, read Take the index 01b of the pixel in the third column, correspondingly restore the transparency value of the pixel in the third column to 0xC8, 0xB8, read the index 01b of the pixel in the fourth column, and correspondingly change the transparency of the pixel in the fourth column The value is restored to 0xB
  • an index can be used to indicate the transparency value of the pixels of a region in a rounded layer, where the transparency values of the pixels in the region are the same.
  • an index 00b can be used to indicate a rectangular region with a length of 60 lines and a width of 30 lines.
  • the transparency value of the pixels in the rectangular area is 0.
  • the transparency value of the pixels in the area can be stored as 00b.
  • the read data is 00b. According to the index and the transparency value of the pixels in the rectangular area The corresponding relationship of, can restore the transparency value of the pixels in the rectangular area.
  • the expression form of the transparency value of the pixel or the expression form of the index listed above is exemplary and does not impose any limitation on the embodiment of the present application.
  • the transparency value of the pixel or the accuracy of the memory occupied by the chroma component value listed above are also exemplary.
  • the representation form of the value and the representation form of the index in the embodiment of the present application can be based on the transparency value of the pixel. The actual accuracy of the memory occupied by, and chroma component values is determined. The above lists the ways to store only the transparency index of the pixels in the rounded layer in the memory.
  • the display subsystem In step S620, the display subsystem generates the rounded corner layer according to the transparency information of the target pixel in the rounded corner layer.
  • the transparency information of the target pixel in the rounded corner layer may include the transparency value of the target pixel in the rounded corner layer or the index of the transparency value of the target pixel in the rounded corner layer.
  • the display subsystem can read from the first storage area in the memory during the DSS reading process of the display subsystem. Get the transparency information of the target pixel in the rounded corner layer, and restore the transparency value of the target pixel in the rounded corner layer according to the transparency information of the target pixel.
  • the display subsystem can read the rounded corner layer from the on-chip memory during the reading process of the display subsystem DSS If the color information of the target pixel in the rounded layer is stored in the non-volatile memory, the display subsystem can directly read from the non-volatile memory during the DSS reading process of the display subsystem Take the color information of the target pixel, or the CPU configures the data in the non-volatile memory into a register or buffer, and the display subsystem obtains the color information of the target pixel from the register or buffer; the target in the rounded corner layer If the color information of the pixel is directly configured in the display subsystem, the display subsystem can directly obtain it. The display subsystem can fill the color of the target pixel according to the acquired color information of the target pixel of the rounded corner layer, thereby generating the rounded corner layer.
  • the display subsystem can read the transparency information of the target pixel in the rounded corner layer from the first storage area in the memory, and read the rounded corner layer from the second storage area in the memory
  • the color information of the target pixel in the display subsystem can read data from the first storage area and the second storage area respectively.
  • the color information of the target pixel restores the color of the target pixel in the rounded corner layer, thereby generating the rounded corner layer.
  • the display subsystem reads the transparency value index of the target pixel from the first storage area, and the display subsystem is based on the transparency value of the pixel. Correspondence with the index of the transparency value of the pixel to obtain the transparency value of the target pixel.
  • the transparency information of the target pixel of the rounded layer in the embodiment of the present application can be stored in the storage manner mentioned in the methods described in FIGS. 6-9, and the color information of the target pixel of the rounded layer can be
  • the storage method mentioned in the methods described in FIGS. 6 to 9 is used for storage. For details, please refer to the above, which will not be repeated here.
  • step S630 the rounded corner layer and at least one target layer are superimposed to obtain an image to be displayed.
  • the target layer is a layer other than the rounded corner layer, used to display the content on the target layer, such as images, text, or tables, on the screen.
  • the method for processing layers in the embodiments of the present application may be implemented by hardware, software, or a combination of software and hardware, and the embodiments of the present application do not specifically limit it. It should be noted that the method for processing layers in the embodiments of the present application is not limited to processing rounded corner layers, and is also applicable to processing other layers.
  • FIG. 10 shows a schematic flowchart of a method for processing layers according to an embodiment of the present application.
  • the processing flow for the fillet layer is as follows.
  • S1010 draw a rounded corner layer. This step can be performed by CPU or GPU.
  • the drawn fillet layer content may be the top content and the bottom content as shown in FIG. 4.
  • Step S1010 can be executed only once after the device is powered on, that is, the CPU or GPU can draw the fillet layer only once.
  • the display subsystem can directly read the first time The contents of the fillet layer stored after drawing without redrawing.
  • the CPU can also configure the color information of the target pixel in a register or a buffer, so that It is used to decode and restore the rounded corner layer in step S1050.
  • this step is optional. If the CPU or GPU finishes drawing the rounded corner layer and stores the transparency value index of the target pixel in the rounded corner layer in the first storage area of the memory, the CPU or GPU encodes the transparency value of the target pixel to be stored.
  • the encoding process is to obtain the transparency value index of the target pixel to be stored in the first storage area according to the transparency value of the target pixel and the corresponding relationship between the transparency value of the pixel and the index of the transparency value of the pixel.
  • the CPU or GPU may only encode the transparency value of the target pixel, or may encode the chrominance component of the target pixel.
  • the CPU or GPU encoding the transparency value and chrominance component of the target pixel can refer to the description of FIG. 8 to FIG. 9 above, which will not be repeated here.
  • the CPU or GPU stores the transparency information and color information of the target pixel in the rounded corner layer. It should be understood that the transparency information of the target pixel in step S1030 may include the transparency value of the target pixel or the transparency value index of the target pixel obtained in step S1020.
  • the CPU or GPU may store both the transparency information and color information of the target pixel in the memory, where the transparency information of the target pixel is stored in the first storage area in the memory, and the color information of the target pixel is stored in the memory The second storage area.
  • the CPU or GPU may store the transparency information of the target pixel in the first storage area in the memory, and store the color information of the target pixel in an on-chip memory such as a register.
  • step S1030 if the CPU or GPU only stores the transparency information of the target pixel in the first storage area in the memory, the color information of the target pixel may be a preset value or a default value stored in the non-volatile memory.
  • step S1040 The display subsystem reads the transparency information of the target pixel stored in the first storage area in the memory into the read channel RCH.
  • the CPU or GPU also stores the color information of the target pixel in the memory, then in this step, the display subsystem can also read the target from the second storage area in the memory as needed. The color information of the pixel.
  • step S1050 this step is optional.
  • the CPU or GPU stores the transparency value and chroma component of the target pixel of the rounded layer in the memory, in this step the display subsystem can directly obtain the transparency value and color of the target pixel. Degree component, this step can be omitted.
  • step S1020 the CPU or GPU encodes the transparency information and/or color information of the target pixel
  • the display subsystem needs to decode the encoded transparency information and/or color information of the target pixel, Taking the decoding of the transparency information of the target pixel as an example, the display subsystem restores the transparency value of the target pixel according to the read transparency value index of the target pixel and the corresponding relationship between the transparency value of the pixel and the index of the pixel transparency value.
  • the display subsystem obtains the color information of the target pixel from the register configured with the color information of the target pixel, and uses the target pixel The color information can fill the color of the target pixel to restore the rounded corner layer.
  • the display subsystem may also directly obtain the color information of the target pixel from the non-volatile memory.
  • the display subsystem performs superimposition and post-processing.
  • the display subsystem superimposes the fillet layer and at least one target layer, and performs image algorithm processing for synthesis and display.
  • Fig. 11 is a schematic structural diagram of a device provided by an embodiment of the present application.
  • the device 1100 in FIG. 11 may be the aforementioned display subsystem, for example, may be a specific example of the display subsystem DSS in FIG. 3.
  • the device shown in FIG. 11 can be used to implement the above method executed by the display subsystem. Specifically, the device 1100 can be used to execute the method in FIG. 6 and can specifically implement the embodiments shown in FIGS. 7 to 9 To avoid redundancy, the description will not be repeated.
  • the apparatus 1100 shown in FIG. 11 includes a reading module 1110, a generating module 1120, and a superimposing module 1130.
  • the reading module 1110 is configured to read the transparency information of the target pixel in the fillet layer from a first storage area in the memory, and the first storage area is dedicated to storing the transparency information of the target pixel.
  • the generating module 1120 is configured to generate the rounded corner layer according to the transparency information of the target pixel in the rounded corner layer.
  • the superimposing module 1130 is used to superimpose the rounded corner layer and at least one target layer to obtain an image to be displayed.
  • the transparency information of the target pixel in the rounded corner layer includes an index of the transparency value of the target pixel, and the number of bits occupied by the index is less than the number of bits occupied by the transparency value of the target pixel .
  • the target pixels include pixels in a transition area of the rounded corner layer, and the transition area is the area where the transparency value of the rounded corner layer is between a first transparency threshold and a second transparency threshold.
  • the pixels in the transition area of the rounded layer layer include a plurality of continuous pixels, and the index is used to indicate the transparency value of the plurality of continuous pixels.
  • the generating module 1120 is specifically configured to generate the rounded corner layer according to the transparency information of the target pixel in the rounded corner layer and the color information of the target pixel.
  • the color information of the target pixel is stored in a second storage area in the memory, the second storage area and the first storage area are independent of each other, and the reading module 1110 is further configured to read from the first storage area.
  • the second storage area reads the color information of the target pixel.
  • the second storage area includes a plurality of independent sub-storage areas, each chromaticity component in the color information of the target pixel is stored in the multiple independent sub-storage areas, and the respective chromaticity The components correspond to the multiple independent sub-storage areas one-to-one.
  • the color information of the target pixel is stored in an on-chip memory, and the reading module 1110 is further configured to obtain the color information of the target pixel from the on-chip memory.
  • At least one module of the apparatus shown in FIG. 11 may be implemented by software, hardware, or a combination of software and hardware.
  • the software can enable computer program instructions to be executed by various types of processors, such as CPUs.
  • the hardware may be various circuits, such as one or more of logic circuits, arithmetic circuits, digital circuits, analog circuits, or programmable circuits. Therefore, the display subsystem may include hardware circuits and necessary software drivers, the driver including the aforementioned computer program instructions.
  • FIG. 12 shows a schematic structural diagram of a device 1200 provided by an embodiment of the present application.
  • the device 1200 in FIG. 12 may be the above-mentioned device, for example, may be a specific example of a terminal device having the hardware layer of FIG. 1.
  • the terminal device 1200 in FIG. 12 includes: at least one processor 1210, at least one network interface 1240 or other user interfaces 1230, a memory 1220, and at least one communication bus 1250.
  • the communication bus 1250 is used to implement connection and communication between these components.
  • the user interface 1230 includes a display (for example, OLED, LCD, CRT, holographic imaging device or projection device, etc.), a keyboard or a pointing device (for example, a mouse, a trackball (trackball), a touch panel or a touch screen, etc.) ).
  • the network interface 1240 may include various wired or wireless transceivers.
  • the memory 1220 may be used to store software programs and modules, and provide instructions and data to the processor 1210.
  • the memory 1220 may mainly include a program storage area and a data storage area, where the program storage area may store an operating system or an application program required by at least one function (such as a sound playback function, an image playback function, etc.); the storage data area may The data (such as audio data, or phone book, etc.) created according to the use of the terminal device 1200 is stored.
  • the memory 1220 may include a read-only memory and a random access memory (random access memory, RAM), and a part of the memory 1220 may also include a non-volatile memory (NVM), such as at least one disk storage device. (magnetic disk storage), flash memory (flash memory) devices, or other volatile solid-state storage devices.
  • NVM non-volatile memory
  • the memory 1220 stores the following elements, executable modules or data structures, or their subsets, or their extended sets: operating system, including various system programs, such as the framework layer shown in FIG. 1 , Core library layer, and driver layer, etc., used to implement various basic services and process hardware-based tasks; application modules, including various applications, such as the desktop (launcher) and media player shown in Figure 1 ( media player), browser (browser), etc., used to implement various application services.
  • operating system including various system programs, such as the framework layer shown in FIG. 1 , Core library layer, and driver layer, etc., used to implement various basic services and process hardware-based tasks
  • application modules including various applications, such as the desktop (launcher) and media player shown in Figure 1 ( media player), browser (browser), etc., used to implement various application services.
  • the processor 1210 by calling a program or instruction stored in the memory 1220, the processor 1210 is configured to: read the transparency information of the target pixel in the rounded corner layer from the first storage area in the memory, and the first storage The area is dedicated to storing the transparency information of the target pixel; generating the rounded corner layer according to the transparency information of the target pixel in the rounded corner layer; superimposing the rounded corner layer and at least one target layer to obtain The image to be displayed.
  • the processor 1210 calls the program or instruction to realize the function of the display subsystem.
  • the device 1200 may correspond to (for example, may be configured in or be itself) the terminal device described in FIG. 1 or FIG. 2, and each module or unit in the device 1200 may be used to execute the methods in FIGS. 5 to 10, respectively. For each action or processing procedure performed by the device, detailed description is omitted here to avoid redundant description.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • each unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of this application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program code .

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

本申请提供了一种处理图层的方法和装置,该方法包括:从内存中的第一存储区读取圆角图层中的目标像素的透明度信息,所述第一存储区专用于存储所述目标像素的透明度信息;根据所述圆角图层中的目标像素的透明度信息,生成所述圆角图层;叠加所述圆角图层和至少一个目标图层以得到待显示图像。本申请实施例中该第一存储区专用于存储目标像素的透明度信息,相应地,在存储过程中,可以在内存中的第一存储区只保存圆角图层的目标像素的透明度信息,因此,能够实现圆角图层中的目标像素的透明度信息的单独存取,对于只需要读取目标像素的透明度信息的场景下数据存取方式更灵活。

Description

处理图层的方法和装置 技术领域
本申请涉及图像处理领域,并且更具体地,涉及一种处理图层的方法和装置。
背景技术
随着移动终端技术的发展,越来越多的终端设备采用圆角显示屏,圆角显示屏的四角可以被裁剪为曲线或弧线,显示屏上也可以设计一些边缘为曲线的挖空部分用来设置用户可见的元件,例如前置摄像头、或听筒等。终端设备上这些曲线位置可以称为圆角。
然而由于屏上像素的排列方式(例如RGB子像素排列、或RGBG子像素排列等)原因使得显示屏上的曲线附近处在显示图像时容易出现锯齿现象而影响屏幕的显示效果。目前多采用在原有图层之上叠加圆角图层的方式来柔化曲线处的锯齿现象。圆角图层一般是黑色图层,通过控制圆角图层中的像素的透明度值可以控制最终显示图像在圆角图层叠加区域是显示原有图层的内容还是圆角图层的黑色内容。现有的圆角图层存取时采用的是打包格式,在存取圆角图层的图像数据时需要同时存取像素的所有信息,例如存取像素的透明度值同时也会存取像素的颜色,无法实现对圆角图层中的像素的透明度信息的单独存取,缺少灵活性。
发明内容
本申请提供一种处理图层的方法和装置,能够实现圆角图层中的目标像素的透明度信息的单独存取。
第一方面,提供了一种处理图层的方法,该方法包括:从内存中的第一存储区读取圆角图层中的目标像素的透明度信息,所述第一存储区专用于存储所述目标像素的透明度信息;根据所述圆角图层中的目标像素的透明度信息,生成所述圆角图层;叠加所述圆角图层和至少一个目标图层以得到待显示图像。
本申请的技术方案中,显示子系统从内存中的第一存储区读取圆角图层中的目标像素的透明度信息,该第一存储区专用于存储目标像素的透明度信息,相应地,在存储过程中,可以在内存中的第一存储区只保存圆角图层的目标像素的透明度信息,因此,能够实现圆角图层中的目标像素的透明度信息的单独存取,对于只需要读取目标像素的透明度信息的场景下数据存取方式更灵活。
应理解,本申请实施例中的圆角图层可以认为是为解决显示屏圆角在显示图像时出现的锯齿现象而额外叠加的图层,圆角图层主要用于显示屏的圆角位置,因此圆角图层可以不是一个完整的与显示屏大小相匹配的图层。本申请实施例中的“圆角”是相对显示屏进行描述的,在显示屏上存在曲线边缘的部分都可以认为是显示屏上的圆角(或称屏幕圆角)。
图层中像素的颜色数据用于表征像素显示的颜色,可以包括各个色度分量,例如红色 分量(R值)、蓝色分量(B值)、绿色分量(G值)或白色分量(W值)等,各个色度分量可以用数值表示,通常用0~255表示,不同数值的色度分量可以表示不同的亮度,不同数值的各个色度分量可以混合出各种颜色。
图层中的像素的透明度数据可以表征像素颜色的透明度,表明多少像素值应当被显示出来,例如当存在前景色和背景色两个图层叠加时,前景色图层中的像素的透明度可以控制显示屏显示前景色还是背景色,或者前景色和背景色各以多少比例混合以显示新颜色等。像素颜色的透明程度也可以用数值表示,该值可以称为像素的透明度值,通常也可以用0~255表示。前景色图层的像素的透明度值小于或于第一透明度阈值时,前景色图层和背景色图层叠加时,人眼无法辨识显示屏显示出来的颜色与背景色的差异(可以认为显示屏不显示前景色),则可以认为像素是透明的,这样的像素也可以称为透明像素;前景色图层的像素的透明度值大于或等于第二透明度阈值时,前景色图层和背景色图层叠加时,人眼无法辨识显示屏显示出来的颜色与前景色的差异(可以认为显示屏不显示背景色),则可以认为像素是不透明的,这样的像素本申请实施例称之为不透明像素,透明度值在第一透明度阈值和第二透明度阈值之间可以表示认为像素是半透明的,即介于透明与不透明之间。本申请实施例中的第一透明度阈值和第二透明度阈值可以根据人眼对于不同颜色色差的辨别能力确定。
本申请实施例中,圆角图层的像素的透明度值小于或等于第一透明度阈值时,该像素即为透明像素,透明像素所在的区域为透明区;圆角图层的像素的透明度值大于或等于第二透明度阈值时,该像素即为不透明像素,不透明像素所在的区域为不透明区或非透明区;圆角图层的像素的透明度值介质第一透明度阈值与第二透明度阈值之间(中间值)时,该像素即为过渡区像素,过渡区像素所在的区域为过渡区。本申请实施例中,圆角图层的过渡区处于透明区和不透明区之间,或者处于两个透明区之间;本申请实施例中的圆角图层的过渡区的像素的透明度值是渐变的。
本申请实施例中,内存的第一存储区专用于存储目标像素的透明度信息,而不用于存储目标像素的其他信息,也就是说圆角图层中的目标像素的透明度信息与圆角图层中的目标像素的其他信息例如像素的颜色信息是分开存储,或者说圆角图层中的目标像素的透明度信息相对于圆角图层中的目标像素的其他信息例如像素的颜色信息是独立存储的。换句话说,将圆角图层中的目标像素的透明度信息单独存储在一起,圆角图层中的目标像素的透明度信息与圆角图层中的目标像素的其他信息存储的位置、区域或者空间是分开的、独立的,因此在读取圆角图层的图像数据时,可以分开读取或者单独读取圆角图层中的目标像素的透明度信息和圆角图层中的像素的其他信息,无需同时读取到圆角图层中的像素的透明度信息和颜色信息等其他信息。
因此,由于显示子系统可以从内存中单独读取圆角图层的目标像素的透明度信息,相比现有从内存中读取圆角图层的像素的所有信息(如透明度信息和颜色信息)来说,能够减少显示子系统从内存中读取数据的所需的读取带宽,能够减少功耗。更进一步地,在存储过程中,若在内存中仅存储圆角图层的目标像素的透明度信息,相比将圆角图层中的像素的所有信息(如透明度信息和颜色信息)均存储于内存中而言,还能够减少圆角图层的图像数据在内存中的存储量以及减少存储所需的带宽。
还应理解,本申请实施例中“圆角图层中的目标像素的透明度信息在内存中的第一存 储区存储”时,圆角图层中的目标像素的透明度信息在第一存储区是连续存储的,例如内存中的第一存储区存储了圆角图层中的全部像素的透明度信息,则在内存的某一区域或空间(即第一存储区)上,连续存储了圆角图层中的全部像素的透明度信息,在该区域或空间上,未存储到圆角图层中的像素的其他信息。因此,“从内存中的第一存储区读取圆角图层中的目标像素的透明度信息”可以认为是“从内存中的第一存储区连续读取圆角图层中的目标像素的透明度信息”。
本申请实施例中的圆角图层中的目标像素的透明度信息用于指示圆角图层中的目标像素的透明度值。
应理解,本申请实施例中内存主要指随机存储器RAM(或称随机存取存储器、内存储器、主存储器、或主存),片上存储器包括寄存器(register)、高速缓冲存储器(或称高速缓存)或缓存(cache)等。本申请实施例中的片上存储器是指与CPU、GPU或显示子系统等处理器或处理模块集成在一个芯片上的存储装置,而本申请实施例中的内存位于独立的芯片上,与CPU、GPU或显示子系统等处理器或处理模块不属于同一芯片。
结合第一方面,在一种可能的实现方式中,所述圆角图层中的目标像素的透明度信息包括所述目标像素的透明度值的索引,且所述索引所占的比特数小于所述目标像素的透明度值所占的比特数。
通过存储占用内存更小的索引来指示占用内存较大的像素的透明度值,不仅能够实现目标像素的透明度值的单独存取,还能够减少圆角图层在内存中的存储量,进一步地,可以减少圆角图层在存取时的带宽,从而减少功耗。
应理解,本申请实施例中的读取带宽为显示子系统通过读通道从内存中读取数据的带宽。
结合第一方面,在一种可能的实现方式中,所述目标像素为所述圆角图层中的部分或全部像素。
结合第一方面,在一种可能的实现方式中,所述目标像素包括所述圆角图层的过渡区的像素,所述过渡区为所述圆角图层中的透明度值介于第一透明度阈值和第二透明度阈值之间的像素所在的区域。可选地,目标像素为所述圆角图层的过渡区的像素。
过渡区是起到淡化锯齿作用的主要部分,本申请实施例中可以只保存圆角图层的过渡区的像素的透明度信息,可以进一步地减少圆角图层在内存中的存储量,从而进一步地可以节省读取带宽,降低功耗。
结合第一方面,在一种可能的实现方式中,所述圆角图层的过渡区的像素包括多个连续像素,所述索引用于指示所述多个连续像素的透明度值。
应理解,该多个连续像素可以是处于过渡区的同一行,也可以是处于过渡区的同一列。
通过存储占用内存更小的索引来指示多个占用内存较大的连续像素的透明度值,不仅能够实现目标像素的透明度值的单独存取,还能够减少圆角图层在内存中的存储量,进一步地,可以减少圆角图层在存取时的带宽,从而减少功耗。
结合第一方面,在一种可能的实现方式中,所述根据所述圆角图层中的目标像素的透明度信息,生成所述圆角图层,包括:根据所述圆角图层中的目标像素的透明度信息,以及所述目标像素的颜色信息,生成所述圆角图层。
结合第一方面,在一种可能的实现方式中,所述目标像素的颜色信息存储于所述内存 中的第二存储区,所述第二存储区与所述第一存储区相互独立,所述方法还包括:从所述第二存储区读取所述目标像素的颜色信息。
目标像素的透明度信息的在内存中的存储区与目标像素的颜色信息在内存中的存储区不同,目标像素的透明度信息和颜色信息可以均存储于内存中,但显示子系统可以根据需要对目标像素的透明度信息或目标像素的颜色信息进行单独存取,显示子系统对于内存中的圆角图层的图像数据的存取方式更灵活,并且在读取过程中,由于显示子系统可以仅读取圆角图层的目标像素的部分数据,能够减少从内存中读取数据所需的读取带宽。
结合第一方面,在一种可能的实现方式中,所述第二存储区包括多个独立的子存储区,所述目标像素的颜色信息中的各个色度分量分别存储于所述多个独立的子存储区中。
目标像素的颜色信息中的各个色度分量也可以分开存储,相应地,显示子系统从内存中读取数据时,可以根据需要单独读取目标像素的至少一个色度分量,显示子系统对于内存中的圆角图层的图像数据的存取方式更灵活。
结合第一方面,在一种可能的实现方式中,所述目标像素的颜色信息存储于片上存储器中,所述方法还包括:从片上存储器中获取所述目标像素的颜色信息。
圆角图层中的目标像素的颜色信息可以不存储于内存中,而存储于片上存储器中,可以进一步减少圆角图层在内存中的存储量。
结合第一方面,在一种可能的实现方式中,所述目标像素的颜色信息为预设值或默认值。例如,该目标像素的颜色信息属于预配置于显示子系统中的预设值或默认值。再例如,该目标像素的颜色信息被存储在非易失性存储器中。
可选地,若圆角图层中的像素的颜色相同,则目标像素的颜色信息包括目标像素中的其中一个像素的色度分量。
显示子系统可以根据该一个像素的色度分量填充圆角图层中的像素的颜色。
可选地,若圆角图层中的像素的各个色度分量相同,则目标像素的颜色信息包括目标像素中的一个像素的一个色度分量。
显示子系统可以根据该一个像素的一个色度分量填充圆角图层中的像素的颜色。
第二方面,提供一种装置,包括用于执行上述第一方面或第一方面的任一种可能的实现方式所述的方法中的各步骤的单元或模块。每个模块或单元可以软件、硬件或软硬件结合实现。
第三方面,提供一种处理图层的设备,包括存储器和处理器,所述存储器用于存储计算机程序,所述处理器用于从存储器中调用并运行该计算机程序,使得所述设备执行第一方面及第一方面的任一种可能实现方式中的方法。
第四方面,提供一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行第一方面或第一方面的任一种可能的实现方式所述的方法。
第五方面,提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在计算机上运行时,使得计算机执行第一方面或第一方面的任一种可能的实现方式所述的方法。
第六方面,提供一种装置,包括显示子系统和处理器,所述显示子系统用于执行第一方面及第一方面的任一种可能实现方式中的方法,所述处理器用于在所述显示子系统执行第一方面及第一方面的任一种可能实现方式中的方法之前绘制圆角图层,并将所述圆角图 层中的目标像素的透明度信息保存在内存中的第一存储区中,所述第一存储区专用于存储所述目标像素的透明度信息。
可选地,处理器包括CPU或GPU。
第七方面,提供一种装置,包括显示子系统和显示设备,所述显示子系统用于执行第一方面及第一方面的任一种可能实现方式中的方法,所述显示设备用于显示所述显示子系统在执行第一方面及第一方面的任一种可能实现方式中的方法后得到的待显示图像。
附图说明
图1是本申请实施例的终端设备的逻辑结构框图;
图2是本申请实施例的终端设备的外观示意图;
图3是本申请实施例的终端设备进行图层叠加的硬件架构示意图;
图4是本申请实施例的圆角图层叠加示意图;
图5是本申请实施例的圆角图层中的部分像素的示意图;
图6是本申请实施例的处理图层的方法的示意性流程图;
图7是本申请一个实施例的处理图层的方法的示意图;
图8是本申请又一个实施例的处理图层的方法的示意图;
图9是本申请又一个实施例的处理图层的方法的示意图;
图10是本申请一个实施例的处理图层的方法的示意性流程图;
图11是本申请实施例提供的装置的示意性结构图;
图12是本申请实施例提供的设备的示意性结构图。
具体实施方式
下面将结合附图,对本申请中的技术方案进行描述。
本申请实施例中所涉及到的设备可以包括手持设备、车载设备、可穿戴设备、计算设备或连接到无线调制解调器的其它处理设备。还可以包括用户单元、蜂窝电话(cellular phone)、智能手机(smart phone)、个人数字助理(personal digital assistant,PDA)电脑、平板型电脑、手持设备(handset)、膝上型电脑(laptop computer)、机器类型通信(machine type communication,MTC)终端、销售终端(point of sales,POS)、车载电脑、无线局域网(wireless local area networks,WLAN)中的站点(STAION,ST),可以是无绳电话、会话启动协议(session initiation protocol,SIP)电话、无线本地环路(wireless local loop,WLL)站以及下一代通信系统,例如,第五代通信(fifth-generation,5G)网络中的设备或者未来演进的公共陆地移动网络(public land mobile network,PLMN)网络中的设备以及其他具有显示屏的设备等。
本申请实施例中以设备为终端设备为例,图1示出了与本申请实施例相关的终端设备的逻辑结构框图。如图1所示,该终端设备的硬件层包括中央处理器(central processing unit,CPU)和/或图形处理器(graphics processing unit,GPU)等。可选地,终端设备的硬件层还可以包括输入设备、显示设备、内存、内存控制器、显示控制器、以及图中未示出的网络接口等。
其中,输入设备可以用于检测用户操作,并生成用于指示该用户操作的用户操作信息, 作为示例而非限定,该输入设备可包括但不限于物理键盘、功能键(例如音量控制键、开关按键等)、轨迹球、鼠标、操作杆、触摸屏、光鼠(光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸)等中的一种或多种。其中触摸屏中可以包括触摸传感器和触摸屏控制器,触摸传感器可以检测用户的触摸位置,接受后传送触摸信息至触摸屏控制器,而触摸屏控制器接收该触摸信息,转换成触点坐标再传送给CPU,同时触摸屏控制器也能接收CPU发来的命令并加以执行。
显示设备可以用于呈现用户界面、图像或视频等可视化信息,例如显示设备可以显示由用户输入的信息或提供给用户的信息以及终端设备的各种菜单等,作为示例而非限定,该显示设备可包括显示器,如液晶显示器(liquid crystal display,LCD)、有机电激发光显示器(organic light emitting diode,OLED)、阴极射线管(cathode ray tube)显示器、全息成像(holographic)显示器或投影(projector)等。本申请实施例中的显示设备属于终端设备的输出设备的一种。
存储装置是终端设备中的计算机系统的记忆设备,用来存放程序和数据,计算机中的全部信息,包括输入的原始数据、计算机程序、中间运行结果和最终运行结果都保存在存储装置中。存储装置中的易失性存储器,即随机存储器(random access memory,RAM)是与CPU直接交换数据的内部存储器,也叫主存储器(简称主存)或内存储器(简称内存),是终端设备的重要部件之一,RAM可以随时读写,而且读写速度很快,通常用于暂时存放CPU中的运算数据以及与硬盘等外部存储器(简称外存)交换的数据,当电源关闭时RAM不能保留数据,在断电时将丢失存储内容。本申请实施例中的内存主要指的是RAM,内存可以包括静态的RAM(static random-access memory,SRAM)和动态的RAM(dynamic random access memory,DRAM),其中DRAM还可以包括双倍速率同步动态随机存储器(double data rate synchronous dynamic random access memory,DDR SDRAM,简称DDR)等。本申请实施例中,RAM与CPU不集成在一个芯片上,RAM与CPU属于不同芯片。
内存控制器是计算机系统内部控制内存并且通过内存控制器使内存与CPU之间交换数据的重要组成部分,其决定了计算机系统的内存性能。
存储装置中还包括一些存储器例如寄存器(register)、高速缓冲存储器(也可以称为高速缓存)或缓存(cache)等片上存储器,这种存储器的读写速度比内存的读写速度快的多,但在断电之后也会丢失存储内容。本申请实施例中的片上存储器是与CPU、GPU或显示子系统等处理器或处理模块集成在一个芯片上的存储器,也就是片上存储器与处理器或处理模块属于同一个芯片。示例性的,存储器可以与CPU集成在一个芯片上成为片上存储器,例如,上述寄存器即为一种片上存储器,寄存器是CPU的内部元件或者说与CPU集成在同一个芯片上,寄存器可以从高速缓存区读取数据,也可以从内存中读取数据,读写速度是最快的。上述高速缓存或缓存也是片上存储器,高速缓存或缓存在CPU中或与CPU集成在一个芯片上,其介于CPU和内存之间,用以缓解CPU与内存之间速度不匹配的矛盾。存储器也可以与GPU集成在一个芯片上成为片上存储器,或者是与显示子系统(芯片上用于负责图像处理的模块)集成在一个芯片上成为片上存储器,或者是与其他的处理器或处理模块集成在一个芯片上成为片上存储器,本申请实施例不做具体限定。
本申请实施例中,与CPU、GPU或显示子系统等处理器或处理模块集成在一个芯片 上的存储装置可以称为片上存储器,而本申请实施例中的内存位于独立的芯片上,与CPU、GPU或显示子系统等处理器或处理模块不属于同一芯片。
存储装置中还包括一些数据存储稳定,断电不丢失的存储器,即非易失性存储器,例如只读存储器(read only memory,ROM)、或闪存(flash memory)等。非易失性存储器与内存类似,也是位于CPU所在芯片外的设备,是独立的芯片。
显示控制器(display controller)可以通过指令系统调整施加到像素上的电压、相位、频率、峰值、有效值、时序、或占空比等一系列参数、或特性来建立起一定的驱动条件,使显示变化多端。
在硬件层之上可运行有操作系统(如Android等)以及一些应用程序。核心库层是操作系统的核心部分,包括输入/输出服务、核心服务、图形设备接口以及实现CPU、和GPU图形处理的图形引擎(graphics engine)等。图形引擎可包括2D引擎、3D引擎、合成器(composition)、和帧缓冲区(frame buffer)等。除此之外,该终端设备还包括驱动层、框架层和应用层。驱动层可包括CPU驱动、GPU驱动、和显示控制器驱动等。框架层可包括图形服务(graphic service)、系统服务(system service)、网页服务(web service)和用户服务(customer service)等;图形服务中,可包括如微件(widget)、画布(canvas)、视图(views)、渲染脚本(render script)等。应用层可包括桌面(launcher)、媒体播放器(media player)、和浏览器(browser)等。
以图1为例,本申请实施例提供的处理图层的方法,应用于终端设备,该终端设备的硬件层可包括处理器(例如,CPU和/或GPU)、显示控制器(display controller)、内存、内存控制器、输入设备、和显示设备等硬件。核心库层(kernel library)可包括输入/输出服务(input/output service,I/O service)、核心服务(kernel service)及图形引擎(graphic engine)等。
图2示出了本申请实施例的终端设备的外观示意图。如图所示,201为终端设备的显示屏,也可以称为屏幕,其四角可以裁剪为弧形,如图中虚线框202中所示的部分。显示屏201上还可以去除部分屏幕以形成挖空部分,用以满足例如前置摄像头、和听筒等元件的布置需要,如图中黑色背景填充的部分即是将显示屏201去除部分屏幕后形成的挖空部分,挖空部分无法显示内容,本申请实施例中,挖空部分可以用于设置前置摄像头。为了美观,显示屏201上挖空部分的边缘一般采用流线型设计,即挖空部分与显示屏的交接处为曲线,如图中虚线框203中所示的部分。显示屏201上的挖空部分可以与屏幕边缘相连,也可以在屏上形成封闭的挖空区域,例如挖空部分可以为孔状。
显示屏201包括许许多多的像素,为了让每一个单独的像素可以显示出各种颜色,可以将像素分解成比像素更低一级的子像素。通常像素都会包括红绿蓝三基色,三基色可以表现不同的亮度,在视觉上就会混合成所需要的颜色。三基色的亮度可以用数值表示,通常用0~255表示,不同数值表示亮度不同,用于表示像素的基色通常可以称为色度分量。在有些像素排列方式中,单个像素可以包括更多或更少的子像素,例如有的单个像素可以只包括上述三基色中的两个颜色的子像素,有的单个像素除了包括上述三种颜色的子像素外,还可以包括白色子像素。屏幕的材质以及子像素的排列方式是影响屏幕显示效果的重要因素。
图2示例性地示出了两种子像素排列方式。例如,显示屏子像素的排列方式可以如区 域204所示的RGB子像素排列,该种排列方式也可以称为标准RGB排列。RGB子像素排列方式可以应用于液晶显示屏(liquid crystal display,LCD),该种排列方式是将一个方块形的像素,平均分成三等份,每一等份即是像素的一个子像素,每一等份赋予不同的颜色,三个子像素是一个整体,即是一个彩色像素,当需要显示不同的颜色的时候,三个子像素可以分别以不同的亮度发光,由于子像素非常小,在视觉上就会混合成所需要的颜色。在标准RGB排列中,每个像素都可以独立显示所需要的颜色,三个子像素的顺序可以是随意的,例如可以是“红绿蓝(R、G、B)”、“蓝绿红(B、G、R)”等。
再如,显示屏子像素的排列方式也可以是如区域204’所示的RGBG子像素排列,该种排列方式也可以称为P排列、钻石像素排列(diamond pentile)。RGBG子像素排列方式可以应用于有机电激光显示屏(organic light-emitting diode,OLED),其单个像素一般只有“红绿(R、G)”或“蓝绿(B、G)”两个子像素点,每个像素需要通过相邻像素的共用子像素来显示内容。
显示屏子像素的排列方式也可以采用其他的方式,例如RGBW子像素排列方式等,在此不再一一列举。仅以上述两种子像素排列方式为例,由于像素排列方式的原因,当在显示屏上形成有曲线边缘时(例如屏幕四角的弧线、屏上挖空部分与屏幕交接处的曲线),在这些地方显示图像时,会不可避免地产生锯断现象(或称之为锯齿现象),从而影响屏幕的显示效果,不够美观。
为了改善显示屏的曲线边缘处在显示图像时产生的锯齿现象,可以通过在原有图层之上叠加圆角图层,并通过控制圆角图层中的像素的透明度来柔化锯齿。下面将结合图3对圆角图层叠加的过程进行描述。
图3示出了本申请实施例的终端设备进行图层叠加的硬件架构示意图。应理解,本申请实施例中的圆角图层可以认为是为解决上述显示屏圆角在显示图像时出现的锯齿现象而额外叠加的图层,圆角图层主要用于显示屏的圆角位置,因此圆角图层可以不是一个完整的与显示屏大小相匹配的图层。显示屏的“圆角”的位置不仅仅包括显示屏的四角区域,还包括在屏上的挖空区域,也就是说只要显示屏在结构上存在曲线的位置都可以认为是显示屏的圆角,另外“圆角”不仅仅包括弧形,还包括其他流线型设计,例如圆形、欧拉螺线型以及其他复杂的曲线等。
图3所示的硬件架构主要包括中央处理器CPU、图像处理器GPU、内存(本申请实施例以双倍速率同步动态随机存储器(double data rate synchronous dynamic random access memory,DDR SDRAM,简称DDR)为例进行说明)、显示子系统(display sub-system,DSS)、显示控制器(display controller)、和面板(panel)等,下面参考图3进行详细描述。图中CPU是系统的中央处理器,在本申请实施例中,CPU可以绘制圆角图层的内容,并将圆角图层的内容存储在DDR中。这里所述的“圆角图层的内容”可以理解为圆角图层的图像数据,例如可以包括圆角图层的像素的颜色数据和透明度(alpha)数据等。
像素的颜色数据用于表征像素显示的颜色,可以包括各个色度分量,例如红色分量(R值)、蓝色分量(B值)、绿色分量(G值)或白色分量(W值)等,各个色度分量可以用数值表示,通常用0~255表示,不同数值的色度分量可以表示不同的亮度,不同数值的各个色度分量可以混合出各种颜色。
像素的透明度数据可以表征像素颜色的透明度,表明多少像素值应当被显示出来,例 如当存在前景色和背景色两个图层叠加时,前景色图层中的像素的透明度可以控制显示屏显示前景色还是背景色,或者前景色和背景色各以多少比例混合以显示新颜色等。像素颜色的透明程度也可以用数值表示,该值可以称为像素的透明度值,通常也可以用0~255表示,例如像素的透明度值小于等于第一透明度阈值时,前景色图层和背景色图层叠加时,人眼无法辨识显示屏显示出来的颜色与背景色的差异(可以认为显示屏不显示前景色),则可以认为像素是透明的,这样的像素也可以称为透明像素;像素的透明度值大于等于第二透明度阈值时,前景色图层和背景色图层叠加时,人眼无法辨识显示屏显示出来的颜色与前景色的差异(可以认为显示屏不显示背景色),则可以认为像素是不透明的,这样的像素本申请实施例称之为不透明像素,透明度值在第一透明度阈值和第二透明度阈值之间可以认为像素是半透明的,即介于透明与不透明之间。
本申请实施例中,CPU绘制的圆角图层的内容可以包括圆角图层中的像素的透明度、圆角图层中的像素的颜色的色度分量等,本申请实施例中以单个像素的色度分量包括R、G、B为例。作为示例而非限定,图4左图中示出了CPU绘制的圆角图层的顶部内容和底部内容,顶部内容可以用于淡化显示屏上部两角处的圆角和上部中间位置的挖空部分的圆角在显示图像时出现的锯齿,底部内容可以用于淡化显示屏下部两角处的圆角在显示图像时出现的锯齿。其中,圆角图层的顶部内容和底部内容可以分别处于两个圆角图层,每个圆角图层的宽度可以和显示屏的宽度匹配,高度可以自由设置或系统预设,例如顶部内容所在的圆角图层可以称之为顶部图层,其高度可以设置为85行;底部内容所在的圆角图层可以称之为底部图层,其高度可以设置为30行。
CPU将圆角图层的内容存储在DDR中时可以采用ARGB8888打包(packed)格式存储,也就是在存储圆角图层内容时,对单个像素来说,像素的透明度值(alpha,以下可以简称A值)占8位比特(8bits)的精度,相当于占用一个字节(1byte)的内存;像素的红色分量(以下可以简称R值)占8位比特(8bits)的精度,相当于占用一个字节(1byte)的内存;像素的蓝色分量(以下可以简称B值)占8位比特(8bits)的精度,相当于占用一个字节(1byte)的内存;像素的绿色分量(以下可以简称G值)占8位比特(8bits)的精度,相当于占用1个字节(1byte)的内存。也就是说在存储过程中,圆角图层中的每个像素占用4个字节的内存(BPP(bytes per pixel)为4),同时包含每个像素的透明度值和颜色数据(色度分量值)。
例如,图3的DDR中的顶层图层0(layer 0)存储的图像数据即为圆角图层的内容,图层0存储的图像数据包括圆角图层中的像素的透明度值和圆角图层中的像素的色度分量值。DDR中可以存储多个图层,每个图层可以存储不同类型的数据,例如文本、表格、插件、或图形等数据。作为示例而非限定,图3中的DDR存储6个图层(layer0~layer5),当然,DDR中还可以存储更多或者更少数量的图层,本申请实施例不做任何限定。
图形处理器GPU可以执行复杂的数学和几何计算,主要负责图像处理,例如GPU也可以执行上述CPU执行的操作,由GPU绘制圆角图层的内容并存储在DDR中,GPU也可以执行图层叠加处理,例如在硬件显示子系统DSS的通道数不够的情况下,可以由GPU将图层进行叠加后再送入DSS中叠加。示例性的,如图3所示,显示子系统DSS包括5个读通道(read channel)(RCH0~RCH4),而DDR存储的图层有6个,图层数大于读通道数,因此可以通过GPU将其中两个图层进行叠加,再将叠加后形成的一个图层写入 DDR中,这时DDR中存储的图层变为5个,再由DSS通过5个读通道分别读取5个图层。
显示子系统DSS是用于负责图像处理的模块,可以通过读通道(如图中的RCH0~RCH4)从DDR中读取各个图层的图像数据,并将各个图层数据按图层分布进行计算,进行叠加(overlay,OV)后生成叠加后的数据,最后传送给面板(即显示屏)显示。显示子系统DSS也可以不对读取到的所有图层进行叠加,可以在读取各个图层的图像数据后,通过开关(switch,SW)控制来选择部分图层进行叠加处理。显示子系统中的显示控制器可以进行显示效果的控制,例如通过指令系统调整施加到像素上的电压、相位、频率、峰值、有效值、时序、或占空比等一系列参数、或特性来建立起一定的驱动条件,使显示变化多端。需要说明的是,显示子系统从内存例如DDR中读取图层的图像数据的带宽为读取带宽。
上文提到,当存在圆角图层时,图层0(layer 0)可以存储圆角图层的内容,作为示例而非限定,在ARGB域,圆角图层的内容可以如图4中的顶部内容和底部内容所示。顶部内容和底部内容所在的圆角图层可以是一个黑色图层,即圆角图层中的每个像素的各个色度分量值均为0(RGB(0,0,0)),而圆角图层中的像素的透明度值可以不同,其中一部分像素的透明度值可以小于等于上述第一透明度阈值,该部分像素即为透明像素,如顶部内容和底部内容中显示为白色的区域中的像素就是透明像素,白色区域的像素不显示像素的颜色,包括透明像素的白色区域可以称为透明区;还有一部分像素的透明度值可以大于等于上述第二透明度阈值,该部分像素即为不透明的,如顶部内容和底部内容中显示为黑色的区域中的像素就是不透明像素,黑色区域的像素显示的是像素的颜色(黑色),包括不透明像素的黑色区域可以称为非透明区(也可称为不透明区)。为了优化显示效果,圆角图层的顶部内容和底部内容中的透明区与非透明区之间并不是直接跳变的(并不是非黑即白),而是在透明区与非透明区之间存在若干个透明度值介于第一透明度阈值和第二透明度阈值之间的像素,也就是说从透明区到非透明区(或从非透明区到透明区)像素的透明度值是逐渐变化的,可参考图5中所示的两条直线之间的灰色区域。
图5示例性的示出了圆角图层中的部分像素,本申请实施例假设第一透明度阈值为0,第二透明度阈值为255,其中图上颜色为黑色的方格可以表示不透明像素,不透明像素的透明度值可以为255,不透明像素所在的区域为不透明区,例如图中线L1的左侧的区域;图上颜色为白色的方格可以表示透明像素,透明像素的透明度值可以为0,透明像素所在的区域为透明区,例如图中线L2的右侧的区域。在不透明区和透明区之间,存在一些灰色的方格,不同程度的灰色表示透明度值不同,灰色方格可以表示过渡区像素,过渡区像素的透明度值为中间值(0到255之间),过渡区像素所在的区域可以称为过渡区,例如线L1和L2之间的区域。像素的透明度值从0到255或从255到0渐变的区域均可以称为过渡区,对于图4中示出圆角图层来说,过渡区位于圆角图层的透明区与不透明区之间。
再例如,本申请实施例假设第一透明度阈值为5,则透明度值小于等于5的像素都可以认为是透明像素,即图中颜色为白色的方格所表示的像素的透明度值不大于5即可;假设第二透明度阈值为250,则透明度值大于等于250的像素都可以认为是不透明像素,即图中颜色为黑色的方格所表示的像素的透明度值不小于250即可;则上述灰色方格所表示的像素的透明度值则介于5~250之间(中间值),该部分像素即过渡区像素,灰色方格所 在的区域即过渡区。
又例如,图5中黑色方格也可以是白色方格,仍假设第一透明度阈值为5,第二透明度阈值为250,也就是说L1的左边区域的像素的透明度值不大于5,L2右边区域的像素的透明度值也不大于5,L1左边的区域和L2右边的区域均为透明区,两个透明区之间的区域的像素的透明度值在5~250之间,该区域中的像素即过渡区像素,过渡区像素所在的区域即为过渡区。
换句话说,在圆角图层中,只要像素的透明度值在第一透明度阈值和第二透明度阈值之间,该像素即为过渡区像素,过渡区像素所在的区域即为过渡区。过渡区可以在透明区和不透明区之间,也可以在两个透明区之间。一般而言,在圆角图层中,过渡区中像素的透明度值是从第一透明度阈值到第二透明度阈值或从第二透明度阈值到第一透明度阈值渐变的。应理解,本申请实施例中的第一透明度阈值和第二透明度阈值的确定可以根据人眼对于不同颜色色差的辨别能力确定。
在叠加圆角图层和其他显示图层时,通过控制圆角图层的像素的透明度值可以控制显示屏在圆角图层的叠加区域最终显示的是圆角图层的黑色还是圆角图层之下的图层的显示内容,并且控制在圆角图层的过渡区的若干个像素的透明度值为中间值,从而可以获得任意形状的平滑过渡。仍参考图4和图5,圆角图层的顶部内容和底部内容中,白色区域表示该区域中的像素的透明度小于等于第一透明度阈值,在和其他显示图层叠加时,显示屏将显示圆角图层之下的图层的内容而不显示圆角图层的黑色内容;黑色区域表示该区域中的像素的透明度大于等于第二透明度阈值,在和其他显示图层叠加时,显示屏将显示圆角图层的黑色内容,而不显示圆角图层之下的图层的显示内容;在白色区域和黑色区域之间存在过渡区(图4中未示出),过渡区内的像素的透明度值为中间值(第一透明度阈值与第二透明度阈值之间的透明度值),在和其他显示图层叠加时,显示屏将显示圆角图层与圆角图层之下的图层进行叠加后的内容,由于该部分像素的透明度值是渐变的,该部分像素的颜色显示程度也是渐变的,透明度值大一些的像素显示的颜色深一些,透明度值小一些的像素显示的颜色浅一些,以图5所示内容为例,过渡区像素的颜色由于透明度值的渐变而显示出从黑色-深灰-浅灰-透明的颜色渐变,可以起到淡化锯齿作用。作为示例而非限定,图4中的右图示出了圆角图层叠加之后的在显示屏上的显示效果,若显示屏上没有挖空部分,则右图中显示的效果即是圆角图层叠加之后的效果,若显示屏上与顶部内容对应的位置上存在挖空部分,由于屏幕在该挖空部分没有像素,实际上并未将圆角图层的黑色区域的显示内容显示完整。
本申请实施例中,采用叠加圆角图层的方法来淡化显示屏圆角显示图像时产生的锯齿时,起到淡化锯齿作用的主要是圆角图层中的像素的透明度值,特别是过渡区的像素的透明度值是渐变的,能够使过渡区的像素的颜色产生渐变的效果,从而使显示屏圆角显示的图像的颜色有渐变的效果,起到淡化锯齿的作用,而圆角图层的颜色可以是黑色的,也可以是其他单一同色。显示子系统DSS在进行图层叠加时需要获取圆角图层中的所有像素的像素值(包括透明度值和颜色),上文提到圆角图层采用ARGB打包格式存取图像数据,因此CPU绘制好圆角图层后,会将圆角图层的所有像素的像素值均存储在内存(如DDR)中,显示子系统DSS读取图层数据时也是通过读通道将圆角图层的所有像素值读取。换句话说,若要存取圆角图层的像素的透明度值,必然同时存取圆角图层的像素的色 度分量,无法灵活地进行圆角图层的像素的透明度信息的单独存取。因此,需要提供一种能够实现圆角图层的像素的透明度信息单独存取的方法。
图6示出了本申请实施例的处理图层的方法,可以进行圆角图层的像素的透明度信息的单独存取,下面结合图6,对本申请实施例进行详细描述。
在步骤S610,显示子系统从内存中的第一存储区读取圆角图层中的目标像素的透明度信息,所述第一存储区专用于存储所述目标像素的透明度信息。
本申请实施例中,锯齿的淡化主要是通过控制圆角图层的像素的透明度值实现的,而圆角图层的颜色可以设置为单一同色,例如圆角图层的所有像素的RGB均为0,其中每个像素的R、G、B值是相同的,或圆角图层的颜色为RGB均相同的其他颜色(例如与设备外壳配色相同),其中每个像素的R、G、B值可以不同,在这种情况下存储圆角图层的图像数据时,由于圆角图层中所有像素的像素值相同,相当于重复存储了像素的颜色信息,例如图7中的(a),即是将圆角图层中的所有像素的A值、R值、G值、B值均存储在内存中,且为了提高读取效率,ARGB采用打包格式存储,每个像素的A值、R值、G值、B值连续存储。本申请实施例中,可以将圆角图层中的目标像素的透明度信息存储在内存中的专用于存储目标像素的透明度信息的第一存储区。
本申请实施例中,内存的第一存储区专用于存储目标像素的透明度信息,而不用于存储目标像素的其他信息,也就是说圆角图层中的目标像素的透明度信息与圆角图层中的目标像素的其他信息例如像素的颜色信息是分开存储,或者说圆角图层中的目标像素的透明度信息相对于圆角图层中的目标像素的其他信息例如像素的颜色信息是独立存储的。换句话说,将圆角图层中的目标像素的透明度信息单独存储在一起,圆角图层中的目标像素的透明度信息与圆角图层中的目标像素的其他信息存储的位置、区域或者空间是分开的、独立的,因此在读取圆角图层的图像数据时,可以分开读取或者单独读取圆角图层中的目标像素的透明度信息和圆角图层中的目标像素的其他信息,无需同时读取到圆角图层中的目标像素的透明度信息和颜色信息等其他信息。
还应理解,本申请实施例中圆角图层中的目标像素的透明度信息在内存中的第一存储区存储时,圆角图层中的目标像素的透明度信息在第一存储区是连续存储的,例如内存中的第一存储区存储了圆角图层中的全部像素的透明度信息,则在内存的某一区域或空间(即第一存储区)上,连续存储了圆角图层中的全部像素的透明度信息,在该区域或空间上,未存储到圆角图层中的像素的其他信息。因此,“从内存中的第一存储区读取圆角图层中的目标像素的透明度信息”可以认为是“从内存中的第一存储区连续读取圆角图层中的目标像素的透明度信息”。本申请实施例中涉及的存储装置可以包括内存和片上存储器,其中片上存储器可以包括高速缓冲存储器(也可以简称高速缓存)、寄存器、或缓存等中的至少一个,与处理器或处理模块集成于一个芯片上。内存则独立于处理器或处理模块所位于的芯片之外。
本申请实施例中的“圆角图层中的目标像素的透明度信息”用于指示圆角图层中的目标像素的透明度值。
将圆角图层中的目标像素的透明度信息存储于内存中的第一存储区可以有多种方式。作为一个示例,可以在内存中只存储圆角图层中的目标像素的透明度信息,内存中用于存储目标像素的透明度信息的区域即为第一存储区。圆角图层中的目标像素的颜色信息可以 在圆角图层绘制完成后存储于片上存储器(例如寄存器、或缓存等)中,或者目标像素的颜色信息配置为预设值或默认值,该预设值或默认值可以是已经存储在非易失性存储器,如flash存储器中的值。该预设值或默认值也可以是预配置在显示子系统中的值,以便显示子系统获取该预设值或默认值。例如,可以在内存中只存储圆角图层中的目标像素的透明度值。
作为示例而非限定,如图7中的(b)所示,图中示意性示出了内存的存储空间,圆角图层中的目标像素的透明度值和色度分量值不再存储在一起,在内存中仅存储了圆角图层的目标像素的透明度值,相应地,显示子系统从内存中读取圆角图层的图像数据时可以单独读取目标像素的透明度值,这样从内存中存取圆角图层中的目标像素透明度值时无需在内存中存取圆角图层中的目标像素的颜色信息,从而能够实现圆角图层中的目标像素的透明度信息的单独存取,相比将目标像素的透明度信息和颜色信息必须同时存取的方式更为灵活。本申请实施例中可以将单独存储圆角图层中的目标像素透明度值的区域(即第一存储区)也可以称为A平面,在本申请实施例中,存储圆角图层的图像数据时,可以只在A平面存储圆角图层中的目标像素的透明度值,无需存储圆角图层中的目标像素的颜色分量(例如R、G、B值等),相比(a)中的存储格式可以减少3/4的内存,同时在内存中存储圆角图层的图像数据时可以只存储目标像素透明度值,从内存中读取圆角图层的图像数据时,可以只读取A平面存储的目标像素的透明度值,分别可以减少3/4的存储带宽和读取带宽,进一步地,圆角图层的读取内容减少,显示子系统的读取带宽减少,从而可以降低功耗。
作为示例而非限定,具体而言,圆角图层中的目标像素的透明度值的存储过程可以如下:将圆角图层中的目标像素中的每个像素的透明度值存储在A平面,其中圆角图层中的目标像素的透明度值在A平面上的存储位置是连续的。应理解,目标像素的透明度值在A平面的存储位置连续可以是逻辑地址连续,和/或物理地址连续。圆角图层中的目标像素的颜色信息可以在圆角图层绘制完成后存储于片上存储器例如寄存器、缓存器、或高速缓存等存储装置中。具体而言,由于圆角图层的颜色可以是单一同色例如黑色,或者是与设备的外观颜色一致的颜色例如蓝色、或金色等,也就是圆角图层中的目标像素的颜色可以是相同的,因而可以在片上存储器中存储目标像素中的一个像素的颜色信息(例如RGB值);若目标像素中每个像素的各个色度分量也相同,那么也可以在片上存储器中存储目标像素中的一个像素的某个色度分量值(例如R值、G值、或B值中的任意一个)。圆角图层中的目标像素的颜色信息还可以是存储于非易失性存储器例如ROM或flash中的预设值或默认值,显示子系统可以直接从该非易失性存储器种读取该预设值或默认值,也可以是在每次设备上电后,由CPU运行计算机程序,将该预设值或默认值从非易失性存储器中配置到寄存器或缓存器里,显示子系统再从寄存器或缓存器中获取该值。圆角图层中的目标像素的颜色信息可以是设备出厂时设定好的,也可以是用户自定义的。系统出厂时,该目标像素的颜色信息即写入非易失性存储器中;用户自定义目标像素的颜色信息时可以通过在输入设备上进行操作例如输出该自定义值,输入设备生成用于指示该自定义值的用户操作信息或指令,CPU执行指令后可以将该用户自定义值存储在非易失性存储器。显示子系统可以在设备上电后自动获得该预设值或默认值,以便后续处理。示例性的,若圆角图层中的像素的颜色均相同,可以使用一个24bits的颜色缓存器来设定圆角图层中的其中 一个像素的色度分量R、G、B值,其中每个色度分量值占用8bits的内存。本申请实施例中,该24bits的颜色缓存器中数据可由CPU绘制完圆角图层后存储,或者由CPU将非易失性存储器中存储的预设值配置。若每个像素的透明度值占用8bits内存,则若内存中仅存储圆角图层中的目标像素的透明度值时,相当于每个像素占用8bits内存,也就是BBP(bytes per pixel)为1,相比采用ARGB8888格式在圆角图层中存储所有像素的图像数据时的BPP为4来说,内存仅需1/4,减少了3/4的内存,同时从内存中读取圆角图层的图像数据时,只需读取圆角图层中的目标像素的透明度值,可以减少3/4的读取带宽,圆角图层的读取内容减少,读取带宽减少,从而可以降低功耗。本申请实施例中,在A平面上存储的目标像素可以是圆角图层中的全部像素或者是圆角图层中的部分像素。
作为另一个示例,可以在内存中均存储圆角图层中的目标像素的透明度信息和圆角图层中的目标像素的颜色信息,其中,目标像素的透明度信息存储于内存中的第一存储区,目标像素的颜色信息存储于内存中的第二存储区,第一存储区和第二存储区相互独立。应理解,第一存储区和第二存储区相互独立可以理解为第一存储区和第二存储区在逻辑空间和/或物理空间上是不同的存储区域,换句话说,圆角图层中的目标像素的透明度信息和圆角图层中的目标像素的颜色信息存储在内存中的不同的存储区域。
存储圆角图层中的目标像素的透明度信息和颜色信息时,将圆角图层中的像素的透明度信息与圆角图层中的像素的颜色信息分开存储。以目标像素的色度分量包括红色分量R值、绿色分量G值和蓝色分量B值为例,例如可以采用透明度值平面与RGB平面(planar)分开格式存储,本申请实施例中可以将单独存储圆角图层中的目标像素的透明度值的区域(即第一存储区)也可以称为A平面,将存储圆角图层中的目标像素的色度分量的区域(即第二存储区)称为RGB平面。作为示例而非限定,如图7中的(c)所示,存储圆角图层的图像数据时,可以在A平面(即第一存储区)存储圆角图层中的目标像素的透明度值,在RGB平面(即第二存储区)存储圆角图层的中的目标像素的颜色分量,即在RGB平面上连续存储目标像素中的每个像素的R值、G值、B值。第二存储区还可以包括多个独立的子存储区,将目标像素的颜色信息中的各个色度分量分别存储于该多个独立的子存储区中,其中各个色度分量与多个独立的子存储区一一对应。作为示例而非限定,如图7中的(d)所示,可以将圆角图层中的目标像素的透明度值、圆角图层中的目标像素的红色分量、蓝色分量、绿色分量分别存储在A平面、R平面、G平面和B平面,其中R平面可以理解为单独存储圆角图层中的目标像素颜色中的红色分量(red)的区域,G平面可以理解为单独存储圆角图层中的目标像素颜色中的绿色分量(green)的区域,B平面可以理解为单独存储圆角图层中的目标像素颜色中的蓝色分量(blue)的区域,其中R平面、G平面和B平面可以理解为第二存储区的不同子存储区。换句话说,可以将圆角图层中的目标像素的颜色信息中的各个色度分量在内存中独立存储或分开存储。本申请实施例中,在内存中存储的圆角图层中的目标像素的透明度值可以是全部或部分像素的透明度值,在内存中存储的圆角图层中的目标像素的色度分量值可以是全部或部分像素的色度分量值。
具体而言,示例性的,若圆角图层的颜色可以改变,在存储圆角图层的图像数据时,除了将圆角图层中的目标像素的透明度值单独存储于内存中的第一存储区之外,还可以将圆角图层中的目标像素的颜色分量例如R值、G值、B值进行单独存储或者存储在一起。例如若圆角图层的颜色为单色(即圆角图层中的所有像素的颜色相同,意味着所有像素的 颜色分量相同),这样就可以只存储其中一个像素的颜色信息,例如RGB值。相比将圆角图层中的目标像素的透明度值存储在内存中而言,将目标像素的一个像素的RGB值存储在内存中所需的带宽可以忽略不计,因而将圆角图层的图像数据存储在内存中所需的带宽与仅将圆角图层的目标像素的透明度值存储在内存中所需的带宽近似相等,相比(a)中的存储格式可以减少3/4的内存,同时在内存中存储圆角图层的图像数据时可以存储目标像素透明度值和一个像素的RGB值,从内存中读取圆角图层的图像数据时,可以只读取A平面存储的圆角图层中的目标像素的透明度值和一个像素的RGB值,分别可以减少约3/4的存储带宽和读取带宽,进一步地,圆角图层的读取内容减少,显示子系统的读取带宽减少,从而可以降低功耗。另外,若圆角图层中的目标像素为单一同色且每个像素的各个色度分量相同,例如RGB(0,0,0),则还可以在内存中的第二存储区仅存储目标像素中的一个像素的某个色度分量,可以进一步地减少圆角图层的存取带宽,降低功耗。若圆角图层的颜色较为复杂(即圆角图层中的像素的颜色不同,意味着像素的颜色分量是不同的),则也可以将圆角图层中的所有像素的颜色信息存储,如图7中(c)或(d)所示,但显示子系统从内存中读取圆角图层的图像数据,仍可以根据需要单独读取各个平面存储的图像数据,无需同时读取所有数据,虽然相比(a)中的存储格式而言内存没有降低,但是可以在显示子系统从内存中读取数据时减少读取带宽,从而可以降低功耗。
作为示例而非限定,本申请实施例中,存储圆角图层的图像数据时,包括但不限于,可以是将圆角图层中的目标像素的A/R/G/B值各存储在一个平面,也就是共四个平面,如图7中(d),也可以是圆角图层中的像素的A/RGB值各存储在一个平面,也就是共二个平面,如图7中(c),当然也可以是其他数量的平面,只要圆角图层中的像素的透明度值独立存储在一个平面(即第一存储区)即可。
应理解,本申请实施例仅以圆角图层中的目标像素的颜色信息包括色度分量为R、G、B为例进行描述,在一些其他实施例中,圆角图层中的目标像素的颜色信息可以包括其他色度分量等,例如可以还包括白色分量(white)W等,但本申请实施例的圆角图层的图像数据存储的方式同样适用。
上述列举的示例中,内存中存储的圆角图层中的目标像素的透明度信息包括圆角图层中的目标像素的透明度值,可选地,上述圆角图层中的目标像素的透明度值也可以替换为圆角图层中的目标像素的透明度值的索引。作为一个示例,可以在内存中仅存储圆角图层中的目标像素的透明度值的索引,且所述索引所占的比特数小于目标像素的透明度值所占的比特数。例如,目标像素可以为圆角图层中的所有像素,换句话说,可以在内存中存储圆角图层中的所有像素的透明度值的索引。
作为示例而非限定,图8示出了一种处理图层的方法的示意图。如图8所示,可以用占用内存为3bits的索引指示占用内存为8bits的像素的透明度值。图8示出了圆角图层中的部分像素,为方便理解,本申请实施例中将第一透明度阈值设为0,第二透明度阈值设为255,图8中白色区域中的像素的透明度值为0,表示的是圆角图层的透明区,黑色区域中的像素的透明度值为255,表示的是圆角图层的不透明区,位于黑色区域和白色区域之间的灰色区域表示的是圆角图层的过渡区,在该过渡区中,像素的透明度值在0~255之间。像素的透明度值可以采用十六进制进行存储,像素的透明度值可以用十进制的数值0~255表示,在存储时,将十进制数值可以转换为十六进制数值进行存储,例如图上颜色 为黑色的像素的透明度值为255,用十六进制可以表示为0xFF,表示像素完全不透明;图上颜色为白色的像素的透明度值为0,用十六进制可以表示为0x00,表示像素完全透明;图上颜色为灰色的像素的透明度值介于0~255之间,不同深度的灰色的像素的透明度值不同,表示像素的透明程度不同,灰色部分的像素就是上文提到的过渡区像素,过渡区像素的透明度值为216,用十六进制可以表示为0xD8。图8中示出了过渡区像素的几种透明度值,以十六进制表示如0xE8、0xD8、0xC8等。图8中右边的表格即圆角图层中的像素的透明度值与透明度值索引的对应关系(或映射关系)的表格。
本申请实施例中,例如在内存中存储圆角图层中的所有像素的透明度值的索引,相应地,显示子系统从内存中读取圆角图层的图像数据时,可以只读取圆角图层中的所有像素的透明度值的索引,再根据像素的透明度值与像素的透明度值的索引的对应关系,获得圆角图层的所有像素的透明度值。相应地,在存储圆角图层中的像素的透明度值索引之前,可以是CPU绘制圆角图层的内容后,先根据像素的透明度值与像素的透明度值的索引的对应关系,将圆角图层中的像素的透明度值转换为透明度值的索引,再存储在内存中。
以图8中示出的圆角图层的部分像素的第二行像素为例,从左到右像素的透明度值依次为0xFF、0xFF、0xFF、0xFF、0xFF、0xD8、0xE8、0xD8、0xC8,在内存中存储时,可以先根据像素的透明度值与像素的透明度值的索引的对应关系,依次在内存中存储111b、111b、111b、111b、111b、010b、011b、010b、001b,该第二行像素的透明度值的索引共计占用27bits内存,相较存储第二行像素的透明度值时的72bits(9bytes)来说,内存仅为存储该第二行像素透明度值的3/8,内存大大减少。相应地,在读取该第二行像素的数据时,读取的是第二行像素的透明度值的索引111b、111b、111b、111b、111b、010b、011b、010b、001b,根据像素的透明度值与像素的透明度值的索引的对应关系,可以获得第二行像素的透明度值依次为0xFF、0xFF、0xFF、0xFF、0xFF、0xD8、0xE8、0xD8、0xC8,读取第二行像素的透明度值的索引的带宽也仅为读取第二行像素透明度值的带宽3/8,因此,通过利用占用内存更小的索引来指示占用内存较大的像素的透明度值,不仅可以实现圆角图层的目标像素的透明度信息的单独存取,而且可以减少圆角图层在内存中的存储量,也就减少了圆角图层存储的内存,同时降低了存储带宽和读取带宽,从而降低功耗。
应理解,本申请实施例中使用多少比特来表达透明度值的索引,可以根据圆角图层中涉及的不同的透明度值数量确定。例如,若圆角图层中共有14个不同的透明度值,则可以选择用4比特来表达透明度值的索引,相比占用8bits内存的像素的透明度值的存储方式来说,内存减少,读取带宽减少,功耗减少。还应理解,本申请实施实施例中的利用占用内存更小的索引来指示占用内存较大的像素的透明度值的方法也可以应用于像素的色度分量的存储中,在此不再详述。又如,目标像素可以包括圆角图层的过渡区的像素,示例性的,目标像素为圆角图层的过渡区像素,换句话说,可以在内存中存储圆角图层中的过渡区像素的透明度值的索引。
仍以图8为例,图上颜色为黑色的像素表示该像素完全不透明,颜色为白色的像素表示该像素完全透明,而介于黑色与白色之间的灰色方格则表示像素介于透明与不透明之间。图上颜色为灰色的像素所在的区域即圆角图层的过渡区,位于过渡区的像素可以称为过渡区像素。在淡化锯齿的实现中,主要是过渡区的像素对锯齿起到柔化效果,因此,在 存储圆角图层的图像数据时,可以仅存储圆角图层过渡区的像素的透明度值的索引,相比上述存储圆角图层中的所有像素的透明度值的索引,可以再进一步地减少内存,降低读取带宽,并进一步地降低功耗。上述示例中,一个索引指示一个像素的透明度值,当然,一个索引也可以指示多个像素的透明度值,示例性的,该多个像素是连续的。
作为示例而非限定,如图9所示,可以用占用内存为2bits的索引指示多个占用内存为8bits的像素的透明度值。图9示出了圆角图层的部分像素,为方便理解,本申请实施例中将第一透明度阈值设为0,第二透明度阈值设为255,图9中白色区域中的像素的透明度值为0,表示的是圆角图层的透明区,黑色区域中的像素的透明度值为255,表示的是圆角图层的不透明区,位于黑色区域和白色区域之间的灰色区域表示的是圆角图层的过渡区,在该过渡区中,像素的透明度值在0~255之间。像素的透明度值可以采用十六进制进行存储,像素的透明度值可以用十进制的数值0~255表示,在存储时,将十进制数值可以转换为十六进制数值进行存储,例如图上颜色为黑色的像素的透明度值为255,用十六进制可以表示为0xFF,表示像素完全不透明;图上颜色为白色的像素的透明度值为0,用十六进制可以表示为0x00,表示像素完全透明;图上颜色为灰色的像素的透明度值介于0~255之间,不同深度的灰色的像素的透明度值不同,表示像素的透明程度不同。图中示出了像素的几种透明度值,以十六进制可以表示如0xE8、0xD8、0xC8等。图上颜色为灰色的像素所在的区域即圆角图层的过渡区,图9中(a)示出了从不透明区过渡到透明区的部分像素,(b)中示出了从透明区过渡到透明区的部分像素。图9中上边的表格即圆角图层中的像素的透明度值与透明度值索引的对应关系(或映射关系)的表格。
本申请实施例中,在内存中存储圆角图层中的过渡区像素的透明度值的索引,相应地,从内存中读取圆角图层的图像数据时,可以只读取圆角图层中的过渡区像素的透明度值的索引,再根据像素的透明度值与像素的透明度值的索引的对应关系,获得圆角图层的过渡区像素的透明度值。相应地,在存储圆角图层中的像素的透明度值索引之前,可以是CPU绘制圆角图层的内容后,先根据像素的透明度值与像素的透明度值的索引的对应关系,将圆角图层中的多个像素的透明度值转换为相应的索引,再存储在内存中。
本申请实施例中,可以用一个索引指示过渡区中的多个连续像素的透明度值,例如一个索引可以指示过渡区中一行或一列的像素的透明度值。以图9中(a)和(b)的第一行像素为例,(a)中过渡区像素的透明度值依次为0xD8、0xE8、0xD8、0xC8,可以用10b指示这四个连续的像素(即图中示出的透明度模式Ⅰ)的透明度值,也就是在内存中存储该过渡区的第一行像素时,在内存中只需存储10b,该过渡区第一行像素的透明度值的索引共计占用2bits,相较存储该过渡区第一行像素的透明度值时的32bits(4bytes)来说,内存仅为存储该过渡区第一行像素透明度值的1/16。相应地,在读取该过渡区第一行像素的数据时,读取的是过渡区第一行像素的透明度值的索引10b,根据像素的透明度值与像素的透明度值的索引的对应关系,可以获得过渡区第一行像素的透明度值依次为0xD8、0xE8、0xD8、0xC8,读取过渡区第一行像素的透明度值的索引的带宽也仅为读取该过渡区第一行像素透明度值的带宽的1/16,因此,通过利用占用内存更小的索引来指示多个占用内存较大的像素的透明度值,不仅可以实现圆角图层的目标像素的透明度信息的单独存取,还可以减少了圆角图层在内存中的存储量,同时降低了读取带宽,从而可以降低功耗。
类似地,(b)中过渡区像素的透明度值依次为0xC8、0xD8、0xE8、0xD8,可以用 01b表达这四个连续的像素(即图中示出的透明度模式Ⅱ),也就是在内存中存储该过渡区的第一行的像素时,在内存中存储01b,该过渡区第一行像素的透明度索引共计占用2bits,相较存储该过渡区第一行像素的透明度值时的32bits(4bytes)来说,内存仅为存储该过渡区第一行像素透明度值的1/16。
本申请实施例用一个索引表达过渡区中的一行或一列的像素的透明度值,相当于使用固定的透明度模式表达圆角图层的过渡区,能够进一步地减少内存,降低功耗。
应理解,图9中示出的过渡区的像素仅仅是示例性的,本申请实施例中,过渡区的每一行像素模式可以均与第一行和第二行过渡区像素模式相同,则过渡区像素中的每一行像素的透明度值都可以用同一个索引来表达;当然,过渡区的每行像素模式可以不完全相同,则每一行像素的透明度值可以分别对应一个索引;本申请实施例中还可以用一个索引指示过渡区中一行或一列像素中的部分连续像素的透明度值;另外,还可以结合图8和图9的方法来存储过渡区的像素的透明度值,即过渡区的部分行或列的像素的透明度值用一个索引来表达,剩下的单独的不同的像素的透明度值可以分别对应一个索引,方法参考上述列举的示例,在此不再一一列举详述。
又如,目标像素可以是圆角图层的所有像素,其中过渡区中的一行或一列像素对应一个索引,透明的像素的透明度值对应一个索引,不透明的像素的透明度值对应一个索引。仍以图9为例,可以用00b代表透明像素的透明度值,用11b代表不透明像素的透明度值,在存储圆角图层的图像数据时,将透明像素的透明度值存储00b,将不透明像素的透明度值存储11b,将由透明区过渡到不透明区的过渡区的像素的透明度值存储01b,将由不透明区过渡到透明区的过渡区的像素的透明度值存储10b。相应地,在读取圆角图层的图像数据时,根据索引与像素的透明度值的对应关系,获得相应的像素的透明度值。应理解,圆角图层的过渡区还可以处于两个透明区之间,用一个索引指示过渡区的多个连续像素的透明度值的方法同样适用,在此不再赘述。本申请实施例中,可以保存圆角图层的所有像素的透明度信息,同时通过像素透明度值索引的存储能够减少圆角图层的存储内存,减少读取带宽,从而降低功耗。
再如,还可以用一个索引指示圆角图层中一片区域的像素的透明度值。例如,在圆角图层的一片区域(例如过渡区)中,像素的透明度值呈有规律的变化,以过渡区为例,例如过渡区第一列的像素的透明度值为0xE8、0xD8、0xC8、0xB8,第二列的像素的透明度值为0xD8、0xC8、0xB8,第三列的像素的透明度值为0xC8、0xB8,第四列的像素的透明度值为0xB8。以索引01b对应0xE8、0xD8、0xC8、0xB8四个像素的透明度值。在存储该四列像素的透明度值时,每一列像素的透明度值均以01b存储,但在读取该四列像素的透明度值时,读取第一列的像素的索引01b,相应地,将第一列的像素的透明度值还原为0xE8、0xD8、0xC8、0xB8,读取第二列的像素的索引01b,相应地,将第二列的像素的透明度值还原为0xD8、0xC8、0xB8,读取第三列的像素的索引01b,相应地,将第三列的像素的透明度值还原为0xC8、0xB8,读取第四列的像素的索引01b,相应地,将第四列的像素的透明度值还原为0xB8,依次循环填充。
又如,可以用一个索引指示圆角图层中一片区域的像素的透明度值,其中该一片区域的像素的透明度值相同,例如,以一个索引00b指示长为60行宽为30行的矩形区域的像素的透明度值,该矩形区域中的像素透明度值均为0。在存储过程中,该区域内的像素的 透明度值可以以00b存储,在读取该矩形区域中的像素的透明度值时,读取的数据为00b,根据该索引与矩形区域的像素的透明度值的对应关系,可以还原该矩形区域的像素的透明度值。
应理解,上文列举的像素的透明度值的表示形式、或索引的表示形式均为示例性的,对本申请实施例不造成任何限定。另外上文列举的像素的透明度值、或色度分量值占用内存的精度也是示例性的,在具体实现中,本申请实施例中的数值的表示形式和索引的表示形式可以根据像素的透明度值、和色度分量值等占用内存的实际精度确定。上述列举了仅在内存中存储圆角图层中的像素的透明度的索引的方式,可选地,上文中提到的在内存中存储圆角图层中的像素的透明度值的各种实现方式同样适用于内存中存储圆角图层中的像素的透明度的索引,具体可参考上文,在此不再一一赘述。
在步骤S620,显示子系统根据所述圆角图层中的目标像素的透明度信息,生成所述圆角图层。可选地,所述圆角图层中的目标像素的透明度信息可以包括圆角图层中的目标像素的透明度值或圆角图层中的目标像素的透明度值的索引。可选地,若仅在内存中的第一存储区存储了圆角图层中的目标像素的透明度信息,显示子系统DSS读取过程中,显示子系统可以从内存中的第一存储区读取到圆角图层中的目标像素的透明度信息,根据目标像素的透明度信息可以还原圆角图层中的目标像素的透明度值。圆角图层中的目标像素的颜色信息若是由CPU绘制圆角图层后存储于片上存储器中,显示子系统DSS读取过程中,显示子系统可以从片上存储器中读取到圆角图层的目标像素的颜色信息;圆角图层中的目标像素的颜色信息若是存储于非易失性存储器中,显示子系统DSS读取过程中,显示子系统可以直接从非易失性存储器中读取该目标像素的颜色信息,或者CPU将非易失性存储器的数据配置到寄存器或缓存器中,显示子系统从寄存器或缓存器中获取该目标像素的颜色信息;圆角图层中的目标像素的颜色信息若是直接配置于显示子系统内,显示子系统可以直接获取。显示子系统根据获取的圆角图层的目标像素的颜色信息可以填充目标像素的颜色,从而生成圆角图层。
可选地,若在内存中的第一存储区存储了圆角图层中的目标像素的透明度信息,在内存中的第二存储区存储了圆角图层中的目标像素的颜色信息,显示子系统DSS读取过程中,显示子系统可以从内存中的第一存储区读取到圆角图层中的目标像素的透明度信息,从内存中的第二存储区读取到圆角图层中的目标像素的颜色信息,其中显示子系统可以分别从第一存储区和第二存储区读取数据。根据从第一存储区中读取的圆角图层中的目标像素的透明度信息还原圆角图层中的目标像素的透明度值,根据从第二存储区中读取的圆角图层中的目标像素的颜色信息还原圆角图层中的目标像素的颜色,从而生成所述圆角图层。
应理解,当在内存中的第一存储区存储的为目标像素的透明度值索引时,显示子系统从第一存储区读取的是目标像素的透明度值索引,显示子系统根据像素的透明度值与像素的透明度值的索引的对应关系,获取目标像素的透明度值。
应理解,本申请实施例中圆角图层的目标像素的透明度信息可以如图6至图9中所描述的方法中提及的存储方式进行存储,圆角图层的目标像素的颜色信息可以如图6至图9中所描述的方法中提及的存储方式进行存储,具体可参考上文,在此不再赘述。
在步骤S630,叠加所述圆角图层和至少一个目标图层以得到待显示图像。目标图层 为除圆角图层之外的其他图层,用于在显示屏上显示该目标图层上的内容,例如图像、文本、或表格等。
需要说明的是本申请实施例中的处理图层的方法可以由硬件实现,也可以由软件实现,也可以由软件和硬件结合实现,本申请实施例不做具体限定。需要说明的是,本申请实施例的处理图层的方法不仅仅限定于处理圆角图层,对于其他图层的处理同样适用。
图10示出了本申请实施例的处理图层的方法的示意性流程图。如图10所示,对圆角图层的处理流程如下。S1010,绘制圆角图层。该步骤可由CPU或GPU执行。示例性的,绘制的圆角图层内容可以如图4中所示的顶部内容和底部内容。步骤S1010可以仅在设备上电以后执行一次,也就是说,CPU或GPU可以仅绘制一次圆角图层,在执行S1030后,在后续的叠加过程中,显示子系统可以直接读取第一次绘制后存储的圆角图层的内容,而无需重新绘制。若本申请实施例中的圆角图层的目标像素的颜色信息存储在非易失性存储器中,在设备上电以后,CPU也可以将目标像素的颜色信息配置在寄存器或缓存器中,以便用于在步骤S1050中对圆角图层进行解码还原。
S1020,该步骤为可选步骤。若CPU或GPU绘制完圆角图层后,将圆角图层中的目标像素的透明度值索引存储在内存中第一存储区,则CPU或GPU对要存储的目标像素的透明度值进行编码,该编码过程即根据目标像素的透明度值、以及像素的透明度值与像素的透明度值的索引的对应关系获取将要存储在第一存储区中的目标像素的透明度值索引。在该步骤中,CPU或GPU可以仅对目标像素的透明度值进行编码,也可以对目标像素的色度分量进行编码。可选地,CPU或GPU对目标像素的透明度值和色度分量编码方式可以参见上文对图8至图9的描述,在此不再赘述。
S1030,CPU或GPU存储圆角图层中的目标像素的透明度信息和颜色信息。应理解,在步骤S1030中的目标像素的透明度信息可以包括目标像素的透明度值,或是步骤S1020中得到的目标像素的透明度值索引。可选地,CPU或GPU可以将目标像素的透明度信息和颜色信息均存储在内存中,其中将目标像素的透明度信息存储在内存中的第一存储区,将目标像素的颜色信息存储在内存中的第二存储区。可选地,CPU或GPU可以将目标像素的透明度信息存储在内存中的第一存储区,将目标像素的颜色信息存储在片上存储器例如寄存器中。目标像素的透明度信息和颜色信息的存储方式可参考上文对图6至图9的相关描述,在此不再赘述。在步骤S1030中,CPU或GPU若仅在内存中的第一存储区保存了目标像素的透明度信息,目标像素的颜色信息可以是存储在非易失性存储器中的预设值或默认值。
S1040,显示子系统将内存中的第一存储区所存储的目标像素的透明度信息读入读通道RCH。可选地,若在步骤S1030中,CPU或GPU将目标像素的颜色信息也存储在内存中,则在该步骤中,显示子系统也可以根据需要从内存中的第二存储区中读取目标像素的颜色信息。
S1050,该步骤为可选步骤。如上所述,若在步骤S1030中,CPU或GPU将圆角图层的目标像素的透明度值和色度分量存储在内存中,在该步骤中显示子系统可以直接获取目标像素的透明度值和色度分量,该步骤可以省略。若在步骤S1020中,CPU或GPU对目标像素的透明度信息和/或颜色信息进行了编码处理,在该步骤中,显示子系统需要对编码的目标像素的透明度信息和/或颜色信息进行解码,以对目标像素的透明度信息解码 为例,显示子系统根据读取的目标像素的透明度值索引、以及像素的透明度值与像素的透明度值的索引的对应关系还原目标像素的透明度值。在该步骤中,若目标像素的颜色信息存储在非易失性存储器中,在进行解码的同时,显示子系统从配置了目标像素的颜色信息的寄存器中获得目标像素的颜色信息,利用目标像素的颜色信息可以对目标像素的颜色进行填充,从而还原圆角图层。在一些实施例中,显示子系统也可以直接从非易失性存储器中获得目标像素的颜色信息。
S1060,显示子系统进行叠加及后处理。显示子系统对圆角图层和至少一个目标图层进行叠加,并进行图像算法处理进行合成以及送显等处理。上文结合图1至图10详细的描述了本申请实施例的方法实施例,下面结合图11和图12,详细描述本申请实施例的装置实施例。应理解,方法实施例的描述与装置实施例的描述相互对应,因此,未详细描述的部分可以参见前面方法实施例。
图11是本申请实施例提供的装置的示意性结构图。图11中的装置1100可以是上文提及的显示子系统,例如可以是图3显示子系统DSS的一个具体的例子。图11所示的装置可以用于实现上文中的由显示子系统执行的方法,具体地,该装置1100可以用于执行图6的方法,并且可以具体实现图7至图9所示的实施例,为避免冗余,不再重复描述。图11所示的装置1100包括读取模块1110、生成模块1120和叠加模块1130。读取模块1110,用于从内存中的第一存储区读取圆角图层中的目标像素的透明度信息,所述第一存储区专用于存储所述目标像素的透明度信息。生成模块1120,用于根据所述圆角图层中的目标像素的透明度信息,生成所述圆角图层。叠加模块1130,用于叠加所述圆角图层和至少一个目标图层以得到待显示图像。可选地,所述圆角图层中的目标像素的透明度信息包括所述目标像素的透明度值的索引,且所述索引所占的比特数小于所述目标像素的透明度值所占的比特数。可选地,所述目标像素包括所述圆角图层的过渡区的像素,所述过渡区为所述圆角图层中的透明度值介于第一透明度阈值和第二透明度阈值之间的像素所在的区域。可选地,所述圆角图层的过渡区的像素包括多个连续像素,所述索引用于指示所述多个连续像素的透明度值。
可选地,生成模块1120具体用于根据所述圆角图层中的目标像素的透明度信息,以及所述目标像素的颜色信息,生成所述圆角图层。可选地,所述目标像素的颜色信息存储于所述内存中的第二存储区,所述第二存储区与所述第一存储区相互独立,读取模块1110还用于从所述第二存储区读取所述目标像素的颜色信息。可选地,所述第二存储区包括多个独立的子存储区,所述目标像素的颜色信息中的各个色度分量存储于所述多个独立的子存储区中,所述各个色度分量与所述多个独立的子存储区一一对应。可选地,所述目标像素的颜色信息存储于片上存储器中,读取模块1110还用于从片上存储器中获取所述目标像素的颜色信息。
图11所示的装置的至少一个模块可以由软件、硬件或软硬件结合来实现。所述软件可以使计算机程序指令,被各类处理器,如CPU执行。所述硬件可以是各类电路,如逻辑电路、算法电路、数字电路、模拟电路、或可编程电路中的一个或多个。因此,显示子系统可以包括硬件电路和必要的软件驱动程序,该驱动程序包括之前提到的计算机程序指令。
在另一个实施例中,显示子系统的功能可以由处理器,例如之前实施例提到的CPU 来实现。图12示出了本申请实施例提供的设备1200的示意性结构图。图12中的设备1200可以是上文提及的设备,例如可以是具有图1的硬件层的终端设备的一个具体例子。图12中的终端设备1200包括:至少一个处理器1210,至少一个网络接口1240或者其他用户接口1230,存储器1220,至少一个通信总线1250。通信总线1250用于实现这些组件之间的连接通信。可选地,该用户接口1230包括显示器(例如,OLED、LCD、CRT、全息成像设备或者投影设备等),键盘或者点击设备(例如,鼠标,轨迹球(trackball),触感板或者触控屏等)。可选地,该网络接口1240可以包括各类有线或无线的收发器。
存储器1220可用于存储软件程序以及模块,并向处理器1210提供指令和数据。存储器1220可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、或至少一个功能所需的应用程序(比如声音播放功能、和图像播放功能等)等;存储数据区可存储根据终端设备1200的使用所创建的数据(比如音频数据、或电话本等)等。此外,存储器1220可以包括只读存储器和随机存取存储器(random access memory,RAM),存储器1220的一部分还还可以包括非易失性存储器(non-volatile memory,NVM),例如至少一个磁盘存储器件(magnetic disk storage)、闪存(flash memory)器件、或其他易失性固态存储器件。
在一些实施方式中,存储器1220存储了如下的元素,可执行模块或者数据结构,或者他们的子集,或者他们的扩展集:操作系统,包含各种系统程序,例如图1所示的框架层、核心库层、和驱动层等,用于实现各种基础业务以及处理基于硬件的任务;应用程序模块,包含各种应用程序,例如图1所示的桌面(launcher)、和媒体播放器(media player)、浏览器(browser)等,用于实现各种应用业务。
在本申请实施例中,通过调用存储器1220存储的程序或指令,处理器1210用于:从内存中的第一存储区读取圆角图层中的目标像素的透明度信息,所述第一存储区专用于存储所述目标像素的透明度信息;根据所述圆角图层中的目标像素的透明度信息,生成所述圆角图层;叠加所述圆角图层和至少一个目标图层以得到待显示图像。通过该方案,处理器1210调用所述程序或指令以实现显示子系统的功能。
该设备1200可以对应(例如,可以配置于或本身即为)图1或图2中描述的终端设备,并且,该设备1200中各模块或单元分别用于执行图5至图10中的方法中设备所执行的各动作或处理过程,这里,为了避免赘述,省略其详细说明。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显 示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (16)

  1. 一种处理图层的方法,其特征在于,包括:
    从内存中的第一存储区读取圆角图层中的目标像素的透明度信息,所述第一存储区专用于存储所述目标像素的透明度信息;
    根据所述圆角图层中的目标像素的透明度信息,生成所述圆角图层;
    叠加所述圆角图层和至少一个目标图层以得到待显示图像。
  2. 根据权利要求1所述的方法,其特征在于,所述圆角图层中的目标像素的透明度信息包括所述目标像素的透明度值的索引,且所述索引所占的比特数小于所述目标像素的透明度值所占的比特数。
  3. 根据权利要求2所述的方法,其特征在于,所述目标像素包括所述圆角图层的过渡区的像素,所述过渡区为所述圆角图层中的透明度值介于第一透明度阈值和第二透明度阈值之间的像素所在的区域。
  4. 根据权利要求3所述的方法,其特征在于,所述圆角图层的过渡区的像素包括多个连续像素,所述索引用于指示所述多个连续像素的透明度值。
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,所述根据所述圆角图层中的目标像素的透明度信息,生成所述圆角图层,包括:
    根据所述圆角图层中的目标像素的透明度信息,以及所述目标像素的颜色信息,生成所述圆角图层。
  6. 根据权利要求5所述的方法,其特征在于,所述目标像素的颜色信息存储于所述内存中的第二存储区,所述第二存储区与所述第一存储区相互独立,所述方法还包括:
    从所述第二存储区读取所述目标像素的颜色信息。
  7. 根据权利要求6所述的方法,其特征在于,所述第二存储区包括多个独立的子存储区,所述目标像素的颜色信息中的各个色度分量分别存储于所述多个独立的子存储区中。
  8. 根据权利要求5所述的方法,其特征在于,所述目标像素的颜色信息存储于片上存储器中,所述方法还包括:
    从片上存储器中获取所述目标像素的颜色信息。
  9. 一种装置,其特征在于,包括:
    读取模块,用于从内存中的第一存储区读取圆角图层中的目标像素的透明度信息,所述第一存储区专用于存储所述目标像素的透明度信息;
    生成模块,用于根据所述圆角图层中的目标像素的透明度信息,生成所述圆角图层;
    叠加模块,用于叠加所述圆角图层和至少一个目标图层以得到待显示图像。
  10. 根据权利要求9所述的装置,其特征在于,所述圆角图层中的目标像素的透明度信息包括所述目标像素的透明度值的索引,且所述索引所占的比特数小于所述目标像素的透明度值所占的比特数。
  11. 根据权利要求10所述的装置,其特征在于,所述目标像素包括所述圆角图层的过渡区的像素,所述过渡区为所述圆角图层中的透明度值介于第一透明度阈值和第二透明 度阈值之间的像素所在的区域。
  12. 根据权利要求11所述的装置,其特征在于,所述圆角图层的过渡区的像素包括多个连续像素,所述索引用于指示所述多个连续像素的透明度值。
  13. 根据权利要求9至12中任一项所述的装置,其特征在于,所述生成模块具体用于根据所述圆角图层中的目标像素的透明度信息,以及所述目标像素的颜色信息,生成所述圆角图层。
  14. 根据权利要求13所述的装置,其特征在于,所述目标像素的颜色信息存储于所述内存中的第二存储区,所述第二存储区与所述第一存储区相互独立,所述读取模块用于从所述第二存储区读取所述目标像素的颜色信息。
  15. 根据权利要求14所述的装置,其特征在于,所述第二存储区包括多个独立的子存储区,所述目标像素的颜色信息中的各个色度分量分别存储于所述多个独立的子存储区中。
  16. 根据权利要求13所述的装置,其特征在于,所述目标像素的颜色信息存储于片上存储器中,所述读取模块用于从片上存储器中获取所述目标像素的颜色信息。
PCT/CN2019/083913 2019-04-23 2019-04-23 处理图层的方法和装置 WO2020215212A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/083913 WO2020215212A1 (zh) 2019-04-23 2019-04-23 处理图层的方法和装置
CN201980006525.7A CN112204619B (zh) 2019-04-23 2019-04-23 处理图层的方法和装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/083913 WO2020215212A1 (zh) 2019-04-23 2019-04-23 处理图层的方法和装置

Publications (1)

Publication Number Publication Date
WO2020215212A1 true WO2020215212A1 (zh) 2020-10-29

Family

ID=72941275

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/083913 WO2020215212A1 (zh) 2019-04-23 2019-04-23 处理图层的方法和装置

Country Status (2)

Country Link
CN (1) CN112204619B (zh)
WO (1) WO2020215212A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113412470B (zh) * 2019-04-23 2023-09-08 华为技术有限公司 处理图层的方法和装置
CN114332324B (zh) * 2021-12-27 2024-10-01 北京字节跳动网络技术有限公司 图像处理方法、装置、设备及介质
CN117632826A (zh) * 2022-08-15 2024-03-01 万有引力(宁波)电子科技有限公司 数据传输方法、装置、系统、设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1664865A (zh) * 2004-02-18 2005-09-07 哈曼贝克自动系统股份有限公司 图像处理器
CN101009786A (zh) * 2006-01-24 2007-08-01 深圳Tcl新技术有限公司 透明度可调节的电视功能界面显示方法
CN102156999A (zh) * 2010-02-11 2011-08-17 腾讯科技(深圳)有限公司 一种用户界面的生成方法和装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1998055965A1 (en) * 1997-06-04 1998-12-10 Oak Technology, Inc. Apparatus and method for optimizing memory usage while processing graphics images
US8878867B2 (en) * 2012-06-11 2014-11-04 Blackberry Limited Transparency information in image or video format not natively supporting transparency
CN106815029B (zh) * 2017-01-24 2019-10-22 南京仁谷系统集成有限公司 一种使用Qt进行二维图层的绘制及事件处理方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1664865A (zh) * 2004-02-18 2005-09-07 哈曼贝克自动系统股份有限公司 图像处理器
CN101009786A (zh) * 2006-01-24 2007-08-01 深圳Tcl新技术有限公司 透明度可调节的电视功能界面显示方法
CN102156999A (zh) * 2010-02-11 2011-08-17 腾讯科技(深圳)有限公司 一种用户界面的生成方法和装置

Also Published As

Publication number Publication date
CN112204619B (zh) 2024-07-30
CN112204619A (zh) 2021-01-08

Similar Documents

Publication Publication Date Title
WO2020215212A1 (zh) 处理图层的方法和装置
CN109166159B (zh) 获取图像的主色调的方法、装置及终端
US10410398B2 (en) Systems and methods for reducing memory bandwidth using low quality tiles
JP2018534607A (ja) プリフェッチを用いた効率的な表示処理
JP2008170988A (ja) グラフィックス・コントローラ、メイン画像とタイル画像から合成画像を生成する方法、およびグラフィクス・コントローラを用いてタイル状背景画像上にメイン画像を合成させる方法
US9883137B2 (en) Updating regions for display based on video decoding mode
WO2019179106A1 (zh) 背光亮度处理方法及系统、背光亮度调节方法、存储介质
WO2020215207A1 (zh) 处理图层的方法和装置
US20150287220A1 (en) Rendering text using anti-aliasing techniques, cached coverage values, and/or reuse of font color values
US11037271B2 (en) Dynamic rendering for foveated rendering
US10565689B1 (en) Dynamic rendering for foveated rendering
US20160307540A1 (en) Linear scaling in a display pipeline
TW201817232A (zh) 影像處理方法及相關裝置
JP2015516584A (ja) 拡張範囲色空間
US11169683B2 (en) System and method for efficient scrolling
US9953591B1 (en) Managing two dimensional structured noise when driving a display with multiple display pipes
US8963946B2 (en) Non-real-time dither using a programmable matrix
US20130063475A1 (en) System and method for text rendering
JP5988404B2 (ja) グラフィックスユニットにおけるアルファチャネル省電力化
US20230237947A1 (en) Display device and method of driving the same
CN115831042B (zh) 图像显示方法和系统、显示驱动装置、存储介质
KR101545292B1 (ko) Osd 생성 장치 및 osd 구현 방법
KR20240122449A (ko) 물리 서브샘플링된 rgb 포맷 서브픽셀 타일 렌더 시스템 및 방법
US20220060708A1 (en) Image-space function transmission
TWI384393B (zh) 顯示動態影像之系統

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19926235

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19926235

Country of ref document: EP

Kind code of ref document: A1