Class VSource
- Direct Known Subclasses:
VCustomSource
Represents a VipsSource
Its constructor is package private to prevent leaking MemorySegments in to the vips-ffm API
Use its static helper methods to create new sources
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated, for removal: This API element is subject to removal in a future version.Gets the rawMemorySegment
(C pointer) for this VipsSource structint
hashCode()
static VSource
newFromBlob
(Arena arena, VBlob blob) Create a new VSource from a VBlob, usually received from a Vips operationstatic VSource
newFromBytes
(Arena arena, byte[] bytes) Create a new VSource directly from some bytesstatic VSource
newFromDescriptor
(Arena arena, int descriptor) Create a new VSource from a file descriptorstatic VSource
newFromFile
(Arena arena, String filename) Create a new VSource from a file pathstatic VSource
newFromInputStream
(Arena arena, InputStream stream) Creates a new VSource from a Java
InputStream
The provided InputStream is coupled to the arena's lifetime, and closed when its scope ends
Note that you can read an image directly from an InputStream using
VImage.newFromStream(java.lang.foreign.Arena, java.io.InputStream, java.lang.String, app.photofox.vipsffm.VipsOption...)
This stream does not support seeking, because InputStream does not support it, so cannot be maximally efficient - but it is still likely more efficient than taking a full intermediate copy of bytes
static VSource
newFromOptions
(Arena arena, String options)
-
Method Details
-
equals
-
hashCode
-
getUnsafeAddress
Deprecated, for removal: This API element is subject to removal in a future version. -
getUnsafeStructAddress
Gets the raw
MemorySegment
(C pointer) for this VipsSource structThe memory address' lifetime is bound to the scope of the arena that created it
Usage of the memory address is strongly discouraged, but it is available if some functionality is missing, and you need to use it with
VipsHelper
-
newFromDescriptor
-
newFromFile
-
newFromBlob
-
newFromBytes
Create a new VSource directly from some bytes
Note that this makes a full copy of the data, which is inefficient - prefer
VImage.newFromFile(java.lang.foreign.Arena, java.lang.String, app.photofox.vipsffm.VipsOption...)
and friends- Throws:
VipsError
-
newFromOptions
-
newFromInputStream
Creates a new VSource from a Java
InputStream
The provided InputStream is coupled to the arena's lifetime, and closed when its scope ends
Note that you can read an image directly from an InputStream using
VImage.newFromStream(java.lang.foreign.Arena, java.io.InputStream, java.lang.String, app.photofox.vipsffm.VipsOption...)
This stream does not support seeking, because InputStream does not support it, so cannot be maximally efficient - but it is still likely more efficient than taking a full intermediate copy of bytes
- Throws:
VipsError
-
getUnsafeStructAddress()