Disclosure of Invention
A first object of the present invention is to provide a method of implementing a two-color printing driving method for a two-color thermal paper.
A second object of the present invention is to provide a thermal printer implementing the above-described two-color printing driving method.
A third object of the present invention is to provide a computer-readable storage medium storing a two-color printing driving method.
In order to achieve the first object of the present invention, the present invention provides a two-color printing driving method comprising: receiving print data; converting the printing data to obtain image data; obtaining multi-frame driving pulse data of each pixel point in the current printing line according to the concentration value of each pixel point of the current printing line of the image data and the driving pulse sequence corresponding to the concentration value; the same-frame driving pulse data of each pixel point in the current printing row form a frame-by-frame heating signal, and the frame-by-frame heating signal is sequentially sent to the corresponding row heating bodies according to the sequence.
Still further, the concentration value is divided into 10 stages, which include concentration 1, concentration 2 … to concentration 10 from shallow to deep; the driving pulse sequence corresponding to the concentration value is as follows: concentration 1:1000000000; degree 2:1100000000; concentration 3:1110000000; concentration 4:1111000000; concentration 5:1111100000; concentration 6:1111110000; concentration 7:1111111000; concentration 8:1111111100; concentration 9:1111111110; concentration 10:1111111111.
still further, the print data includes color information including red information and black information.
In order to achieve the second object of the present invention, the present invention provides a thermal printer including a processor for implementing the steps of the dual color printing driving method according to the above scheme when executing a computer program stored in a memory.
In order to achieve the third object of the present invention, the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the two-color printing driving method of the above-described scheme.
The invention has the advantages that when the heating element is driven to generate heat according to red-black dual-color image data, every point of the current line needs to be distinguished from 10 concentration levels from light red to black when each point is printed, the heating element is driven by multi-frame heating signals of the current line, the multi-section heating time of the heating element is effectively controlled, and the printing effect is gradually changed from light red to black along with the increment of the heating time of each point, so that a plurality of concentration levels from light red to black are printed, and the effective dual-color printing control is realized.
Detailed Description
Referring to fig. 1 to 5, the dual-color printing driving method is applied to a thermal printer, and is mainly used for dual-color printing on additive-color thermal paper, wherein the color development is first color when the heat applied is low, the color development is second color when the heat applied is high, and when the heat applied to the thermal paper is low, the thermal paper is light red, the red gradually gets deeper along with the increase of the heat, and the thermal paper is black when the heat applied is highest.
When the two-color printing driving method is performed, step S11 is first performed, and print data including font information, pattern information, and color information including red information, black information, gradation information, and the like is received. In the editing stage, the color of the fonts or the patterns can be set, namely, the black, the red and the depth degree of the red can be set.
Step S12 is then executed, where the image data is a dot matrix map obtained by converting the print data according to the conversion result, and in this case, each row has 11 pixels as an example, and according to the density value of each pixel of the current print row of the image data and the driving pulse sequence corresponding to the density value (as shown in fig. 3), that is, the density value is divided into 10 levels, which includes from shallow to deep density 1, density 2 … to density 10, the corresponding density value is heated and driven by a 10-frame heating signal, the driving pulse sequence corresponding to the density value is as follows:
concentration 1:1000000000;
concentration 2:1100000000;
concentration 3:1110000000;
concentration 4:1111000000;
concentration 5:1111100000;
concentration 6:1111110000;
concentration 7:1111111000;
concentration 8:1111111100;
concentration 9:1111111110;
concentration 10:1111111111.
and then obtaining multi-frame driving pulse data of each pixel point in the current printing row.
Then, step S13 is executed, the same-frame driving pulse data of each pixel point in the current printing row forms a frame-by-frame heating signal, taking FIG. 2 as an example of a target printing pattern, which has 11 pixel points, from left to right, the first two second pixel points are black with the concentration of 10, the hexadecimal color code is #231915, the tenth pixel point is light red with the concentration of 2, the hexadecimal color code is # ef8575, the eleventh pixel point is light red with the concentration of 1, the hexadecimal color code is # f3bbb2, the heating is performed through 10 frames of heating on-off signals, thus, when one row of heating bodies is driven, the frame-by-frame heating signals of 10 frames are respectively 1 st frame data1 "11111111", 2 nd frame data2"11111111110", 3 rd frame data3"11111111100", 4 th frame data4"11111111000", 5 th frame data5"11111110000", 6 th frame data6"11111100000", 7 th frame data7"11111000000", 8 th frame data8"11110000000", 9 th frame data9"11100000000", 10 th frame data10"11000000000", and the driving of 5 th frame data5"11111110000" is exemplified, the heating bodies of 1 st to 7 are driven to generate heat, and the heating bodies of 8 th to 11 are not generated heat of "0" from left to right.
Finally, step 14 is executed, in which frame-by-frame heating signals are sequentially sent to the corresponding row of heating bodies, and referring to fig. 4 and 5, EN is a thermal printhead enable signal, CLK is a CLOCK input signal, DAT is a DATA image DATA input signal, LAT is a LATCH register LATCH signal, and STB is a stream frame-by-frame heating signal. The main control chip of the printer sends an EN enabling signal to enable the thermal printing head, then each CLK clock signal sends a bit of DAT image data until the image data of the current line is sent, the LAT register latches the image data in a low level, finally the STB heating element heating signal is sent to the thermal printing head, and the low level is effective.
Finally, as shown in fig. 2, the leftmost two dots are heated for 10 times, the density is 10 levels, the dots are black, the rightmost one dot is heated only once, the density is 1 level, and the dots are light red. Of course, in this embodiment, other additive color type thermal paper may be used, such as blue-black dual-color printing and yellow-black dual-color printing. And in practical application of the thermal sheet, the 58-type thermal sheet is generally used, and the width of a printing line is 48MM, and 8 heating elements are generally arranged in 1MM, so that a plurality of heating points are arranged in one line during practical printing, and the heating elements in the same line are driven simultaneously during driving. And the driving pulse sequences with corresponding concentrations can be multiple or different frames are used for driving and heating.
The thermal printer includes a processor for implementing the steps of the dual color printing driving method as described above when executing the computer program stored in the memory.
A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the two-color printing driving method of the scheme described above.