Beispiel #1
0
 public static CGGradient create(CGColorSpace space, float[] components, float[] locations) {
   if (space == null) {
     throw new NullPointerException("space");
   }
   if (components == null) {
     throw new NullPointerException("components");
   }
   return create(
       space,
       VM.getArrayValuesAddress(CoreGraphics.toMachineSizedFloatArray(components)),
       locations != null
           ? VM.getArrayValuesAddress(CoreGraphics.toMachineSizedFloatArray(locations))
           : 0,
       locations != null ? locations.length : 0);
 }
Beispiel #2
0
 public void replaceRegion(
     @ByVal MTLRegion region,
     @MachineSizedUInt long level,
     byte[] pixelBytes,
     @MachineSizedUInt long bytesPerRow) {
   replaceRegion(region, level, VM.getArrayValuesAddress(pixelBytes), bytesPerRow);
 }
Beispiel #3
0
 /*</constructors>*/
 public NSOutputStream(byte[] bytes) {
   super((SkipInit) null);
   if (bytes == null) {
     throw new NullPointerException("bytes");
   }
   initObject(init(VM.getArrayValuesAddress(bytes), bytes.length));
 }
Beispiel #4
0
 public long write(byte[] bytes, int offset, int length) {
   NSMutableData.checkOffsetAndCount(bytes.length, offset, length);
   if (length == 0) {
     return 0;
   }
   return write(VM.getArrayValuesAddress(bytes) + offset, length);
 }
Beispiel #5
0
 public byte[] getBytes(
     int length,
     @MachineSizedUInt long bytesPerRow,
     @ByVal MTLRegion region,
     @MachineSizedUInt long level) {
   byte[] bytes = new byte[length];
   getBytes(VM.getArrayValuesAddress(bytes), bytesPerRow, region, level);
   return bytes;
 }
Beispiel #6
0
 private static CGGradient create(CGColorSpace space, CGColor[] colors, Object locations) {
   if (colors == null) {
     throw new NullPointerException("colors");
   }
   try (CFArray colorsArray = CFArray.create(colors)) {
     return create(
         space,
         colorsArray,
         locations != null
             ? VM.getArrayValuesAddress(CoreGraphics.toMachineSizedFloatArray(locations))
             : 0);
   }
 }
Beispiel #7
0
 private static CGGradient create(CGColorSpace space, CGColor[] colors, Object locations) {
   if (colors == null) {
     throw new NullPointerException("colors");
   }
   try (CFMutableArray colorsArray =
       CFMutableArray.createMutable(null, colors.length, CoreFoundation.TypeArrayCallBacks())) {
     for (CGColor c : colors) {
       colorsArray.appendValue(Struct.toStruct(VoidPtr.class, c.getHandle()));
     }
     return create(
         space,
         colorsArray,
         locations != null
             ? VM.getArrayValuesAddress(CoreGraphics.toMachineSizedFloatArray(locations))
             : 0);
   }
 }
Beispiel #8
0
 /*</members>*/
 public ByteBuffer getContents() {
   return VM.newDirectByteBuffer(getContents0(), (int) getLength());
 }