AffineTransform
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eAffine transform uses a 2x3 matrix to define how pixel locations (u, v) in an image correspond to real-world coordinates 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, with (width, height) representing the bottom-right corner, using the "PixelIsArea" raster space.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e(translateX, translateY)\u003c/code\u003e values represent the real-world coordinates of the image's top-left corner, acting as the origin of the pixel grid in the CRS.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003escaleX\u003c/code\u003e and \u003ccode\u003escaleY\u003c/code\u003e define the pixel size in the CRS when there's no rotation or shear, with \u003ccode\u003escaleY\u003c/code\u003e often negative to allow the top-left pixel to represent the north-westernmost point.\u003c/p\u003e\n"],["\u003cp\u003eThe transformation is calculated by multiplying the affine matrix with the column vector (u, v, 1) derived from the pixel coordinates.\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. |"]]