Olympus camera class.
This class provides the operation and display of live view, including content acquisition in the camera and capturing of still images and recording movies by connecting to the camera. This class has several groups.
Please refer to each group for details of the interface.
Several functions are provided for the vendor. These are not available in third party applications.
Classes | |
| enum | ActionType |
| Type of shooting mode and drive mode. More... | |
| interface | CompletedCallback |
| Interface to monitor whether operation is complete. More... | |
| enum | ConnectionType |
| Connection classification for camera. More... | |
| interface | DownloadContentCallback |
| Interface to monitor download progress of media file. More... | |
| interface | DownloadContentListCallback |
| Interface to monitor download progress for list of media stored in the camera. More... | |
| interface | DownloadImageCallback |
| Interface to monitor progress of image download. More... | |
| interface | DownloadLargeContentCallback |
| Interface to monitor download progress of large media file. More... | |
| enum | DrivingZoomLensDirection |
| Driving direction of optical zoom. More... | |
| enum | DrivingZoomLensSpeed |
| Driving speed of optical zoom. More... | |
| class | LiveViewSize |
| Supported frame size of live view image in pixels. More... | |
| enum | MagnifyingLiveViewScale |
| Magnification of live view. More... | |
| enum | MagnifyingLiveViewScrollDirection |
| Scroll direction in magnified live view. More... | |
| interface | ProgressCallback |
| Interface to monitor processing status. More... | |
| class | ProgressEvent |
| Report progress of processing. More... | |
| enum | ResizeVideoQuality |
| Supported video quality when resized. More... | |
| enum | RunMode |
| Run mode of the camera. More... | |
| interface | TakePictureCallback |
| Interface to monitor progress of shooting operation. More... | |
| enum | TakingProgress |
| Progress of shooting operation. More... | |
Instance | |
This is OLYCamera instance group. | |
| OLYCamera () | |
| Constructor of OLYCamera. | |
| String | toString () |
| Return description of this object in string format. More... | |
| Context | getContext () |
| Return application context object to use Wi-Fi and Bluetooth. More... | |
| void | setContext (Context context) |
| Set application context object to use Wi-Fi and Bluetooth. More... | |
| static String | getVersion () |
| Version of Olympus camera kit. More... | |
| static String | getBuildNumber () |
| Build number of Olympus camera kit. | |
Camera Communication group | |
|
Camera communication group of Olympus camera class. This group connects and disconnects the camera. | |
| String | getHost () |
| Return IP address of the camera. More... | |
| void | setHost (String host) |
| Set IP address of the camera. More... | |
| int | getCommandPort () |
| Return port number where the camera receives commands. More... | |
| void | setCommandPort (int port) |
| Set port number where the camera receives commands. More... | |
| int | getLiveViewStreamingPort () |
| Return port number where Camera Kit receives live view images. More... | |
| void | setLiveViewStreamingPort (int port) |
| Set receive port for live view streaming. More... | |
| int | getEventPort () |
| Return port number where Camera Kit receives events issued by the camera. More... | |
| void | setEventPort (int port) |
| Set port number where Camera Kit receives events issued by the camera. More... | |
| BluetoothDevice | getBluetoothDevice () |
| Return object for Bluetooth device. More... | |
| void | setBluetoothDevice (BluetoothDevice device) |
| Set object for Bluetooth device. More... | |
| String | getBluetoothPassword () |
| Return password to connect to the camera via Bluetooth. More... | |
| void | setBluetoothPassword (String password) |
| Set password to connect to the camera via Bluetooth. More... | |
| boolean | isBluetoothPrepareForRecordingWhenPowerOn () |
| Return if the camera starts recording setup after power on via Bluetooth. More... | |
| void | setBluetoothPrepareForRecordingWhenPowerOn (boolean prepareForRecordingWhenPowerOn) |
| Set if the camera starts recording setup after power on via Bluetooth. More... | |
| boolean | isConnectingRequiresBluetoothPassword () throws OLYCameraKitException |
| Return if application needs to set a password property when connecting to the camera via Bluetooth. More... | |
| void | wakeup () throws OLYCameraKitException |
| Wake up the camera via Bluetooth Smart. More... | |
| ConnectionType | getConnectionType () |
| Return type of connection to the camera. More... | |
| void | setConnectionListener (OLYCameraConnectionListener l) |
| Set listener to receive change to communication state of the camera. More... | |
| boolean | isConnected () |
| Return if the camera is currently connected. More... | |
| boolean | canConnect (ConnectionType connectionType, long timeout) |
| Indicate if the application can connect to the camera. More... | |
| void | connect (ConnectionType connectionType) throws OLYCameraKitException |
| Connect to the camera. More... | |
| void | disconnectWithPowerOff (boolean powerOff) throws OLYCameraKitException |
| Disconnect from the camera. More... | |
| static UUID[] | getBluetoothServices () |
| Return list of Bluetooth service ID. More... | |
Camera system group | |
|
This is camera system group of Olympus camera class. For example, application can get or set the following camera properties:
Please refer to the camera list of properties for more information. | |
| static final String | HARDWARE_INFORMATION_CAMERA_MODEL_NAME_KEY = "cameramodel" |
| Dictionary key for accessing 'Camera Model Name' elements of camera hardware information. | |
| static final String | HARDWARE_INFORMATION_CAMERA_FIRMWARE_VERSION_KEY = "fwversion" |
| Dictionary key for accessing 'Camera Firmware Version' elements of camera hardware information. | |
| static final String | HARDWARE_INFORMATION_LENS_TYPE_KEY = "lenstype" |
| Dictionary key for accessing 'Lens Type' elements of camera hardware information. | |
| static final String | HARDWARE_INFORMATION_LENS_ID_KEY = "lensID" |
| Dictionary key for accessing 'Lens ID' elements of camera hardware information. | |
| static final String | HARDWARE_INFORMATION_LENS_FIRMWARE_VERSION_KEY = "lensfwversion" |
| Dictionary key for accessing 'Lens Firmware Version' elements of camera hardware information. | |
| static final String | HARDWARE_INFORMATION_FLASH_ID_KEY = "stbID" |
| Dictionary key for accessing 'Flash ID' elements of camera hardware information. | |
| static final String | HARDWARE_INFORMATION_FLASH_FIRMWARE_VERSION_KEY = "stbfwversion" |
| Dictionary key for accessing 'Flash Firmware Version' elements of camera hardware information. | |
| static final String | HARDWARE_INFORMATION_ACCESSORY_ID_KEY = "acclensID" |
| Dictionary key for accessing 'Accessory ID' elements of camera hardware information. | |
| static final String | HARDWARE_INFORMATION_ACCESSORY_FIRMWARE_VERSION_KEY = "acclensfwversion" |
| Dictionary key for accessing 'Accessory Firmware Version' elements of camera hardware information. | |
| void | setCameraStatusListener (OLYCameraStatusListener l) |
| Set listener to receive changes to camera property. More... | |
| boolean | isHighTemperatureWarning () |
| Return whether inside of the camera is in high-temperature condition. More... | |
| String | getLensMountStatus () |
| Return status of lens mount. More... | |
| String | getMediaMountStatus () |
| Return status of media (memory card) mount. More... | |
| boolean | isMediaBusy () |
| Return whether the camera is writing to the media (memory card). More... | |
| boolean | isMediaError () |
| Return whether the media (memory card) I/O error has occurred. More... | |
| long | getRemainingMediaCapacity () |
| Free space of the media (memory card) attached to the camera. More... | |
| int | getRemainingImageCapacity () |
| Return the maximum number of images that can be stored in the media (memory card). More... | |
| double | getRemainingVideoCapacity () |
| Return the maximum number of seconds a movie that can be stored in the media (memory card). More... | |
| Map< String, Object > | inquireHardwareInformation () throws OLYCameraKitException |
| Get hardware information of the camera. More... | |
| void | setCameraPropertyListener (OLYCameraPropertyListener l) |
| Set listener to receive when the camera property changes. More... | |
| Set< String > | getCameraPropertyNames () |
| Return list of camera property names currently available. More... | |
| List< String > | getCameraPropertyValueList (String name) throws OLYCameraKitException |
| Get list of the camera property values that can be set. More... | |
| String | getCameraPropertyValue (String name) throws OLYCameraKitException |
| Get value that is set in the camera properties. More... | |
| Map< String, String > | getCameraPropertyValues (Set< String > names) throws OLYCameraKitException |
| Get values that are set in the camera properties. More... | |
| String | getCameraPropertyTitle (String name) |
| Get title of the camera property. More... | |
| String | getCameraPropertyValueTitle (String value) |
| Get title of the camera property value. More... | |
| boolean | canSetCameraProperty (String name) |
| Check to see if value to the camera properties can be set. More... | |
| void | setCameraPropertyValue (String name, String value) throws OLYCameraKitException |
| Set value to the camera properties. More... | |
| void | setCameraPropertyValues (Map< String, String > values) throws OLYCameraKitException |
| Set values to camera properties. More... | |
| RunMode | getRunMode () |
| Return current run mode of the camera. More... | |
| void | changeRunMode (RunMode mode) throws IllegalArgumentException, OLYCameraKitException |
| Changes run mode of the camera system. More... | |
| void | changeTime (Date date) throws OLYCameraKitException |
| Change date and time of camera. More... | |
| void | setGeolocation (String location) throws OLYCameraKitException |
| Register geolocation information to the camera. More... | |
| void | clearGeolocation () throws OLYCameraKitException |
| Discard registered geolocation information. More... | |
Playback group | |
|
Playback group of Olympus camera class. This group downloads and edits still image and movie saved in the camera. | |
| static final float | IMAGE_RESIZE_1024 = 1024 |
| Resize long side of the image to 1024 pixels. | |
| static final float | IMAGE_RESIZE_1600 = 1600 |
| Resize long side of the image to 1600 pixels. | |
| static final float | IMAGE_RESIZE_1920 = 1920 |
| Resize long side of the image to 1920 pixels. | |
| static final float | IMAGE_RESIZE_2048 = 2048 |
| Resize long side of the image to 2048 pixels. | |
| static final float | IMAGE_RESIZE_NONE = Float.MAX_VALUE |
| Use the original size of the image. | |
| void | setPlaybackListener (OLYCameraPlaybackListener l) |
| Set listener to receive changes to playback operations. More... | |
| void | downloadContentList (DownloadContentListCallback callback) |
| Download list of all supported media (still image and video) in the camera. More... | |
| void | downloadContentThumbnail (String path, DownloadImageCallback callback) |
| Download thumbnail of media (still image and movie) stored in memory card. More... | |
| void | downloadContentScreennail (String path, DownloadImageCallback callback) |
| Download reduced image of media (still image and movie) stored in memory card. More... | |
| void | downloadImage (String path, float resize, DownloadImageCallback callback) |
| Download resized still image. More... | |
| void | downloadContent (String path, DownloadContentCallback callback) |
| Download media (still image and movie) stored in memory card. More... | |
| void | downloadLargeContent (String path, DownloadLargeContentCallback callback) |
| Split large media (still image or movie) into smaller parts and download each part. More... | |
| int | countNumberOfContents () throws OLYCameraKitException |
| Count the number of media (still image and movie) in the camera. More... | |
| Map< String, Object > | inquireContentInformation (String path) throws OLYCameraKitException |
| Get information of media (still image and movie) stored in memory card. More... | |
| void | resizeVideoFrame (String path, float resize, ResizeVideoQuality quality, ProgressCallback callback) |
| Resizes each frame of the video content, and save it as a new content into the camera. More... | |
Playback Auxiliary group | |
|
It is a playback auxiliary group of Olympus camera class. This group can erase video and still image and movie saved in the camera. | |
| void | protectContent (String path) throws OLYCameraKitException |
| Protect media (still image and movie) stored in memory card. More... | |
| void | unprotectContent (String path) throws OLYCameraKitException |
| Cancel protection of the media (still image and movie) stored in memory card. More... | |
| void | unprotectAllContents (ProgressCallback callback) |
| Cancel protection of all the media (still image and movie) stored in memory card. More... | |
| void | eraseContent (String path) throws OLYCameraKitException |
| Delete media (still image and movie) stored in memory card. More... | |
Recording group of Olympus camera class. | |
|
This group takes still pictures, records video, and controls exposure and focus. Application can configure exposure parameters, focus, color and tone using camera property control methods in Camera System group Please refer to list of camera properties for more information. | |
| static final String | START_TAKING_PICTURE_OPTION_LIMIT_SHOOTINGS_KEY = "_limit" |
| Dictionary key to access elements that specifies maximum number of shots at beginning of continuous shooting. | |
| boolean | isAutoStartLiveView () |
| Return whether live view starts automatically when run mode is changed to Recording mode. More... | |
| void | setAutoStartLiveView (boolean autoStartLiveView) |
| Set true to start live view automatically when run mode is changed to Recording mode. More... | |
| boolean | isLiveViewEnabled () |
| Return whether live view started. More... | |
| OLYCamera.LiveViewSize | getLiveViewSize () |
| Return frame size of live view in pixels. More... | |
| void | setLiveViewListener (OLYCameraLiveViewListener l) |
| Set listener to notify state of live view image when it changes. More... | |
| void | setRecordingListener (OLYCameraRecordingListener l) |
| Set listener to notify camera state when it changes. More... | |
| boolean | isTakingPicture () |
| Return whether photo shooting is in progress on the camera. More... | |
| boolean | isRecordingVideo () |
| Return whether video recording is in progress on the camera. More... | |
| PointF | getActualAutoFocusPoint () |
| Return coordinates focused with autofocus. More... | |
| float | getActualFocalLength () |
| Return current focal length of the lens. More... | |
| float | getMinimumFocalLength () |
| Return focal length at the wide end of the lens. More... | |
| float | getMaximumFocalLength () |
| Return focal length at the telephoto end of the lens. More... | |
| String | getActualApertureValue () |
| Return F value used by lens and camera. More... | |
| String | getActualShutterSpeed () |
| Return shutter speed used by the camera. More... | |
| String | getActualExposureCompensation () |
| Return exposure compensation value used by the camera. More... | |
| String | getActualIsoSensitivity () |
| Return ISO sensitivity used by camera. More... | |
| boolean | isActualIsoSensitivityWarning () |
| Return whether out of range warning of ISO sensitivity is occurring in the camera. More... | |
| boolean | isExposureWarning () |
| Return that out of range warning of the exposure is occurring in the camera. More... | |
| boolean | isExposureMeteringWarning () |
| Return whether warning of the exposure metering is occurring in the camera. More... | |
| void | startLiveView () throws OLYCameraKitException |
| Start live view. More... | |
| void | stopLiveView () throws OLYCameraKitException |
| Stop live view. More... | |
| void | changeLiveViewSize (OLYCamera.LiveViewSize size) throws OLYCameraKitException |
| Change the size of live view. More... | |
| ActionType | getActionType () |
| Get the shooting mode and drive mode. More... | |
| void | startTakingPicture (HashMap< String, Object > options, TakePictureCallback callback) |
| Start shooting photo. More... | |
| void | stopTakingPicture (TakePictureCallback callback) |
| Finish shooting photo. More... | |
| void | takePicture (HashMap< String, Object > options, TakePictureCallback callback) |
| Execute batch operation from start of shooting photos to end of shooting. More... | |
| void | startRecordingVideo (HashMap< String, Object > options, CompletedCallback callback) |
| Start recording movie. More... | |
| void | stopRecordingVideo (CompletedCallback callback) |
| Finish recording movie. More... | |
| void | lockAutoFocus (TakePictureCallback callback) |
| Lock autofocus operation. More... | |
| void | unlockAutoFocus () throws OLYCameraKitException |
| Unlock autofocus operation. More... | |
| void | setAutoFocusPoint (PointF point) throws OLYCameraKitException |
| Set coordinates to use for auto focus. More... | |
| void | clearAutoFocusPoint () throws OLYCameraKitException |
| Clear coordinates used for auto focus. More... | |
| void | lockAutoExposure () throws OLYCameraKitException |
| Lock operation of automatic exposure control. More... | |
| void | unlockAutoExposure () throws OLYCameraKitException |
| Release lock of automatic exposure control. More... | |
| void | setAutoExposurePoint (PointF point) throws OLYCameraKitException |
| Specify coordinates of reference exposure for automatic exposure control. More... | |
| void | clearAutoExposurePoint () throws OLYCameraKitException |
| Release specified coordinates of reference exposure for automatic exposure control. More... | |
| RectF | getAutoFocusEffectiveArea () throws OLYCameraKitException |
| Get valid range of coordinates to use for auto focus. More... | |
| RectF | getAutoExposureEffectiveArea () throws OLYCameraKitException |
| Get valid range of coordinates to use for automatic exposure control. More... | |
Recording auxiliary group of Olympus camera class. | |
|
This group provides zoom control and other features to support recording still image and movie. | |
| static final String | LEVEL_GAUGE_ORIENTATION_KEY = "orientation" |
| Dictionary key for accessing 'Orientation' elements of the level gauge information. | |
| static final String | LEVEL_GAUGE_ROLLING_KEY = "roll" |
| Dictionary key for accessing 'Roll' elements of the level gauge information. More... | |
| static final String | LEVEL_GAUGE_PITCHING_KEY = "pitch" |
| Dictionary key for accessing 'Pitch' elements of the level gauge information. More... | |
| static final String | DIGITAL_ZOOM_SCALE_RANGE_MINIMUM_KEY = "minimumZoomScale" |
| Dictionary key for accessing 'Minimum zoom scale' elements of the level gauge information. | |
| static final String | DIGITAL_ZOOM_SCALE_RANGE_MAXIMUM_KEY = "maximumZoomScale" |
| Dictionary keys to access 'Maximum zoom scale' elements of the digital zoom information. | |
| static final String | MAGNIFYING_OVERALL_VIEW_SIZE_KEY = "_overallviewsize" |
| Dictionary key for accessing 'Overall view' elements of the magnified live view information. | |
| static final String | MAGNIFYING_DISPLAY_AREA_RECT_KEY = "_displayarearect" |
| Dictionary key for accessing 'Display area' elements of the magnified live view information. | |
| void | setRecordingSupportsListener (OLYCameraRecordingSupportsListener l) |
| Set listener to notify camera state when it changes. More... | |
| boolean | isDrivingZoomLens () |
| Return whether optical zoom is changing in the camera. More... | |
| boolean | isMagnifyingLiveView () |
| Return whether live view is magnified. More... | |
| Map< String, Object > | getLevelGauge () |
| Return information of level gauge. More... | |
| Map< String, RectF > | getDetectedHumanFaces () |
| Return face recognition results. More... | |
| void | startDrivingZoomLensForDirection (DrivingZoomLensDirection direction, DrivingZoomLensSpeed speed) throws OLYCameraKitException |
| Start driving optical zoom with specific speed and direction. More... | |
| void | startDrivingZoomLensToFocalLength (float focalLength) throws OLYCameraKitException |
| Start driving optical zoom to specified focal length. More... | |
| void | stopDrivingZoomLens () throws OLYCameraKitException |
| Stop driving optical zoom. More... | |
| Map< String, Float > | getDigitalZoomScaleRange () throws OLYCameraKitException |
| Get configurable magnification range of digital zoom. More... | |
| void | changeDigitalZoomScale (float scale) throws OLYCameraKitException |
| Change magnification of digital zoom. More... | |
| void | startMagnifyingLiveView (MagnifyingLiveViewScale scale) throws OLYCameraKitException |
| Start magnifying live view. More... | |
| void | startMagnifyingLiveViewAtPoint (PointF point, MagnifyingLiveViewScale scale) throws OLYCameraKitException |
| Start magnifying live view with center coordinate of magnification. More... | |
| void | stopMagnifyingLiveView () throws OLYCameraKitException |
| Stop magnifying live view. More... | |
| void | changeMagnifyingLiveViewScale (MagnifyingLiveViewScale scale) throws OLYCameraKitException |
| Change magnification of live view. More... | |
| void | changeMagnifyingLiveViewArea (MagnifyingLiveViewScrollDirection direction) throws OLYCameraKitException |
| Move display area in magnified live view. More... | |
| Map< String, Object > | getMagnifyingLiveViewArea () throws OLYCameraKitException |
| Get display area information of magnified live view. More... | |
| void | downloadLastCapturedImage (DownloadImageCallback callback) |
| Download the last captured image. More... | |
Coordinate conversion utilities | |
|
These utilities convert between coordinates in viewfinder coordinate system and coordinates in live view coordinate system. Live view coordinate system is in units of pixels for live view image. The origin is the upper-left corner. Vertical and horizontal coordinate axes match the image display of the smartphone. If camera is rotated into portrait orientation, the origin is still in the upper-left, but the width and height of the image are changed since image is rotated. Live view coordinates are used to represent a pixel position on the image when user touches the live view. Viewfinder coordinate system is normalized to width = 1.0 and height = 1.0 for live view image. The origin is the upper-left corner. Vertical and horizontal coordinate axes correspond to image sensor in camera. If camera is rotated into portrait or landscape mode, there is no change to the image width and height or the picture rotation. Viewfinder coordinate system is used to represent the in-focus position and the position of the specified auto focus lock. | |
| static PointF | convertPointOnLiveImageIntoViewfinder (PointF point, float width, float height, int rotatedDegrees) |
| Convert coordinates in live view coordinate system into coordinates in viewfinder coordinate system. More... | |
| static PointF | convertPointOnViewfinderIntoLiveImage (PointF point, float width, float height, int rotatedDegrees) |
| Convert coordinates in viewfinder coordinate system into coordinates in live view coordinate system. More... | |
| static RectF | convertRectOnLiveImageIntoViewfinder (RectF rect, float width, float height, int rotatedDegrees) |
| Convert rectangular coordinates in live view coordinate system into the rectangular coordinates in viewfinder coordinate system. More... | |
| static RectF | convertRectOnViewfinderIntoLiveImage (RectF rect, float width, float height, int rotatedDegrees) |
| Convert rectangular coordinates in viewfinder coordinate system into rectangular coordinates in live view coordinate system. More... | |
Camera property value conversion utilities | |
| static String | encodeCameraPropertyValue (String name, String data) |
| Get internal representation of camera property value for a name-value pair. More... | |
| static String[] | decodeCameraPropertyValue (String value) |
| Get a camera property name and a camera property value from internal representation of camera property value. More... | |
| boolean canConnect | ( | ConnectionType | connectionType, |
| long | timeout | ||
| ) |
Indicate if the application can connect to the camera.
If the application is connected to the camera, the application will get an error.
| connectionType | Type of connection. You specify 'Wi-Fi'. |
| timeout | Number of milliseconds for timeout. If 0 is specified, default value is set. |
| boolean canSetCameraProperty | ( | String | name | ) |
Check to see if value to the camera properties can be set.
If the application specifies a value that does not exist in the list of camera properties currently available, the application will get an error. Depending on the setting value of the shooting mode, connection type, etc., several properties are read-only access or prohibited. Please refer to the documentation of the camera list of properties for more information.
| name | The camera property name. (e.g. "APERTURE", "SHUTTER", "ISO", "WB") |
| void changeDigitalZoomScale | ( | float | scale | ) | throws OLYCameraKitException |
Change magnification of digital zoom.
If application specifies magnification that is not included in the configurable range, there will be an error. When changing run mode to any mode except recording mode, magnification is changed back to 1x automatically.
| scale | Magnification of digital zoom. |
| void changeLiveViewSize | ( | OLYCamera.LiveViewSize | size | ) | throws OLYCameraKitException |
Change the size of live view.
| size | Frame size of live view in pixels. |
| void changeMagnifyingLiveViewArea | ( | MagnifyingLiveViewScrollDirection | direction | ) | throws OLYCameraKitException |
Move display area in magnified live view.
If live view is not magnified, an error occurs.
| direction | Scrolling direction of the display area. |
| void changeMagnifyingLiveViewScale | ( | MagnifyingLiveViewScale | scale | ) | throws OLYCameraKitException |
Change magnification of live view.
If live view is not magnified, an error occurs.
| scale | Magnification of live view. |
| void changeRunMode | ( | RunMode | mode | ) | throws IllegalArgumentException, OLYCameraKitException |
Changes run mode of the camera system.
Available camera features change for different run modes. For example, application should change the mode to OLYCamera::RunMode::Playback when shooting photographs, and should change the mode to OLYCamera::RunMode::Recording when getting a list of the camera contents. Please refer to the related documentation for more information on relationship between run mode and available camera features.
Response of this API may become slow when shooting or writing to memory card.
| mode | Run mode of the camera. |
| void changeTime | ( | Date | date | ) | throws OLYCameraKitException |
Change date and time of camera.
When capturing without specifying date and time in the camera, a wrong value is set to metadata of media (still image and movie) and time stamp of media file.
Date and time must be specified in Greenwich Mean Time (GMT), with time zone set in the mobile device. OS standard API returns date and time in GMT format, and this method can use the returned value without changing the format.
| date | Date and time. |
| void clearAutoExposurePoint | ( | ) | throws OLYCameraKitException |
Release specified coordinates of reference exposure for automatic exposure control.
Set camera property "AE" to "AE_PINPOINT" before calling this method.
| void clearAutoFocusPoint | ( | ) | throws OLYCameraKitException |
Clear coordinates used for auto focus.
| void clearGeolocation | ( | ) | throws OLYCameraKitException |
Discard registered geolocation information.
| void connect | ( | ConnectionType | connectionType | ) | throws OLYCameraKitException |
Connect to the camera.
Connection to the camera is complete, application will be able to use features of the SDK. If application wants to change the connection type when it is already connected to the camera, the application must disconnect and connect again.
Application must set the application context before this API call. For multiple network connections, use Android API level 21 or higher and supported device. For Bluetooth Smart connection, use Android API level 18 or higher and supported device.
| connectionType | Type of connection. You cannot specify 'not connected'. |
|
static |
Convert coordinates in live view coordinate system into coordinates in viewfinder coordinate system.
| point | Coordinates in live view coordinate system. |
| width | Width of live view image. |
| height | Height of live view image. |
| rotatedDegrees | Rotate angle of live view image in degrees. |
|
static |
Convert coordinates in viewfinder coordinate system into coordinates in live view coordinate system.
| point | Coordinates in viewfinder coordinate system. |
| width | Width of live view image. |
| height | Height of live view image. |
| rotatedDegrees | Rotate angle of live view image in degrees. |
|
static |
Convert rectangular coordinates in live view coordinate system into the rectangular coordinates in viewfinder coordinate system.
This method is used to convert coordinates of auto focus frame for example.
| rect | Rectangular coordinates in live view coordinate system. |
| width | Width of live view image. |
| height | Height of live view image. |
| rotatedDegrees | Rotate angle of live view image in degrees. |
|
static |
Convert rectangular coordinates in viewfinder coordinate system into rectangular coordinates in live view coordinate system.
This method is used to convert coordinates of auto focus frame for example.
| rect | Rectangular coordinates in viewfinder coordinate system. |
| width | Width of live view image. |
| height | Height of live view image. |
| rotatedDegrees | Rotate angle of live view image in degrees. |
| int countNumberOfContents | ( | ) | throws OLYCameraKitException |
Count the number of media (still image and movie) in the camera.
|
static |
Get a camera property name and a camera property value from internal representation of camera property value.
| value | Pair of property name and value set in the property. (e.g. "<APERTURE/3.5>", "<SHUTTER/250>", "<ISO/Auto>", "<WB/WB_AUTO>") |
| void disconnectWithPowerOff | ( | boolean | powerOff | ) | throws OLYCameraKitException |
Disconnect from the camera.
You can also power off the camera when you disconnect from the camera. If disconnect is successful, the value of the property and state of the camera will be cleared. (Communication settings of the camera connection are not cleared.)
| powerOff | If true, the camera will be powered off with disconnection from the camera. |
| void downloadContent | ( | String | path, |
| DownloadContentCallback | callback | ||
| ) |
Download media (still image and movie) stored in memory card.
File path must be string which combines the directory path and file name obtained from list of all supported media. Otherwise an error occurs.
| path | File path to the still image or movie. |
| callback | Callback used when download status changes. |
| void downloadContentList | ( | DownloadContentListCallback | callback | ) |
Download list of all supported media (still image and video) in the camera.
Download list of files in /DCIM directory of memory card that is inserted in the camera. List contains all still image and movie files in supported format. Application should distinguish unsupported files using file extension and eliminate them from the list before use.
| callback | Callback used when download status changes. |
Downloaded list is array of OLYCameraFileInfo object.
| void downloadContentScreennail | ( | String | path, |
| DownloadImageCallback | callback | ||
| ) |
Download reduced image of media (still image and movie) stored in memory card.
File path must be string which combines the directory path and file name obtained from list of all supported media. Otherwise an error occurs.
| path | File path to the still image or movie. |
| callback | Callback used when download status changes. |
| void downloadContentThumbnail | ( | String | path, |
| DownloadImageCallback | callback | ||
| ) |
Download thumbnail of media (still image and movie) stored in memory card.
File path must be string which combines the directory path and file name obtained from list of all supported media. Otherwise an error occurs.
| path | File path to the still image or movie. |
| callback | Callback used when download status changes. |
| void downloadImage | ( | String | path, |
| float | resize, | ||
| DownloadImageCallback | callback | ||
| ) |
Download resized still image.
File path must be string which combines the directory path and file name obtained from list of all supported media. Otherwise an error occurs.
| path | File path to the still image. |
| resize | Size in number of pixels after resizing. |
| callback | Callback used when download status changes. |
| void downloadLargeContent | ( | String | path, |
| DownloadLargeContentCallback | callback | ||
| ) |
Split large media (still image or movie) into smaller parts and download each part.
File path must be string which combines the directory path and file name obtained from list of all supported media. Otherwise an error occurs.
| path | File path to the still image or movie. |
| callback | Callback used when the part is downloaded. |
| void downloadLastCapturedImage | ( | DownloadImageCallback | callback | ) |
Download the last captured image.
Download the still image in the original size captured that was saved through the last shooting process. This API may not return an expected image if the camera does not finish writing the image to the memory card. Call this API after the camera finishes writing the image to the memory card.
Only the last one image is returned even if continuous shooting is enabled.
| callback | Callback used when download progress changes. |
|
static |
Get internal representation of camera property value for a name-value pair.
| name | Camera property name. (e.g. "APERTURE", "SHUTTER", "ISO", "WB") |
| data | Camera property value. (e.g. "3.5", "250", "Auto", "WB_AUTO") |
| void eraseContent | ( | String | path | ) | throws OLYCameraKitException |
Delete media (still image and movie) stored in memory card.
File path must be string which combines the directory path and file name obtained from list of all supported media. Otherwise an error occurs. When the application tries to delete the private media, an error occurs.
| path | File path of the media. |
| ActionType getActionType | ( | ) |
Get the shooting mode and drive mode.
Application can determine whether to perform any shooting as a response to a user tap by referring to this value. Please refer to the description of OLYCamera::ActionType.
| String getActualApertureValue | ( | ) |
Return F value used by lens and camera.
This value can change depending on the state of the object and the shooting mode. This value can be changed when zooming where the focal length is set to the minimum aperture. Aperture value is set to the minimum value if the value to be set is smaller than the minimum value. Please refer to the documentation of the list of camera properties for more information.
This property is set only if the following conditions are met.
| PointF getActualAutoFocusPoint | ( | ) |
Return coordinates focused with autofocus.
These coordinates are expressed in viewfinder coordinate system. Application can convert the coordinates in the live view image using the coordinate conversion utility OLYCamera::convertPointOnViewfinderIntoLiveImage.
| String getActualExposureCompensation | ( | ) |
Return exposure compensation value used by the camera.
This value can change depending on the state of the object and the shooting mode. Please refer to the documentation of the list of camera properties for more information.
This property is set only if the following conditions are met.
| float getActualFocalLength | ( | ) |
Return current focal length of the lens.
| String getActualIsoSensitivity | ( | ) |
Return ISO sensitivity used by camera.
When ISO sensitivity of the camera property is set to automatic, the value that the camera has chosen will be set. This value can change depending on the state of the object and the shooting mode. Please refer to the documentation of the list of camera properties for more information.
This property is set only if the following conditions are met.
| String getActualShutterSpeed | ( | ) |
Return shutter speed used by the camera.
This value can change depending on the state of the object and the shooting mode. Please refer to the list of camera properties for more information.
This property is set only if the following conditions are met.
| RectF getAutoExposureEffectiveArea | ( | ) | throws OLYCameraKitException |
Get valid range of coordinates to use for automatic exposure control.
Application can convert to rectangular coordinates for live view image on the rectangular coordinates indicating the range using the coordinate conversion utility OLYCamera::convertRectOnViewfinderIntoLiveImage.
| RectF getAutoFocusEffectiveArea | ( | ) | throws OLYCameraKitException |
Get valid range of coordinates to use for auto focus.
Application can convert to rectangular coordinates from live view image in the rectangular coordinates indicating the range using the coordinate conversion utility OLYCamera::convertRectOnViewfinderIntoLiveImage.
| BluetoothDevice getBluetoothDevice | ( | ) |
Return object for Bluetooth device.
| String getBluetoothPassword | ( | ) |
Return password to connect to the camera via Bluetooth.
|
static |
Return list of Bluetooth service ID.
| Set<String> getCameraPropertyNames | ( | ) |
Return list of camera property names currently available.
Application must check whether the target camera property is contained in the list or not. If not, the target property can not be configured.
| String getCameraPropertyTitle | ( | String | name | ) |
Get title of the camera property.
If the application specifies a value that does not exist in the list of camera properties currently available, the application will have an error. Please refer to the documentation of the camera list of properties for more information.
| name | The camera property name. (e.g. "APERTURE", "SHUTTER", "ISO", "WB") |
| String getCameraPropertyValue | ( | String | name | ) | throws OLYCameraKitException |
Get value that is set in the camera properties.
If the application specifies a value that does not exist in the list of camera properties currently available, the application will get an error. Depending on shooting mode, connection type, etc., several properties are read-only access or prohibited. Please refer to the documentation of the camera list of properties for more information.
The return value is a string in the form of "<Property Name/Property Value>."
| name | The camera property name. (e.g. "APERTURE", "SHUTTER", "ISO") |
| List<String> getCameraPropertyValueList | ( | String | name | ) | throws OLYCameraKitException |
Get list of the camera property values that can be set.
If the application specifies a value that does not exist in the list of camera properties currently available, the application will have an error. If the application changes settings such as shooting mode, there are times when the contents of the list changes. Please refer to the documentation of the camera list of properties for more information.
Each value in the list is a string in the form of "<Property Name/Property Value>."
| name | The camera property name. (e.g. "APERTURE", "SHUTTER", "ISO") |
| Map<String, String> getCameraPropertyValues | ( | Set< String > | names | ) | throws OLYCameraKitException |
Get values that are set in the camera properties.
If the application specifies a value that does not exist in the list of camera properties currently available, the application will get an error. Depending on shooting mode, connection type, etc., several properties are read-only access or prohibited. Please refer to the documentation of the camera list of properties for more information.
| names | The camera property names. Each element is a string. |
The retrieved values are in dictionary format. The dictionary key is the camera property name. Setting of the camera property is stored in value corresponding to the key.
| String getCameraPropertyValueTitle | ( | String | value | ) |
Get title of the camera property value.
If the application specifies a value that does not exist in the list of camera properties currently available, the application will get an error. Depending on the setting value of the shooting mode, connection type, etc., several properties are read-only access or prohibited. Please refer to the documentation of the camera list of properties for more information.
The argument for parameter "value" is a string in the form of "<Property Name/Property Value>."
| value | Pair of property name and property value set in the property. (e.g. "<APERTURE/3.5>", "<SHUTTER/250>", "<ISO/Auto>", "<WB/WB_AUTO>") |
| int getCommandPort | ( | ) |
Return port number where the camera receives commands.
| ConnectionType getConnectionType | ( | ) |
Return type of connection to the camera.
| Context getContext | ( | ) |
Return application context object to use Wi-Fi and Bluetooth.
| Map<String, RectF> getDetectedHumanFaces | ( | ) |
Return face recognition results.
Coordinate information of face detected by the camera is stored in dictionary format. The dictionary key is a string that represents the identification number. It is not possible to track the coordinates of a recognized face by relying on a specific identification number.
This property is set only if the following conditions are met.
| Map<String, Float> getDigitalZoomScaleRange | ( | ) | throws OLYCameraKitException |
Get configurable magnification range of digital zoom.
The following information is included.
| int getEventPort | ( | ) |
Return port number where Camera Kit receives events issued by the camera.
| String getHost | ( | ) |
Return IP address of the camera.
| String getLensMountStatus | ( | ) |
Return status of lens mount.
Status of lens mount:
| Map<String, Object> getLevelGauge | ( | ) |
Return information of level gauge.
The following information is included.
This property is set only if the following conditions are met.
| OLYCamera.LiveViewSize getLiveViewSize | ( | ) |
Return frame size of live view in pixels.
| int getLiveViewStreamingPort | ( | ) |
Return port number where Camera Kit receives live view images.
| Map<String, Object> getMagnifyingLiveViewArea | ( | ) | throws OLYCameraKitException |
Get display area information of magnified live view.
If live view is not magnified, an error occurs.
| float getMaximumFocalLength | ( | ) |
Return focal length at the telephoto end of the lens.
This is the longest focal length of the lens.
| String getMediaMountStatus | ( | ) |
Return status of media (memory card) mount.
Status of media mount:
| float getMinimumFocalLength | ( | ) |
Return focal length at the wide end of the lens.
This is the shortest focal length of the lens.
| int getRemainingImageCapacity | ( | ) |
Return the maximum number of images that can be stored in the media (memory card).
The exact value depends on the data for the compression ratio of the captured image. Sometimes the value does not change after capturing.
This property is set only if the following conditions are met.
| long getRemainingMediaCapacity | ( | ) |
Free space of the media (memory card) attached to the camera.
Unit is byte.
| double getRemainingVideoCapacity | ( | ) |
Return the maximum number of seconds a movie that can be stored in the media (memory card).
The exact value depends on the data for the compression ratio of the captured video.
This property is set only if the following conditions are met.
| RunMode getRunMode | ( | ) |
Return current run mode of the camera.
|
static |
Version of Olympus camera kit.
Check this value if the SDK behavior seems incorrect. Problem may have been resolved in the latest version of the SDK.
| Map<String, Object> inquireContentInformation | ( | String | path | ) | throws OLYCameraKitException |
Get information of media (still image and movie) stored in memory card.
File path must be string which combines the directory path and file name obtained from list of all supported media. Otherwise an error occurs.
| path | File path to the still image or movie. |
Information on still image
Information on movie (string format)
| Map<String, Object> inquireHardwareInformation | ( | ) | throws OLYCameraKitException |
Get hardware information of the camera.
Hardware information is in dictionary format. The following keys are defined in order to access each element.
Please refer to the related documentation for more information.
| boolean isActualIsoSensitivityWarning | ( | ) |
Return whether out of range warning of ISO sensitivity is occurring in the camera.
When shooting during the warning, there is a case of obtaining a result that is not the correct exposure such as underexposed or overexposed.
| boolean isAutoStartLiveView | ( | ) |
Return whether live view starts automatically when run mode is changed to Recording mode.
If false, call API to start live view after changing run mode to Recording mode.
| boolean isBluetoothPrepareForRecordingWhenPowerOn | ( | ) |
Return if the camera starts recording setup after power on via Bluetooth.
| boolean isConnected | ( | ) |
Return if the camera is currently connected.
| boolean isConnectingRequiresBluetoothPassword | ( | ) | throws OLYCameraKitException |
Return if application needs to set a password property when connecting to the camera via Bluetooth.
| boolean isDrivingZoomLens | ( | ) |
Return whether optical zoom is changing in the camera.
| boolean isExposureMeteringWarning | ( | ) |
Return whether warning of the exposure metering is occurring in the camera.
Subject is too dark or too bright to be measured by the camera's exposure meter. When shooting during the warning, the image may be underexposed or overexposed.
| boolean isExposureWarning | ( | ) |
Return that out of range warning of the exposure is occurring in the camera.
The camera can not determine ISO sensitivity, shutter speed or aperture value corresponding to current exposure value. When shooting during the warning, the image may be underexposed or overexposed.
| boolean isHighTemperatureWarning | ( | ) |
Return whether inside of the camera is in high-temperature condition.
You can also check using the lighting state of the LED on the camera body. If the inside of the camera has reached a high temperature, please stop using the camera immediately, and wait for the camera to return to normal temperature.
| boolean isLiveViewEnabled | ( | ) |
Return whether live view started.
| boolean isMagnifyingLiveView | ( | ) |
Return whether live view is magnified.
| boolean isMediaBusy | ( | ) |
Return whether the camera is writing to the media (memory card).
You can also check in the lighting state of the LED on the camera body. While the camera is writing to the media, you will see API response is slow.
| boolean isMediaError | ( | ) |
Return whether the media (memory card) I/O error has occurred.
There is a possibility that the media is broken. Please replace with a new media if it occurs frequently.
| boolean isRecordingVideo | ( | ) |
Return whether video recording is in progress on the camera.
When recording is in progress, application cannot change the value of the camera properties.
| boolean isTakingPicture | ( | ) |
Return whether photo shooting is in progress on the camera.
When shooting is in progress, application cannot change the value of the camera properties.
| void lockAutoExposure | ( | ) | throws OLYCameraKitException |
Lock operation of automatic exposure control.
| void lockAutoFocus | ( | TakePictureCallback | callback | ) |
Lock autofocus operation.
Focus the camera to the specified coordinates, and then lock so that focus does not later change. Application must have previously set the coordinates for auto focus. Application must call unlock to resume auto focus.
| callback | Callback used when auto focus is locked. |
Application can convert rectangular coordinates in live view image using the coordinate conversion utility OLYCamera::convertRectOnViewfinderIntoLiveImage.
| void protectContent | ( | String | path | ) | throws OLYCameraKitException |
Protect media (still image and movie) stored in memory card.
When the application tries to delete the private media, an error occurs. File path must be string which combines the directory path and file name obtained from list of all supported media. Otherwise an error occurs.
| path | File path of the media. |
| void resizeVideoFrame | ( | String | path, |
| float | resize, | ||
| ResizeVideoQuality | quality, | ||
| ProgressCallback | callback | ||
| ) |
Resizes each frame of the video content, and save it as a new content into the camera.
Application can also add the image effect to the scene when editing and merging videos. Video content that application specifies must be a short movie format. If application specifies a non-video content, error occurs.
| path | File path of the video content. |
| resize | Pixel size of each frame after resizing process. (only 1280 is valid in current version) |
| quality | Quality of video after resizing process. |
| callback | Callback used when the resizing progress changes. |
| void setAutoExposurePoint | ( | PointF | point | ) | throws OLYCameraKitException |
Specify coordinates of reference exposure for automatic exposure control.
Application must set coordinates with this method prior to locking automatic exposure control. Application will get an error if value exceeds the valid range of target coordinates.
Set camera property "AE" to "AE_PINPOINT" before calling this method.
| point | Target coordinates. Coordinates are in viewfinder coordinate system. |
Application can convert the focusing coordinates from the coordinates in live view image using the coordinate conversion utility OLYCamera::convertPointOnLiveImageIntoViewfinder.
| void setAutoFocusPoint | ( | PointF | point | ) | throws OLYCameraKitException |
Set coordinates to use for auto focus.
Prior to locking focus, application sets the coordinates to focus with this method. Application will get an error if value exceeds the valid range of focus coordinates.
| point | Coordinates where to focus. Coordinates are in viewfinder coordinate system. |
Application can convert the focusing coordinates from coordinates in live view image using the coordinate conversion utility OLYCamera::convertPointOnLiveImageIntoViewfinder.
| void setAutoStartLiveView | ( | boolean | autoStartLiveView | ) |
Set true to start live view automatically when run mode is changed to Recording mode.
| void setBluetoothDevice | ( | BluetoothDevice | device | ) |
Set object for Bluetooth device.
The value is used when you connect via Bluetooth Smart to the camera. Configure this value before starting connection via Bluetooth Smart.
| device | Object for Bluetooth device. |
| void setBluetoothPassword | ( | String | password | ) |
Set password to connect to the camera via Bluetooth.
The value is used when you connect via Bluetooth Smart to the camera. Configure this value before starting connection via Bluetooth Smart.
| password | Password to connect to the camera via Bluetooth. |
| void setBluetoothPrepareForRecordingWhenPowerOn | ( | boolean | prepareForRecordingWhenPowerOn | ) |
Set if the camera starts recording setup after power on via Bluetooth.
The value is used when you connect via Bluetooth Smart to the camera. Configure this value before starting connection via Bluetooth Smart.
| prepareForRecordingWhenPowerOn | If true, the camera starts recording setup after power on via Bluetooth. |
| void setCameraPropertyListener | ( | OLYCameraPropertyListener | l | ) |
Set listener to receive when the camera property changes.
| l | Listener to be called. |
| void setCameraPropertyValue | ( | String | name, |
| String | value | ||
| ) | throws OLYCameraKitException |
Set value to the camera properties.
If the application specifies a value that does not exist in the list of camera properties currently available, the application will get an error. Depending on the setting value of the shooting mode and connection type etc., there are several properties that are read-only access or prohibited. Please refer to the documentation of the camera list of properties for more information.
The argument for parameter "value" is a string in the form of "<Property Name/Property Value>."
| name | The camera property name. (e.g. "APERTURE", "SHUTTER", "ISO", "WB") |
| value | Pair of property name and property value set in the property. (e.g. "<APERTURE/3.5>", "<SHUTTER/250>", "<ISO/Auto>", "<WB/WB_AUTO>") |
| void setCameraPropertyValues | ( | Map< String, String > | values | ) | throws OLYCameraKitException |
Set values to camera properties.
Specifying a value that does not exist in the list of camera properties currently available, will give an error. Depending on the setting value of the shooting mode, connection type, etc., several properties are read-only access or prohibited. Please refer to the documentation of the camera list of properties for more information.
| values | The pairs of the camera property value and name. |
Name-value pairs of the camera properties that can be specified in dictionary format. The application must specify the camera property name in the dictionary key and store the value associated with that key in the camera properties.
| void setCameraStatusListener | ( | OLYCameraStatusListener | l | ) |
Set listener to receive changes to camera property.
| l | Listener to be called. |
| void setCommandPort | ( | int | port | ) |
Set port number where the camera receives commands.
Value is used when you connect to the camera via Wi-Fi. Set value only if specific port number is needed. Default is TCP/80.
| port | number where the camera receives commands. |
| void setConnectionListener | ( | OLYCameraConnectionListener | l | ) |
Set listener to receive change to communication state of the camera.
| l | Listener to be called. |
| void setContext | ( | Context | context | ) |
Set application context object to use Wi-Fi and Bluetooth.
| context | Application context object to use Wi-Fi and Bluetooth. |
| void setEventPort | ( | int | port | ) |
Set port number where Camera Kit receives events issued by the camera.
Value is used when you connect to the camera via Wi-Fi. Set value only if specific port number is needed. Default is TCP/65000.
| port | number where Camera Kit receives events issued by the camera. |
| void setGeolocation | ( | String | location | ) | throws OLYCameraKitException |
Register geolocation information to the camera.
After application registers the current geolocation in the camera, the GPS geolocation information will be set in the meta-data of the picture during capture.
The geolocation information must be specified by GGA and RMC defined in NMEA-0183.
| location | The new geolocation information. |
| void setHost | ( | String | host | ) |
Set IP address of the camera.
Value is used when you connect to the camera via Wi-Fi. Set value only if specific IP address is needed. Default is <IP_ADDRESS>.
| host | IP address of the camera. |
| void setLiveViewListener | ( | OLYCameraLiveViewListener | l | ) |
Set listener to notify state of live view image when it changes.
| l | Listener to be called. |
| void setLiveViewStreamingPort | ( | int | port | ) |
Set receive port for live view streaming.
Value is used when you connect to the camera via Wi-Fi. Set value only if specific port number is needed. Default is UDP/5555.
| port | Port number where Camera Kit receives live view images. |
| void setPlaybackListener | ( | OLYCameraPlaybackListener | l | ) |
Set listener to receive changes to playback operations.
| l | Listener to be called. |
| void setRecordingListener | ( | OLYCameraRecordingListener | l | ) |
Set listener to notify camera state when it changes.
The camera state relates to capturing operation which affects still image or movie.
| l | Listener to be called. |
| void setRecordingSupportsListener | ( | OLYCameraRecordingSupportsListener | l | ) |
Set listener to notify camera state when it changes.
The camera state relates to capturing operation which affects still image or movie.
| l | Listener to be called. |
| void startDrivingZoomLensForDirection | ( | DrivingZoomLensDirection | direction, |
| DrivingZoomLensSpeed | speed | ||
| ) | throws OLYCameraKitException |
Start driving optical zoom with specific speed and direction.
Lens attached to the camera must support electric zoom. If the optical zoom is already being driven, application will get an error.
| direction | Driving direction. |
| speed | Driving speed. |
| void startDrivingZoomLensToFocalLength | ( | float | focalLength | ) | throws OLYCameraKitException |
Start driving optical zoom to specified focal length.
Lens attached to the camera must support electric zoom. If optical zoom is already being driven, error occurs.
| focalLength | Focal length. |
| void startLiveView | ( | ) | throws OLYCameraKitException |
Start live view.
If live view is not started, some properties cannot update their values, and some methods for taking pictures and recording movies return an error.
| void startMagnifyingLiveView | ( | MagnifyingLiveViewScale | scale | ) | throws OLYCameraKitException |
Start magnifying live view.
If live view is already magnified, an error occurs.
| scale | Magnification of live view. |
| void startMagnifyingLiveViewAtPoint | ( | PointF | point, |
| MagnifyingLiveViewScale | scale | ||
| ) | throws OLYCameraKitException |
Start magnifying live view with center coordinate of magnification.
If live view is already magnified, an error occurs.
| point | Center coordinate of the magnified display in viewfinder coordinate system. The viewfinder coordinate system is explained in coordinate conversion utilities section of OLYCamera. |
| scale | Magnification of live view. |
| void startRecordingVideo | ( | HashMap< String, Object > | options, |
| CompletedCallback | callback | ||
| ) |
Start recording movie.
Call this method only when recording process is not in progress. Do not call this method under still image shooting mode.
| options | Not used in current version. |
| callback | Callback used when recording is complete. |
| void startTakingPicture | ( | HashMap< String, Object > | options, |
| TakePictureCallback | callback | ||
| ) |
Start shooting photo.
Call this method only when shooting process is not in progress. Do not call this method under movie recoding mode.
| options | Optional shooting parameters. |
| callback | Callback used when status of shooting operation changes. |
Optional parameters of the shooting.
The application can convert the rectangular coordinates in live view image using the coordinate conversion utility OLYCamera::convertRectOnViewfinderIntoLiveImage.
| void stopDrivingZoomLens | ( | ) | throws OLYCameraKitException |
Stop driving optical zoom.
Lens attached to the camera must support electric zoom. If optical zoom already being driven, error occurs.
| void stopLiveView | ( | ) | throws OLYCameraKitException |
Stop live view.
| void stopMagnifyingLiveView | ( | ) | throws OLYCameraKitException |
Stop magnifying live view.
If live view is not magnified, an error occurs.
| void stopRecordingVideo | ( | CompletedCallback | callback | ) |
Finish recording movie.
Call this method only when recording process is in progress. Do not call this method under still image shooting mode.
| callback | Callback used when recording is complete. |
| void stopTakingPicture | ( | TakePictureCallback | callback | ) |
Finish shooting photo.
Call this method only when shooting process is in progress. Do not call this method under movie recoding mode.
| callback | Callback used when status of shooting operation changes. |
| void takePicture | ( | HashMap< String, Object > | options, |
| TakePictureCallback | callback | ||
| ) |
Execute batch operation from start of shooting photos to end of shooting.
Call this method only when shooting process is not in progress. Do not call this method under movie recoding mode.
| options | Optional shooting parameters. |
| callback | Callback used when status of shooting operation changes. |
Optional parameters of the shooting.
The application can convert the rectangular coordinates in live view image using the coordinate conversion utility OLYCamera::convertRectOnViewfinderIntoLiveImage.
| String toString | ( | ) |
Return description of this object in string format.
| void unlockAutoExposure | ( | ) | throws OLYCameraKitException |
Release lock of automatic exposure control.
| void unlockAutoFocus | ( | ) | throws OLYCameraKitException |
Unlock autofocus operation.
| void unprotectAllContents | ( | ProgressCallback | callback | ) |
Cancel protection of all the media (still image and movie) stored in memory card.
| callback | Callback used when cancellation progress changes. |
| void unprotectContent | ( | String | path | ) | throws OLYCameraKitException |
Cancel protection of the media (still image and movie) stored in memory card.
When the protection is canceled, the application is allowed to delete the media. File path must be string which combines the directory path and file name obtained from list of all supported media. Otherwise an error occurs.
| path | File path of the media. |
| void wakeup | ( | ) | throws OLYCameraKitException |
Wake up the camera via Bluetooth Smart.
After the camera turns on, the application can connect to the camera. If the application is connected to the camera, the application will get an error.
Application must set the application context before this API call.
|
static |
Dictionary key for accessing 'Pitch' elements of the level gauge information.
'Pitch' describes the camera is pointed up or down.
|
static |
Dictionary key for accessing 'Roll' elements of the level gauge information.
'Roll' is rotation around the optical axis.


