Create a new image by copying this image and scaling to fit the ImageInfo's dimensions and converting the pixels into the ImageInfo's ColorInfo. This is done retaining the domain (backend) of the image (e.g. gpu, raster) @param imageInfo New image dimensions @param samplingMode sampling mode
(@NotNull ImageInfo imageInfo, @NotNull SamplingMode samplingMode)
| 456 | * are out of range |
| 457 | */ |
| 458 | @Nullable |
| 459 | public Image makeScaled(@NotNull ImageInfo imageInfo, @NotNull SamplingMode samplingMode) { |
| 460 | try { |
| 461 | long ptr = _nMakeScaled(_ptr, |
| 462 | imageInfo._width, |
| 463 | imageInfo._height, |
| 464 | imageInfo._colorInfo._colorType.ordinal(), |
| 465 | imageInfo._colorInfo._alphaType.ordinal(), |
| 466 | Native.getPtr(imageInfo._colorInfo._colorSpace), |
| 467 | samplingMode._pack()); |
| 468 | return ptr == 0 ? null : new Image(ptr); |
| 469 | } finally { |
| 470 | ReferenceUtil.reachabilityFence(this); |
| 471 | ReferenceUtil.reachabilityFence(imageInfo); |
| 472 | } |
| 473 | } |
| 474 | |
| 475 | /** |
| 476 | * Returns an Image that is made from subset of this Image. |
no test coverage detected