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

Method makeRasterFromData

shared/java/Image.java:150–167  ·  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, Data data, long rowBytes)

Source from the content-addressed store, hash-verified

148 * @return Image
149 */
150 public static Image makeRasterFromData(ImageInfo imageInfo, Data data, long rowBytes) {
151 try {
152 Stats.onNativeCall();
153 long ptr = _nMakeRasterFromData(imageInfo._width,
154 imageInfo._height,
155 imageInfo._colorInfo._colorType.ordinal(),
156 imageInfo._colorInfo._alphaType.ordinal(),
157 Native.getPtr(imageInfo._colorInfo._colorSpace),
158 Native.getPtr(data),
159 rowBytes);
160 if (ptr == 0)
161 throw new RuntimeException("Failed to makeRaster " + imageInfo + " " + data + " " + rowBytes);
162 return new Image(ptr);
163 } finally {
164 ReferenceUtil.reachabilityFence(imageInfo._colorInfo._colorSpace);
165 ReferenceUtil.reachabilityFence(data);
166 }
167 }
168
169 /**
170 * @deprecated - use {@link #makeRasterFromBitmap(Bitmap)}

Callers 2

makeRasterMethod · 0.95
drawMethod · 0.95

Calls 4

onNativeCallMethod · 0.95
_nMakeRasterFromDataMethod · 0.95
getPtrMethod · 0.95
reachabilityFenceMethod · 0.95

Tested by

no test coverage detected