AffineTransform
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\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. |"]]