| lesson 50 New Year resolutions |
| The New Year is a time for resolutions. |
| Mentally, at least, most of us could compile formidable lists of 'dos' and 'don'ts'. |
| The same old favorites recur year in year out with monotonous regularity. |
| We resolve to get up earlier each morning, eat less, |
| find more time to play with the children, do a thousand and one jobs about the house, |
| be nice to people we don't like, drive carefully, and take the dog for a walk every day. |
| Past experience has taught us that certain accomplishments are beyond attainment. |
| If we remain inveterate smokers, it is only because we have so often experienced the frustration that results from failure. |
| Most of us fail in our efforts at self-improvement because our schemes are too ambitious and we never have time to carry them out. |
| We also make the fundamental error of announcing our resolutions to everybody |
| so that we look even more foolish when we slip back into our bad old ways. |
| Aware of these pitfalls, this year I attempted to keep my resolutions to myself. |
| I limited myself to two modest ambitions: to do physical exercise every morning and to read more of an evening. |
| An all-night party on New Year's Eve provided me with a good excuse for not carrying out either of these new resolutions on the first day of the year, |
| but on the second, I applied myself assiduously to the task. |
| The daily exercises lasted only eleven minutes and I proposed to do them early in the morning before anyone had got up. |
| The self-discipline required to drag myself out of bed eleven minutes earlier than usual was considerable. |
| Nevertheless, I managed to creep down into the living room for two days before anyone found me out. |
| After jumping about on the carpet and twisting the human frame into uncomfortable positions, |
| I sat down at the breakfast table in an exhausted condition. |
| It was this that betrayed me. |
| The next morning the whole family trooped in to watch the performance. |
| That was really unsettling, but I fended off the taunts and jibes of the family good-humouredly and soon everybody got used to the idea. |
| However, my enthusiasm waned. |
| The time I spent at exercises gradually diminished. |
| Little by little the eleven minutes fell to zero. |
| By January 10th, I was back to where I had started from. |
| I argued that if I spent less time exhausting myself at exercises in the morning, I would keep my mind fresh for reading when I got home from work. |
| Resisting the hypnotizing effect of television, I sat in my room for a few evenings with my eyes glued to a book. |
| One night, however, feeling cold and lonely, I went downstairs and sat in front of the television pretending to read. |
| That proved to be my undoing, for I soon got back to my old bad habit of dozing off in front of the screen. |
| I still haven't given up my resolution to do more reading. |
| In fact, I have just bought a book entitled How to Read a Thousand Words a Minute. |
| Perhaps it will solve my problem, but I just haven't had time to read it! |


