mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-19 06:47:29 +08:00
Document CameraImageProvider
Makes it easier than looking up the Qt documentation online.
This commit is contained in:
parent
9e4fcd820e
commit
6cf2e89f6b
@ -1,15 +1,26 @@
|
|||||||
|
# Copyright (c) 2018 Ultimaker B.V.
|
||||||
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from PyQt5.QtGui import QImage
|
from PyQt5.QtGui import QImage
|
||||||
from PyQt5.QtQuick import QQuickImageProvider
|
from PyQt5.QtQuick import QQuickImageProvider
|
||||||
from PyQt5.QtCore import QSize
|
from PyQt5.QtCore import QSize
|
||||||
|
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
|
|
||||||
|
## Creates screenshots of the current scene.
|
||||||
class CameraImageProvider(QQuickImageProvider):
|
class CameraImageProvider(QQuickImageProvider):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__(QQuickImageProvider.Image)
|
super().__init__(QQuickImageProvider.Image)
|
||||||
|
|
||||||
## Request a new image.
|
## Request a new image.
|
||||||
|
#
|
||||||
|
# The image will be taken using the current camera position.
|
||||||
|
# Only the actual objects in the scene will get rendered. Not the build
|
||||||
|
# plate and such!
|
||||||
|
# \param id The ID for the image to create. This is the requested image
|
||||||
|
# source, with the "image:" scheme and provider identifier removed. It's
|
||||||
|
# a Qt thing, they'll provide this parameter.
|
||||||
|
# \param size The dimensions of the image to scale to.
|
||||||
def requestImage(self, id, size):
|
def requestImage(self, id, size):
|
||||||
for output_device in Application.getInstance().getOutputDeviceManager().getOutputDevices():
|
for output_device in Application.getInstance().getOutputDeviceManager().getOutputDevices():
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user