Aperture.Viewfinder¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)
- Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
The camera to use |
||
r/w/en |
Whether to detect barcodes in the camera feed |
||
r |
What the viewfinder is currently doing |
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when a barcode is detected in the camera feed. |
Fields¶
- Inherited:
Class Details¶
- class Aperture.Viewfinder(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
a new
Aperture.Viewfinder
- Return type:
Creates a new
Aperture.Viewfinder
.New in version 0.1.
- get_camera()¶
- Returns:
the current camera
- Return type:
Gets the camera that the
Aperture.Viewfinder
is currently using. SeeAperture.Viewfinder
:camera
.New in version 0.1.
- get_detect_barcodes()¶
-
Gets whether the
Aperture.Viewfinder
is looking for barcodes in its camera feed.New in version 0.1.
- get_state()¶
- Returns:
the viewfinder’s state
- Return type:
Gets the state of the
Aperture.Viewfinder
. SeeAperture.Viewfinder
:state
.New in version 0.1.
- set_camera(camera)¶
- Parameters:
camera (
Aperture.Camera
) – a camera index- Raises:
Sets the camera that the
Aperture.Viewfinder
will use. SeeAperture.Viewfinder
:camera
.New in version 0.1.
- set_detect_barcodes(detect_barcodes)¶
-
Sets whether the
Aperture.Viewfinder
should look for barcodes in its camera feed. SeeAperture.Viewfinder
:detect-barcodes
.Before calling this function, use
Aperture.is_barcode_detection_enabled
() to make sure the barcode detection feature is enabled.New in version 0.1.
- start_recording_to_file(file)¶
- Parameters:
file (
str
) – file path to save the video to- Raises:
Starts recording a video. The video will be saved to file.
Call
Aperture.Viewfinder.stop_recording_async
() to stop recording.New in version 0.1.
- stop_recording_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to execute upon completion
Stop recording video. callback will be called when this is complete.
New in version 0.1.
- stop_recording_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
provided to callback- Raises:
- Returns:
- Return type:
Finishes an operation started by
Aperture.Viewfinder.stop_recording_async
().New in version 0.1.
- take_picture_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to execute upon completion
Takes a picture.
This may take a while. The resolution might be changed temporarily, autofocusing might take place, etc. Basically everything you’d expect to happen when you click the photo button in a camera app.
When the picture has been taken, callback will be called. Use
Aperture.Viewfinder.take_picture_finish
() to get the picture as aGdkPixbuf.Pixbuf
.New in version 0.1.
- take_picture_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
provided to callback- Raises:
- Returns:
the image that was taken, or
None
if there was an error- Return type:
Finishes an operation started by
Aperture.Viewfinder.take_picture_async
().New in version 0.1.
Signal Details¶
- Aperture.Viewfinder.signals.barcode_detected(viewfinder, barcode_type, data)¶
- Signal Name:
barcode-detected
- Flags:
- Parameters:
viewfinder (
Aperture.Viewfinder
) – The object which received the signalbarcode_type (
Aperture.Barcode
) – the type of barcodedata (
str
) – the data encoded in the barcode
Emitted when a barcode is detected in the camera feed.
This will only be emitted if
Aperture.Viewfinder
:detect-barcodes
isTrue
.Barcodes are only detected when they appear on the feed, not on every frame when they are visible.
New in version 0.1.
Property Details¶
- Aperture.Viewfinder.props.camera¶
- Name:
camera
- Type:
- Default Value:
- Flags:
The camera that is currently being used.
Use
Aperture.DeviceManager
to obtainAperture.Camera
objects.To successfully switch cameras, the
Aperture.Viewfinder
must be in theAperture.ViewfinderState.READY
state. This is because switching camera sources would interrupt any picture or video that is being taken.New in version 0.1.
- Aperture.Viewfinder.props.detect_barcodes¶
- Name:
detect-barcodes
- Type:
- Default Value:
- Flags:
Whether the
Aperture.Viewfinder
should detect barcodes.When a barcode is detected, the
::barcode-detected
signal will be emitted.This only works if barcode detection is enabled. See
Aperture.is_barcode_detection_enabled
(). If barcode detection is not available, the value of this property will always beFalse
, even if you try to set it toTrue
.New in version 0.1.
- Aperture.Viewfinder.props.state¶
- Name:
state
- Type:
- Default Value:
- Flags:
What the viewfinder is currently doing.
The state indicates what the viewfinder is currently doing, or sometimes that an error occurred. Many operations, like taking a picture or starting a recording, require that the
Aperture.Viewfinder
be in theAperture.ViewfinderState.READY
state.New in version 0.1.