Display control method applied to ink screen and related device
1. A display control method applied to an ink screen is characterized by comprising the following steps:
for an ink screen background object, processing the color of the background object into a desired color suitable for an ink screen in a drawing function of a system layer;
displaying the background object based on the desired color.
2. The method of claim 1, wherein the desired color is white, and wherein processing the color of the background object into the desired color suitable for an ink screen in a rendering function of a system layer comprises:
acquiring the color value of each pixel point of the background object through member variables from the drawing method of the color drawing function class; searching pixel points in a target color range from the member variables, and replacing the colors of the pixel points with white;
alternatively, the first and second electrodes may be,
updating, for the background object, a color value of a render object of the background object to white.
3. The method according to claim 1 or 2, characterized in that the method further comprises
Updating the color value of a drawing object of a character object to be drawn to black aiming at the character object to be drawn;
rendering the textual object to black in the background object.
4. The method of claim 2, wherein updating the color value of the rendered object of the background object to white comprises:
and performing color transformation on the initial background color of the background object by adopting a color value matrix and the drawing object of the background object, and transforming the initial background color into white.
5. The method according to claim 4, wherein the color-transforming an initial background color of the background object using the matrix of color values and the drawing object of the background object to transform the initial background color into white comprises:
replacing the color filter class in the drawing object of the background object by the color value matrix class corresponding to the color value matrix;
and calling the color value matrix class, and performing multiplication operation by adopting the color value matrix and the background color matrix of the initial background color to obtain a white background object.
6. The method of claim 3, wherein before the updating the color value of the rendered object of the text object to black, the method further comprises:
and determining the color value of the text object as a color value.
7. The method of claim 6, wherein the text object is rendered in the background object if the color value of the text object is a black value.
8. The method of claim 1, wherein before the updating the color value of the rendered object of the background object to white, the method further comprises:
it is determined that the contrast enhancement function is enabled.
9. The method of claim 8, further comprising:
and responding to the operation of the contrast enhancement function by the user, and switching on or switching off the contrast enhancement function.
10. A terminal device, comprising:
an ink screen;
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the display control method applied to the ink screen according to any one of claims 1 to 9.
Background
The applications in the terminal equipment are mostly designed for color screen display. The interface of the application mostly displays color content. And the ink screen is displayed in both black and white colors.
Therefore, if the application interfaces of a plurality of terminal devices are directly displayed on the ink screen, the display effect is poor. However, the audience of the ink screen is small, and the ink screen is adapted by few applications, so that how to provide a universal display control method suitable for the ink screen is particularly important.
Disclosure of Invention
The application aims to provide a display control method and a related device applied to an ink screen, so as to solve the problem that the display effect is poor if application interfaces of a plurality of terminal devices in the related art are directly displayed on the ink screen.
In a first aspect, the present application provides a display control method applied to an ink screen, the method including:
for an ink screen background object, processing the color of the background object into a desired color suitable for an ink screen in a drawing function of a system layer;
displaying the background object based on the desired color.
Optionally, the processing, in the system layer drawing function, the color of the background object to a desired color suitable for an ink screen includes:
acquiring the color value of each pixel point of the background object through member variables from the drawing method of the color drawing function class; searching pixel points in a target color range from the member variables, and replacing the colors of the pixel points with white;
alternatively, the first and second electrodes may be,
updating, for the background object, a color value of a render object of the background object to white.
Optionally, the target color range includes a color value whose mean value is greater than the first specified value, and color values of the respective color components are less than the second specified value.
Optionally, the method further includes:
updating the color value of a drawing object of a character object to be drawn to black aiming at the character object to be drawn;
rendering the textual object to black in the background object.
Optionally, updating the color value of the drawing object of the background object to be white includes:
and performing color transformation on the initial background color of the background object by adopting a color value matrix and the drawing object of the background object, and transforming the initial background color into white.
Optionally, the performing, by using the color value matrix and the drawing object of the background object, color transformation on an initial background color of the background object, and transforming the initial background color into white includes:
replacing the color filter class in the drawing object of the background object by the color value matrix class corresponding to the color value matrix;
and calling the color value matrix class, and performing multiplication operation by adopting the color value matrix and the background color matrix of the initial background color to obtain a white background object.
Optionally, before the color value of the rendered object of the text object is updated to black, the method further includes:
and determining the color value of the text object as a color value.
Optionally, if the color value of the text object is a black value, rendering the text object in the background object.
Optionally, before the updating the color value of the drawing object of the background object to white, the method further includes:
it is determined that the contrast enhancement function is enabled.
Optionally, the method further includes:
and responding to the operation of the contrast enhancement function by the user, and switching on or switching off the contrast enhancement function.
In a second aspect, the present application provides an electronic device comprising:
an ink screen;
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the display control method applied to the ink screen according to any one of the first aspect.
In a third aspect, the present application also provides a computer storage medium having a computer program stored thereon, which when executed by a processing unit, performs the steps of the method of any of the first aspects.
In a fourth aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the method of any of the first aspects.
In addition, for technical effects brought by any one implementation manner of the second aspect to the fourth aspect, reference may be made to technical effects brought by different implementation manners of the first aspect, and details are not described here.
The color of the background object can be adjusted by modifying the drawing function of the system layer of the terminal device, and the color of the background object can be modified without independently adapting each application because the function of the system layer is effective to any application, so that the display effect of the application interface on an ink screen is improved.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments of the present application will be briefly described below, and it is obvious that the drawings described below are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a terminal device according to an embodiment of the present application;
FIG. 2 is a diagram of a software architecture of a terminal device according to one embodiment of the present application;
FIG. 3 is a flowchart illustrating a display control method applied to an ink screen according to an embodiment of the present application;
FIGS. 4 a-4 b are schematic diagrams of interfaces provided according to embodiments of the present application;
FIG. 5 is a flowchart illustrating a display control method applied to an ink screen according to an embodiment of the present application;
FIG. 6 is a schematic flow chart of a display control method applied to an ink screen according to an embodiment of the present application;
FIG. 7 is a schematic flow chart of a display control method applied to an ink screen according to an embodiment of the present application;
FIG. 8 is a graph comparing effects of a display control method applied to an ink screen according to an embodiment of the present application;
FIG. 9 is a schematic flow chart of a display control method applied to an ink screen according to an embodiment of the present application;
FIG. 10 is a diagram illustrating another comparison of effects of a display control method applied to an ink screen according to an embodiment of the present application;
FIG. 11 is a comparison diagram illustrating still another effect of the display control method applied to an ink screen according to an embodiment of the present application;
fig. 12 schematically illustrates another schematic diagram of a terminal device structure provided in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. The embodiments described are some, but not all embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Also, in the description of the embodiments of the present application, "/" indicates or means, for example, a/B may indicate a or B; "and/or" in the text is only an association relationship describing an associated object, and means that three relationships may exist, for example, a and/or B may mean: three cases of a alone, a and B both, and B alone exist, and in addition, "a plurality" means two or more than two in the description of the embodiments of the present application.
The terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first," "second," or "second" may explicitly or implicitly include one or more of that feature, and in the description of embodiments of the application, "a plurality" means two or more unless otherwise indicated.
The ink screen is displayed and presented by black and white. The ink screen is well suited for reading text. However, in the related art, the application development of the terminal device is mainly based on color screen display, and such an application has poor display effect if displayed directly on an ink screen. Moreover, there are few applications that can be adapted to the ink screen display, and thus a general method for improving the display effect of the ink screen for color interface applications is needed.
In view of this, the color of the background object is adjusted by modifying the rendering function of the system layer of the terminal device, and since the rendering function of the system layer is effective for any application, the color of the background object can be modified without individually adapting each application, so as to improve the display effect of the application interface on the ink screen.
The drawing function of the system layer comprises a drawing class realization function and a system canvas function. The method comprises the steps of obtaining a background object, and obtaining a system canvas function of the terminal device, wherein the system canvas function is used for modifying the color of the background object.
In addition, in the embodiment of the application, the characters can be adjusted to be black, so that the black characters are displayed on a white background, and the character page can be well displayed by using an ink screen. In addition, the method improves the display effect of the application on the ink screen by modifying the system bottom layer, can be suitable for all applications of the terminal equipment, and does not need each application to adapt to the ink screen.
The following describes a display control method applied to an ink screen according to the present application with reference to the accompanying drawings.
First, fig. 1 shows a schematic configuration diagram of a terminal device 100.
The following specifically describes the embodiment by taking the terminal device 100 as an example. It should be understood that the terminal device 100 shown in fig. 1 is only an example, and the terminal device 100 may have more or less components than those shown in fig. 1, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
A block diagram of a hardware configuration of a terminal device 100 according to an exemplary embodiment is exemplarily shown in fig. 1. As shown in fig. 1, the terminal device 100 includes: a Radio Frequency (RF) circuit 110, a memory 120, a display unit 130, a camera 140, a sensor 150, an audio circuit 160, a Wireless Fidelity (Wi-Fi) module 170, a processor 180, a bluetooth module 181, and a power supply 190.
The RF circuit 110 may be used for receiving and transmitting signals during information transmission and reception or during a call, and may receive downlink data of a base station and then send the downlink data to the processor 180 for processing; the uplink data may be transmitted to the base station. Typically, the RF circuitry includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.
The memory 120 may be used to store software programs and data. The processor 180 performs various functions of the terminal device 100 and data processing by executing software programs or data stored in the memory 120. The memory 120 may include high speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. The memory 120 stores an operating system that enables the terminal device 100 to operate. The memory 120 may store an operating system and various application programs, and may also store program codes for performing the methods described in the embodiments of the present application.
The display unit 130 may be used to receive input numeric or character information and generate signal input related to user settings and function control of the terminal device 100, and particularly, the display unit 130 may include a touch screen 131 disposed on the front surface of the terminal device 100 and may collect touch operations of a user thereon or nearby, such as clicking a button, dragging a scroll box, and the like.
The display unit 130 may also be used to display a Graphical User Interface (GUI) of information input by or provided to the user and various menus of the terminal apparatus 100. Specifically, the display unit 130 may include a display screen 132 disposed on the front surface of the terminal device 100. The display screen 132 may be configured in the form of a liquid crystal display, a light emitting diode, or the like. The display unit 130 may be configured to display a font color configuration interface in the present application, so as to implement uniform configuration of font colors of multiple/all applications.
The touch screen 131 may cover the display screen 132, or the touch screen 131 and the display screen 132 may be integrated to implement the input and output functions of the terminal device 100, and after the integration, the touch screen may be referred to as a touch display screen for short. In the present application, the display unit 130 may display the application programs and the corresponding operation steps.
The camera 140 may be used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing elements convert the light signals into electrical signals which are then passed to the processor 180 for conversion into digital image signals.
The terminal device 100 may further comprise at least one sensor 150, such as an acceleration sensor 151, a distance sensor 152, a fingerprint sensor 153, a temperature sensor 154. The terminal device 100 may also be configured with other sensors such as a gyroscope, barometer, hygrometer, thermometer, infrared sensor, light sensor, motion sensor, and the like.
The audio circuitry 160, speaker 161, microphone 162 may provide an audio interface between the user and the terminal device 100. The audio circuit 160 may transmit the electrical signal converted from the received audio data to the speaker 161, and convert the electrical signal into a sound signal for output by the speaker 161. The terminal device 100 may also be provided with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 162 converts the collected sound signal into an electrical signal, converts the electrical signal into audio data after being received by the audio circuit 160, and outputs the audio data to the RF circuit 110 to be transmitted to, for example, another terminal device, or outputs the audio data to the memory 120 for further processing. In this application, the microphone 162 may capture the voice of the user.
Wi-Fi belongs to a short-distance wireless transmission technology, and the terminal device 100 can help a user to send and receive e-mails, browse webpages, access streaming media and the like through the Wi-Fi module 170, and provides wireless broadband internet access for the user.
The processor 180 is a control center of the terminal device 100, connects various parts of the entire terminal device using various interfaces and lines, and performs various functions of the terminal device 100 and processes data by running or executing software programs stored in the memory 120 and calling data stored in the memory 120. In some embodiments, processor 180 may include one or more processing units; the processor 180 may also integrate an application processor, which mainly handles operating systems, user interfaces, applications, etc., and a baseband processor, which mainly handles wireless communications. It will be appreciated that the baseband processor described above may not be integrated into the processor 180. In the present application, the processor 180 may run an operating system, an application program, a user interface display, a touch response, and the display control method of the ink screen according to the embodiment of the present application. Further, the processor 180 is coupled with the display unit 130.
And the bluetooth module 181 is configured to perform information interaction with other bluetooth devices having a bluetooth module through a bluetooth protocol. For example, the terminal device 100 may establish a bluetooth connection with a wearable electronic device (e.g., a smart watch) having a bluetooth module via the bluetooth module 181, so as to perform data interaction.
The terminal device 100 also includes a power supply 190 (such as a battery) for powering the various components. The power supply may be logically connected to the processor 180 through a power management system to manage charging, discharging, power consumption, etc. through the power management system. The terminal device 100 may further be configured with a power button for powering on and off the terminal device, and locking the screen.
Fig. 2 is a block diagram of a software configuration of the terminal device 100 according to the embodiment of the present application.
The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system may be divided into four layers, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer, from top to bottom, respectively.
The application layer may include a series of application packages.
As shown in fig. 2, the application package may include applications such as e-readers, cameras, galleries, calendars, calls, maps, navigation, WLAN, bluetooth, music, video, short messages, etc.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2, the application framework layers may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, dialed and answered calls, browsing history and bookmarks, phone books, short messages, etc.
The view system includes visual controls such as controls to display a photograph, controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including an application for capturing images may include a view displaying text and a view displaying pictures.
The phone manager is used to provide the communication function of the terminal device 100. Such as management of call status (including on, off, etc.).
The resource manager provides various resources, such as localized strings, icons, pictures, layout files, video files, etc., to the application.
The notification manager allows the application to display notification information (e.g., message digest of short message, message content) in the status bar, can be used to convey notification-type messages, and can automatically disappear after a short dwell without user interaction. Such as a notification manager used to inform download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, text information is prompted in the status bar, a prompt tone is given, the terminal device vibrates, an indicator light flickers, and the like.
The Android Runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), Media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), and the like.
The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
A 2D (an animation mode) graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The terminal device 100 in the embodiment of the present application may be a mobile phone, a tablet computer, a wearable device, a notebook computer, a television, and other terminal devices that employ an ink screen.
In order to improve the display effect of the color screen applied to the ink screen, the embodiment of the application provides a solution.
For ease of understanding, the key terms of the present application will first be described:
the background object refers to the background of the application interface, and can be a solid background or an image background.
The rendering object of the background object, namely the Canvas rendering object, is a basic class for display in the system of the terminal device, and is used for creating a Canvas for display.
And the character object refers to characters required to be displayed in the application interface.
The rendering object of the text object, i.e. the Paint object, is a basic class for controlling the display color in the system of the terminal device. The Paint object is equivalent to a paintbrush, the Paint object has color attributes, each text object corresponds to the Paint object, and the color of the text object is defined through the color attributes in the Paint object. The background object also has a Paint object, and the color of the background object is adjusted through a color transformation class ColorFilter in the Paint object.
The drawing function of the system layer refers to a method that the system of the terminal device has for displaying the corresponding content, for drawing the corresponding content. Such as the drawing method draw in colordraw (drawing class), and further, for example, the system canvas function. Wherein, colordraw class is a relatively basic and commonly used color setting component in Android applications. The position is as follows: frame/base/graphics/java/android/graphics/dram/colorable. The system canvas function is like the BaseCarvas class. The BaseCarvas is a base class of an Android drawing system, rendering of all application interfaces is processed through Canvas, and the positions of the Canvas are as follows:
/frameworks/base/graphics/java/android/graphics/BaseCanvas.java。
based on the drawing function of the system layer, the display control method applied to the ink screen provided in the present application is shown in fig. 3, and includes the following steps:
in step 301, for an ink screen background object, processing the color of the background object into a desired color suitable for an ink screen in a drawing function of a system layer;
in step 302, the background object is displayed based on the desired color.
Therefore, the interface content of each application needs to be displayed on the ink screen based on the drawing function of the system layer, so that the application can adapt to all applications by processing the color of the background object in the drawing function of the system layer, different processing methods for the color screen or the ink screen do not need to be independently developed for each application, the interface of the application originally developed by referring to the color screen can be adapted to the ink screen, and the display effect of the application in the ink screen is improved.
The following description will be made with respect to two methods, i.e., a color rendering function class and a system canvas function, respectively.
Method for improving display effect of ink screen based on function of system canvas
The display control method applied to the ink screen provided by the embodiment of the application changes the drawing function of a system layer of the terminal equipment. E.g., modify the baseclasses. The BaseCarvas class is a base class of an Android drawing system, and rendering of all application interfaces can be processed through Canvas drawing objects. The location address of the BaseCavas class is, for example:
/frameworks/base/graphics/java/android/graphics/BaseCanvas.java。
in implementation, the display effect of the ink screen on the color screen application can be enhanced based on the BaseCarvas class in the position address. The modifications may include the following:
1. the contrast enhancement function is added:
in order to improve the flexibility of use, system attributes can be added in the embodiment of the application for a user to confirm whether to display by adopting the scheme provided by the embodiment of the application.
For example, as shown in fig. 4a, a text contrast enhancement function (hereinafter also referred to as ink _ mode) may be added to the setup function of the system. The contrast enhancement function can be turned on or off by a switch control button next to the function.
Furthermore, as shown in FIG. 4a, the contrast enhancement function operator interface shown in FIG. 4b may also be accessed by selecting the contrast enhancement function.
In the operation page, only the character object can be selected to be effective, and then only the character object is processed into black in the subsequent display processing, so that special processing can not be carried out on the background object. Similarly, one may choose to only work on the background object, and then only bleach the background object to a desired color, such as white, without processing the text object. In addition, effective applications can be set, for example, the embodiment of the application has a good effect on electronic reading interfaces and news interfaces, and a user can select to enable the contrast enhancement function only for the applications. During selection, the folder can contain a plurality of application icons to manage one type of application, so that the selection of the folder for the plurality of applications can be realized, and the applications can be selected one by one. Of course, it is also possible to select both folders and applications. When a folder is selected, it means that the contrast enhancement function is enabled for all applications in the folder. When an application is selected, it means that the contrast enhancement function is enabled for each selected application.
Of course, it should be noted that, in addition to application control of the contrast enhancement function, which may be added to the setting function of the system, the contrast enhancement function may also be installed in the terminal device as a single application, and the application is applicable to the embodiment of the present application.
2. Processing of the character object:
in the text rendering method (e.g., drawText, etc.), it can be determined whether the contrast enhancement function is turned on. If the Color of the Paint object of the character object is started, the Color of the Paint object of the character object is updated to be black, otherwise, a default flow is executed, namely, the Color is displayed according to the original Color of the character object, for example, the original Color is black, white or gray, the Color is displayed according to the original Color, and if the original Color is Color, the Color is mapped to the gray Color of the ink screen corresponding to the Color for display.
Of course, if the user is set to not validate the text object based on fig. 4b, then the Color of the Paint object of the text object will not be updated to black when the text object is processed subsequently, and a default flow will be executed.
3. Processing of background objects:
in the background rendering method (e.g., drawRect, drawPatch, etc.), it is determined whether the contrast enhancement function is turned on. If the color value matrix is started, a color value matrix (constructed by using color value matrix classes such as ColorMatrix) can be constructed to cover the ColorFilter of the Paint object. The original value is fused through the color values provided in the matrix, so that the aim of bleaching the background color is fulfilled.
For example, replacing the ColorFilter class of the Paint object with the ColorMatrix class and then calling the ColorFilter class is equivalent to implementing calling of the ColorMatrix class so as to perform color transformation by using the color value matrix.
For example, drawRect provides an API (Application Programming Interface) for the android system to draw rectangular areas. In the embodiment of the application, the color of the rectangular area can be modified, that is, the color value of the Paint object in the rectangular area is modified to be white. For example, replacing the ColorFilter in the Paint object with the ColorFiIter class realizes color fusion of the color value matrix and the background object, so that the background object is changed into white. For example, when the application interface is displayed on a color screen, and the color of the rectangular region is red, the color of the rectangular region may be updated to white in the application, so as to achieve the purpose of bleaching the background color of the rectangular region.
For another example, drawPatch provides another API for the android system to call the picture resource to draw the background picture. In the embodiment of the present application, the called object may be modified, for example, when the method is applied to color screen display, a color image adopted in a background area may be defined as white to a color value of a Paint object of the background object in the present application, so as to achieve the purpose of bleaching the background color. For example, the ColorFilter class is used to replace the ColorFilter in the Paint object, so that color fusion between the color value matrix and the background object, i.e., the picture resource, is realized, and the background object is changed into white.
In one possible embodiment, the matrix of color values is as follows:
[2f,2f,2f,0,0]
[2f,2f,2f,0,0]
[2f,2f,2f,0,0]
f in the matrix of color values represents a floating point number, the preceding value of which may range from-1 to 2. Of course, it should be noted that the color value matrix may be designed according to the actual scene requirement, and this is not limited in this application.
The color matrix of each point of the background object of the application interface can be a 4 multiplied by 5 digital matrix used for processing the color of the picture. For each pixel point, there is a background color matrix to store the RGBA (red, green, blue, Alpha, red, green, blue, transparency) values of the colors. An example background color matrix is as follows:
[a,b,c,d,e]
[f,g,h,i,g]
[k,l,m,n,o]
[p,q,r,s,t]
each character in the background color matrix represents a number, and the numbers represented by different characters can be the same or different and are determined according to the color values of the pixel points. Wherein [ a, B, c, d, e ] of the first row is used to determine R in the color values, [ f, G, h, i, G ] of the second row is used to determine G in the color values, [ k, l, m, n, o ] of the third row is used to determine B in the color values, and [ p, q, R, s, t ] of the fourth row is used to determine A in the color values. The value in the fifth column of the matrix is used to determine the offset in each component, respectively.
When the color value matrix is adopted to fuse the background color of the background object, the matrix operation, namely multiplication operation, between the color value matrix and the background color matrix is adopted to realize the bleaching of the background object. The operation process is shown in formula 1.
In the formula (1), the first and second groups,is a matrix of the background color,is a matrix of color values and is,is the final calculation result, i.e. the final displayed color.
After the system level modification of the present application is introduced, a flow of a color control method of an ink screen in the present application is described below, and an example of bleaching a background object and updating a text object to black is described below, as shown in fig. 5, the method includes the following steps:
in step 501, for a background object, a color value of a rendering object of the background object is updated to white.
In one embodiment, as described above, the initial background color of the background object may be color-transformed into white using the color value matrix and the drawing object of the background object. The color value matrix can realize color transformation of the background color so as to bleach the background color and improve the display effect of the ink-wash screen on the character objects in the color interface.
Of course, in implementation, only the background object may be color-processed, so that the contrast between the text object in the foreground and the background object can be enhanced. Of course, to further improve contrast, the textual objects may also be processed. For example, in step 502, for a text object to be rendered, the color value of the rendering object of the text object is updated to black.
In some embodiments, before step 502 is performed, it may be determined whether the color value of the text object is a color value, i.e., a color other than black. If so, step 502 is performed to update the color of the text object to be black, otherwise, step 502 may not be performed, and the text object is rendered in the background object.
It should be noted that the execution order of step 501 and step 502 is not limited, that is, step 501 may be executed first and then step 502 is executed, or step 502 may be executed first and then step 501 is executed.
In step 503, the text object is rendered to black in the background object.
Therefore, in the embodiment of the application, the color value of the background object is updated to be white through the drawing object of the system layer, the color of the character object is updated to be black, the display effect that the background color is white and the characters are black is realized, and the contrast of the ink-wash screen on the displayed character content can be enhanced.
In implementation, as shown in fig. 6, an overall flowchart of the display control method for an ink-water screen provided in the embodiment of the present application is schematically illustrated, and the method includes the following steps:
in step 601, the contrast enhancement function is turned on or off in response to a user operation on the contrast enhancement function.
In step 602, if it is determined that the contrast enhancement function is enabled, for a background object of the text object, replacing a color filter class in a rendered object of the background object with a color value matrix class corresponding to the color value matrix, calling the color value matrix class, and performing multiplication operation with the color value matrix and a background color matrix of the initial background color to obtain a white background object.
In step 603, if it is determined that the contrast enhancement function is enabled, for the text object to be drawn, the color value of the drawn object of the text object is updated to black.
It should be noted that the execution order of step 602 and step 603 is also not limited.
In step 604, the text object is rendered black in the background object.
Next, a display control method of an ink screen provided in the embodiment of the present application is described from the perspective of the basesweep class, as shown in fig. 7:
firstly, the BaseCavas class can be modified by a developer, and specific modifications can be referred to the description of the points 1 to 3, and are not described herein again.
After modifying the BaseCavas class, in the running process of the system, aiming at the drawText class for processing the character color, when the system is executed, whether a contrast enhancement function is started or not can be judged firstly, if so, the color value of the Paint object of the character object is changed into black, and then the character object is rendered. If so, a default rendering flow may be performed.
In the system operation process, whether a contrast enhancement function is started or not can be judged firstly aiming at the drawRect class for processing the background color. If so, designing a color value matrix type ColorMatrix to obtain a color value matrix, covering a ColorMatrix class in the Paint object of the background object by adopting the ColorMatrix, and performing color transformation by adopting the ColorMatrix to bleach the background object when drawing any background object. That is, the replacement of the ColorFilter class at a time can be applied to any subsequent background object without replacing each background object individually.
Fig. 8 is a front-back comparison diagram illustrating a display control method for an ink screen according to an embodiment of the present application. The left diagram in fig. 8 indicates the display effect before processing, and the right diagram in fig. 8 indicates the display effect after processing. Obviously, aiming at the contents of characters, the method provided by the embodiment of the application can improve the display effect and has good effect on electronic reading, news and electronic novels.
Second, based on the improvement of the display effect of the ink screen from the color drawing function class
The present application may modify the rendering method draw in the ColorDrawable class. The colordraw class is a relatively basic and commonly used color setting component in Android applications. The positions are as follows:
/frameworks/base/graphics/java/android/graphics/drawable/ColorDrawable.jav
the color processing of the background object can be realized by modifying some of the operational flows of the rendering method draw in this position. The modifications may include the following:
1. the contrast enhancement function is added:
in order to improve the flexibility of use, system attributes can be added in the embodiment of the application for a user to confirm whether to display by adopting the scheme provided by the embodiment of the application. A text contrast enhancement function (hereinafter also referred to as ink _ mode) may be added to the setting function of the system, and the description of the function is described above based on fig. 4a and 4b, and will not be described here.
2. Color replacement process:
as shown in fig. 9, first, in the embodiment of the present application, the system attribute ink _ mode may be taken out first, and whether to start the function is determined. And if not, executing a default drawing process, otherwise, taking out the current color value of the background object in the draw function through the member variable mColorState, and marking as the color.
Then, the color values of R (ed), G (reen), B (lue) in color are extracted, and the average value of R, G, B is calculated and recorded as avrg.
And then searching pixel points in the target color range from the member variables. And then the color of the pixel point is replaced by white. Wherein the target color range is defined as having a mean value of color values greater than a first specified value and color values of the respective color components (R, G, B) less than a second specified value. For example, R, G, B values are all less than 0x10, and avrg greater than Oxc8 falls within the target color range. Of course, it should be noted that the searching method and range of the target color range may be defined according to actual requirements, and the present application is not limited thereto.
In the embodiment of the present application, the target color ranges are defined such that the R, G, B values are all smaller than 0x10, and avrg is greater than 0xc8, so that the bleaching of a lighter color into white can be realized without processing a darker color, thereby improving the contrast.
For example, fig. 10 shows a comparison diagram of colors in the target color range replaced by the present scheme. The left image in fig. 10 is a pre-processed image, and only light gray is bleached in fig. 10, and the color of the other display contents is not changed. The right image is the image after processing. As can be seen from the contrast, the background color light gray in the left image is bleached to white, enhancing the contrast.
Of course, it should be noted that, in the embodiment of the present application, not only the colors within the target color range may be bleached, but also the word may be processed into black as described in the embodiment based on the canvas object in the first point.
In implementation, the character object to be processed can be selectively selected and processed into black. For example, as shown in fig. 11, to further enhance the contrast, the effect diagram of "please fill in the mobile phone number" and "next step" is selected to be processed to black.
When selecting a text object, the selection may be based on the contrast between the text object and its background color, for example, a text object with a contrast below a threshold is processed to be black. The selection may also be made according to the content of the text object, e.g. the text object with the associated key word is processed to be black. The selection may also be based on the semantics of the text object, for example, using a neural network to determine the semantics of the text object, and then processing the text object with the target semantics to black. The target semantics can be set by a user or according to an application type, which is not limited in this application.
Based on the same inventive concept, the embodiment of the present application further provides a terminal device, as shown in fig. 12, including an ink screen 1201 and a processor 1202;
a memory 1203 for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement:
for an ink screen background object, processing the color of the background object into a desired color suitable for an ink screen in a drawing function of a system layer;
displaying the background object based on the desired color.
Optionally, the desired color is white, the processing of the color of the background object into the desired color suitable for the ink screen in the drawing function of the system layer is performed, and the processor is configured to:
acquiring the color value of each pixel point of the background object through member variables from the drawing method of the color drawing function class; searching pixel points in a target color range from the member variables, and replacing the colors of the pixel points with white;
alternatively, the first and second electrodes may be,
updating, for the background object, a color value of a render object of the background object to white.
Optionally, the target color range includes a color value whose mean value is greater than the first specified value, and color values of the respective color components are less than the second specified value.
Optionally, the processor is further configured to:
the method further comprises the following steps:
updating the color value of a drawing object of a character object to be drawn to black aiming at the character object to be drawn;
rendering the textual object to black in the background object.
Optionally, the updating of the color value of the drawing object of the background object to white is performed, and the processor is configured to:
and performing color transformation on the initial background color of the background object by adopting a color value matrix and the drawing object of the background object, and transforming the initial background color into white.
Optionally, executing the rendering object using the color value matrix and the background object, performing color transformation on an initial background color of the background object, and transforming the initial background color into white, where the processor is configured to:
replacing the color filter class in the drawing object of the background object by the color value matrix class corresponding to the color value matrix;
and calling the color value matrix class, and performing multiplication operation by adopting the color value matrix and the background color matrix of the initial background color to obtain a white background object.
Optionally, before performing the updating of the color value of the drawing object of the text object to black, the processor is further configured to:
determining the color value of the character object as a color value;
optionally, the processor is further configured to: and if the color value of the character object is a black value, rendering the character object in the background object.
Optionally, before performing the updating of the color value of the drawing object of the background object to white, the processor is further configured to: it is determined that the contrast enhancement function is enabled.
Optionally, the processor is further configured to:
and responding to the operation of the contrast enhancement function by the user, and switching on or switching off the contrast enhancement function.
Since the computer storage medium in the embodiment of the present application can be applied to the method, the technical effect obtained by the method can also refer to the embodiment of the method, and the embodiment of the present application is not described herein again.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.