This relates generally to electronic devices, and, more particularly, to electronic devices with displays.
Electronic devices often include displays. For example, an electronic device may have an organic light-emitting diode (OLED) display based on organic light-emitting diode pixels or a liquid crystal display (LCD) based on liquid crystal display pixels. A user interface may be presented on the display. If care is not taken, the user interface may not have a desired aesthetic appearance or rendering and displaying the user interface may consume more processing power than desired.
A method of operating a display may include rendering a layer for the display that includes an element that is encoded with a lightening or darkening effect and compositing the rendered layer with at least one additional layer by applying the lightening or darkening effect to the at least one additional layer based on relative depth between the rendered layer and the at least one additional layer.
An electronic device may include a display and control circuitry configured to render a layer for the display that includes an element that is encoded with a lightening or darkening effect and composite the rendered layer with at least one additional layer by applying the lightening or darkening effect to the at least one additional layer based on relative depth between the rendered layer and the at least one additional layer.
A method of operating a display may include rendering a layer for the display that includes an element. The element may be encoded, using an opacity value for the element and color values for the element, with an effect. The method may further include compositing the rendered layer with at least one additional layer by applying the effect to the at least one additional layer based on relative depth between the rendered layer and the at least one additional layer.
An illustrative electronic device of the type that may be provided with a display is shown in
As shown in
Input-output circuitry in device 10 such as input-output devices 12 may be used to allow data to be supplied to device 10 and to allow data to be provided from device 10 to external devices. Input-output devices 12 may include buttons, joysticks, scrolling wheels, touch pads, keypads, keyboards, microphones, speakers, tone generators, vibrators, sensors, light-emitting diodes and other status indicators, data ports, etc. A user can control the operation of device 10 by supplying commands through input-output devices 12 and may receive status information and other output from device 10 using the output resources of input-output devices 12.
Input-output devices 12 may include one or more displays such as display 14. Display 14 may be a liquid crystal display, an organic light-emitting diode display, a microLED display, or any other desired type of display. Display 14 may be a touch screen display that includes a touch sensor for gathering touch input from a user or display 14 may be insensitive to touch. A touch sensor for display 14 may be based on an array of capacitive touch sensor electrodes, acoustic touch sensor structures, resistive touch components, force-based touch sensor structures, a light-based touch sensor, or other suitable touch sensor arrangements. A touch sensor for display 14 may be formed from electrodes formed on a common display substrate with the pixels of display 14 or may be formed from a separate touch sensor panel that overlaps the pixels of display 14. If desired, display 14 may be insensitive to touch (i.e., the touch sensor may be omitted). Display 14 in electronic device 10 may be a head-up display that can be viewed without requiring users to look away from a typical viewpoint or may be a head-mounted display that is incorporated into a device that is worn on a user's head. If desired, display 14 may also be a holographic display used to display holograms.
Input-output devices 12 may include at least one camera 18. The camera may capture images of the physical environment around electronic device. In some cases, the camera may capture pass-through video that is displayed on display 14 in real time. The pass-through video may simulate the physical environment that would be viewable through display 14 if display 14 was transparent or omitted. In this way, the user may perceive the physical environment (including a portion behind the display) without interruption, even when display 14 is blocking some of the physical environment from view.
Control circuitry 16 may be used to run software on device 10 such as operating system code and applications. During operation of device 10, the software running on control circuitry 16 may display images on display 14.
The user interface presented on display 14 may include multiple overlapping user interface elements if desired. As shown in
To improve the aesthetic appearance of the user interface on display 14, lightening and/or darkening effects may be applied to one or more user interface elements. The lightening and/or darkening effects (sometimes referred to as vibrancy effects) may be used to blend foreground and background colors, which may help foreground content stand out against the background while also hinting at the content residing in the background.
The user interface elements may be composited from back to front using a painter's algorithm. The lightening and/or darkening effects may be applied during this compositing process. Each user interface element on display 14 may be assigned a respective layer. In the example of
During the compositing process, the color of the foreground (e.g., the higher of the two layers) and the background (e.g., the lower of the two layers) may be blended. A lightening or darkening effect may be applied when blending the two layers.
For example, consider the example where a lightening effect is used when compositing window 34 on background 32 in
Consider a pixel that has, in background 32, gray levels of (0.5, 1, 0), where the first value is the red level, the second value is the green level, and the third value is the blue level. The pixel may have, in window 34, gray levels of (0.3, 0.8, 0.2). In other words, D=(0.5, 1, 0) and S=(0.3, 0.8, 0.2). The resulting composite when the formula of
For example, consider the example where a darkening effect is used when compositing window 36 on background 32 in
The formula of
Therefore, the lightening or darkening effect of
The lightening and darkening effects may be cumulative. In other words, as the user interface is composited from back to front, the result of a first composite is used as the background for a subsequent composite. Considering the example of
Continuing the previous example of the pixel in window 34 that is composited with a lightening effect, the resulting gray scale values (R=(0.8, 1, 0.2)) of the first composite may be used as the destination values D for the subsequent composite with user interface element 38.
Continuing the previous example of the pixel in window 36 that is composited with a darkening effect, the resulting gray scale values (R=(0, 0.8, 0)) of the first composite may be used as the destination values D for the subsequent composite with user interface element 40.
The aforementioned examples of applying the darkening and/or lightening effect when compositing user interface elements is merely illustrative. In general, the darkening and/or lightening effects may be used when compositing any elements (e.g., any rendered elements may serve as the foreground and background layers for the compositing process).
The operations of
One example where the background is not static is when the background is a video feed. Specifically, the background of the display may be a video feed (e.g., a pass-through video feed) from camera 18. When the background is a video feed, the operations of
To mitigate processing requirements and power consumption while still applying lightening and/or darkening effects to a rapidly changing background layer, the lightening and/or darkening effects may be encoded in one or more elements that is composited with the background layer. Additional elements (e.g., user interface elements) may optionally be composited with the layer including the one or more elements with the effects to form a single composite (sometimes referred to as a user interface composite) that has the encoded lightening and/or darkening effects. Forming the single composite of user interface elements may be relatively processing intensive. However, these operations only need to be performed when the appearance of one of the user interface elements changes. In other words, this process may be performed relatively infrequently.
The composite of user interface elements may then be composited with a background (e.g., a video feed background) using a source-over compositing technique. When the user interface elements are composited with the video feed background, the previously encoded lightening and/or darkening effects are applied to the video feed background. Compositing the user interface element composite with the video feed may be performed frequently (e.g., every frame of the video feed or every display frame, whichever is a slower frequency) but may have low processing requirements. Using this type of technique therefore allows background-dependent lightening and/or darkening effects to be applied when displaying a user interface over a video feed without requiring excessive processing power or power consumption.
The composite of the user interface elements and the background video feed may use a source-over compositing technique.
An S.a value of 0 corresponds to an opacity of 0 (e.g., the foreground image is entirely transparent). In this case, R.rgb=D.rgb (e.g., when the foreground image is entirely transparent, the composite image matches the background image).
An S.a value of 1 corresponds to an opacity of 1 (e.g., the foreground image is entirely opaque). In this case, R.rgb=S.rgb (e.g., when the foreground image is entirely opaque, the composite image matches the foreground image).
If desired, a premultiplied source-over compositing technique may instead be used.
To encode a lightening effect into a user interface element (that is later applied when the user interface element is composited with the background), the premutliplied source-over blend of
Consider an example where a user interface element has an opacity (S.a) set equal to 0 and gray levels of (0.1, 0.1, 0.1). When the user interface element is composited with the background image, the resulting gray levels are equal to S.rgb+D.rgb (e.g., a blend that results in the gray levels being increased). In this way, using an opacity of 0 with positive, non-zero gray levels in the formula of
To encode a darkening effect into a user interface element (that is later applied when the user interface element is composited with the background), the premutliplied source-over blend of
Consider an example where a user interface element has an opacity (S.a) set equal to 0 and gray levels of (−0.1, −0.1, −0.1). When the user interface element is composited with the background image, the resulting gray levels are equal to S.rgb+D.rgb (e.g., an additive blend that results in the gray levels being decreased due to the negative gray levels). In this way, using an opacity of 0 with negative, non-zero gray levels in the formula of
The user interface elements encoded with lightening or darkening effects may be, for example, included in the back-most layer of the user interface. Next, during the operations of block 904, the one or more user interface elements may be composited from back to front to create a user interface composite. The lightening formula of
If desired, one layer may be rendered during the operations of block 902. At least one element in the rendered layer may have an encoded lightening and/or darkening effect.
During the operations of block 906, the control circuitry may composite the user interface composite (from block 904) with at least one additional layer (e.g., a background layer). The compositing operations of block 906 may be performed based on relative depth between the rendered layer and the at least one additional layer. In particular, the control circuitry may use the premultiplied source-over composite formula from
In the aforementioned example where one layer is rendered during the operations of block 902, the rendered layer from block 902 may be composited with at least one additional layer during the operations of block 906. The compositing operations of block 906 may be performed based on relative depth between the rendered layer and the at least one additional layer. In particular, the control circuitry may use the premultiplied source-over composite formula from
Finally, during the operations of block 908, the composite from block 906 may be displayed (e.g., on display 14).
The operations of blocks 902 and 904 may be performed every time the user interface changes in appearance (e.g., in response to user input using one or more input-output devices 12). This may be irregular and relatively infrequent (e.g., one second may pass between consecutive changes, ten seconds may pass between consecutive changes, etc.). The operations of blocks 906 and 908 may be performed repeatedly and more frequently. For example, when the background layer is a video feed, the operations of blocks 906 and 908 may be performed for every frame of the video feed and/or every frame of the display. The operations of block 906 and 908 may be performed at a frequency that is equal to the lower of the frame rate for the display and the frame rate for the video feed. In an example where the frame rate of the display is higher than the frame rate of the video feed, the operations of blocks 906 and 908 are performed at a frequency that is equal to the frame rate of the video feed. In an example where the frame rate of the display is lower than the frame rate of the video feed, the operations of blocks 906 and 908 are performed at a frequency that is equal to the frame rate of the display.
The operations of blocks 906 and 908 may be performed at a frequency that is greater than 1 Hz, greater than 20 Hz, greater than 50 Hz, greater than 100 Hz, etc. The operations of blocks 902 and 904 may be performed irregularly, but generally less frequently than the operations of blocks 906 and 908.
The operations of blocks 902 and 904 are therefore processing-heavy but relatively infrequent whereas the operations of blocks 906 and 908 are frequent but relatively light on processing requirements. This type of scheme for displaying a user interface therefore allows for lightening and darkening effects to be applied to a background without consuming excessive amounts of power and processing resources.
The example herein of representing gray levels between 0 and 1 is merely illustrative. In general, the gray levels may be represented using other desired schemes (e.g., 0 to 255). Additionally, it is noted that the gray levels may be stored in an extended range pixel format (e.g., with 10 bits per channel). Using this type of format, the gray levels may have a possible range of −0.5 to 1.6 (as an example). In other words, using the extended range pixel format may allow the storing of negative gray levels (which is used to encode darkening effects as previously discussed).
Although the method of
The foregoing is merely illustrative and various modifications can be made by those skilled in the art without departing from the scope and spirit of the described embodiments. The foregoing embodiments may be implemented individually or in any combination.
This application claims priority to U.S. provisional patent application No. 63/409,092, filed Sep. 22, 2022, which is hereby incorporated by reference herein in its entirety.
Number | Date | Country | |
---|---|---|---|
63409092 | Sep 2022 | US |