Vips.Foreign¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_object |
r |
Class Details¶
- class Vips.Foreign(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
- classmethod find_load(filename)¶
- Parameters:
filename (
str
) – file to find a loader for- Returns:
the name of an operation on success,
None
on error- Return type:
Searches for an operation you could use to load filename. Any trailing options on filename are stripped and ignored.
See also:
Vips.Foreign.find_load_buffer
(), vips_image_new_from_file().
- classmethod find_load_buffer(data)¶
- Parameters:
data (
bytes
) – start of memory buffer- Returns:
the name of an operation on success,
None
on error.- Return type:
Searches for an operation you could use to load a memory buffer. To see the range of buffer loaders supported by your vips, try something like:
vips -l | grep load_buffer
See also: vips_image_new_from_buffer().
- classmethod find_load_source(source)¶
- Parameters:
source (
Vips.Source
) – source to load from- Returns:
the name of an operation on success,
None
on error.- Return type:
Searches for an operation you could use to load a source. To see the range of source loaders supported by your vips, try something like:
vips -l | grep load_source
See also: vips_image_new_from_source().
- classmethod find_save(filename)¶
- Parameters:
filename (
str
) – name to find a saver for- Returns:
the name of an operation on success,
None
on error- Return type:
Searches for an operation you could use to write to filename. Any trailing options on filename are stripped and ignored.
See also:
Vips.Foreign.find_save_buffer
(), vips_image_write_to_file().
- classmethod find_save_buffer(suffix)¶
- Parameters:
suffix (
str
) – name to find a saver for- Returns:
the name of an operation on success,
None
on error- Return type:
Searches for an operation you could use to write to a buffer in suffix format.
See also: vips_image_write_to_buffer().
- classmethod find_save_target(suffix)¶
- Parameters:
suffix (
str
) – format to find a saver for- Returns:
the name of an operation on success,
None
on error- Return type:
Searches for an operation you could use to write to a target in suffix format.
See also: vips_image_write_to_buffer().
- classmethod get_suffixes()¶
-
Get a
None
-terminated array listing all the supported suffixes.This is not the same as all the supported file types, since libvips detects image format for load by testing the first few bytes.
Use
Vips.Foreign.find_load
() to detect type for a specific file.Free the return result with
GLib.strfreev
().
- classmethod is_a(loader, filename)¶
- Parameters:
- Returns:
True
if filename can be loaded by loader.- Return type:
Return
True
if filename can be loaded by loader. loader is something like “tiffload” or “VipsForeignLoadTiff”.
- classmethod is_a_buffer(loader, data)¶
- Parameters:
- Returns:
True
if data can be loaded by loader.- Return type:
Return
True
if data can be loaded by loader. loader is something like “tiffload_buffer” or “VipsForeignLoadTiffBuffer”.
- classmethod is_a_source(loader, source)¶
- Parameters:
loader (
str
) – name of loader to use for testsource (
Vips.Source
) – source to test
- Returns:
True
if data can be loaded by source.- Return type:
Return
True
if source can be loaded by loader. loader is something like “tiffload_source” or “VipsForeignLoadTiffSource”.
- classmethod map(base, fn, a, b)¶
- Parameters:
base (
str
) – base class to search below (eg. “Vips.ForeignLoad
")fn (
Vips.SListMap2Fn
) – function to apply to eachVips.ForeignClass
- Returns:
the result of iteration
- Return type:
Apply a function to every
Vips.ForeignClass
that VIPS knows about. Foreigns are presented to the function in priority order.Like all VIPS map functions, if fn returns
None
, iteration continues. If it returns non-None
, iteration terminates and that value is returned. The map function returnsNone
if all calls returnNone
.See also: vips_slist_map().