vrImageService¶
-
class
vrImageService
¶
(Inherits vrBaseService
)
Service for vrdImage related functions.
Summary¶
- Functions:
- createImage(source) → vrdImage
- getShareMode() → vrImageTypes.ShareMode
- loadImage(filename, loadType, loadOptions) → vrdImage
- readImageInformation(filename) → string
- releaseImage(image)
- reuseImage(source) → vrdImage
- saveImage(image, filename) → bool
- saveImageSequence(image, directory) → bool
- setShareMode(mode)
Functions¶
-
vrImageService.
createImage
(source=vrdImage())¶ Creates an empty image.
Parameters: source (vrdImage) – An optional source to copy from Returns: The created image. Return type: vrdImage
Returns the current share mode for images.
Returns: The current share mode. Return type: vrImageTypes.ShareMode
-
vrImageService.
loadImage
(filename, loadType=vrImageTypes.LoadType.Default, loadOptions=0)¶ Loads an image.
Parameters: - filename (string) – The filename of the image.
- loadType (vrImageTypes.LoadType) – (Optional) The type of image to load.
- loadOptions (integer) – (Optional) Bitmask created from vrImageTypes.LoadOptionsBitmask.
Returns: The image. By default, existing images from the scene are reused and returned by this function if they have the same data as the loaded image.
Return type:
-
vrImageService.
readImageInformation
(filename)¶ Reads an image information.
This function reads metadata (e.g. Exif data) from an image and outputs it as as string.
Parameters: filename (string) – The filename of an image. Returns: The meta information. Return type: string
-
vrImageService.
releaseImage
(image)¶ In case a loaded image is not needed, this method can be used to release (remove) it. Images only need to be released if they are never passed to VRED, as soon as it is passed to VRED, VRED will remove it if it is no longer needed. This method will not delete images that are still in use.
Parameters: image (vrdImage) – Image to be released
-
vrImageService.
reuseImage
(source)¶ Re-use an image from scene instead of source.
Looks for an existing image in the scene that has the same data as source and return it. If found, source is released and the file path of the equal image is set to the path of source. If not found, source is returned.
Parameters: source (vrdImage) – Source image Returns: The equal image if found, source image if not found. Return type: vrdImage
-
vrImageService.
saveImage
(image, filename)¶ Saves an image.
Parameters: - image (vrdImage) – The image to be saved.
- filename (string) – The filename where the image should be saved.
Returns: True if saving was successful, false otherwise.
Return type: bool
-
vrImageService.
saveImageSequence
(image, directory)¶ Saves an image sequence.
This writes an image sequence stored inside a vrdImage to a directory.
Parameters: - image (vrdImage) – The image containing the sequence.
- directory (string) – The directory where the images should be saved.
Returns: True if saving was successful, false otherwise.
Return type: bool
Sets the current share mode for images.
Parameters: mode (vrImageTypes.ShareMode) – The share mode to set.