Table of Contents
- Overview
- Features
- Getting Started
- Basics
- Extensions
- Installation
- Author
- Contribution
- License
- Changelog
Overview
DeLorean is a lightweight framework which allows you to write better async code in Swift. We designed DeLorean to be simple to use and also very flexible. It’s partially based on JavaScript A+ specs. We have added some useful features like progressable
and cancellable
promises. This promises layer queues all async task on background to avoid block the main thread.
Features
- Super friendly API
- Enum-based DSL to handle Promise state
- Promises can be dispatched on any thread or custom queue
- All promises are
Cancellable
andprogressable
- The framework has 100% test coverage
- No external dependencies
- Minimal implementation
- Support for
iOS/macOS/tvOS/watchOS
- Support for CocoaPods/Carthage/Swift Package Manager
Getting Started
This is a tiny example to build and execute a promise with DeLorean
.
let foobar = Promise { future in
future(.fulfill("foobar"))
}
foobar.then { value in
print(value)
}
Basics
Creating promises
You can create and Promise with enum DSL for async
operations.
let foobar = Promise { future in
future(.progress("foo"))
future(.fulfill("foobar"))
}
foobar.progress {
print($0)
}.then { string in
print(string)
}
Also, you can create and Promise with block API for async
operations.
let foobar = Promise { progress, fulfill, reject, cancel in
progress("foo")
cancel()
}
foobar.progress {
print($0)
}.cancel {
// ¯\_(ツ)_/¯
}
Then
You can simple chaining multiple asynchronous tasks.
let foobar = Promise { future in
future(.fulfill("foobar"))
}
promise.then { value in
print(value)
}
Or you can transform data between chainable promises.
let foobar = Promise { future in
future(.fulfill("foobar"))
}.then({ value in
print(value)
}).then({ value in
return value.count
}).then({ value in
return value > 0
})
Catch
This function allows you to handle Promise’s errors. The operator itself implicitly returns another promise, that is rejected with the same error.
let foobar = Promise<Void> { future in
future(.reject(SimpleError()))
}.then({ value in
print(value)
}).catch({ error in
// Handle simple error here
})
Progress
If there is an asynchronous action that can succeed
more than once, or delivers a series of values over time instead of just one, but you don’t want to finish the promise you can use this function.
let foobar = Promise<Int> { future in
future(.progress(0))
future(.progress(1))
future(.progress(2))
future(.fulfill(3))
}.progress({ value in
// This block is called multiple times
print(value)
}).then({ value in
// This block is called once
print(value)
})
Cancel
This function will trigger a callback that the promise can use to cancel its work. Naturally, requesting cancellation of a promise that has already been resolved does nothing, even if the callbacks have not yet been invoked.
let foobar = Promise<Int> { future in
future(.progress(0))
future(.cancel)
future(.fulfill(3))
}.progress {
print($0)
}.cancel {
// Handle cancellable work
}.then { value in
// This block is never called
print(value)
}
Extensions
All
This function create a Promise that resolved when the list of passed Promises resolves (promises are resolved in parallel). Promise also reject as soon as a promise reject for any reason.
let promise1 = Promise(value: 1)
let promise2 = Promise(value: 2)
let promise3 = Promise(value: 3)
let promise4 = Promise(value: 4)
let promise = Promise<Int>
.all([promise1, promise2, promise3, promise4])
.then { values in
for number in values {
print(number)
}
}
Always
This function allows you to specify a block which will be always executed both for fulfill and reject of the Promise.
let foobar = Promise<Int> { _ in
throw SimpleError()
}.then {
print($0)
}.catch {
// Handle error
}.always {
// This block is always called
}
Race
This function race many asynchronous promises and return the value of the first to complete.
let promise1 = Promise(value: 1)
let promise2 = Promise(value: 2)
let promise3 = Promise(value: 3)
let promise4 = Promise(value: 4)
let promise = Promise<Int>
.race([promise1, promise2, promise3, promise4])
.then { fastValue in
print(fastValue)
}
Recover
Recover lets us catch an error and easily recover from it without breaking the rest of the promise chain.
let foobar = Promise<Int> { _ in
throw SimpleError()
}.recover { error in
return Promise(value: 0)
}.then {
print($0)
}.catch {
// Handle error
}
Retry
Retry operator allows you to execute source chained promise if it ends with a rejection. If reached the attempts the promise still rejected chained promise is also rejected along with the same source error.
let promise = Promise<Int>
.retry(attempt: 3) { () -> Promise<Int> in
guard threshold != 1 else { return Promise(value: 8) }
threshold -= 1
return Promise(error: SimpleError())
}
Timeout
Timeout allows us to wait for a promise for a time interval or reject it, if it doesn’t resolve within the given time. The interval is expresed in seconds.
let promise = Promise<Int> { future in
future(.fulfill(5))
}.timeout(0.5)
Validate
Validate is a function that takes a predicate, and rejects the promise chain if that predicate fails.
let promise = Promise(value: 2)
.validate { $0 == 3 }
.catch { error in
// This promise always fails
}
Zip
This function allows you to join different promises (2, 3 or 4) and return a tuple with the result of them. Promises are resolved in parallel.
let promise1 = Promise(value: 0)
let promise2 = Promise(value: "foobar")
let zipped = Promise<Void>.zip(promise1, promise2)
.then { value1, value2 in
print(value1) // This function prints `0`
print(value2) // This function prints `"foobar"`
}
You can check the DeLorean.playground
to experiment with more examples. If you need to see deeply information you can check our Documentation
Installation
CocoaPods
DeLorean is available through CocoaPods. To install it, simply add the following line to your Podfile:
platform :ios, '10.0'
use_frameworks!
swift_version = '4.0'
target 'MyApp' do
pod 'DeLorean'
end
Carthage
You can also install it via Carthage. To do so, add the following to your Cartfile:
github 'therapychat/DeLorean'
Swift Package Manager
You can use Swift Package Manager and specify dependency in Package.swift
by adding this:
.Package(url: "https://github.com/therapychat/DeLorean.git", majorVersion: 0)
Author
Sergio Fernández<EMAIL_ADDRESS>Contribution
For the latest version, please check develop branch. Changes from this branch will be merged into the master branch at some point.
- If you want to contribute, submit a pull request against a development
develop
branch. - If you found a bug, open an issue.
- If you have a feature request, open an issue.
License
DeLorean is available under the Apache License 2.0
. See the LICENSE file for more info.
Changelog
See CHANGELOG file.


