Movatterモバイル変換


[0]ホーム

URL:


Class

VipsSource

Description[src]

class Vips.Source : Vips.Connection{  gboolean decode,  gboolean have_tested_seek,  gboolean is_pipe,  gint64 read_position,  gint64 length}

AVipsSource provides a unified interface for reading, seeking, andmapping data, regardless of the underlying source type.

This source can originate from something like a socket, file or memory area.

During the header phase, we save data from unseekable sources in a bufferso readers can rewind and read again. We don’t buffer data during thedecode stage.

Hierarchy

hierarchythisVipsSourceancestor_0VipsConnectionancestor_0--thisancestor_1VipsObjectancestor_1--ancestor_0ancestor_2GObjectancestor_2--ancestor_1

Ancestors

Descendants

Constructors

vips_source_new_from_blob

Create a source attached to an area of memory.

vips_source_new_from_descriptor

Create an source attached to a file descriptor.descriptor isclosed withclose() when source is finalized.

vips_source_new_from_file

Create a source attached to a file.

vips_source_new_from_memory

Create a source attached to an area of memory.

vips_source_new_from_options

Create a source from an option string.

vips_source_new_from_target

Create a source from a temp target that has been written to.

Functions

vips_source_g_input_stream_new

Create aVipsSourceGInputStream which wrapsstream.

Instance methods

vips_source_decode

Signal the end of header read and the start of the pixel decode phase.After this, you can no longer seek on this source.

vips_source_is_file

Test if this source is a simple file with support for seek. Named pipes,for example, will fail this test. IfTRUE, you can usevips_connection_filename() to find the filename.

vips_source_is_mappable

Some sources can be efficiently mapped into memory.You can still usevips_source_map() if this function returnsFALSE,but it will be slow.

vips_source_length

Return the length in bytes of the source. Unseekable sources, forexample pipes, will have to be read entirely into memory before the lengthcan be found, so this operation can take a long time.

vips_source_map

Map the source entirely into memory and return a pointer to thestart. Iflength is non-NULL, the source size is written to it.

vips_source_map_blob

Just likevips_source_map(), but return aVipsBlob containing thepointer.source will stay alive as long as the result is alive.

vips_source_minimise

Minimise the source. As many resources as can be safely removed areremoved. Usevips_source_unminimise() to restore the source if you wish touse it again.

vips_source_read

Read up tolength bytes fromsource and store the bytes inbuffer.Return the number of bytes actually read. If all bytes have been read fromthe file, return 0.

vips_source_rewind

Rewind the source to the start.

vips_source_seek

Move the file read position. You can’t call this after pixel decode starts.The arguments are exactly aslseek().

vips_source_sniff

Return a pointer to the first few bytes of the file. If the file is tooshort, returnNULL.

vips_source_sniff_at_most

Attempt to sniff at mostlength bytes from the start of the source. Apointer to the bytes is returned indata. The number of bytes actuallyread is returned — it may be less thanlength if the file is shorter thanlength. A negative number indicates a read error.

vips_source_unminimise

Restore the source after minimisation. This is called at the startof every source method, so loaders should not usually need this.

Methods inherited fromVipsConnection (2)
vips_connection_filename
No description available.

vips_connection_nick
No description available.

Methods inherited fromVipsObject (27)

Please see VipsObject for a full list of methods.

Methods inherited fromGObject (43)

Please see GObject for a full list of methods.

Properties

Vips.Source:blob
No description available.

Properties inherited fromVipsConnection (2)
Vips.Connection:descriptor
No description available.

Vips.Connection:filename
No description available.

Properties inherited fromVipsObject (2)
Vips.Object:description
No description available.

Vips.Object:nickname
No description available.

Signals

Signals inherited fromVipsObject (4)
VipsObject::close

The ::close signal is emitted once during object close. The objectis dying and may not work.

VipsObject::postbuild

The ::postbuild signal is emitted once just after successful objectconstruction. Return non-zero to cause object construction to fail.

VipsObject::postclose

The ::postclose signal is emitted once after object close. Theobject pointer is still valid, but nothing else.

VipsObject::preclose

The ::preclose signal is emitted once just before object closestarts. The object is still alive.

Signals inherited fromGObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties hasits value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct VipsSourceClass {  VipsConnectionClass parent_class;  gint64 (* read) (    VipsSource* source,    void* buffer,    size_t length  );  gint64 (* seek) (    VipsSource* source,    gint64 offset,    int whence  );  }

No description available.

Class members
parent_class: VipsConnectionClass

No description available.

read: gint64 (* read) ( VipsSource* source, void* buffer, size_t length )

No description available.

seek: gint64 (* seek) ( VipsSource* source, gint64 offset, int whence )

No description available.

Virtual methods

Vips.SourceClass.read

Read up tolength bytes fromsource and store the bytes inbuffer.Return the number of bytes actually read. If all bytes have been read fromthe file, return 0.

Vips.SourceClass.seek

Move the file read position. You can’t call this after pixel decode starts.The arguments are exactly aslseek().


[8]ページ先頭

©2009-2025 Movatter.jp