// // ImageOverlay.cpp // interface/src/ui/overlays // // Copyright 2014 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "ImageOverlay.h" #include #include #include #include QString const ImageOverlay::TYPE = "image"; QUrl const ImageOverlay::URL(QString("hifi/overlays/ImageOverlay.qml")); // ImageOverlay's properties are defined in the QML file specified above. /**jsdoc * These are the properties of an image {@link Overlays.OverlayType|OverlayType}. * @typedef {object} Overlays.ImageProperties * * @property {Rect} bounds - The position and size of the image display area, in pixels. Write-only. * @property {number} x - Integer left, x-coordinate value of the image display area = bounds.x. * Write-only. * @property {number} y - Integer top, y-coordinate value of the image display area = bounds.y. * Write-only. * @property {number} width - Integer width of the image display area = bounds.width. Write-only. * @property {number} height - Integer height of the image display area = bounds.height. Write-only. * @property {string} imageURL - The URL of the image file to display. The image is scaled to fit to the bounds. * Write-only. * @property {Vec2} subImage=0,0 - Integer coordinates of the top left pixel to start using image content from. * Write-only. * @property {Color} color=0,0,0 - The color to apply over the top of the image to colorize it. Write-only. * @property {number} alpha=0.0 - The opacity of the color applied over the top of the image, 0.0 - * 1.0. Write-only. * @property {boolean} visible=true - If true, the overlay is rendered, otherwise it is not rendered. * Write-only. */ ImageOverlay::ImageOverlay() : QmlOverlay(URL) { } ImageOverlay::ImageOverlay(const ImageOverlay* imageOverlay) : QmlOverlay(URL, imageOverlay) { } ImageOverlay* ImageOverlay::createClone() const { return new ImageOverlay(this); }