AffineTransform
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eAffine transform uses a 2x3 matrix to define how pixel locations (u, v) correspond to locations in a Coordinate Reference System (CRS).\u003c/p\u003e\n"],["\u003cp\u003ePixel coordinates start at (0, 0) for the top-left corner of the image and (width, height) for the bottom-right corner, using the "PixelIsArea" raster space.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003etranslateX\u003c/code\u003e and \u003ccode\u003etranslateY\u003c/code\u003e values represent the origin of the pixel grid within the CRS.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003escaleX\u003c/code\u003e and \u003ccode\u003escaleY\u003c/code\u003e represent pixel size when there's no rotation or shear, with \u003ccode\u003escaleY\u003c/code\u003e often negative to position the (0, 0) pixel in the north-west.\u003c/p\u003e\n"],["\u003cp\u003eThis transformation is described by a JSON object containing six values: \u003ccode\u003escaleX\u003c/code\u003e, \u003ccode\u003eshearX\u003c/code\u003e, \u003ccode\u003etranslateX\u003c/code\u003e, \u003ccode\u003eshearY\u003c/code\u003e, \u003ccode\u003escaleY\u003c/code\u003e, and \u003ccode\u003etranslateY\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# AffineTransform\n\nThe affine transform. The six values form a 2x3 matrix: \n\n ( ( scaleX, shearX, translateX )\n ( shearY, scaleY, translateY ) )\n\nspecifying a transformation such that given a pixel location `(u, v)`, the corresponding location in the CRS is this matrix times the column vector `(u, v, 1)`. Pixel coordinates use the \"PixelIsArea\" raster space, i.e. `(0, 0)` is the top-left corner of the top-left pixel, and `(width, height)` is the bottom-right corner of the image. `(translateX, translateY)` is the origin (in the CRS) of the pixel grid. If there is no shear or rotation, then `(scaleX, scaleY)` is the pixel size. `scaleY` is often negative so that the `(0, 0)` pixel corner can represent the north-westernmost corner of the image.\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"scaleX\": number, \"shearX\": number, \"translateX\": number, \"shearY\": number, \"scaleY\": number, \"translateY\": number } ``` |\n\n| Fields ||\n|--------------|---------------------------------------------------------------------------------|\n| `scaleX` | `number` The horizontal scale factor. |\n| `shearX` | `number` The horizontal shear factor for some, though not all, transformations. |\n| `translateX` | `number` The horizontal offset. |\n| `shearY` | `number` The vertical shear factor for some, though not all, transformations. |\n| `scaleY` | `number` The vertical scale factor. |\n| `translateY` | `number` The vertical offset. |"]]