- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
RasterSourceAcquireFunc is the type of function which is called when a
pattern is being rendered from. It should create a surface that provides the
pixel data for the region of interest as defined by extents, though the
surface itself does not have to be limited to that area. For convenience the
surface should probably be of image type, created with
Surface.createSimilarImage(Surface, Format, int, int)
for the target
(which enables the number of copies to be reduced during transfer to the
device). Another option, might be to return a similar surface to the target
for explicit handling by the application of a set of cached sources on the
device. The region of sample data provided should be defined using
Surface.setDeviceOffset(double, double)
to specify the top-left
corner of the sample data (along with width and height of the surface).- Since:
- 1.12
-
Method Summary
Modifier and TypeMethodDescriptionacquire
(RasterSource pattern, Surface target, RectangleInt extents) Called when a pattern is being rendered from.default MemorySegment
toCallback
(Arena arena) Generates an upcall stub, a C function pointer that will callupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
.default MemorySegment
upcall
(MemorySegment pattern, MemorySegment callbackData, MemorySegment target, MemorySegment extents) The callback that is executed by native code.
-
Method Details
-
acquire
Called when a pattern is being rendered from. It should create a surface that provides the pixel data for the region of interest as defined by extents, though the surface itself does not have to be limited to that area. For convenience the surface should probably be of image type, created withSurface.createSimilarImage(Surface, Format, int, int)
for the target (which enables the number of copies to be reduced during transfer to the device). Another option, might be to return a similar surface to the target for explicit handling by the application of a set of cached sources on the device. The region of sample data provided should be defined usingSurface.setDeviceOffset(double, double)
to specify the top-left corner of the sample data (along with width and height of the surface).- Parameters:
pattern
- the pattern being rendered fromtarget
- the rendering target surfaceextents
- rectangular region of interest in pixels in sample space- Returns:
- a
Surface
- Since:
- 1.12
-
upcall
default MemorySegment upcall(MemorySegment pattern, MemorySegment callbackData, MemorySegment target, MemorySegment extents) The callback that is executed by native code. This method marshals the parameters and callsacquire(RasterSource, Surface, RectangleInt)
.- Parameters:
pattern
- the pattern being rendered fromcallbackData
- ignoredtarget
- the rendering target surfaceextents
- rectangular region of interest in pixels in sample space- Returns:
- a
Surface
- Since:
- 1.12
-
toCallback
Generates an upcall stub, a C function pointer that will callupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
.- Parameters:
arena
- the arena in which the upcall stub will be allocated- Returns:
- the function pointer of the upcall stub
- Since:
- 1.12
-