MCPcopy Create free account
hub / github.com/JetBrains/skija / makeRaster

Method makeRaster

shared/java/Image.java:38–54  ·  view source on GitHub ↗

Creates Image from pixels. Image is returned if pixels are valid. Valid Pixmap parameters include: dimensions are greater than zero; each dimension fits in 29 bits; ColorType and AlphaType are valid, and ColorType is not ColorType.UNKNOWN; row bytes

(ImageInfo imageInfo, byte[] bytes, long rowBytes)

Source from the content-addressed store, hash-verified

36 * @see <a href="https://fiddle.skia.org/c/@Image_MakeRasterCopy">https://fiddle.skia.org/c/@Image_MakeRasterCopy</a>
37 */
38 public static Image makeRaster(ImageInfo imageInfo, byte[] bytes, long rowBytes) {
39 try {
40 Stats.onNativeCall();
41 long ptr = _nMakeRaster(imageInfo._width,
42 imageInfo._height,
43 imageInfo._colorInfo._colorType.ordinal(),
44 imageInfo._colorInfo._alphaType.ordinal(),
45 Native.getPtr(imageInfo._colorInfo._colorSpace),
46 bytes,
47 rowBytes);
48 if (ptr == 0)
49 throw new RuntimeException("Failed to makeRaster " + imageInfo + " " + bytes + " " + rowBytes);
50 return new Image(ptr);
51 } finally {
52 Reference.reachabilityFence(imageInfo._colorInfo._colorSpace);
53 }
54 }
55
56 /**
57 * <p>Creates Image from pixels.</p>

Callers 1

drawMethod · 0.95

Calls 4

onNativeCallMethod · 0.95
_nMakeRasterMethod · 0.95
getPtrMethod · 0.95
_nMakeRasterDataMethod · 0.95

Tested by

no test coverage detected