Learn R Programming

Rvision (version 0.6.0)

cloneImage: Make a copy of an Image object

Description

Image objects are pointers toward C++ objects stored in memory. When copying an Image object using an assignment operator, this creates a copy of the pointer, but not a copy of the C++ object. Any operation on the copied Image object will therefore result in a modification of the orginal Image object. This function duplicates the original Image object instead, allowing safe operations on it while maintaining the integrity of the original Image object.

Usage

cloneImage(x)

Arguments

x

An Image object.

Value

An Image object.

See Also

Image

Examples

Run this code
# NOT RUN {
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
balloon_clone <- cloneImage(balloon)

# }

Run the code above in your browser using DataLab