System and method for applying antialiasing to images
AssigneeGoogle Inc.
InventorYuqian Li
Life of this patent
Estimating the term…
Abstract
A system and method for providing an image with antialiasing is disclosed. By way of example, the image may be rendered by dividing an object to be rendered into portions defined by scan lines, where the locations of the scan lines coincide with the endpoints of the object's line segments, intersections between line segments and pixel boundaries. The value of pixels having regions located between two consecutive scan lines may be based on the area of trapezoidal and triangular shapes that are defined by the scan lines, the line segments, and pixel boundaries.
Claims20
A system of providing an image comprised of pixels, each pixel being associated with a region of the image, the system comprising:
- one or more computing devices, and
- memory storing instructions and data, the instructions being executable by the one or more computing devices and the data comprising an object to be displayed, the object being comprised of plurality of line segments having endpoints,
- wherein the instructions comprise:
- determining locations of a plurality of reference lines, each reference line having a location, wherein the location of at least one reference line is determined to correspond with the location of an endpoint of a line segment and the location of at least one reference line is determined to correspond with an intersection between two line segments of the plurality of line segments,
- determining, for each of a plurality of the pixels of the image, a pixel value associated with a visual characteristic of the pixel based on an amount of overlap between a portion of the object between two consecutive reference lines and the region associated with the pixel, and
- providing the image for display.
A method for providing an image of an object for display in an image comprised of pixels, each pixel having a size, the object having edges comprised of line segments, the method comprising:
- identifying, with one or more computing devices, a first set of locations that correspond with end points of the line segments,
- identifying, with the one or more computing devices, a second set of locations that correspond with intersections of line segments within the image,
- identifying, with the one or more computing devices, a third set of locations that correspond with the size of the pixels, the first set of locations, the second set of locations and the third set of locations collectively comprising a set of reference locations,
- determining, for a region of the image and with the one or more computing devices, an area of the region occupied by a portion of the object, the region comprising the region between a first reference line having a location corresponding with a first reference location and a second reference line having a location corresponding with a second reference location, the first reference line being parallel to the second reference line,
- determining, based on the area of the region occupied by the portion of the object and with the one or more computing devices, a pixel value for a pixel associated with the region, and
- providing the image for display.
A non-transitory computing-device readable storage medium on which computing-device readable instructions of a program are stored, the instructions, when executed by one or more computing devices, causing the one or more computing devices to perform a method, the method comprising:
- determining locations of a plurality of scan lines for an image having a width of W and height of H along x and y coordinates, respectively, wherein a region of the image is [0,W]×[0,H] and the location of a scan line is y=ci, where ci is selected from the group consisting of (a) an integer between 0 and H, (b) the y value of an endpoint of a first line segment to be rendered with antialiasing, or (c) the y value of an intersection of a first line segment with a second line segment;
- determining an area of a trapezoid between consecutive scan lines, wherein one side of the trapezoid is defined by the first line segment and the remaining three sides of the trapezoid is defined by one or more of the consecutive scan lines, the second line segment, or a boundary of a pixel intersected by the first line segment;
- determining an alpha or brightness value of a plurality of pixels intersected by the first line segment based on the area of the trapezoid;
- and
- determining an image based on the plurality of pixels.
Dependencies are inferred from the claim text.