Files
PhotonVision/photon-client/src/components/common/cv-image.vue
Matt 8a7318f5dd Update log viewer, add uncalibrated modal (#108)
Adds a prettier log viewer, with the ability to filter logs. Also warns user and prevents switching into 3d mode if the resolution is uncalibrated.
2020-09-04 18:18:44 -07:00

49 lines
1.6 KiB
Vue

<template>
<img
:id="id"
crossOrigin="anonymous"
:style="styleObject"
:src="src"
alt=""
@click="e => $emit('click', e)"
>
</template>
<script>
export default {
name: "CvImage",
// eslint-disable-next-line vue/require-prop-types
props: ['address', 'scale', 'maxHeight', 'maxHeightMd', 'maxHeightXl', 'colorPicking', 'id', 'disconnected'],
computed: {
styleObject: {
get() {
let ret = {
"border-radius": "3px",
"display": "block",
"object-fit": "contain",
"object-position": "50% 50%",
"max-width": "100%",
"margin-left": "auto",
"margin-right": "auto",
"max-height": this.maxHeight,
height: `${this.scale}%`,
cursor: (this.colorPicking ? `url(${require("../../assets/eyedropper.svg")}),` : "") + "default",
};
if (this.$vuetify.breakpoint.xl) {
ret["max-height"] = this.maxHeightXl;
} else if (this.$vuetify.breakpoint.mdAndUp) {
ret["max-height"] = this.maxHeightMd;
}
return ret;
}
},
src: {
get() {
return this.disconnected ? require("../../assets/noStream.jpg") : this.address;
},
},
},
}
</script>