CN110333832B - Typesetting spacing adjustment method, device and equipment for multiple printed images and storage medium - Google Patents

Typesetting spacing adjustment method, device and equipment for multiple printed images and storage medium Download PDF

Info

Publication number
CN110333832B
CN110333832B CN201910601154.9A CN201910601154A CN110333832B CN 110333832 B CN110333832 B CN 110333832B CN 201910601154 A CN201910601154 A CN 201910601154A CN 110333832 B CN110333832 B CN 110333832B
Authority
CN
China
Prior art keywords
rounding
coordinate
pixel
nth image
output pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910601154.9A
Other languages
Chinese (zh)
Other versions
CN110333832A (en
Inventor
左国云
黄中琨
陈艳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Senda Shenzhen Technology Co Ltd
Original Assignee
Senda Shenzhen Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Senda Shenzhen Technology Co Ltd filed Critical Senda Shenzhen Technology Co Ltd
Priority to CN201910601154.9A priority Critical patent/CN110333832B/en
Publication of CN110333832A publication Critical patent/CN110333832A/en
Application granted granted Critical
Publication of CN110333832B publication Critical patent/CN110333832B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/1203Improving or facilitating administration, e.g. print management
    • G06F3/1208Improving or facilitating administration, e.g. print management resulting in improved quality of the output result, e.g. print layout, colours, workflows, print preview
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/125Page layout or assigning input pages onto output media, e.g. imposition

Abstract

The invention discloses a typesetting distance adjusting method, device and equipment for a plurality of printed images and a storage medium, and relates to the technical field of inkjet printing, wherein the method comprises the following steps: acquiring the transverse resolution and the longitudinal resolution of the printer; acquiring a starting pixel coordinate of an nth image in a plane coordinate system corresponding to a canvas according to a starting position of the nth image in the canvas, and a starting pixel rounding coordinate after the starting pixel coordinate takes an integer value; acquiring an output pixel coordinate of the nth image and an output pixel rounding coordinate of the nth image after the output pixel coordinate takes an integer value according to the output size of the nth image in the plane coordinate system; and adjusting the actual initial pixel coordinate or the actual output pixel coordinate of the nth image according to the rounding direction and rounding error of the initial pixel rounding coordinate and the output pixel rounding coordinate. The invention can control the error generated by the pixel rounding operation in the multi-image typesetting process within the preset range, and effectively avoid the phenomenon of interval or image overlapping between images in the printed images.

Description

Typesetting spacing adjustment method, device and equipment for multiple printed images and storage medium
Technical Field
The present invention relates to the field of image printing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for adjusting typesetting pitches of multiple printed images.
Background
Typesetting printing of multiple images is a frequently encountered situation in the daily printing process, in which multiple images are scaled and arranged on canvas side by side, and then printed on a printing medium with a certain printing resolution by raster image processor (Raster Image Processor, RIP) software and printing control software.
In the drawing process of RIP, the output positions of a plurality of images in a canvas need to be calculated, wherein the initial pixel position of the images in the canvas is calculated by the product of the upper left corner coordinates of the images in the canvas and the printing resolution, and the printing pixel size of the images is calculated by the product of the output size of the images and the printing resolution. As shown in fig. 1, the first image of the typesetting has an upper left corner (236.77, 705.12), an output size (282.12, 219.48), an X-direction start position of 360×236.77/25.4×3355.795, a y-direction start position of 360×705.12/25.4× 9993.826, a horizontal pixel size of 360×282.12/25.4× 3998.55, and a vertical pixel size of 360×219.48/25.4× 3110.74, if the printing resolution is 360.
In actual rendering, the pixel position must be an integer. For this purpose, the layout starting position may be rounded directly or rounded. In fig. 1, if the layout start position 3355.795 of the first image is directly rounded, 3355 is obtained, so that the end position of the first image is 3355+3998=7535; assuming that the layout start position of the second image is 7536.01, the first image and the second image are not spaced in the layout, but the division by the above-described decimal point results in 1 pixel being spaced between the first image and the second image, resulting in a spacing line in the print result.
Disclosure of Invention
The invention mainly aims to provide a method and a device for adjusting typesetting spacing of a plurality of printed images and a storage medium, and aims to solve the problem that in the existing multi-image typesetting printing process, intervals or image overlapping occur between images in actual printed images caused by rounding pixel coordinates of the images.
To achieve the above object, an aspect of the present invention provides a method for adjusting typesetting pitch of a plurality of print images, the method being applied to typesetting containing N images to be printed, the method comprising:
acquiring the transverse resolution and the longitudinal resolution of the printer;
acquiring a starting pixel coordinate of an nth image in a plane coordinate system corresponding to a canvas according to a starting position of the nth image in the canvas, and a starting pixel rounding coordinate after the starting pixel coordinate takes an integer value;
acquiring an output pixel coordinate of the nth image and an output pixel rounding coordinate of the nth image after the output pixel coordinate takes an integer value according to the output size of the nth image in the plane coordinate system;
adjusting the actual initial pixel coordinates or the actual output pixel coordinates of the nth image according to the rounding directions and rounding errors of the initial pixel rounding coordinates and the output pixel rounding coordinates;
where n=1, 2 … N.
Further, the starting pixel coordinates (x_p, y_p) of the nth image are:
Figure BDA0002119331700000021
Figure BDA0002119331700000022
where (x_a, y_a) is the starting position of the nth image in the canvas, dpi_x is the lateral resolution of the printer, and dpi_y is the longitudinal resolution of the printer.
Further, the starting pixel rounding coordinate is obtained by taking an integer of an X coordinate value and an integer of a Y coordinate value of the starting pixel coordinate.
Further, the output pixel coordinates (w_p, h_p) of the nth image are:
Figure BDA0002119331700000023
Figure BDA0002119331700000024
wherein, (w_a, h_a) is the output size of the nth image, dpi_x is the lateral resolution of the printer, and dpi_y is the longitudinal resolution of the printer.
Further, the output pixel rounded coordinates are obtained by rounding X-coordinate values and Y-coordinate values of the output pixel coordinates.
Further, the adjusting the actual starting pixel coordinate or the actual output pixel coordinate of the nth image according to the rounding direction and the rounding error of the starting pixel rounding coordinate and the output pixel rounding coordinate includes:
when the X rounding direction of the initial pixel rounding coordinate and the w rounding direction of the output pixel rounding coordinate are both rounded upwards, and the sum of the X rounding error of the initial pixel rounding coordinate and the w rounding error of the output pixel rounding coordinate is greater than or equal to a preset value, subtracting 1 from the X of the initial pixel rounding coordinate of the nth image to obtain the actual initial pixel coordinate X of the nth image;
when the x rounding direction of the initial pixel rounding coordinate and the W rounding direction of the output pixel rounding coordinate are both downwards rounding, and the sum of the x rounding error of the initial pixel rounding coordinate and the W rounding error of the output pixel rounding coordinate is smaller than or equal to a preset value, adding 1 to the output pixel rounding coordinate W of the nth image to obtain an actual output pixel coordinate W of the nth image;
when the Y rounding direction of the initial pixel rounding coordinate and the h rounding direction of the output pixel rounding coordinate are both rounded upwards, and the sum of the Y rounding error of the initial pixel rounding coordinate and the h rounding error of the output pixel rounding coordinate is greater than or equal to a preset value, subtracting 1 from the Y of the initial pixel rounding coordinate of the nth image to obtain an actual initial pixel coordinate Y of the nth image;
and when the y rounding direction of the initial pixel rounding coordinate and the H rounding direction of the output pixel rounding coordinate are both downwards rounding, and the sum of the y rounding error of the initial pixel rounding coordinate and the H rounding error of the output pixel rounding coordinate is smaller than or equal to a preset value, adding 1 to the output pixel rounding coordinate H of the nth image to obtain the actual output pixel coordinate H of the nth image.
Further, the upward rounding refers to extracting an integer part of the numerical value and adding 1, and the downward rounding refers to extracting the integer part of the numerical value; the rounding error is the difference between the original pixel coordinate value and the rounded pixel coordinate value.
In another aspect, the present invention provides a typesetting distance adjustment device for a plurality of printed images, where the device is applied to typesetting including N images to be printed, and the device includes:
the first acquisition module is used for acquiring the transverse resolution and the longitudinal resolution of the printer;
the second acquisition module is used for acquiring the initial pixel coordinate of the nth image in the plane coordinate system corresponding to the canvas according to the initial position of the nth image in the canvas and the initial pixel rounding coordinate of the nth image after the initial pixel coordinate takes an integer value;
the third acquisition module is used for acquiring the output pixel coordinate of the nth image and the output pixel rounding coordinate of the nth image after the output pixel coordinate takes an integer value according to the output size of the nth image in the plane coordinate system;
the adjusting module is used for adjusting the actual initial pixel coordinate or the actual output pixel coordinate of the nth image according to the rounding direction and the rounding error of the initial pixel rounding coordinate and the output pixel rounding coordinate;
where n=1, 2 … N.
In another aspect, the present invention also provides a typesetting pitch adjustment apparatus for a plurality of print images, including: at least one processor, at least one memory, and computer program instructions stored in the memory, which when executed by the processor, implement the method of any of the above.
Another aspect of the present invention also provides a storage medium having stored thereon computer program instructions, characterized in that the steps of the method for adjusting typesetting pitch of a plurality of print images according to any one of the above are implemented when the computer program instructions are executed by a processor.
According to the method, the device and the storage medium for adjusting the typesetting distance of the plurality of printing images, in the process of typesetting of the plurality of images, the initial pixel coordinate and the output pixel coordinate of each image are respectively rounded, and the initial pixel coordinate or the output pixel coordinate of each image is adjusted according to the rounding direction and the rounding error of the initial pixel rounding coordinate and the output pixel rounding coordinate of each image. The invention can control the error generated by the pixel rounding operation in the multi-image typesetting process within the preset range, and effectively avoid the phenomenon of interval or image overlapping between images in the printed images.
Drawings
FIG. 1 is a schematic diagram of a conventional multi-drawing typesetting printing;
FIG. 2 is a flow chart of a method for adjusting typesetting spacing of a plurality of printed images according to an embodiment of the present invention;
FIG. 3 is a diagram of canvas coordinates and typeset image coordinates according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of typesetting spacing adjustment for a plurality of printed images in accordance with an embodiment of the present invention;
FIG. 5 is a schematic diagram of typesetting spacing adjustment for multiple printed images according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a typesetting space adjusting device for multiple printed images according to a second embodiment of the present invention;
fig. 7 is a schematic hardware structure of a typesetting pitch adjustment device for multiple print images according to a second embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In the following description, suffixes such as "module", "component", or "unit" for representing elements are used only for facilitating the description of the present invention, and have no specific meaning per se. Thus, "module," "component," or "unit" may be used in combination.
Example 1
An embodiment of the present invention provides a method for adjusting typesetting pitch of a plurality of printed images, where the method is applied to typesetting including N images to be printed, as shown in fig. 2, and the method includes:
s1, acquiring transverse resolution and longitudinal resolution of a printer;
where printer resolution is also referred to as output resolution, refers to the number of dots per inch that can be printed at most in both the lateral and longitudinal directions at the time of printing out, and is typically "dots per inch", dpi (dot per inch). The printing resolution generally includes a lateral resolution dpi_x and a longitudinal resolution dpi_y that longitudinally resolve two directions, and typically the resolution of the laser printer in both the longitudinal and lateral directions is nearly the same, while the output resolution of the inkjet printer in both the longitudinal and lateral directions is very different; the resolution of the printer may also be set manually. In this embodiment, the lateral resolution dpi_x=600 DPI, and the longitudinal resolution dpi_y=800 DPI.
S2, acquiring a starting pixel coordinate of an nth image in a plane coordinate system corresponding to a canvas according to a starting position of the nth image in the canvas, and a starting pixel rounding coordinate after the starting pixel coordinate takes an integer value;
the initial pixel coordinate of the image refers to the coordinate of the top left corner vertex of the image in the canvas coordinate system, and is obtained by calculating the product of the top left corner coordinate of the image in the canvas coordinate system and the printing resolution. The output pixel coordinates of the image are right lower corner marks of the right lower corner vertex of the image in a canvas coordinate system, and are obtained through calculation of the product of the output size of the image and the printing resolution.
As shown in fig. 3, the typeset images a and b are contained in the canvas 10, and a plane coordinate system XOY is established in the canvas 10, wherein the origin O of the plane coordinate system XOY coincides with the top left corner vertex of the first typeset image a, the X-axis direction is horizontally right, and the Y-axis direction is vertically downward. The starting pixel coordinates of the image a are the coordinates of the upper left corner vertex O of the image a in the XOY coordinate system, and the output pixel coordinates of the image a are the coordinates of the lower right corner vertex P of the image a in the XOY coordinate system. The starting pixel coordinates of image b are the coordinates of the upper left corner vertex M of image b in the XOY coordinate system, and the output pixel coordinates of image b are the coordinates of the lower right corner vertex N of image b in the XOY coordinate system.
N is used to describe which image is processed, in this embodiment, n=1, 2 … N.
The starting pixel coordinates (x_p, y_p) of the nth image are:
Figure BDA0002119331700000061
Figure BDA0002119331700000062
where (x_a, y_a) is the starting position of the nth image in the canvas, dpi_x is the lateral resolution of the printer, and dpi_y is the longitudinal resolution of the printer.
The starting pixel rounding coordinate is obtained by taking an integer of an X coordinate value and an integer of a Y coordinate value of the starting pixel coordinate.
The above-mentioned rounding of the X-coordinate value of the starting pixel coordinate may be performed by rounding the X-coordinate value, or by directly rounding the X-coordinate value (i.e., taking only the integer part of the X-coordinate value), or by adding a rounding to the X-coordinate value (i.e., taking the integer part of the X-coordinate value and adding a rounding to the X-coordinate value). The Y coordinate value of the starting pixel coordinate may be rounded, directly rounded or rounded.
In this embodiment, the Y-coordinate value of the starting pixel coordinate may be the same as or different from the X-coordinate value of the starting pixel coordinate. For example, the X-coordinate value of the start pixel coordinate and the Y-coordinate value of the start pixel coordinate may be rounded, or the X-coordinate value of the start pixel coordinate may be rounded, and the Y-coordinate value of the start pixel coordinate may be rounded by adding one.
S3, acquiring an output pixel coordinate of the nth image and an output pixel rounding coordinate of the nth image after the output pixel coordinate takes an integer value according to the output size of the nth image in the plane coordinate system;
the output pixel coordinates of the image are right lower corner marks of the right lower corner vertex of the image in a canvas coordinate system, and are obtained through calculation of the product of the output size of the image and the printing resolution.
The output pixel coordinates (w_p, h_p) of the nth image are:
Figure BDA0002119331700000063
Figure BDA0002119331700000071
wherein, (w_a, h_a) is the output size position of the nth image, dpi_x is the lateral resolution of the printer, and dpi_y is the longitudinal resolution of the printer.
The output pixel rounding coordinate is obtained by taking an integer of an X coordinate value and an integer of a Y coordinate value of the output pixel coordinate.
The above-mentioned integer may be rounded off the X coordinate value, or may be directly rounded off the X coordinate value (i.e., only the integer part of the X coordinate value), or may be added to the X coordinate value (i.e., the integer part of the X coordinate value is added to one). The Y coordinate value of the output pixel coordinate may be rounded, directly rounded or added with an integer as described above.
In this embodiment, the Y-coordinate value of the output pixel coordinate may be the same as or different from the X-coordinate value of the output pixel coordinate. For example, the X-coordinate value of the output pixel coordinate and the Y-coordinate value of the output pixel coordinate may be rounded, or the X-coordinate value of the output pixel coordinate may be rounded, and the Y-coordinate value of the output pixel coordinate may be rounded by adding a rounding.
S4, adjusting the actual initial pixel coordinate or the actual output pixel coordinate of the nth image according to the rounding direction and the rounding error of the initial pixel rounding coordinate and the output pixel rounding coordinate;
specifically, the method comprises the following steps:
when the X rounding direction of the starting pixel rounding coordinate and the w rounding direction of the output pixel rounding coordinate are both rounded upwards, and the sum of the X rounding error of the starting pixel rounding coordinate and the w rounding error of the output pixel rounding coordinate is greater than or equal to a preset value, that is, x_ap > = x_p and w_ap > = w_p and (x_ap-x_p+w_ap-w_p) > = preset value, subtracting 1 from the starting pixel rounding coordinate X of the nth image to obtain an actual starting pixel coordinate X of the nth image; the other actual coordinate values are corresponding rounded coordinate values.
When the x rounding direction of the initial pixel rounding coordinate and the W rounding direction of the output pixel rounding coordinate are both rounded downwards, and the sum of the x rounding error of the initial pixel rounding coordinate and the W rounding error of the output pixel rounding coordinate is smaller than or equal to a preset value, namely x_ap < = x_p and w_ap < = w_p and (x_p-x_ap+w_p-w_ap) > = preset value, adding 1 to the output pixel rounding coordinate W of the nth image to obtain an actual output pixel coordinate W of the nth image; the other actual coordinate values are corresponding rounded coordinate values.
When the Y rounding direction of the starting pixel rounding coordinate and the h rounding direction of the output pixel rounding coordinate are both rounded upwards, and the sum of the Y rounding error of the starting pixel rounding coordinate and the h rounding error of the output pixel rounding coordinate is greater than or equal to a preset value, namely y_ap > = y_p and h_ap > = h_p and (y_ap-y_p+h_ap-h_p) > = preset value, subtracting 1 from the Y of the starting pixel rounding coordinate of the nth image to obtain an actual starting pixel coordinate Y of the nth image; the other actual coordinate values are corresponding rounded coordinate values.
When the y rounding direction of the initial pixel rounding coordinate and the H rounding direction of the output pixel rounding coordinate are both rounded downwards, and the sum of the y rounding error of the initial pixel rounding coordinate and the H rounding error of the output pixel rounding coordinate is smaller than or equal to a preset value, namely y_ap < = y_p and h_ap < = h_p and (y_p-y_ap+h_p-h_ap) > = preset value, adding 1 to the output pixel rounding coordinate H of the nth image to obtain an actual output pixel coordinate H of the nth image; the other actual coordinate values are corresponding rounded coordinate values.
Wherein, the upward rounding refers to extracting an integer part of the numerical value and adding 1, and the downward rounding refers to extracting an integer part of the numerical value. The rounding error is the difference between the original pixel coordinate value and the rounded pixel coordinate value. The preset value may be determined according to the rounding error precision, and in a preferred embodiment, the preset value is 0.5, i.e. the rounding error is controlled within a range of 0.5 pixels.
It should be noted that, in the case where the above condition is not satisfied, if the x rounding direction of the starting pixel rounding coordinate and the w rounding direction of the output pixel rounding coordinate are different, or the sum of the x rounding error of the starting pixel rounding coordinate and the w rounding error of the output pixel rounding coordinate is greater than a preset value, the actual starting pixel coordinate and the actual output pixel coordinate of the image are respectively the same as the starting pixel rounding coordinate and the output pixel rounding coordinate.
The method for adjusting typesetting pitch of a plurality of print images according to the present invention will be described in detail below with reference to fig. 4. As in fig. 4, the canvas 10 contains images a, b, c and d to be typeset, wherein in the XOY coordinate system, the initial position of the image a in the canvas 10 is (0, 0), and the output size position is (5, 7); the initial position of the image b in the canvas 10 is (5, 0), and the output size position is (4, 7); the image c has a starting position (7, 7) in the canvas 10, an output size position (4, 5), the image d has a starting position (11, 7) in the canvas 10, and an output size position (5, 5). The following will take image b as an example.
In fig. 4, the starting pixel coordinates (x_p, y_p) of image b are:
x_p=5*600/25.4=118.11;y_p=0;
the starting pixel coordinates of image b are (118.11,0)
In this embodiment, the X coordinate and the Y coordinate of the initial pixel coordinate of the image b are all rounded off;
as shown in fig. 4, the starting pixel rounding coordinates (x_ap, y_ap) of the image b are obtained as (118,0).
The output pixel coordinates (w_p, h_p) of image b are:
w_p=4*600/25.4=94.49;h_p=7*800/25.4=220.47
the output pixel coordinates of image b are (94.49, 220.47)
In this embodiment, the X-coordinate and the Y-coordinate of the output pixel coordinate of the image b are both rounded off;
as shown in fig. 4, the rounded output pixel coordinates (w_ap, h_ap) of the image b are obtained as (94, 220).
In this example, the rounding directions of the starting pixel rounding coordinate and the output pixel rounding coordinate of the image b are all rounded downward, that is: x_ap < = x_p and w_ap < = w_p; y_ap < = y_p and h_ap < = h_p
The sum of the x rounding error 0.11 of the starting pixel rounding coordinate of the image b and the W rounding error 0.49 of the output pixel rounding coordinate of the image b is equal to a preset value of 0.5, i.e., (x_p-x_ap+w_p-w_ap) > = 0.5, and the actual output pixel coordinate W of the image b is the output pixel rounding coordinate w_ap of the image b plus 1, i.e., 95.
The sum of the y rounding error 0 of the starting pixel rounding coordinate of the image b and the H rounding error 0.47 of the output pixel rounding coordinate of the image b is smaller than a preset value of 0.5, namely (y_p-y_ap+h_p-h_ap) <0.5, and the actual output pixel coordinate H of the image b is the output pixel rounding coordinate h_ap of the image b, namely 220.
As shown in fig. 5, the actual start pixel coordinates (X, Y) of the image b are (118,0), and the actual output pixel coordinates (W, H) of the image b are (95, 220) after the above processing.
In the method for adjusting the typesetting distance of the multiple printing images, in the process of typesetting of the multiple images, the initial pixel coordinate and the output pixel coordinate of each image are rounded respectively, and the initial pixel coordinate or the output pixel coordinate of each image is adjusted according to the rounding direction and the rounding error of the initial pixel rounding coordinate and the output pixel rounding coordinate of each image. The invention can control the error generated by the pixel rounding operation in the multi-image typesetting process within the range of 0.5 pixel, and effectively avoid the phenomenon of interval or image overlapping between images in the printed images.
Based on the above-described respective method embodiments, the present invention also provides the following apparatus embodiments.
Example two
A second embodiment of the present invention provides a typesetting pitch adjustment device 4 for a plurality of printed images, which is applied to typesetting including N images to be printed, as shown in fig. 6, where the typesetting pitch adjustment device 6 for a plurality of printed images includes:
the first acquisition module is used for acquiring the transverse resolution and the longitudinal resolution of the printer;
the second acquisition module is used for acquiring the initial pixel coordinate of the nth image in the plane coordinate system corresponding to the canvas according to the initial position of the nth image in the canvas and the initial pixel rounding coordinate of the nth image after the initial pixel coordinate takes an integer value;
the third acquisition module is used for acquiring the output pixel coordinate of the nth image and the output pixel rounding coordinate of the nth image after the output pixel coordinate takes an integer value according to the output size of the nth image in the plane coordinate system;
the adjusting module is used for adjusting the actual initial pixel coordinate or the actual output pixel coordinate of the nth image according to the rounding direction and the rounding error of the initial pixel rounding coordinate and the output pixel rounding coordinate;
where n=1, 2 … N.
Wherein the starting pixel coordinates (x_p, y_p) of the nth image are:
Figure BDA0002119331700000101
Figure BDA0002119331700000102
where (x_a, y_a) is the starting position of the nth image in the canvas, dpi_x is the lateral resolution of the printer, and dpi_y is the longitudinal resolution of the printer.
The initial pixel rounding coordinate is obtained by taking an integer of an X coordinate value and an integer of a Y coordinate value of the initial pixel coordinate.
The output pixel coordinates (w_p, h_p) of the nth image are:
Figure BDA0002119331700000103
Figure BDA0002119331700000104
wherein, (w_a, h_a) is the output size position of the nth image, dpi_x is the lateral resolution of the printer, and dpi_y is the longitudinal resolution of the printer.
The output pixel rounding coordinates are obtained by taking an integer from an X coordinate value and an integer from a Y coordinate value of the output pixel coordinates.
In a preferred embodiment, the adjustment module is specifically configured to:
when the X rounding direction of the initial pixel rounding coordinate and the w rounding direction of the output pixel rounding coordinate are both rounded upwards, and the sum of the X rounding error of the initial pixel rounding coordinate and the w rounding error of the output pixel rounding coordinate is greater than or equal to a preset value, subtracting 1 from the X of the initial pixel rounding coordinate of the nth image to obtain the actual initial pixel coordinate X of the nth image;
when the x rounding direction of the initial pixel rounding coordinate and the W rounding direction of the output pixel rounding coordinate are both downwards rounding, and the sum of the x rounding error of the initial pixel rounding coordinate and the W rounding error of the output pixel rounding coordinate is smaller than or equal to a preset value, adding 1 to the output pixel rounding coordinate W of the nth image to obtain an actual output pixel coordinate W of the nth image;
when the Y rounding direction of the initial pixel rounding coordinate and the h rounding direction of the output pixel rounding coordinate are both rounded upwards, and the sum of the Y rounding error of the initial pixel rounding coordinate and the h rounding error of the output pixel rounding coordinate is greater than or equal to a preset value, subtracting 1 from the Y of the initial pixel rounding coordinate of the nth image to obtain an actual initial pixel coordinate Y of the nth image;
when the y rounding direction of the initial pixel rounding coordinate and the H rounding direction of the output pixel rounding coordinate are both downwards rounding, and the sum of the y rounding error of the initial pixel rounding coordinate and the H rounding error of the output pixel rounding coordinate is smaller than or equal to a preset value, adding 1 to the output pixel rounding coordinate H of the nth image to obtain an actual output pixel coordinate H of the nth image;
wherein, the upward rounding refers to extracting an integer part of the numerical value and adding 1, and the downward rounding refers to extracting an integer part of the numerical value. The rounding error is the difference between the original pixel coordinate value and the rounded pixel coordinate value.
In addition, the multi-print image layout pitch adjustment apparatus of the embodiment of the present invention described in connection with the first embodiment is implemented. Fig. 7 is a schematic diagram showing a hardware configuration of a typesetting pitch adjustment apparatus for a plurality of print images according to an embodiment of the present invention.
The multiple print image imposition distance adjustment device may include a processor 401 and a memory 402 storing computer program instructions.
In particular, the processor 401 described above may include a Central Processing Unit (CPU), or an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or may be configured as one or more integrated circuits implementing embodiments of the present invention.
Memory 402 may include mass storage for data or instructions. By way of example, and not limitation, memory 402 may comprise a Hard Disk Drive (HDD), floppy Disk Drive, flash memory, optical Disk, magneto-optical Disk, magnetic tape, or universal serial bus (Universal Serial Bus, USB) Drive, or a combination of two or more of the foregoing. Memory 402 may include removable or non-removable (or fixed) media, where appropriate. Memory 402 may be internal or external to the data processing apparatus, where appropriate. In a particular embodiment, the memory 402 is a non-volatile solid state memory. In a particular embodiment, the memory 402 includes Read Only Memory (ROM). The ROM may be mask programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these, where appropriate.
The processor 401 reads and executes the computer program instructions stored in the memory 402 to implement any one of the plural print image typesetting pitch adjustment methods of the above-described embodiments.
In one example, the multiple print image imposition distance adjustment apparatus may further include a communication interface 403 and a bus 410. As shown in fig. 7, the processor 401, the memory 402, and the communication interface 403 are connected to each other by a bus 410 and perform communication with each other.
The communication interface 403 is mainly used to implement communication between each module, device, unit and/or apparatus in the embodiment of the present invention.
Bus 410 includes hardware, software, or both, coupling components of the spray head nozzle detection device to one another. By way of example, and not limitation, the buses may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an infiniband interconnect, a Low Pin Count (LPC) bus, a memory bus, a micro channel architecture (MCa) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable bus, or a combination of two or more of the above. Bus 410 may include one or more buses, where appropriate. Although embodiments of the invention have been described and illustrated with respect to a particular bus, the invention contemplates any suitable bus or interconnect.
Example III
A third embodiment of the present invention provides a storage medium storing one or more programs executable by one or more processors to implement the steps of:
acquiring the transverse resolution and the longitudinal resolution of the printer;
acquiring a starting pixel coordinate of an nth image in a plane coordinate system corresponding to a canvas according to a starting position of the nth image in the canvas, and a starting pixel rounding coordinate after the starting pixel coordinate takes an integer value;
acquiring an output pixel coordinate of the nth image and an output pixel rounding coordinate of the nth image after the output pixel coordinate takes an integer value according to the output size of the nth image in the plane coordinate system;
adjusting the actual initial pixel coordinates or the actual output pixel coordinates of the nth image according to the rounding directions and rounding errors of the initial pixel rounding coordinates and the output pixel rounding coordinates;
where n=1, 2 … N.
In a preferred embodiment, the starting pixel coordinates (x_p, y_p) of the nth image are:
Figure BDA0002119331700000131
Figure BDA0002119331700000132
where (x_a, y_a) is the starting position of the nth image in the canvas, dpi_x is the lateral resolution of the printer, and dpi_y is the longitudinal resolution of the printer.
In a preferred embodiment, the starting pixel rounding coordinate is obtained by rounding the X-coordinate value and the Y-coordinate value of the starting pixel coordinate.
In a preferred embodiment, the output pixel coordinates (w_p, h_p) of the nth image are:
Figure BDA0002119331700000133
Figure BDA0002119331700000141
wherein, (w_a, h_a) is the output size of the nth image, dpi_x is the lateral resolution of the printer, and dpi_y is the longitudinal resolution of the printer.
In a preferred embodiment, the output pixel rounding coordinate is obtained by rounding an X-coordinate value and a Y-coordinate value of the output pixel coordinate.
In a preferred embodiment, in the step of adjusting the actual starting pixel coordinates or the actual output pixel coordinates of the nth image according to the rounding direction and the rounding error of the starting pixel rounding coordinates and the output pixel rounding coordinates, the one or more programs may be executed by one or more processors to implement the following steps:
when the X rounding direction of the initial pixel rounding coordinate and the w rounding direction of the output pixel rounding coordinate are both rounded upwards, and the sum of the X rounding error of the initial pixel rounding coordinate and the w rounding error of the output pixel rounding coordinate is greater than or equal to a preset value, subtracting 1 from the X of the initial pixel rounding coordinate of the nth image to obtain the actual initial pixel coordinate X of the nth image;
when the x rounding direction of the initial pixel rounding coordinate and the W rounding direction of the output pixel rounding coordinate are both downwards rounding, and the sum of the x rounding error of the initial pixel rounding coordinate and the W rounding error of the output pixel rounding coordinate is smaller than or equal to a preset value, adding 1 to the output pixel rounding coordinate W of the nth image to obtain an actual output pixel coordinate W of the nth image;
when the Y rounding direction of the initial pixel rounding coordinate and the h rounding direction of the output pixel rounding coordinate are both rounded upwards, and the sum of the Y rounding error of the initial pixel rounding coordinate and the h rounding error of the output pixel rounding coordinate is greater than or equal to a preset value, subtracting 1 from the Y of the initial pixel rounding coordinate of the nth image to obtain an actual initial pixel coordinate Y of the nth image;
and when the y rounding direction of the initial pixel rounding coordinate and the H rounding direction of the output pixel rounding coordinate are both downwards rounding, and the sum of the y rounding error of the initial pixel rounding coordinate and the H rounding error of the output pixel rounding coordinate is smaller than or equal to a preset value, adding 1 to the output pixel rounding coordinate H of the nth image to obtain the actual output pixel coordinate H of the nth image.
Wherein, the upward rounding refers to extracting an integer part of the numerical value and adding 1, and the downward rounding refers to extracting the integer part of the numerical value; the rounding error is the difference between the original pixel coordinate value and the rounded pixel coordinate value.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
It should also be noted that the exemplary embodiments mentioned in this disclosure describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, or may be performed in a different order from the order in the embodiments, or several steps may be performed simultaneously.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.

Claims (9)

1. A typesetting pitch adjustment method of a plurality of print images, the method being applied to typesetting containing N images to be printed, the method comprising:
acquiring the transverse resolution and the longitudinal resolution of the printer;
acquiring a starting pixel coordinate of an nth image in a plane coordinate system corresponding to a canvas according to a starting position of the nth image in the canvas, and a starting pixel rounding coordinate after the starting pixel coordinate takes an integer value;
acquiring an output pixel coordinate of the nth image and an output pixel rounding coordinate of the nth image after the output pixel coordinate takes an integer value according to the output size of the nth image in the plane coordinate system;
wherein n=1, 2 … N;
when the X rounding direction of the initial pixel rounding coordinate and the w rounding direction of the output pixel rounding coordinate are both rounded upwards, and the sum of the X rounding error of the initial pixel rounding coordinate and the w rounding error of the output pixel rounding coordinate is greater than or equal to a preset value, subtracting 1 from the X of the initial pixel rounding coordinate of the nth image to obtain the actual initial pixel coordinate X of the nth image;
when the x rounding direction of the initial pixel rounding coordinate and the W rounding direction of the output pixel rounding coordinate are both downwards rounding, and the sum of the x rounding error of the initial pixel rounding coordinate and the W rounding error of the output pixel rounding coordinate is smaller than or equal to a preset value, adding 1 to the output pixel rounding coordinate W of the nth image to obtain an actual output pixel coordinate W of the nth image;
when the Y rounding direction of the initial pixel rounding coordinate and the h rounding direction of the output pixel rounding coordinate are both rounded upwards, and the sum of the Y rounding error of the initial pixel rounding coordinate and the h rounding error of the output pixel rounding coordinate is greater than or equal to a preset value, subtracting 1 from the Y of the initial pixel rounding coordinate of the nth image to obtain an actual initial pixel coordinate Y of the nth image;
and when the y rounding direction of the initial pixel rounding coordinate and the H rounding direction of the output pixel rounding coordinate are both downwards rounding, and the sum of the y rounding error of the initial pixel rounding coordinate and the H rounding error of the output pixel rounding coordinate is smaller than or equal to a preset value, adding 1 to the output pixel rounding coordinate H of the nth image to obtain the actual output pixel coordinate H of the nth image.
2. The method for adjusting typesetting pitch of a plurality of print images according to claim 1, wherein the starting pixel coordinates (x_p, y_p) of the nth image are:
Figure QLYQS_1
Figure QLYQS_2
where (x_a, y_a) is the starting position of the nth image in the canvas, dpi_x is the lateral resolution of the printer, and dpi_y is the longitudinal resolution of the printer.
3. The method according to claim 2, wherein the starting pixel rounding coordinates of the nth image are obtained by rounding the abscissa and ordinate values of the starting pixel coordinates.
4. The method for adjusting the typesetting pitch of a plurality of print images according to claim 1, wherein the output pixel coordinates (w_p, h_p) of the nth image are:
Figure QLYQS_3
Figure QLYQS_4
wherein, (w_a, h_a) is the output size of the nth image, dpi_x is the lateral resolution of the printer, and dpi_y is the longitudinal resolution of the printer.
5. The method according to claim 4, wherein the output pixel rounding coordinates of the nth image are obtained by rounding an abscissa value and an ordinate value of the output pixel coordinates.
6. The method for adjusting typesetting pitch of a plurality of print images according to claim 1, wherein the upward rounding means extracting an integer part of a numerical value and adding 1, and the downward rounding means extracting an integer part of a numerical value; the rounding error is the difference between the original pixel coordinate value and the rounded pixel coordinate value.
7. A typesetting pitch adjustment apparatus for a plurality of printed images, the apparatus being applied to typesetting containing N images to be printed, the apparatus comprising:
the first acquisition module is used for acquiring the transverse resolution and the longitudinal resolution of the printer;
the second acquisition module is used for acquiring the initial pixel coordinate of the nth image in the plane coordinate system corresponding to the canvas according to the initial position of the nth image in the canvas and the initial pixel rounding coordinate of the nth image after the initial pixel coordinate takes an integer value;
the third acquisition module is used for acquiring the output pixel coordinate of the nth image and the output pixel rounding coordinate of the nth image after the output pixel coordinate takes an integer value according to the output size of the nth image in the plane coordinate system;
the adjusting module is used for adjusting the actual initial pixel coordinate or the actual output pixel coordinate of the nth image according to the rounding direction and the rounding error of the initial pixel rounding coordinate and the output pixel rounding coordinate;
wherein n=1, 2 … N;
when the X rounding direction of the initial pixel rounding coordinate and the w rounding direction of the output pixel rounding coordinate are both rounded upwards, and the sum of the X rounding error of the initial pixel rounding coordinate and the w rounding error of the output pixel rounding coordinate is greater than or equal to a preset value, subtracting 1 from the X of the initial pixel rounding coordinate of the nth image to obtain the actual initial pixel coordinate X of the nth image;
when the x rounding direction of the initial pixel rounding coordinate and the W rounding direction of the output pixel rounding coordinate are both downwards rounding, and the sum of the x rounding error of the initial pixel rounding coordinate and the W rounding error of the output pixel rounding coordinate is smaller than or equal to a preset value, adding 1 to the output pixel rounding coordinate W of the nth image to obtain an actual output pixel coordinate W of the nth image;
when the Y rounding direction of the initial pixel rounding coordinate and the h rounding direction of the output pixel rounding coordinate are both rounded upwards, and the sum of the Y rounding error of the initial pixel rounding coordinate and the h rounding error of the output pixel rounding coordinate is greater than or equal to a preset value, subtracting 1 from the Y of the initial pixel rounding coordinate of the nth image to obtain an actual initial pixel coordinate Y of the nth image;
and when the y rounding direction of the initial pixel rounding coordinate and the H rounding direction of the output pixel rounding coordinate are both downwards rounding, and the sum of the y rounding error of the initial pixel rounding coordinate and the H rounding error of the output pixel rounding coordinate is smaller than or equal to a preset value, adding 1 to the output pixel rounding coordinate H of the nth image to obtain the actual output pixel coordinate H of the nth image.
8. A typesetting pitch adjustment apparatus for a plurality of print images, comprising: at least one processor, at least one memory, and computer program instructions stored in the memory, which when executed by the processor, implement the method of any one of claims 1-6.
9. A storage medium having stored thereon computer program instructions which, when executed by a processor, implement the steps of the method of typesetting spacing adjustment of multiple print images as claimed in any one of claims 1-6.
CN201910601154.9A 2019-07-04 2019-07-04 Typesetting spacing adjustment method, device and equipment for multiple printed images and storage medium Active CN110333832B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910601154.9A CN110333832B (en) 2019-07-04 2019-07-04 Typesetting spacing adjustment method, device and equipment for multiple printed images and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910601154.9A CN110333832B (en) 2019-07-04 2019-07-04 Typesetting spacing adjustment method, device and equipment for multiple printed images and storage medium

Publications (2)

Publication Number Publication Date
CN110333832A CN110333832A (en) 2019-10-15
CN110333832B true CN110333832B (en) 2023-04-28

Family

ID=68143119

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910601154.9A Active CN110333832B (en) 2019-07-04 2019-07-04 Typesetting spacing adjustment method, device and equipment for multiple printed images and storage medium

Country Status (1)

Country Link
CN (1) CN110333832B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111079210B (en) * 2019-12-21 2024-02-09 深圳市汉森软件股份有限公司 Two-dimensional rectangular picture typesetting method, device, equipment and storage medium
CN112799615A (en) * 2021-01-25 2021-05-14 武汉先同科技有限公司 Personalized printing control method and system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013008247A (en) * 2011-06-24 2013-01-10 Canon Inc Image processing apparatus, image processing method, and program
CN103823643B (en) * 2012-11-18 2016-08-10 北京毕普创智软件有限公司 The print-out method of engineering drawing and device
CN105677262B (en) * 2014-11-19 2018-09-11 杨黎明 The composition method and device of banner printing
CN109656492B (en) * 2018-12-19 2023-04-28 森大(深圳)技术有限公司 Print data processing method, system, device and storage medium

Also Published As

Publication number Publication date
CN110333832A (en) 2019-10-15

Similar Documents

Publication Publication Date Title
CN110421984B (en) Reciprocating scanning printing control method, device, equipment and storage medium
CN110069767B (en) Typesetting method based on electronic book, electronic equipment and computer storage medium
CN110816082B (en) Method, device and equipment for obtaining alignment error value of spray head and storage medium
EP0422793B1 (en) Graphics scaling method for high resolution printers
CN110333832B (en) Typesetting spacing adjustment method, device and equipment for multiple printed images and storage medium
CN110341328B (en) Multi-PCB character splicing printing method and device, medium and flat printing equipment
CN110757956B (en) Method, device and equipment for acquiring installation deviation value of spray head and storage medium
CN111267489B (en) Print data processing method, device, equipment and storage medium
CN110039901B (en) Oneepass inkjet printing control method, device, equipment and medium
CN111047536B (en) CCD image correction method, device, equipment and storage medium
CN110027325B (en) Printing control method, device, equipment and printer
US20140320868A1 (en) Printer and a method of printing
CN111347793B (en) Digital nozzle splicing error processing method and device, printing equipment and storage medium
CN110688074B (en) Method, device and equipment for distributing data for multi-nozzle printing and storage medium
CN107992869B (en) Method and device for correcting tilted characters and electronic equipment
CN110816065A (en) Ink discharging method and device for overlapped hole area of nozzle and storage medium
CN110908623B (en) Data processing method, device, equipment and medium for large-format image partition printing
CN110281664B (en) Printing medium positioning printing method, device, equipment, medium and flat-panel printer
CN111045609B (en) Ink jet printing method, device, equipment and storage medium
CN110757955B (en) Method, device and equipment for verifying nozzle alignment calibration value and storage medium
CN109656492B (en) Print data processing method, system, device and storage medium
CN110605917B (en) Printing control method, device and equipment for PCB characters and storage medium
CN110275686B (en) Method, device and equipment for controlling typesetting interval of multiple printing images and storage medium
CN113986152A (en) Ink jet printing method, device, equipment and storage medium for image segment conversion
CN113442581B (en) Printing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant