UNPKG

@snap/camera-kit

Version:
56 lines 2.03 kB
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; export const protobufPackage = "snapchat.snapdoc"; function createBaseCaptureCharacteristics() { return { flashOn: false, frontFacing: false }; } export const CaptureCharacteristics = { encode(message, writer = new BinaryWriter()) { if (message.flashOn !== false) { writer.uint32(8).bool(message.flashOn); } if (message.frontFacing !== false) { writer.uint32(16).bool(message.frontFacing); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCaptureCharacteristics(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.flashOn = reader.bool(); continue; } case 2: { if (tag !== 16) { break; } message.frontFacing = reader.bool(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, create(base) { return CaptureCharacteristics.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a, _b; const message = createBaseCaptureCharacteristics(); message.flashOn = (_a = object.flashOn) !== null && _a !== void 0 ? _a : false; message.frontFacing = (_b = object.frontFacing) !== null && _b !== void 0 ? _b : false; return message; }, }; //# sourceMappingURL=capture_characteristics.js.map