MCPcopy Create free account
hub / github.com/HumbleUI/Skija / makeScaled

Method makeScaled

shared/java/Image.java:458–473  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 2

drawMethod · 0.80

Calls 4

_nMakeScaledMethod · 0.95
getPtrMethod · 0.95
reachabilityFenceMethod · 0.95
_packMethod · 0.65

Tested by

no test coverage detected