Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

CIImageMBS.AsNSImageMBS as Variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 13.0 Yes No No Yes, macOS only No
Function: Creates a NSImageMBS which references the given CIImage.
Example:
// make a dummy CIImage
dim Logo as Picture = LogoMBS(500)
dim jpeg as string = PictureToJPEGStringMBS(logo, 80)
dim ci as CIImageMBS = CIImageMBS.imageWithData(jpeg)

// convert to NSImage
dim ni as NSImageMBS = ci.AsNSImageMBS

// and display
Backdrop = ni.CopyPictureWithMask
Notes:
Returns nil on error.
Result declared as Variant to avoid plugin dependencies.

Feedback, Comments & Corrections

CIImageMBS.autoAdjustmentFilters as CIFilterMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 13.1 Yes No No Yes, macOS only No
Function: Returns all filters that perform auto adjustment.
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.jpg")
dim image as CIImageMBS = CIImageMBS.imageWithContentsOfFile(f)

dim filters() as CIFilterMBS = image.autoAdjustmentFilters

dim beginImage as CIImageMBS = image
for each filter as CIFilterMBS in filters
filter.ValueAsCIImage("inputImage") = beginImage
beginImage = filter.ValueAsCIImage("outputImage")
next

Backdrop = beginImage.RenderPicture
Notes: An array of auto adjustment filters to apply to the image. The filters are preset with values for correcting deficiencies in the supplied image.

Feedback, Comments & Corrections

CIImageMBS.autoAdjustmentFiltersWithOptions(options as dictionary) as CIFilterMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 13.1 Yes No No Yes, macOS only No
Function: Returns a subset of the filters that perform auto adjustment.
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.jpg")
dim image as CIImageMBS = CIImageMBS.imageWithContentsOfFile(f)

dim options as new Dictionary
options.Value(CIImageMBS.kCIImageAutoAdjustEnhance) = true
options.Value(CIImageMBS.kCIImageAutoAdjustRedEye) = true

dim filters() as CIFilterMBS = image.autoAdjustmentFiltersWithOptions(options)

dim beginImage as CIImageMBS = image
for each filter as CIFilterMBS in filters
filter.ValueAsCIImage("inputImage") = beginImage
beginImage = filter.ValueAsCIImage("outputImage")
next

Backdrop = beginImage.RenderPicture
Notes:
options: You can control which filters are returned by supplying one or more of the keys described in "Auto Adjustment Keys."
The options dictionary can also contain a CIDetectorImageOrientation key. This key is a number with the same value as defined by the TIFF and EXIF specifications; values can range from 1 through 8. The value specifies where the origin (0,0) of the image is located. If not present, the default value is 1, which means the origin of the image is top, left. For details on the image origin specified by each value, see kCGImagePropertyOrientation.

Returns an array of auto adjustment filters, filtered by the supplied options, to apply to the image. The filters are preset with values for correcting deficiencies in the supplied image.

Feedback, Comments & Corrections

CIImageMBS.Constructor(CGLayer as CGLayerMBS, options as Dictionary = nil)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 14.1 Yes No No Yes, macOS only No
Function: Creates and returns an image object from the contents supplied by a CGLayer object, using the specified options.
Notes:
layer: A CGLayer object. For more information see Quartz 2D Programming Guide and CGLayer Reference.
options: A dictionary specifying image options.

Returns an image object initialized with the contents of the layer object and set up with the specified options.

See also:

Feedback, Comments & Corrections

