Method for quickly converting resource image into print engine data
By generating blank two-bit-deep print engine data and performing operations by column and row, the resource image is split into multiple sub-images, solving the problem of excessive time consumption in traditional technologies and achieving image conversion efficiency for fast printing.
Patent Information
- Application Number
- CN202510685613.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-05-26
AI Technical Summary
Traditional real-time dynamic image generation technology has a cumbersome process and takes too long to meet the needs of fast printing, especially when dealing with large images.
By obtaining the width, height and number of nozzles of the resource image, blank two-bit-deep print engine data is generated, the resource image is split into multiple sub-images, and the first-bit operation is performed by column and written by row, and finally the sub-image is completely attached to the print engine data.
It improves the efficiency of image conversion, meets the needs of fast printing, and simplifies the image conversion process.
Smart Images

Figure CN120602591A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of digital inkjet printing, and in particular relates to a method for quickly converting a resource image into print engine data. Background Art
[0002] Inkjet technology is a printing technique that uses tiny ink droplets to create text or images on substrates. Real-time dynamic image generation is a key component of inkjet technology, enabling dynamic control of ink droplet ejection to achieve high-precision pattern printing.
[0003] Traditional real-time dynamic image generation technology uses image algorithms to obtain product coordinates. This is then combined with the resource image, the number of printheads, and DPI (Dots Per Inch) to generate a base map. Using contextual rendering, the resource image is drawn onto the base map, which is then split into a "long image" that is then converted into print engine data. However, this traditional real-time dynamic image generation process is cumbersome and time-consuming, especially when processing large images, which can take hundreds of milliseconds to several seconds, making it inadequate for fast printing.
[0004] Therefore, it is necessary to provide a method for quickly converting resource images into print engine data to solve the above problems. Summary of the Invention
[0005] The present invention provides a method for quickly converting a resource image into print engine data, which can improve image conversion efficiency and meet the demand for fast printing.
[0006] To achieve the above objectives, the present invention provides the following technical solutions.
[0007] A method for rapidly converting a resource image into print engine data, the method comprising:
[0008] Obtain the width, height and number of nozzles of the resource image, and generate blank two-bit-deep print engine data according to the number of nozzles of a single nozzle; split the resource image into multiple sub-images according to the number of nozzles; respectively input the data area address, width and height of the multiple sub-images and the mapping coordinates of the print engine data to create a mapping task; the mapping task performs a first-bit operation on the multiple sub-images in a column manner to obtain a first operation result, and the first-bit operation is detection; use the first operation result to perform a second-bit operation on the print engine data, and the second-bit operation is writing by row; and completely paste the multiple sub-images on the print engine data through a loop.
[0009] Preferably, by reading the first address of the resource image plus the offset, the width and height, bit depth and data area address of the resource image are respectively obtained, and the width of the resource image byte is calculated according to the bit depth and width of the resource image. The divisor is the width of the resource image, and the dividend is the bit depth multiplied by eight. If the remainder is zero, the quotient is the width of the resource image byte. If the remainder is not zero, the quotient plus one is the width of the resource image byte.
[0010] Preferably, the address of the first sub-image among the multiple sub-images is obtained, and according to the address of the first sub-image and the width of the resource image byte, the position of the current byte is obtained in the form of a double loop, and the double loop includes an outer loop and an inner loop. The outer loop multiplies the height of the first sub-image by the byte width of the first sub-image to obtain the first address offset of each row of the first sub-image, and then adds the first address of the data area of the first sub-image to obtain the specific position of the first address of each row. The purpose of the inner loop is to traverse the bytes of the current row of the first sub-image.
[0011] Preferably, the method further includes: using pSrcChar as the address of a single byte, performing a first bit operation on the single byte of the pSrcChar address, and using an immediate number to perform an OR operation on the current byte respectively; obtaining information of each bit in the current byte, storing the information of each bit in eight variables representing the number of bits to obtain eight bit variables, and performing a bit operation on the current variable starting from the first bit variable; according to the first row and the last byte of the first sub-image, calculating the position of the last byte from the first row to the eighth row of the first sub-image to obtain eight print byte data; and performing an OR operation on the eight bit variables and the eight print byte data.
[0012] Preferably, the method further includes: the byte of the first sub-image is shifted backward by one position, the bit control variable is 1, the subscript is 0, and the pSrcChar address is the second byte of the first line; the address of the print data is offset downward by 8 lines from the current address; the loop is continued to write the data until the first bit of the last byte from the first line to the last line is processed, and the subscript is 0.
[0013] Preferably, the method further includes: after the inner loop is completed, the outer loop is reached, the bit control variable changes from 1 to 3, the subscript is 2, the pSrcChar address is the second byte of the second line, the subscript is 1, and the print byte data is the last byte of the first line; the value of each bit is detected respectively; the bit is shifted left and right to the third bit respectively; according to the current eight print byte data byte addresses, the BIT is respectively ORed; the loop is continued, the pSrcChar address is shifted one bit according to the current row number, and the address of the print data is offset downward by 8 rows from the current address; the loop is continued to write the data until the third bit of the last byte from the first row to the last row is processed.
[0014] Preferably, the method further includes: after the inner loop is completed, reaching the outer loop, the bit control variable is 5, the subscript is 4, the pSrcChar address is the first byte of the third line, and the print byte data is the last byte of the first line; detecting the value of each bit respectively; shifting the bit left and right to the fifth bit respectively; performing OR operation on the BIT respectively according to the current eight print byte data byte addresses; continuing the loop, the pSrcChar address is shifted one bit according to the current number of rows, and the address of the print data is offset by 8 rows downward from the current address; continuing the loop, writing the data until the 5th bit of the last byte from the first line to the last line is processed, with the subscript being 4.
[0015] Preferably, the method further includes: after the inner loop is completed, reaching the outer loop, the bit control variable is 7, the subscript is 6, the pSrcChar address is the first byte of the fourth line, and the print byte data is the last byte of the first line; detecting the value of each bit respectively; shifting the bit left and right to the fifth bit respectively; performing OR operation on the BIT respectively according to the current eight print byte data byte addresses; continuing the loop, the pSrcChar address is shifted one bit according to the current number of rows, and the address of the print data is offset downward by 8 rows from the current address; continuing the loop, writing the data until the 7th bit of the last byte from the first line to the last line is processed, with the subscript being 6.
[0016] Preferably, the method further comprises: performing multiple cycles until the bit data of the last byte of the print data is completely written; and continuing the cycle of detecting and writing until the first sub-image is completely written into the print data.
[0017] Preferably, the method further comprises: completing writing of print data of remaining sub-images among the plurality of sub-images.
[0018] Compared with the prior art, the technical solution of the embodiment of the present invention has beneficial effects.
[0019] The present invention provides a method for quickly converting a resource image into print engine data, which obtains the width, height and number of nozzles of the resource image, and generates blank two-bit-deep print engine data according to the number of nozzles of a single nozzle; splits the resource image into multiple sub-images according to the number of nozzles; respectively inputs the data area addresses, widths and heights of the multiple sub-images and the mapping coordinates of the print engine data to create a mapping task; the mapping task performs a first-bit operation on the multiple sub-images in a column manner to obtain a first operation result, and the first-bit operation is detection; uses the first operation result to perform a second-bit operation on the print engine data, and the second-bit operation is writing by row; and the multiple sub-images are completely pasted on the print engine data through a loop, which can improve image conversion efficiency and meet fast printing requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a flow chart of a method for rapidly converting a resource image into print engine data in an embodiment of the present invention;
[0021] Figure 2 It is a schematic diagram of multiple sub-images in the method for rapidly converting a resource image into print engine data in an embodiment of the present invention. DETAILED DESCRIPTION
[0022] To make the objectives, features, and beneficial effects of the present invention more readily apparent, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described below are merely illustrative of the present invention and are not intended to limit the present invention. Furthermore, the same or similar reference numerals may be used in the drawings to refer to the same or similar elements in different embodiments, and descriptions of the same or similar elements in different embodiments, as well as descriptions of prior art elements, features, and effects, may be omitted.
[0023] Figure 1 This is a flow chart of a method for rapidly converting a resource image into print engine data in an embodiment of the present invention. Figure 1 An embodiment of the present invention provides a method for quickly converting a resource image into print engine data, comprising:
[0024] Step S101: Obtain the width, height and number of nozzles of the resource image, and generate blank two-bit-deep print engine data according to the number of nozzle holes of a single nozzle;
[0025] Step S102: splitting the resource image into multiple sub-images according to the number of printheads;
[0026] Step S103: respectively inputting the data area addresses, widths and heights of the plurality of sub-images and the mapping coordinates of the print engine data to create a mapping task;
[0027] Step S104: The mapping task performs a first operation on the multiple sub-images column by column to obtain a first operation result, and the first operation is detection;
[0028] Step S105: Use the first operation result to perform a second operation on the print engine data, and the second operation is writing by row;
[0029] Step S106: Completely paste the multiple sub-images onto the print engine data through a loop.
[0030] Specifically, the resource image is stored in the memory in the form of a one-dimensional array. The pixel bit depth of the resource image is 1bpp. The number of nozzles can be obtained by reading the configuration file.
[0031] In a specific implementation, by reading the starting address of the resource image plus an offset, the width and height, bit depth, and data area address of the resource image are respectively obtained. The width of the resource image in bytes is calculated through the bit depth and width of the resource image. The divisor is the width of the resource image, the dividend is the bit depth multiplied by eight. If the remainder is zero, the quotient is the width of the resource image in bytes. If the remainder is not zero, the quotient plus one is the width of the resource image in bytes.
[0032] Specifically, the pixel bit depth is 2bpp.
[0033] According to the number of nozzles, the resource image is divided into corresponding parts. At the same time, according to the controlled offset and the number of nozzles, the positions of multiple sub-images are determined.
[0034] When the actual byte width of the resource image is greater than or equal to the theoretical byte width, calculating the theoretical byte width is to remove the extra bytes during the inner loop. For example:
[0035] The calculated theoretical byte width (a1) is: 5;
[0036] The actual byte width (b1) of the resource image: 8;
[0037] Here, b1 >= a1, and it must be so. The situation of b1 < a1 will not occur.
[0038] In this way, the inner loop only needs to map to the 5th byte, that is, the index is 4. The index starts from 0 and the range is (0 - 4). The subsequent three bytes are invalid data and can be discarded.
[0039] If the remainder is not zero, it means that the pixel width is not an integer multiple of the bit depth multiplied by eight, indicating that the last byte of data is not fully used, and there are several extra bits. This needs to be handled separately. The last byte is based on the theoretical byte calculation, and the actual number of bytes in the resource image is actually more. In other words, this last byte is not the last byte of the actual bytes of the resource image. If the remainder is 1, it means that only BIT[7] is used. If the remainder is 2, it means that only BIT[7], BIT[6], and so on are used.
[0040] The solution of the present application will be specifically described below using three sub-images as an example. The specific implementation of more sub-images can refer to the solution of three sub-images, which will not be repeated here.
[0041] Figure 2 This is a schematic diagram of multiple sub-images in a method for rapidly converting a resource image into print engine data in an embodiment of the present invention. Figure 2 The resource image 21 is divided into three sub-images, namely the first sub-image 211, the second sub-image 212 and the third sub-image 213, and 22 is blank print engine data.
[0042] In a specific implementation, the address of the first sub-image among the multiple sub-images is obtained, and based on the address of the first sub-image and the width of the resource image byte, a double loop is used to obtain the position of the current byte. The double loop includes an outer loop and an inner loop. The outer loop multiplies the height of the first sub-image by the byte width of the first sub-image to obtain the starting address offset of each row of the first sub-image, and then adds the starting address of the data area of the first sub-image to obtain the specific position of the starting address of each row. The purpose of the inner loop is to traverse the bytes of the current row of the first sub-image.
[0043] In a specific implementation, the method further includes: using pSrcChar as the address of a single byte, performing a first bit operation on the single byte of the pSrcChar address, and using an immediate number to perform an AND operation on the current byte; obtaining information of each bit in the current byte, storing the information of each bit in eight variables representing the number of bits to obtain eight bit variables, and performing a bit operation on the current variable starting from the first bit variable; based on the first row and the last byte of the first sub-image, calculating the position of the last byte from the first row to the eighth row of the first sub-image to obtain eight print byte data; and performing an OR operation on the eight bit variables and the eight print byte data.
[0044] Specifically, the immediate value is [0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01], and the eight bit variables are BIT[7], BIT[6], BIT[5], BIT[4], BIT[3], BIT[2], BIT[1], and BIT[0]. The eight print bytes are represented as pBack2bppChar0, pBack2bppChar1, pBack2bppChar2, pBack2bppChar3, pBack2bppChar4, pBack2bppChar5, pBack2bppChar6, and pBack2bppChar7, all of which are pointers.
[0045] Use immediate data to perform AND operations on the current byte, as shown below:
[0046] BIT[7]=(*pSrcChar)&0x80;
[0047] BIT[6]=(*pSrcChar)&0x40;
[0048] BIT[5]=(*pSrcChar)&0x20;
[0049] BIT[4]=(*pSrcChar)&0x10;
[0050] BIT[3]=(*pSrcChar)&0x08;
[0051] BIT[2]=(*pSrcChar)&0x04;
[0052] BIT[1]=(*pSrcChar)&0x02;
[0053] BIT[0]=(*pSrcChar)&0x01.
[0054] Perform bitwise operations on the current variable starting from the first variable, as shown below:
[0055] BIT[7]=(BIT[7]>>7);
[0056] BIT[6]=(BIT[6]>>6);
[0057] BIT[5]=(BIT[5]>>5);
[0058] BIT[4]=(BIT[4]>>4);
[0059] BIT[3] = (BIT[3]>>3);
[0060] BIT[2] = (BIT[2]>>2);
[0061] BIT[1] = (BIT[1]>>1);
[0062] BIT[0]=(BIT[0]>>0).
[0063] Perform an OR operation on the eight bit variables and the eight print byte data, as shown below:
[0064] *(pBack2bppChar0)|=BIT[7];
[0065] *(pBack2bppChar1)|=BIT[6];
[0066] *(pBack2bppChar2)|=BIT[5];
[0067] *(pBack2bppChar3)|=BIT[4];
[0068] *(pBack2bppChar4)|=BIT[3];
[0069] *(pBack2bppChar5)|=BIT[2];
[0070] *(pBack2bppChar6)|=BIT[1];
[0071] *(pBack2bppChar7)|=BIT[0].
[0072] In a specific implementation, the method also includes: the byte of the first sub-image is moved backward by one position, the bit control variable is 1, the subscript is 0, and the pSrcChar address is the second byte of the first line; the address of the print data is offset by 8 rows downward from the current address; the loop is continued to write the data, the first bit of the last byte from the first line to the last line (from right to left), the subscript is 0.
[0073] For example: pBack2bppChar0 = 0x0, pBack2bppChar1 = 0x, then now it is pBack2bppChar0 = 0x8, pBack2bppChar1 = 0x9.
[0074] The loop continues to write data in this way. The first bit of the last byte of the first to last line (from right to left) is subscripted to 0. The current print data address is the last byte address of the 7th, 6th, 5th, 4th, 3rd, 2nd, 1st, and 0th lines respectively. The data written is the last bit of the current byte.
[0075] In a specific implementation, the method further includes: after the inner loop is completed, the outer loop is reached, the bit control variable changes from 1 to 3, the subscript is 2, the pSrcChar address is the second byte of the second line, the subscript is 1, the print byte data is the last byte of the first line, and the print data addresses are the last bytes of the 0th, 1st, 2nd, 3rd, 4th, 5th, 6th, and 7th lines in the positive direction; the value of each bit is detected respectively; the bit is shifted left and right to the third bit respectively; according to the current eight print byte data byte addresses, the BIT is respectively ORed; the loop is continued, the pSrcChar address is shifted one position according to the current line number, and the address of the print data is offset by 8 lines downward from the current address; the loop is continued to write the data until the third bit (subscript 2) of the last byte from the first line to the last line is processed.
[0076] The bits are shifted left and right to the third bit (subscript 2), as shown below:
[0077] BIT[7]=(BIT[7]>>5);
[0078] BIT[6]=(BIT[6]>>4);
[0079] BIT[5]=(BIT[5]>>3);
[0080] BIT[4]=(BIT[4]>>2);
[0081] BIT[3] = (BIT[3]>>1);
[0082] BIT[2] = (BIT[2]>>0);
[0083] BIT[1]=(BIT[1]<<1);
[0084] BIT[0]=(BIT[0]<<2).
[0085] In a specific implementation, the method further includes: after the inner loop is completed, the outer loop is reached, the bit control variable is 5, the subscript is 4, the pSrcChar address is the first byte of the third line, and the print byte data is the last byte of the first line, then the current print data address is the last byte address of the 7th, 6th, 5th, 4th, 3rd, 2nd, 1st, and 0th lines respectively; the value of each bit is detected respectively; the bit is shifted left and right to the fifth bit respectively; according to the current eight print byte data byte addresses, the BIT is respectively ORed; the loop is continued, the pSrcChar address is shifted one position according to the current line number, and the address of the print data is offset downward by 8 lines from the current address; the loop is continued to write the data until the 5th bit (subscript 4) of the last byte from the first line to the last line is processed.
[0086] The bits are shifted left and right to the fifth bit (subscript 4), as shown below:
[0087] BIT[7]=(BIT[7]>>3);
[0088] BIT[6]=(BIT[6]>>2);
[0089] BIT[5]=(BIT[5]>>1);
[0090] BIT[4] = (BIT[4]>>0);
[0091] BIT[3] = (BIT[3] << 1);
[0092] BIT[2] = (BIT[2] << 2);
[0093] BIT[1]=(BIT[1]<<3);
[0094] BIT[0]=(BIT[0]<<4).
[0095] In a specific implementation, the method further includes: after the inner loop is completed, the outer loop is reached, the bit control variable is 7, the subscript is 6, the pSrcChar address is the first byte of the fourth line, and the print byte data is the last byte of the first line, then the current print data address is the last byte address of the 7th, 6th, 5th, 4th, 3rd, 2nd, 1st, and 0th lines respectively; the value of each bit is detected respectively; the bit is shifted left and right to the fifth bit respectively; according to the current eight print byte data byte addresses, the BIT is respectively ORed; the loop is continued, the pSrcChar address is shifted one position according to the current line number, and the address of the print data is offset downward by 8 lines from the current address; the loop is continued to write the data until the 7th bit (subscript 6) of the last byte from the first line to the last line is processed.
[0096] The bits are shifted left and right to the seventh bit (subscript 6), as shown below:
[0097] BIT[7]=(BIT[7]>>1);
[0098] BIT[6]=(BIT[6]>>0);
[0099] BIT[5] = (BIT[5] << 1);
[0100] BIT[4] = (BIT[4] << 2);
[0101] BIT[3] = (BIT[3] << 3);
[0102] BIT[2] = (BIT[2] << 4);
[0103] BIT[1] = (BIT[1] << 5);
[0104] BIT[0]=(BIT[0]<<6).
[0105] In a specific implementation, the method further includes: performing multiple cycles until the bit data of the last byte of the print data is completely written; and continuing the cycle of detecting and writing until the first sub-image is completely written into the print data.
[0106] In a specific implementation, the method further includes: completing the writing of print data of the remaining sub-images in the plurality of sub-images.
[0107] The data calculation method for the second sub-image is the same as that for the first sub-image.
[0108] The third sub-image is still detected from bottom to top and by row, and the print data is written from left to right and by column.
[0109] Still based on the form of two-layer loop, at the beginning, pSrcChar corresponds to the address of the first byte of the last row of the third sub-image, and detects the data.
[0110] Based on the first line and first byte of the right portion of the print data, calculate the position of the first byte of the first to eighth lines. Obtain eight bytes of data, represented as pBack2bppChar0, pBack2bppChar1, pBack2bppChar2, pBack2bppChar3, pBack2bppChar4, pBack2bppChar5, pBack2bppChar6, and pBack2bppChar7, all of which are pointers.
[0111] According to the bit control variable bit 7, the BIT is shifted left and right, as shown below:
[0112] BIT[7]=(BIT[7]>>1);
[0113] BIT[6]=(BIT[6]>>0);
[0114] BIT[5] = (BIT[5] << 1);
[0115] BIT[4] = (BIT[4] << 2);
[0116] BIT[3] = (BIT[3] << 3);
[0117] BIT[2] = (BIT[2] << 4);
[0118] BIT[1] = (BIT[1] << 5);
[0119] BIT[0]=(BIT[0]<<6).
[0120] Based on the current pBack2bppChar0-7 byte address, the bits are ORed separately. Continuing the loop, pSrcChar is shifted back one byte according to the current row number. The print data addresses pBack2bppChar0-7 are offset downward by 8 rows from the current address. The loop writes the current resource row number to the 7th bit (subscript 6) of the first byte of the first to last rows of print data.
[0121] Continuing the outer loop, pSrcChar corresponds to the address of the first byte of the second-to-last line of the third sub-image, and the print data pBack2bppChar0-7 is the previous address.
[0122] According to the bit control variable bit 5, the BIT is shifted left and right, as shown below:
[0123] BIT[7]=(BIT[7]>>3);
[0124] BIT[6]=(BIT[6]>>2);
[0125] BIT[5]=(BIT[5]>>1);
[0126] BIT[4] = (BIT[4]>>0);
[0127] BIT[3] = (BIT[3] << 1);
[0128] BIT[2] = (BIT[2] << 2);
[0129] BIT[1]=(BIT[1]<<3);
[0130] BIT[0]=(BIT[0]<<4).
[0131] Based on the current pBack2bppChar0-7 byte address, the bits are ORed separately. Continuing the loop, pSrcChar is shifted back one byte according to the current row number. The print data addresses pBack2bppChar0-7 are offset downward by 8 rows from the current address. The loop writes the current resource row number to the 5th bit (subscript 4) of the first byte of the first to last rows of print data.
[0132] Continuing the outer loop, pSrcChar corresponds to the address of the first byte of the third to last row of the third sub-image, and the print data pBack2bppChar0-7 is the previous address.
[0133] According to the bit control variable bit 3, the BIT is shifted left and right, as shown below:
[0134] BIT[7]=(BIT[7]>>5);
[0135] BIT[6]=(BIT[6]>>4);
[0136] BIT[5]=(BIT[5]>>3);
[0137] BIT[4]=(BIT[4]>>2);
[0138] BIT[3] = (BIT[3]>>1);
[0139] BIT[2] = (BIT[2]>>0);
[0140] BIT[1]=(BIT[1]<<1);
[0141] BIT[0]=(BIT[0]<<2).
[0142] Based on the current pBack2bppChar0-7 byte address, the bits are ORed separately. Continuing the loop, pSrcChar is shifted back one byte according to the current row number. The print data addresses pBack2bppChar0-7 are shifted downward by 8 rows from the current address. The loop writes the current resource row number to the third bit (subscript 2) of the first byte of the first to last rows of the print data.
[0143] Continuing the outer loop, pSrcChar corresponds to the address of the first byte of the fourth-to-last line of the third sub-image, and the print data pBack2bppChar0-7 is the previous address.
[0144] According to the bit control variable bit 1, the BIT is shifted left and right, as shown below:
[0145] BIT[7]=(BIT[7]>>7);
[0146] BIT[6]=(BIT[6]>>6);
[0147] BIT[5]=(BIT[5]>>5);
[0148] BIT[4]=(BIT[4]>>4);
[0149] BIT[3] = (BIT[3]>>3);
[0150] BIT[2] = (BIT[2]>>2);
[0151] BIT[1] = (BIT[1]>>1);
[0152] BIT[0]=(BIT[0]>>0).
[0153] Based on the current pBack2bppChar0-7 byte address, the bits are ORed together. Continuing the loop, pSrcChar is shifted back one byte according to the current row number. The print data addresses pBack2bppChar0-7 are shifted downward by 8 rows from the current address. The loop writes the current resource row number to the first bit (subscript 0) of the first byte and the first row of the print data.
[0154] Through internal and external loops and bit control, resource data is read by row and written by column, ultimately achieving data copying.
[0155] In summary, the method for quickly converting a resource image into print engine data in an embodiment of the present invention obtains the width, height and number of nozzles of the resource image, and generates blank two-bit-deep print engine data according to the number of nozzles of a single nozzle; splits the resource image into multiple sub-images according to the number of nozzles; respectively inputs the data area address, width and height of the multiple sub-images and the mapping coordinates of the print engine data to create a mapping task; the mapping task performs a first-bit operation on the multiple sub-images in a column manner to obtain a first operation result, and the first-bit operation is detection; uses the first operation result to perform a second-bit operation on the print engine data, and the second-bit operation is writing by row; by looping, the multiple sub-images are completely pasted on the print engine data, which can improve image conversion efficiency and meet fast printing requirements.
[0156] Although specific embodiments have been described above, these embodiments are not intended to limit the scope of the present disclosure, even when only a single embodiment is described with respect to specific features. The feature examples provided in the present disclosure are intended to be illustrative, not limiting, unless otherwise stated. In specific implementations, the technical features of one or more dependent claims may be combined with the technical features of the independent claim, based on actual needs and where technically feasible, and may be derived from the technical features of the corresponding independent claim in any appropriate manner rather than solely through the specific combinations listed in the claims.
Claims
1. A method for rapidly converting a resource image into print engine data, characterized in that: The method comprises: Get the width, height and number of nozzles of the resource image, and generate blank two-bit-deep print engine data based on the number of nozzle holes of a single nozzle; Splitting the resource image into multiple sub-images according to the number of printheads; respectively inputting the data area addresses, widths and heights of the plurality of sub-images and the mapping coordinates of the print engine data to create a mapping task; The mapping task performs a first bit operation on the plurality of sub-images in a column manner to obtain a first operation result, wherein the first bit operation is detection; Performing a second bit operation on the print engine data using the first operation result, wherein the second bit operation is writing by row; The multiple sub-images are completely pasted on the print engine data through a loop.
2. The method for rapidly converting a resource image into print engine data according to claim 1, characterized in that: By reading the first address of the resource image and adding the offset, the width and height, bit depth and data area address of the resource image are obtained respectively, and the width of the resource image byte is calculated according to the bit depth and width of the resource image. The divisor is the width of the resource image, and the dividend is the bit depth multiplied by eight. If the remainder is zero, the quotient is the width of the resource image byte. If the remainder is not zero, the quotient plus one is the width of the resource image byte.
3. The method for rapidly converting a resource image into print engine data according to claim 2, characterized in that: Obtain the address of the first sub-image among the multiple sub-images, and obtain the position of the current byte in a double loop according to the address of the first sub-image and the byte width of the resource image. The double loop includes an outer loop and an inner loop. The outer loop multiplies the height of the first sub-image by the byte width of the first sub-image to obtain the first address offset of each row of the first sub-image, and adds the first address of the data area of the first sub-image to obtain the specific position of the first address of each row. The purpose of the inner loop is to traverse the bytes of the current row of the first sub-image.
4. The method for rapidly converting a resource image into print engine data according to claim 3, characterized in that: The method further comprises: A single byte is addressed with pSrcChar, the first bit of the single byte at the pSrcChar address is operated, and the immediate value is used to perform AND operations on the current byte. Obtain information of each bit in the current byte, store the information of each bit in eight variables representing the number of bits to obtain eight bit variables, and perform bit operations on the current variables starting from the first variable; Calculating positions of the last bytes of the first to eighth rows of the first sub-image according to the first row and the last byte of the first sub-image to obtain eight print byte data; Perform an OR operation on the eight bit variables and the eight print byte data.
5. The method for rapidly converting a resource image into print engine data according to claim 4, characterized in that: The method further comprises: The byte of the first sub-image is shifted back one position, the bit control variable is 1, and the subscript is 0. The address of pSrcChar is the second byte of the first row; The address of the print data is offset 8 lines downward from the current address; Continue the loop and write the data, with the first bit of the last byte from the first row to the last row having the subscript 0.
6. The method for rapidly converting a resource image into print engine data according to claim 5, characterized in that: The method further comprises: After the inner loop is completed, the outer loop is reached, the bit control variable changes from 1 to 3, the subscript is 2, the pSrcChar address is the second byte of the second line, the subscript is 1, and the printed byte data is the last byte of the first line; Detect the value of each bit separately; The bits are shifted left and right to the third position respectively; According to the current eight print byte data byte addresses, perform OR operation on the BIT respectively; Continue the loop, the pSrcChar address is shifted one row backward according to the current row number, and the address of the print data is shifted 8 rows downward from the current address; Continue looping and writing data until the third bit of the last byte of the first to last rows is processed.
7. The method for rapidly converting a resource image into print engine data according to claim 6, characterized in that: The method further comprises: After the inner loop is completed, the outer loop is reached, the bit control variable is 5, the subscript is 4, the pSrcChar address is the first byte of the third line, and the printed byte data is the last byte of the first line; Detect the value of each bit separately; The bits are shifted left and right to the fifth position respectively; According to the current eight print byte data byte addresses, perform OR operation on the BIT respectively; Continue the loop, the pSrcChar address is shifted one row backward according to the current row number, and the address of the print data is shifted 8 rows downward from the current address; Continue looping and writing data until the 5th bit of the last byte of the first to last rows, with subscript 4, is processed.
8. The method for rapidly converting a resource image into print engine data according to claim 7, characterized in that: The method further comprises: After the inner loop is completed, the outer loop is reached, the bit control variable is 7, the subscript is 6, the pSrcChar address is the first byte of the fourth line, and the printed byte data is the last byte of the first line; Detect the value of each bit separately; The bits are shifted left and right to the fifth position respectively; According to the current eight print byte data byte addresses, perform OR operation on the BIT respectively; Continue the loop, the pSrcChar address is shifted one row backward according to the current row number, and the address of the print data is shifted 8 rows downward from the current address; Continue looping and writing data until the seventh bit of the last byte of the first to last rows is processed, with the subscript being 6.
9. The method for rapidly converting a resource image into print engine data according to claim 8, characterized in that: The method further comprises: After multiple cycles, until the last byte of the print data is completely written; The detection and writing are continued in a loop until the first sub-image is completely written with printing data.
10. The method for rapidly converting a resource image into print engine data according to claim 9, characterized in that: The method further comprises: Writing of print data of the remaining sub-images among the plurality of sub-images is completed.
Citation Information
Patent Citations
Print data splitting processing method, apparatus, and printing apparatus
CN109471602A
Concentric annulus traversal annular image printing method based on digital ink-jet technology
CN110126496A
Jet printing data processing method and device of multi-nozzle jet printing equipment
CN115302961A
Apparatus and method for efficient graphics processing including ray tracing
CN116391207A
Printed circuit board (PCB) jet printing method and device, printing equipment and medium
CN117062327A
Cited By
Image rendering and binary conversion control method, system and device and storage medium
CN121722341A
An image rendering and binarization control method, system, device and storage medium
CN121722341B