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 TypeMethodDescriptionbooleanGets the rawMemorySegment(C pointer) for this VipsSource structinthashCode()static VSourcenewFromBlob(Arena arena, VBlob blob) Create a new VSource from a VBlob, usually received from a Vips operationstatic VSourcenewFromBytes(Arena arena, byte[] bytes) Create a new VSource directly from some bytesstatic VSourcenewFromDescriptor(Arena arena, int descriptor) Create a new VSource from a file descriptorstatic VSourcenewFromFile(Arena arena, String filename) Create a new VSource from a file pathstatic VSourcenewFromInputStream(Arena arena, InputStream stream) Creates a new VSource from a Java
InputStreamThe 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 VSourcenewFromOptions(Arena arena, String options)
-
Method Details
-
equals
-
hashCode
-
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
InputStreamThe 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
-