Sets ImageInfo to info following the rules in setImageInfo() and allocates pixel memory. rowBytes must equal or exceed info.width() times info.bytesPerPixel(), or equal zero. Returns false and calls reset() if ImageInfo could not be set, or memory could not be allocated. On most p
(@NotNull ImageInfo info, long rowBytes)
| 464 | * @return true if pixel storage is allocated |
| 465 | */ |
| 466 | public boolean allocPixels(@NotNull ImageInfo info, long rowBytes) { |
| 467 | try { |
| 468 | _imageInfo = null; |
| 469 | Stats.onNativeCall(); |
| 470 | return _nAllocPixelsRowBytes(_ptr, |
| 471 | info._width, |
| 472 | info._height, |
| 473 | info._colorInfo._colorType.ordinal(), |
| 474 | info._colorInfo._alphaType.ordinal(), |
| 475 | Native.getPtr(info._colorInfo._colorSpace), |
| 476 | rowBytes); |
| 477 | } finally { |
| 478 | ReferenceUtil.reachabilityFence(this); |
| 479 | ReferenceUtil.reachabilityFence(info._colorInfo._colorSpace); |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | /** |
| 484 | * <p>Sets ImageInfo to info following the rules in {@link #setImageInfo(ImageInfo, long)} and allocates pixel |