[0035] Relevant technical content and detailed description of the present invention, cooperate accompanying drawing to illustrate as follows:
[0036] Please refer to figure 1 , is a flow chart of the pixel-based subtitle coloring method of the present invention. Read an external subtitle file (S100), and read a target sequence number of the subtitle file (S102). Then, judge whether the subtitle file is terminated (S200) according to the target sequence number: if the subtitle file terminates, then end the coloring action (S208); The sequence number of the target column is incremented by 1 (S202). Then, display a target row subtitle corresponding to the target row number and display a spare row subtitle corresponding to the spare row number (S204). Read a coordinate parameter and a time parameter corresponding to the subtitle of the target column (S206), wherein the coordinate parameter includes a column coordinate value and a row coordinate value, and the column coordinate value and the row coordinate value are used to determine the target column The subtitle coloring range; and the time parameter includes a start time and an end time, which are used to determine the start time and end time of subtitle coloring of the target column. That is, the coloring range of the target column subtitle starts to be painted at the start time, and when the end time arrives, the coloring action of the target column subtitle is completed. Then, it is judged whether the column coordinate value reaches the termination condition (S300): if the column coordinate value has reached the termination condition, then clear the target column subtitle and add 1 to the target column sequence number (S302); if the column coordinate value has not yet reached Termination condition, then judge whether the row coordinate value reaches the termination condition (S400): if the row coordinate value has reached the termination condition, then clear the row coordinate value as the row coordinate initial value and add 1 to the column coordinate value (S402) . Wherein, the initial value of the coordinate of the row is set to 1; if the coordinate value of the row has not reached the termination condition, then according to the color change requirement of a pixel corresponding to the coordinate parameter, it is judged whether the pixel needs to be painted (S500): if the If the pixel corresponding to the coordinate parameter needs to be colored, color the pixel (S502); if the pixel corresponding to the coordinate parameter does not need to be colored, ignore the pixel color (S506). Then, add 1 to the row coordinate value (S504), and execute the step (S400) again.
[0037] Please refer to Figure 2A and image 3 , are respectively the schematic diagram and Figure 2A A partial enlargement of the . If an external subtitle file with 20 subtitles is displayed on the screen (not shown) in double subtitle mode, and the subtitles are colored, and the content of the first three subtitles of the external subtitle file is assumed They are: "ABCDEF", "GHIJ", and "KLMNO". If a target sequence number Nt is read, its value is 1, that is, Nt=1, then it means that the first section column subtitle (" ABCDEF ") corresponding to the target sequence number Nt is a target column subtitle Wt, and another preparation The column number Ns is set as the target column number Nt plus 1, so its value is 2, that is, Ns=2, which means that the second column subtitle ("GHIJ") corresponding to the preliminary column number Ns is a preliminary column Subtitle Ws. Then, the target column subtitle Wt and the preliminary column subtitle Ws are first displayed on a screen, and the target column subtitle Wt has a coordinate parameter Cp and a time parameter Tp: wherein, the time parameter Tp includes a start time Ts and An end time Te is used to determine the start time and end time of coloring the target column subtitle Wt; the coordinate parameter Cp includes a column coordinate value Rt with a size of 120 pixels and a row coordinate value Ct with a size of 14 pixels , which is used to determine the coloring range of the target column subtitle Wt. That is, the coloring of the target column subtitle Wt is started at the start time Ts, and the coloring of the target column subtitle Wt is completed when the end time Te arrives.
[0038]When starting to color the target column subtitle Wt, the starting pixel for coloring is determined by the column coordinate value Rt and the row coordinate value Ct of the coordinate parameter Cp, if both the column coordinate value Rt and the row coordinate value Ct are 1 (i.e. Rt=1 and Ct=1), and the color of the pixel corresponding to the column coordinate value (Rt=1) and the row coordinate value (Ct=1) needs to be changed before and after painting. Pixel coloring; if the color does not need to be changed, keep the original color before coloring, and ignore the coloring of the pixel. Then, add 1 to the row coordinate value Ct, that is, Ct=2, and then judge the pixel color change demand corresponding to the column coordinate value (Rt=1) and the row coordinate value (Ct=2), and judge whether to The pixel is colored. When the row coordinate value Ct is greater than 14 after adding 1, that is, Ct=15, it means that all pixels in this column (Rt=1) have been painted. Therefore, clearing the row coordinate value Ct is the row coordinate initial value, that is Ct=1, and add 1 to the coordinate value Rt of this column, that is, Rt=2, so as to paint all the pixels in the next column (Rt=2). Until the column coordinate value Rt is greater than 120 after adding 1, that is, =121, it means that all pixels of the target column subtitle Wt have been painted. Then, clear the target column subtitle Wt and add 1 to the target column serial number Nt, that is, Nt=2, which means that the second column subtitle ("GHIJ") corresponding to the target column serial number Nt is a target column subtitle Wt, And this preliminary row serial number Ns is set as this target row serial number Nt plus 1, so its value is 3, promptly Ns=3, then represent that the 3rd section subtitle (" KLMNO ") that this preliminary row serial number Ns corresponds is The prepared column subtitle Ws.
[0039] Please refer to Figure 2B , is a schematic diagram of another target column subtitle coloring method according to the present invention. That is, the second subtitle (“GHIJ”) is the target subtitle Wt for coloring, which is the same as the above-mentioned detailed process, and will not be repeated here. Until the target column number Nt is greater than 20 after adding 1, that is, Nt=21, it means that all column subtitles of the external subtitle file have been colored. In this way, in units of pixels, from top to bottom column by column, and from left to right row by row, until the subtitle coloring of the external subtitle file is completed. In this embodiment, the assumed values of the target column number Nt, the column coordinate value Rt, and the row coordinate value Ct are not limited in actual implementation.
[0040] Please refer to Figure 4 and Figure 5 , are respectively the schematic diagram and flow chart that the present invention carries out coloring to a subtitle file and merges with a video file and displays on a screen, the subtitle coloring method of the present invention with pixel as a unit can be used for accompaniment functions such as karaoke superior. Wherein, the display environment of the subtitle file and the video file includes a screen 10, a video display area 20, and a subtitle display area 30, wherein the subtitle display area 30 includes a first subtitle display area 302 and a second subtitle display area display area 304 . in, Figure 5 The steps include: reading an external video file (S602), reading an external subtitle file (S604), and merging the subtitle file and the video file (S606). Then display the merged subtitle file and the video file on a screen 10 (S608). Wherein, the subtitle file and the video file are used on different layers. Then perform coloring processing on the subtitle file (S610). In step (S608), the target row subtitle and the prepared row subtitle of the subtitle file (such as Figure 2A shown) are respectively displayed on the first subtitle display area 302 and the second subtitle display area 304 to achieve double-column subtitle display, and start to color the target column subtitles. If the coloring of the target column subtitle is completed, then by adding 1 to the target column serial number, the target column subtitle and the prepared column subtitle (such as Figure 2B shown) are displayed on the second subtitle display area 304 and the first subtitle display area 302 respectively, and a new target column subtitle coloring is started.