spot-sdk-js
Version:
Develop applications and payloads for Spot using the unofficial Boston Dynamics Spot Node.js SDK.
1,591 lines (1,411 loc) • 94.1 kB
JavaScript
// source: bosdyn/api/image.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var bosdyn_api_header_pb = require('../../bosdyn/api/header_pb.js');
goog.object.extend(proto, bosdyn_api_header_pb);
var bosdyn_api_geometry_pb = require('../../bosdyn/api/geometry_pb.js');
goog.object.extend(proto, bosdyn_api_geometry_pb);
var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js');
goog.object.extend(proto, google_protobuf_duration_pb);
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
goog.object.extend(proto, google_protobuf_timestamp_pb);
goog.exportSymbol('proto.bosdyn.api.CaptureParameters', null, global);
goog.exportSymbol('proto.bosdyn.api.GetImageRequest', null, global);
goog.exportSymbol('proto.bosdyn.api.GetImageResponse', null, global);
goog.exportSymbol('proto.bosdyn.api.Image', null, global);
goog.exportSymbol('proto.bosdyn.api.Image.Format', null, global);
goog.exportSymbol('proto.bosdyn.api.Image.PixelFormat', null, global);
goog.exportSymbol('proto.bosdyn.api.ImageCapture', null, global);
goog.exportSymbol('proto.bosdyn.api.ImageRequest', null, global);
goog.exportSymbol('proto.bosdyn.api.ImageResponse', null, global);
goog.exportSymbol('proto.bosdyn.api.ImageResponse.Status', null, global);
goog.exportSymbol('proto.bosdyn.api.ImageSource', null, global);
goog.exportSymbol('proto.bosdyn.api.ImageSource.CameraModelsCase', null, global);
goog.exportSymbol('proto.bosdyn.api.ImageSource.ImageType', null, global);
goog.exportSymbol('proto.bosdyn.api.ImageSource.PinholeModel', null, global);
goog.exportSymbol('proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics', null, global);
goog.exportSymbol('proto.bosdyn.api.ListImageSourcesRequest', null, global);
goog.exportSymbol('proto.bosdyn.api.ListImageSourcesResponse', null, global);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.bosdyn.api.Image = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.Image, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.Image.displayName = 'proto.bosdyn.api.Image';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.bosdyn.api.CaptureParameters = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.CaptureParameters, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.CaptureParameters.displayName = 'proto.bosdyn.api.CaptureParameters';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.bosdyn.api.ImageCapture = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.ImageCapture, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.ImageCapture.displayName = 'proto.bosdyn.api.ImageCapture';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.bosdyn.api.ImageSource = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.bosdyn.api.ImageSource.oneofGroups_);
};
goog.inherits(proto.bosdyn.api.ImageSource, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.ImageSource.displayName = 'proto.bosdyn.api.ImageSource';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.bosdyn.api.ImageSource.PinholeModel = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.ImageSource.PinholeModel, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.ImageSource.PinholeModel.displayName = 'proto.bosdyn.api.ImageSource.PinholeModel';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics.displayName = 'proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.bosdyn.api.ListImageSourcesRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.ListImageSourcesRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.ListImageSourcesRequest.displayName = 'proto.bosdyn.api.ListImageSourcesRequest';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.bosdyn.api.ListImageSourcesResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.bosdyn.api.ListImageSourcesResponse.repeatedFields_, null);
};
goog.inherits(proto.bosdyn.api.ListImageSourcesResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.ListImageSourcesResponse.displayName = 'proto.bosdyn.api.ListImageSourcesResponse';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.bosdyn.api.ImageRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.ImageRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.ImageRequest.displayName = 'proto.bosdyn.api.ImageRequest';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.bosdyn.api.GetImageRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.bosdyn.api.GetImageRequest.repeatedFields_, null);
};
goog.inherits(proto.bosdyn.api.GetImageRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.GetImageRequest.displayName = 'proto.bosdyn.api.GetImageRequest';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.bosdyn.api.ImageResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.ImageResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.ImageResponse.displayName = 'proto.bosdyn.api.ImageResponse';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.bosdyn.api.GetImageResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.bosdyn.api.GetImageResponse.repeatedFields_, null);
};
goog.inherits(proto.bosdyn.api.GetImageResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.GetImageResponse.displayName = 'proto.bosdyn.api.GetImageResponse';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.bosdyn.api.Image.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.Image.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.bosdyn.api.Image} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.Image.toObject = function(includeInstance, msg) {
var f, obj = {
cols: jspb.Message.getFieldWithDefault(msg, 2, 0),
rows: jspb.Message.getFieldWithDefault(msg, 3, 0),
data: msg.getData_asB64(),
format: jspb.Message.getFieldWithDefault(msg, 5, 0),
pixelFormat: jspb.Message.getFieldWithDefault(msg, 6, 0)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.bosdyn.api.Image}
*/
proto.bosdyn.api.Image.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.Image;
return proto.bosdyn.api.Image.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.Image} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.Image}
*/
proto.bosdyn.api.Image.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 2:
var value = /** @type {number} */ (reader.readInt32());
msg.setCols(value);
break;
case 3:
var value = /** @type {number} */ (reader.readInt32());
msg.setRows(value);
break;
case 4:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setData(value);
break;
case 5:
var value = /** @type {!proto.bosdyn.api.Image.Format} */ (reader.readEnum());
msg.setFormat(value);
break;
case 6:
var value = /** @type {!proto.bosdyn.api.Image.PixelFormat} */ (reader.readEnum());
msg.setPixelFormat(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.Image.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.Image.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.bosdyn.api.Image} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.Image.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getCols();
if (f !== 0) {
writer.writeInt32(
2,
f
);
}
f = message.getRows();
if (f !== 0) {
writer.writeInt32(
3,
f
);
}
f = message.getData_asU8();
if (f.length > 0) {
writer.writeBytes(
4,
f
);
}
f = message.getFormat();
if (f !== 0.0) {
writer.writeEnum(
5,
f
);
}
f = message.getPixelFormat();
if (f !== 0.0) {
writer.writeEnum(
6,
f
);
}
};
/**
* @enum {number}
*/
proto.bosdyn.api.Image.Format = {
FORMAT_UNKNOWN: 0,
FORMAT_JPEG: 1,
FORMAT_RAW: 2,
FORMAT_RLE: 3
};
/**
* @enum {number}
*/
proto.bosdyn.api.Image.PixelFormat = {
PIXEL_FORMAT_UNKNOWN: 0,
PIXEL_FORMAT_GREYSCALE_U8: 1,
PIXEL_FORMAT_RGB_U8: 3,
PIXEL_FORMAT_RGBA_U8: 4,
PIXEL_FORMAT_DEPTH_U16: 5,
PIXEL_FORMAT_GREYSCALE_U16: 6
};
/**
* optional int32 cols = 2;
* @return {number}
*/
proto.bosdyn.api.Image.prototype.getCols = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Image} returns this
*/
proto.bosdyn.api.Image.prototype.setCols = function(value) {
return jspb.Message.setProto3IntField(this, 2, value);
};
/**
* optional int32 rows = 3;
* @return {number}
*/
proto.bosdyn.api.Image.prototype.getRows = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Image} returns this
*/
proto.bosdyn.api.Image.prototype.setRows = function(value) {
return jspb.Message.setProto3IntField(this, 3, value);
};
/**
* optional bytes data = 4;
* @return {!(string|Uint8Array)}
*/
proto.bosdyn.api.Image.prototype.getData = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/**
* optional bytes data = 4;
* This is a type-conversion wrapper around `getData()`
* @return {string}
*/
proto.bosdyn.api.Image.prototype.getData_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getData()));
};
/**
* optional bytes data = 4;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getData()`
* @return {!Uint8Array}
*/
proto.bosdyn.api.Image.prototype.getData_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getData()));
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.bosdyn.api.Image} returns this
*/
proto.bosdyn.api.Image.prototype.setData = function(value) {
return jspb.Message.setProto3BytesField(this, 4, value);
};
/**
* optional Format format = 5;
* @return {!proto.bosdyn.api.Image.Format}
*/
proto.bosdyn.api.Image.prototype.getFormat = function() {
return /** @type {!proto.bosdyn.api.Image.Format} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
};
/**
* @param {!proto.bosdyn.api.Image.Format} value
* @return {!proto.bosdyn.api.Image} returns this
*/
proto.bosdyn.api.Image.prototype.setFormat = function(value) {
return jspb.Message.setProto3EnumField(this, 5, value);
};
/**
* optional PixelFormat pixel_format = 6;
* @return {!proto.bosdyn.api.Image.PixelFormat}
*/
proto.bosdyn.api.Image.prototype.getPixelFormat = function() {
return /** @type {!proto.bosdyn.api.Image.PixelFormat} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
};
/**
* @param {!proto.bosdyn.api.Image.PixelFormat} value
* @return {!proto.bosdyn.api.Image} returns this
*/
proto.bosdyn.api.Image.prototype.setPixelFormat = function(value) {
return jspb.Message.setProto3EnumField(this, 6, value);
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.bosdyn.api.CaptureParameters.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.CaptureParameters.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.bosdyn.api.CaptureParameters} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.CaptureParameters.toObject = function(includeInstance, msg) {
var f, obj = {
exposureDuration: (f = msg.getExposureDuration()) && google_protobuf_duration_pb.Duration.toObject(includeInstance, f),
gain: jspb.Message.getFloatingPointFieldWithDefault(msg, 2, 0.0)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.bosdyn.api.CaptureParameters}
*/
proto.bosdyn.api.CaptureParameters.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.CaptureParameters;
return proto.bosdyn.api.CaptureParameters.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.CaptureParameters} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.CaptureParameters}
*/
proto.bosdyn.api.CaptureParameters.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new google_protobuf_duration_pb.Duration;
reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader);
msg.setExposureDuration(value);
break;
case 2:
var value = /** @type {number} */ (reader.readDouble());
msg.setGain(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.CaptureParameters.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.CaptureParameters.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.bosdyn.api.CaptureParameters} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.CaptureParameters.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getExposureDuration();
if (f != null) {
writer.writeMessage(
1,
f,
google_protobuf_duration_pb.Duration.serializeBinaryToWriter
);
}
f = message.getGain();
if (f !== 0.0) {
writer.writeDouble(
2,
f
);
}
};
/**
* optional google.protobuf.Duration exposure_duration = 1;
* @return {?proto.google.protobuf.Duration}
*/
proto.bosdyn.api.CaptureParameters.prototype.getExposureDuration = function() {
return /** @type{?proto.google.protobuf.Duration} */ (
jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 1));
};
/**
* @param {?proto.google.protobuf.Duration|undefined} value
* @return {!proto.bosdyn.api.CaptureParameters} returns this
*/
proto.bosdyn.api.CaptureParameters.prototype.setExposureDuration = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.CaptureParameters} returns this
*/
proto.bosdyn.api.CaptureParameters.prototype.clearExposureDuration = function() {
return this.setExposureDuration(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.CaptureParameters.prototype.hasExposureDuration = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional double gain = 2;
* @return {number}
*/
proto.bosdyn.api.CaptureParameters.prototype.getGain = function() {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.CaptureParameters} returns this
*/
proto.bosdyn.api.CaptureParameters.prototype.setGain = function(value) {
return jspb.Message.setProto3FloatField(this, 2, value);
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.bosdyn.api.ImageCapture.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.ImageCapture.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.bosdyn.api.ImageCapture} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.ImageCapture.toObject = function(includeInstance, msg) {
var f, obj = {
acquisitionTime: (f = msg.getAcquisitionTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
transformsSnapshot: (f = msg.getTransformsSnapshot()) && bosdyn_api_geometry_pb.FrameTreeSnapshot.toObject(includeInstance, f),
frameNameImageSensor: jspb.Message.getFieldWithDefault(msg, 5, ""),
image: (f = msg.getImage()) && proto.bosdyn.api.Image.toObject(includeInstance, f),
captureParams: (f = msg.getCaptureParams()) && proto.bosdyn.api.CaptureParameters.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.bosdyn.api.ImageCapture}
*/
proto.bosdyn.api.ImageCapture.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.ImageCapture;
return proto.bosdyn.api.ImageCapture.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.ImageCapture} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.ImageCapture}
*/
proto.bosdyn.api.ImageCapture.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 30:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setAcquisitionTime(value);
break;
case 31:
var value = new bosdyn_api_geometry_pb.FrameTreeSnapshot;
reader.readMessage(value,bosdyn_api_geometry_pb.FrameTreeSnapshot.deserializeBinaryFromReader);
msg.setTransformsSnapshot(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setFrameNameImageSensor(value);
break;
case 3:
var value = new proto.bosdyn.api.Image;
reader.readMessage(value,proto.bosdyn.api.Image.deserializeBinaryFromReader);
msg.setImage(value);
break;
case 4:
var value = new proto.bosdyn.api.CaptureParameters;
reader.readMessage(value,proto.bosdyn.api.CaptureParameters.deserializeBinaryFromReader);
msg.setCaptureParams(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.ImageCapture.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.ImageCapture.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.bosdyn.api.ImageCapture} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.ImageCapture.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getAcquisitionTime();
if (f != null) {
writer.writeMessage(
30,
f,
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
f = message.getTransformsSnapshot();
if (f != null) {
writer.writeMessage(
31,
f,
bosdyn_api_geometry_pb.FrameTreeSnapshot.serializeBinaryToWriter
);
}
f = message.getFrameNameImageSensor();
if (f.length > 0) {
writer.writeString(
5,
f
);
}
f = message.getImage();
if (f != null) {
writer.writeMessage(
3,
f,
proto.bosdyn.api.Image.serializeBinaryToWriter
);
}
f = message.getCaptureParams();
if (f != null) {
writer.writeMessage(
4,
f,
proto.bosdyn.api.CaptureParameters.serializeBinaryToWriter
);
}
};
/**
* optional google.protobuf.Timestamp acquisition_time = 30;
* @return {?proto.google.protobuf.Timestamp}
*/
proto.bosdyn.api.ImageCapture.prototype.getAcquisitionTime = function() {
return /** @type{?proto.google.protobuf.Timestamp} */ (
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 30));
};
/**
* @param {?proto.google.protobuf.Timestamp|undefined} value
* @return {!proto.bosdyn.api.ImageCapture} returns this
*/
proto.bosdyn.api.ImageCapture.prototype.setAcquisitionTime = function(value) {
return jspb.Message.setWrapperField(this, 30, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.ImageCapture} returns this
*/
proto.bosdyn.api.ImageCapture.prototype.clearAcquisitionTime = function() {
return this.setAcquisitionTime(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.ImageCapture.prototype.hasAcquisitionTime = function() {
return jspb.Message.getField(this, 30) != null;
};
/**
* optional FrameTreeSnapshot transforms_snapshot = 31;
* @return {?proto.bosdyn.api.FrameTreeSnapshot}
*/
proto.bosdyn.api.ImageCapture.prototype.getTransformsSnapshot = function() {
return /** @type{?proto.bosdyn.api.FrameTreeSnapshot} */ (
jspb.Message.getWrapperField(this, bosdyn_api_geometry_pb.FrameTreeSnapshot, 31));
};
/**
* @param {?proto.bosdyn.api.FrameTreeSnapshot|undefined} value
* @return {!proto.bosdyn.api.ImageCapture} returns this
*/
proto.bosdyn.api.ImageCapture.prototype.setTransformsSnapshot = function(value) {
return jspb.Message.setWrapperField(this, 31, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.ImageCapture} returns this
*/
proto.bosdyn.api.ImageCapture.prototype.clearTransformsSnapshot = function() {
return this.setTransformsSnapshot(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.ImageCapture.prototype.hasTransformsSnapshot = function() {
return jspb.Message.getField(this, 31) != null;
};
/**
* optional string frame_name_image_sensor = 5;
* @return {string}
*/
proto.bosdyn.api.ImageCapture.prototype.getFrameNameImageSensor = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
};
/**
* @param {string} value
* @return {!proto.bosdyn.api.ImageCapture} returns this
*/
proto.bosdyn.api.ImageCapture.prototype.setFrameNameImageSensor = function(value) {
return jspb.Message.setProto3StringField(this, 5, value);
};
/**
* optional Image image = 3;
* @return {?proto.bosdyn.api.Image}
*/
proto.bosdyn.api.ImageCapture.prototype.getImage = function() {
return /** @type{?proto.bosdyn.api.Image} */ (
jspb.Message.getWrapperField(this, proto.bosdyn.api.Image, 3));
};
/**
* @param {?proto.bosdyn.api.Image|undefined} value
* @return {!proto.bosdyn.api.ImageCapture} returns this
*/
proto.bosdyn.api.ImageCapture.prototype.setImage = function(value) {
return jspb.Message.setWrapperField(this, 3, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.ImageCapture} returns this
*/
proto.bosdyn.api.ImageCapture.prototype.clearImage = function() {
return this.setImage(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.ImageCapture.prototype.hasImage = function() {
return jspb.Message.getField(this, 3) != null;
};
/**
* optional CaptureParameters capture_params = 4;
* @return {?proto.bosdyn.api.CaptureParameters}
*/
proto.bosdyn.api.ImageCapture.prototype.getCaptureParams = function() {
return /** @type{?proto.bosdyn.api.CaptureParameters} */ (
jspb.Message.getWrapperField(this, proto.bosdyn.api.CaptureParameters, 4));
};
/**
* @param {?proto.bosdyn.api.CaptureParameters|undefined} value
* @return {!proto.bosdyn.api.ImageCapture} returns this
*/
proto.bosdyn.api.ImageCapture.prototype.setCaptureParams = function(value) {
return jspb.Message.setWrapperField(this, 4, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.ImageCapture} returns this
*/
proto.bosdyn.api.ImageCapture.prototype.clearCaptureParams = function() {
return this.setCaptureParams(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.ImageCapture.prototype.hasCaptureParams = function() {
return jspb.Message.getField(this, 4) != null;
};
/**
* Oneof group definitions for this message. Each group defines the field
* numbers belonging to that group. When of these fields' value is set, all
* other fields in the group are cleared. During deserialization, if multiple
* fields are encountered for a group, only the last value seen will be kept.
* @private {!Array<!Array<number>>}
* @const
*/
proto.bosdyn.api.ImageSource.oneofGroups_ = [[8]];
/**
* @enum {number}
*/
proto.bosdyn.api.ImageSource.CameraModelsCase = {
CAMERA_MODELS_NOT_SET: 0,
PINHOLE: 8
};
/**
* @return {proto.bosdyn.api.ImageSource.CameraModelsCase}
*/
proto.bosdyn.api.ImageSource.prototype.getCameraModelsCase = function() {
return /** @type {proto.bosdyn.api.ImageSource.CameraModelsCase} */(jspb.Message.computeOneofCase(this, proto.bosdyn.api.ImageSource.oneofGroups_[0]));
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.bosdyn.api.ImageSource.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.ImageSource.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.bosdyn.api.ImageSource} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.ImageSource.toObject = function(includeInstance, msg) {
var f, obj = {
name: jspb.Message.getFieldWithDefault(msg, 2, ""),
cols: jspb.Message.getFieldWithDefault(msg, 4, 0),
rows: jspb.Message.getFieldWithDefault(msg, 5, 0),
depthScale: jspb.Message.getFloatingPointFieldWithDefault(msg, 6, 0.0),
pinhole: (f = msg.getPinhole()) && proto.bosdyn.api.ImageSource.PinholeModel.toObject(includeInstance, f),
imageType: jspb.Message.getFieldWithDefault(msg, 9, 0)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.bosdyn.api.ImageSource}
*/
proto.bosdyn.api.ImageSource.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.ImageSource;
return proto.bosdyn.api.ImageSource.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.ImageSource} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.ImageSource}
*/
proto.bosdyn.api.ImageSource.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setName(value);
break;
case 4:
var value = /** @type {number} */ (reader.readInt32());
msg.setCols(value);
break;
case 5:
var value = /** @type {number} */ (reader.readInt32());
msg.setRows(value);
break;
case 6:
var value = /** @type {number} */ (reader.readDouble());
msg.setDepthScale(value);
break;
case 8:
var value = new proto.bosdyn.api.ImageSource.PinholeModel;
reader.readMessage(value,proto.bosdyn.api.ImageSource.PinholeModel.deserializeBinaryFromReader);
msg.setPinhole(value);
break;
case 9:
var value = /** @type {!proto.bosdyn.api.ImageSource.ImageType} */ (reader.readEnum());
msg.setImageType(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.ImageSource.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.ImageSource.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.bosdyn.api.ImageSource} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.ImageSource.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getName();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getCols();
if (f !== 0) {
writer.writeInt32(
4,
f
);
}
f = message.getRows();
if (f !== 0) {
writer.writeInt32(
5,
f
);
}
f = message.getDepthScale();
if (f !== 0.0) {
writer.writeDouble(
6,
f
);
}
f = message.getPinhole();
if (f != null) {
writer.writeMessage(
8,
f,
proto.bosdyn.api.ImageSource.PinholeModel.serializeBinaryToWriter
);
}
f = message.getImageType();
if (f !== 0.0) {
writer.writeEnum(
9,
f
);
}
};
/**
* @enum {number}
*/
proto.bosdyn.api.ImageSource.ImageType = {
IMAGE_TYPE_UNKNOWN: 0,
IMAGE_TYPE_VISUAL: 1,
IMAGE_TYPE_DEPTH: 2
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.bosdyn.api.ImageSource.PinholeModel.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.ImageSource.PinholeModel.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.bosdyn.api.ImageSource.PinholeModel} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.ImageSource.PinholeModel.toObject = function(includeInstance, msg) {
var f, obj = {
intrinsics: (f = msg.getIntrinsics()) && proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.bosdyn.api.ImageSource.PinholeModel}
*/
proto.bosdyn.api.ImageSource.PinholeModel.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.ImageSource.PinholeModel;
return proto.bosdyn.api.ImageSource.PinholeModel.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.ImageSource.PinholeModel} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.ImageSource.PinholeModel}
*/
proto.bosdyn.api.ImageSource.PinholeModel.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics;
reader.readMessage(value,proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics.deserializeBinaryFromReader);
msg.setIntrinsics(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.ImageSource.PinholeModel.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.ImageSource.PinholeModel.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.bosdyn.api.ImageSource.PinholeModel} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.ImageSource.PinholeModel.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getIntrinsics();
if (f != null) {
writer.writeMessage(
1,
f,
proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics.serializeBinaryToWriter
);
}
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics.toObject = function(includeInstance, msg) {
var f, obj = {
focalLength: (f = msg.getFocalLength()) && bosdyn_api_geometry_pb.Vec2.toObject(includeInstance, f),
principalPoint: (f = msg.getPrincipalPoint()) && bosdyn_api_geometry_pb.Vec2.toObject(includeInstance, f),
skew: (f = msg.getSkew()) && bosdyn_api_geometry_pb.Vec2.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics}
*/
proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics;
return proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics}
*/
proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new bosdyn_api_geometry_pb.Vec2;
reader.readMessage(value,bosdyn_api_geometry_pb.Vec2.deserializeBinaryFromReader);
msg.setFocalLength(value);
break;
case 2:
var value = new bosdyn_api_geometry_pb.Vec2;
reader.readMessage(value,bosdyn_api_geometry_pb.Vec2.deserializeBinaryFromReader);
msg.setPrincipalPoint(value);
break;
case 3:
var value = new bosdyn_api_geometry_pb.Vec2;
reader.readMessage(value,bosdyn_api_geometry_pb.Vec2.deserializeBinaryFromReader);
msg.setSkew(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getFocalLength();
if (f != null) {
writer.writeMessage(
1,
f,
bosdyn_api_geometry_pb.Vec2.serializeBinaryToWriter
);
}
f = message.getPrincipalPoint();
if (f != null) {
writer.writeMessage(
2,
f,
bosdyn_api_geometry_pb.Vec2.serializeBinaryToWriter
);
}
f = message.getSkew();
if (f != null) {
writer.writeMessage(
3,
f,
bosdyn_api_geometry_pb.Vec2.serializeBinaryToWriter
);
}
};
/**
* optional Vec2 focal_length = 1;
* @return {?proto.bosdyn.api.Vec2}
*/
proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics.prototype.getFocalLength = function() {
return /** @type{?proto.bosdyn.api.Vec2} */ (
jspb.Message.getWrapperField(this, bosdyn_api_geometry_pb.Vec2, 1));
};
/**
* @param {?proto.bosdyn.api.Vec2|undefined} value
* @return {!proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics} returns this
*/
proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics.prototype.setFocalLength = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.ImageSource.PinholeModel.CameraIntrinsics} returns