My Team
Justin
Manager
ID: 1
Email:
<EMAIL_ADDRESS>Office Number: 1
Jake
Engineer
ID: 3
Email:
<EMAIL_ADDRESS>Github:
Justinean
Jon
Intern
ID: 2
Email:
<EMAIL_ADDRESS>School: University of Minnesota


The Registrar is the contract that handles the domain issuing logic. In this section we’ll explain the interaction with this contract.
As explained in the RNS specification doc, the domain ownership is determinate by a Vickrey auction. A Vickrey auction is a type of sealed-bid auction. Bidders submit bids without knowing the bided amount of any other participant. The highest bidder is the winner and the price paid is the second-highest bid.
Is RNS, the auction lasts 5 days and is divided in two periods:
There is no “soft start” phase, meaning that all names are available on launch time.
0x5269f5bc51cdd8aa62755c97229b7eeddd8e69a6
See RNS Testnet section for testing environment information.
Instance Registrar contract
var registrarInstance = web3.eth.contract(registrarAbi)
var registrar = registrarInstance.at(registrarAddress)
Hash your domain
var label = 'nakamoto'
var sha3 = web3.sha3(label)
Verify domain status after starting an auction for the name
var status = registrar.entries(sha3)
If the dmain name is in Open state, start an auction. The auctions are public, this means anyone can bid in it.
if (status[0] == 0)
registrar.startAuction(sha3)
Within the next 3 days, the name is in auction state. Bid!
Bids are sent by sending a message to the Registrar contract with a hash and an amount. The hash contains information about the bid, including the hash of the domain bided, the bid amount, and a random salt. The value of the bid itself can be masqueraded by sending more than the value of your actual bid.
Bids must be placed before the reveal period begins. Any bid created during or after this period won’t be considered valid.
Since this is an auction, it is expected that most public hashes, like known domains and common dictionary words, will have multiple bidders pushing the price up.
var owner, value, salt
if (status === 1) {
var shaBid = registrar.shaBid(sha3, owner, value, salt)
registrar.newBid(shaBid)
}
Within the next 2 days, the name is in Reveal state. Reveal your bid!
Once the reveal phase of the auction starts, it’s time to unseal your bid. You can do this by calling the method unsealBid
with the same parameters used originally for shaBid
.
If the bid doesn’t meet the requirements (below min value or created during the reveal period) or doesn’t beat the second-best bid, all of the tokens locked in the Deed are refunded.
If the bid doesn’t best the highest value offered, but does beat the second highest, the final value of the auction is updated to equal the bid and all locked tokens are refunded.
If the bid turns out to be the biggest yet, the auction’s highest value and second highest are updated. The former highest bid is refunded to its owner.
if (status === 4)
registrar.unsealBid(sha3, value, salt)
Once the Auction phase finalized, if you are the winner you must register your domain name. In order to concrete the auction and finalize apply the changes to the Registry, the auction winner must call the finalizeAuction
method.
This function can’t be called by any other account but the new owner of the auctioned name.
When calling this method, the Registrar contract refunds the difference between the highest and the second highest values and modifies the Registry adding (or modifying) the entry which links the full domain and the new owner.
As well as modifying the registry, the registrar also signals the Deed to start its expiration period, which lasts one year, and pay the initial annual rent fee.
var entry = entries(sha3)
if (entry[0] === 2) {
var deedInstance = web3.contract(deedAbi)
var deed = deedInstance.at(entry[1])
if (deed.owner() === me)
registrar.finalizeAuction(sha3)
}
Now the name is registered in the RNS Registry.
Domain names have a validity of 1 year after the registration date. Said expiry date is reflected through the associated Deed contract. Owners have a period of 3 months before the expiry date to pay the rent and extend their ownership for 1 year. The rent value is 1 RIF token.
The domains whose annual rent is not paid, backs to Open state and becomes available to open an auction again. If a user wins an auction over it, she is able to override the existing name resolution.
Context
RNS public rns;
bytes32 public rootNode;
RIFToken public tokenContract;
rns
the Registry contract
rootNode
the top-level domain. For RNS web3.sha3('rsk')
. All new nodes are sub nodes of ‘rsk’
tokenContract
the RIF ERC-677 token contract
Types
struct Entry {
TokenDeed deed;
uint registrationDate;
uint value;
uint highestBid;
}
Entry
the actual state of a hashStorage
mapping (bytes32 => Entry) _entries;
mapping (address => mapping (bytes32 => TokenDeed)) public sealedBids;
_entries
store all hash states. The state is not modified when someone bids, but it is when someone reveals a bid.
sealedBids
store, for each user, the Deed address for each sealed bid. Notices that the sealed bid is not recoverable without the salt value
Constants
uint32 constant TOTAL_AUCTION_LENGTH = 5 days;
uint32 constant REVEAL_PERIOD = 48 hours;
uint32 constant LATE_UNSEAL_PERIOD = 15 days;
uint constant RELEASE_FEE_PER_MIL = 200; // 200 of 1000 = 20%
uint constant MIN_TOKEN_QUANTITY = 1 * 10**18; // 1 token
uint constant RENT_VALUE = 1 * 10**18; // 1 token
Start an auction for an available hash
Signature
function startAuction(bytes32 _hash) public registryOpen()
Parameters
_hash
: the hash to start an auction onEvents
AuctionStarted
Example
var name = 'nakamoto'
var hash = web3.sha3(name)
registrar.startAuction(hash)
Start multiple auctions for better anonymity.
A user can start an auction by sending an array of hashes that they want to bid for. This array is sent so that the user can open an auction for X dummy hashes when she is only interested in bidding for one. This will increase the cost for an attacker to simply bid blindly on all new auctions. Dummy auctions that are open but not bid on are closed after a week.
Signature
function startAuctions(bytes32[] _hashes) public
Parameters
_hashes
: an array of hashes, at least one of which the user wants to bid onEvents
AuctionStarted
Example
var name = 'nakamoto'
var hash = web3.sha3(label)
var fake1 = web3.sha3('nakamoto1')
var fake2 = web3.sha3('nakamoto2')
registrar.startAuctions([fake1, hash, fake2])
Submit a new sealed bid on a desired hash in a blind auction
Bids are sent by sending a message to the main contract with a hash and an amount. The hash contains information about the bid, including the bided hash, the bid amount, and a random salt. Bids are not tied to any one auction until they are revealed. The value of the bid itself can be masqueraded by sending more than the value of your actual bid. For bids revealed after reveal period, a percentage (defined in the late unsealing Refund schedule) will be sent to a special RIF address.
This method requires the sender to approve the Registrar to use the specified tokenQuantity
in the ERC677 (inherited form ERC20) contract.
Otherwise it can be done through the tokenFallback
after a transfer with the corresponding parameters.
Signature
function newBid(bytes32 _sealedBid, uint _tokenQuantity) public
Parameters
_sealedBid
: a sealed bid, created by the shaBid
function_tokenQuantity
: token quantity to bidEvents
NewBid
Example
var hash = web3.sha3('nakamoto')
var owner = accounts[0]
var amount = 8e18
var sentAmount = 10e18
var salt = random()
var shaBid = registrar.shaBid(hash, owner, amount, salt)
rif.approve(registrar.address, sentAmount, (err, res) => {
if (!err) registrar.newBid(shaBid, sentAmount)
})
Method to be called through a dynamic invocation from an ERC677 token contract
Signature
function newBidWithToken(address _from, uint _tokenQuantity, bytes32 _sealedBid)
Hash 0x1413151f
_from
: address sending the tokens as well as submitting the bid_tokenQuantity
: amount in tokens received through the transference_sealedBid
: sealed bid, created through the shaBid
functionEvents
NewBid
Example
const deposit = 200e18
const sealedBid = registrar.shaBid(web3.sha3('nakamoto'), accounts[0], 150e18, 4512)
const data = '0x1413151f' + sealedBid.slice(2)
rif.transferAndCall(registrar.address, deposit, data)
Start a set of auctions and bid on one of them. This method functions identically to calling startAuctions
followed by newBid
, but all in one transaction.
Signature
function startAuctionsAndBid(bytes32[] _hashes, bytes32 _sealedBid, uint _tokenQuantity) public payable
Parameters
_hashes
: a list of hashes to start auctions on._sealedBid
: a sealed bid for one of the auctions._tokenQuantity
: amount of tokens to mask the bid with.Events
AuctionStarted
NewBid
Example
var hash = web3.sha3('nakamoto')
var hashes = [
web3.sha3('fake1'),
hash,
web3.sha3('fake2')
]
var amountSent = 15e18
var shaBid = registrar.shaBid(hash, accounts[0], 10e8, 1000)
rif.approve(registrar.address, amountSent, (err, res) => {
if (!err) registrar.startAuctionsAndBid(hashes, shaBid, amountSent)
})
Submit the properties of a bid to reveal them. The hash, value and salt must be the same set in the sealed bid, otherwise, no bid will be unsealed.
The refund schedule is defined in this method.
Signature
function unsealBid(bytes32 _hash, uint _value, bytes32 _salt) public
Parameters
_hash
: the node in the sealedBid_value
: the bid amount in the sealedBid_salt
: the sale in the sealedBidEvents
BidRevealed
Example
registrar.unsealBid(myHash, myValueBade, mySalt)
Finalize an auction after the registration date has passed. Updates the Registry to reflect the new node owner. Starts the winning Deed’s expiration period.
Signature
function finalizeAuction(bytes32 _hash) public onlyOwner(_hash)
Parameters
_hash
: the hash of the name the auction is forEvents
HashRegistered
Example
var name = web3.sha3('nakamoto')
registrar.finalizeAuction(name)
// Now you might
registry.setResolver(namehash(name + '.rsk'), myResolverAddress)
Pay the annual rent for a name. The rent value is 1 RIF.
Domains have a validity of 1 year after the registration date. Said expiry date is reflected through the associated Deed contract. Owners have a period of 3 months before the expiryDate to pay the rent and extend their ownership for 1 year.
This method requires the sender to approve the Registrar to use the specified tokenQuantity in the ERC677 contract.
Otherwise it can be done through the tokenFallback
after a transfer with the corresponding parameters.
Signature
function payRent(bytes32 _hash) public
Parameters
_hash
: the hash of the name to pay the rent forExample
rif.approve(registrar.address, 1e18, (err, res) => {
registrar.payRent(web3.sha3('nakamoto'), 1e18)
})
Method to be called through a dynamic invocation from an ERC223 token contract.
Signature
function payRentWithToken(address _from, uint _tokenQuantity, bytes32 _hash) public
Hash 0xe1ac9915
Parameters
_from
: address sending the tokens as well as submitting the bid
_tokenQuantity
: amount in tokens received through the transference
_hash
: hash of the name to pay the rent for
Example
const hash = web3.sha3('nakamoto')
const rent = 1e18;
const data = '0xe1ac9915' + hash.slice(2);
rif.transferAndCall(registrar.address, rent, data);
Change the owner of the domain. This impacts in the Registry and the token Deed. The owner of a domain may transfer it to someone else at any time.
Signature
function transfer(bytes32 _hash, address _newOwner) public onlyOwner(_hash)
Parameters
_hash
: the node to transfer_newOwner
: the address to transfer ownership toExample
var hash = web3.sha3('nakamoto')
var newOwnerAddress = '0x53ab...'
reigstrar.trasnfer(hash, newOwnerAddress)
After some time, or if we’re no longer the Registrar, the owner can release the name and get a part of their tokens back. The allowed release period is within the annual rent payment period, which starts 3 months before the expiration date.
Signature
function releaseDeed(bytes32 _hash) public onlyOwner(_hash)
Parameters
_hash
: the node to releaseExample
var hash = web3.sha3('nakamoto')
registrar.releaseDeed(hash)
Events
HashReleased
Allows anyone to delete the owner and resolver records for (subdomain of) a domain name that is not currently owned in the Registrar. If passing, ex: ‘foo.bar.rsk’, the owner and Resolver fields on ‘foo.bar.rsk’ and ‘bar.rsk’ will all be cleared.
Signature
function eraseNode(bytes32[] _labels) public
Parameters
_labels
: a series of label hashes identifying the name to zero out, rooted at the registrar’s root. Must contain at least one element. For instance, to zero ‘foo.bar.rsk’ on a registrar that owns ‘.rsk’, pass an array containing [web3.sha3('foo'), web3.sha3('bar')]
.Transfers the Deed to the current Registrar, if different from this one. Used during the upgrade process to an enhanced Registrar.
Signature
function transferRegistrars(bytes32 _hash) public onlyOwner(_hash)
Parameters
_hash
The name-hash to transfer.Accepts a transfer from a previous Registrar; stubbed out here since there is no previous registrar implementing this interface.
Signature
function acceptRegistrarTransfer(bytes32 _hash, TokenDeed _deed, uint _registrationDate) public pure
Parameters
_hash
: the sha3 hash of the label to transfer._deed
: the TokenDeed object for the name being transferred in._registrationDate
: the date at which the name was originally registered.Returns the state of a hash auction.
Signature
function state(bytes32 _hash) public view returns (Mode)
_hash
: hash of the name to query aboutReturns
Mode
Example
const state = registrar.state(web3.sha3('nakamoto'))
if (state == 0) console.log('This name is available for auction!')
else if (state == 1) console.log('This name is already in auction!')
else if (state == 2) console.log('This name is already owned!')
else if (state == 4) console.log('This name is during reveal phase!')
Returns information related to a certain name
function entries(bytes32 _hash) public view returns (Mode, address, uint, uint, uint)
_hash
: hash of the name to query aboutReturns
Mode
- state: the state of the auction for the label.address
- deed: the address of the current winning Deed.uint
- registration date: the auction’s finish date. It is a number that represents the seconds remaining to the auction’s finish date.uint
- value: the second highest bid. It is a number that represents the tokens bade. It may be 0 if there is only one bid.uint
- highest bid: the highest bid (and winning value) made for the auction. It is a number that represents the tokens bade.Example
var entry = registrar.entries(web3.sha3('nakamoto'))
var iAmWinning = entry[1] === myDeed
var endDate = new Date(entry[2] * 1000)
if(iAmWinning) {
var iWillPay = entry[3]
var iBade = entry[4]
}
Hash the values required for a secret bid
Signature
function shaBid(bytes32 _hash, address _owner, uint _value, bytes32 _salt) public pure returns (bytes32)
Parameters
_hash
: the node corresponding to the desired name-hash_value
: the bid amount in tokens_salt
: a random value to ensure secrecy of the bidReturns
bytes32
The hash of the bid valuesFallback function to be called when the contract receives a transference through an ERC677 contract.
Functions supported:
newBidWithToken
(signature 0x1413151f
) with a 32 byte parameter (sealedBid to submit)payRentWithToken
(signature 0xe1ac9915
) with a 32 byte parameter (hash of the name to pay the rent for)Signature
function tokenFallback(address _from, uint _value, bytes _data) public
Parameters
_from
: address which sent the tokens_value
: amount of tokens sent_data
: byte array with information of which function to call and the parameters used for the invocationevent AuctionStarted(bytes32 indexed hash, uint registrationDate);
event NewBid(bytes32 indexed hash, address indexed bidder, uint deposit);
event BidRevealed(bytes32 indexed hash, address indexed owner, uint value, uint8 status);
event HashRegistered(bytes32 indexed hash, address indexed owner, uint value, uint registrationDate);
event HashReleased(bytes32 indexed hash, uint value);
The states are defined:
enum Mode {
Open,
Auction,
Owned,
Forbidden,
Reveal
}
| # | State | |
|---|---|---|
| 0 | Open | Domain is available and the auction hasn’t started |
| 1 | Auction | Domain is available and the auction has been started |
| 2 | Owned | Domain is taken and currently owned by someone |
| 4 | Reveal | Domain is currently in the ‘reveal’ stage of the auction |


Alex Brooker (born 1984-05-15[ref]) has appeared in 152 episodes between 2012-2019. Alex Brooker on Wikipedia.