Class: Vips::Target
- Inherits:
-
Connection
- Object
- GObject::GObject
- Object
- Connection
- Vips::Target
- Defined in:
- lib/vips/target.rb
Overview
A target. For example:
target = Vips ::Target.new_to_file ('k2.jpg')
image.write_to_target(target, '.jpg')
Direct Known Subclasses
Defined Under Namespace
Modules: TargetLayout Classes: ManagedStruct , Struct
Instance Attribute Summary
Attributes inherited from GObject::GObject
Class Method Summary collapse
-
.new_to_descriptor(descriptor) ⇒ Target
Create a new target to a file descriptor.
-
.new_to_file(filename) ⇒ Target
Create a new target to a file name.
-
.new_to_memory ⇒ Target
Create a new target to an area of memory.
Methods inherited from Connection
Methods inherited from Object
#get , #get_pspec , #get_typeof , #get_typeof_error , print_all , #set , #signal_connect
Methods inherited from GObject::GObject
#ffi_managed_struct , ffi_managed_struct , #ffi_struct , ffi_struct , #initialize
Constructor Details
This class inherits a constructor from GObject::GObject
Class Method Details
.new_to_descriptor(descriptor) ⇒ Target
Create a new target to a file descriptor. File descriptors are small integers, for example 1 is stdout.
Pass targets to Image#write_to_target to write images to them.
Parameters:
-
descriptor
(Integer)
—
the file descriptor
Returns:
-
(Target )
—
the new Vips::Target
Raises:
- (Vips::Error )
.new_to_file(filename) ⇒ Target
Create a new target to a file name.
Pass targets to Image#write_to_target to write images to them.
Parameters:
-
filename
(String)
—
the name of the file
Returns:
-
(Target )
—
the new Vips::Target
Raises:
- (Vips::Error )
.new_to_memory ⇒ Target
Create a new target to an area of memory.
Pass targets to Image#write_to_target to write images to them.
Once the image has been written, use Object#get ("blob")
to read out the data.
Returns:
-
(Target )
—
the new Vips::Target