CIImageMBS.Constructor(data as memoryblock, BytesPerRow as Integer, width as Integer, height as Integer, format as Integer, cgcolorspace as CGColorSpaceMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 7.3 Yes No No Yes, macOS only No
Function: Creates a CIImage from a RAW memory buffer.
Notes:
Format must be one of this constants: kCIFormatRGBAf, kCIFormatRGBA16 and kCIFormatARGB8.

On success, the handle is not zero.

See also:

Feedback, Comments & Corrections

CIImageMBS.Constructor(data as Memoryblock, Length as Integer, BytesPerRow as Integer, width as Integer, height as Integer, format as Integer, cgcolorspace as CGColorSpaceMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 7.3 Yes No No Yes, macOS only No
Function: Creates a CIImage from a RAW memory buffer.
Notes:
Data points directly to the row data.
Length is the size of the memoryblock in bytes.
BytesPerRow is the size of a row in bytes.
Width and height are the dimensions of the image.
Format must be one of this constants: kCIFormatRGBAf, kCIFormatRGBA16 and kCIFormatARGB8.
Colorspace is the CoreGraphics Colorspace object to be used.

On success, the handle is not zero.

See also:

Feedback, Comments & Corrections

CIImageMBS.copy as CIImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 17.4 Yes No No Yes, macOS only No
Function: Creates a copy of the image.

Feedback, Comments & Corrections

CIImageMBS.CreateCGImage(r as CGRectMBS = nil) as CGImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 13.1 Yes No No Yes, macOS only No
Function: Creates a new image with the content of the CIImage.
Example:
dim logo as Picture = LogoMBS(500)
dim ci as CIImageMBS = CIImageMBS.imageWithPicture(logo)
dim cg as CGImageMBS = ci.CreateCGImage
Backdrop = cg.Picture
Notes:
Render the region 'r' of image 'im' into a temporary buffer using the context, then create and return a new CoreGraphics image with the results.
If r is nil, the whole image extent is used.

See also:

Feedback, Comments & Corrections

CIImageMBS.CreateCGImage(r as CGRectMBS, ColorSpace as CGColorSpaceMBS) as CGImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 13.1 Yes No No Yes, macOS only No
Function: Creates a new image with the content of the CIImage.
Notes:
Render the region 'r' of image 'im' into a temporary buffer using the context, then create and return a new CoreGraphics image with the results.
If r is nil, the whole image extent is used.

See also:

Feedback, Comments & Corrections

CIImageMBS.imageByApplyingOrientation(orientation as Integer) as CIImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 15.0 Yes No No Yes, macOS only No
Function: Returns a new image representing the original image with a transform appied to it based on an orientation value.
Notes:
Orientation values from 1 to 8 as defined in the TIFF spec are supported.
Returns original image if the image is of infinite extent.

Possible orientation values:
Valueorientationdetails
1top leftrow 0 top, col 0 lhs
2top rightrow 0 top, col 0 rhs
3bottom rightrow 0 bottom, col 0 rhs
4bottom leftrow 0 bottom, col 0 lhs
5left toprow 0 lhs, col 0 top
6right toprow 0 rhs, col 0 top
7right bottomrow 0 rhs, col 0 bottom
8left bottomrow 0 lhs, col 0 bottom

Feedback, Comments & Corrections

CIImageMBS.ImageByApplyingTransform(transform as NSAffineTransformMBS) as CIImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 7.3 Yes No No Yes, macOS only No
Function: Returns a new image representing the original image with the transform 'matrix' appended to it.

Feedback, Comments & Corrections

CIImageMBS.imageByClampingToExtent as CIImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 15.0 Yes No No Yes, macOS only No
Function: Return a new infinte image by replicating the pixels of the receiver image's extent.

Feedback, Comments & Corrections

CIImageMBS.imageByCompositingOverImage(dest as CIImageMBS) as CIImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 16.0 Yes No No Yes, macOS only No
Function: Returns a new image created by compositing the original image over the specified destination image.
Notes:
dest: An image to serve as the destination of the compositing operation.

Returns an image object representing the result of the compositing operation.

Calling this method is equivalent to using the CISourceOverCompositing filter. To use other compositing operations and blending modes, create a CIFilter object using one of the built-in filters from the CICategoryCompositeOperation category. For details, see Core Image Filter Reference.

Available in OS X v10.4 and later.

Feedback, Comments & Corrections

CIImageMBS.imageByCroppingToRect(r as CGRectMBS) as CIImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 13.0 Yes No No Yes, macOS only No
Function: Returns a new image that represents the original image after cropping to a rectangle.
Notes: Available in OS X v10.5 and later.

Feedback, Comments & Corrections

CIImageMBS.properties as Dictionary
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 13.0 Yes No No Yes, macOS only No
Function: Returns the metadata properties of an image.
Notes: If the image is the output of one or more CIFilters, then the metadata of the root inputImage will be returned.

Feedback, Comments & Corrections

CIImageMBS.releaseHandle
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Decrements the retain count of a CIImage reference.
Notes:
Each retain must have a release. Too many releases and your app will crash, too many retains and it will leak memory.
Use only if you really know what you are doing.

Feedback, Comments & Corrections

CIImageMBS.RenderNSImage(UseSoftwareRenderer as boolean = false) as Variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 7.3 Yes No No Yes, macOS only No
Function: Creates a picture based of the CIImage content.
Example:
dim f as CIFilterEdgesMBS

f=new CIFilterEdgesMBS
f.inputImage=NewCIImagewithFileMBS(SpecialFolder.Desktop.Child("Paris.jpg"))
f.inputIntensity=5

dim n as NSImageMBS
n=f.outputImage.RenderNSImage(false)
Notes:
Creates a new NSImage, creates a CGContext for it, draws the image into the buffer and returns it as a Realbasic object.

Returns nil on failure.
Rendering the image will cause the calculations to be done so this call is quite expensive.

If UseSoftwareRenderer is true, the hardware acceleration is not used.

Feedback, Comments & Corrections

CIImageMBS.RenderPicture(Width as Integer = 0, Height as Integer = 0, UseSoftwareRenderer as boolean = false) as Picture
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 7.3 Yes No No No No
Function: Creates a picture based of the CIImage content.
Example:
dim f as CIFilterEdgesMBS

f=new CIFilterEdgesMBS
f.inputImage=NewCIImagewithFileMBS(SpecialFolder.Desktop.Child("Paris.jpg"))
f.inputIntensity=5
Backdrop=f.outputImage.RenderPicture
Notes:
Creates a new image buffer, creates a CGContext for it, draws the image into the buffer and returns it as a picture with mask. If you need picture with alpha channel, please use RenderPictureWithAlpha function.

Returns nil on failure.
Rendering the image will cause the calculations to be done so this call is quite expensive.

If UseSoftwareRenderer is true, the hardware acceleration is not used.

Feedback, Comments & Corrections

CIImageMBS.RenderPictureWithAlpha(Width as Integer = 0, Height as Integer = 0, UseSoftwareRenderer as boolean = false) as Picture
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 15.0 Yes No No No No
Function: Creates a picture based of the CIImage content.
Example:
dim f as CIFilterEdgesMBS

f=new CIFilterEdgesMBS
f.inputImage=NewCIImagewithFileMBS(SpecialFolder.Desktop.Child("Paris.jpg"))
f.inputIntensity=5
Backdrop= f.outputImage.RenderPictureWithAlphaMT
Notes:
Creates a new image buffer, creates a CGContext for it, draws the image into the buffer and returns it as a Xojo picture with alpha channel.

Returns nil on failure.
Rendering the image will cause the calculations to be done so this call is quite expensive.

If UseSoftwareRenderer is true, the hardware acceleration is not used.

Feedback, Comments & Corrections

CIImageMBS.RenderPictureWithAlphaMT(Width as Integer = 0, Height as Integer = 0, UseSoftwareRenderer as boolean = false) as Picture
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 15.1 Yes No No No No
Function: Creates a picture based of the CIImage content.
Notes:
Same as the other RenderPictureWithAlpha function, but threaded.
Must be called inside a Xojo (Real Studio) thread so time yields to main thread and you can keep the GUI running.

Creates a new image buffer, creates a CGContext for it, draws the image into the buffer and returns it as a Xojo picture with alpha channel.

Returns nil on failure.
Rendering the image will cause the calculations to be done so this call is quite expensive.

If UseSoftwareRenderer is true, the hardware acceleration is not used.

Feedback, Comments & Corrections

CIImageMBS.retainHandle
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 14.2 Yes No No Yes, macOS only No
Function: Increments the retain count of a CIImage reference.
Notes:
Each retain must have a release. Too many releases and your app will crash, too many retains and it will leak memory.
Use only if you really know what you are doing.

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS MacCG Plugin.




Links
MBS Xojo tutorial videos