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

Previous items Next items

GM16ImageMBS.read(width as UInt32, height as UInt32, map as string, StorageType as Integer, data as ptr)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Read single image frame from an array of raw pixels, with specified storage type (ConstituteImage).
Notes:
Returns an Image corresponding to an image stored in a raw memory array format. The pixel data must be in scanline order top-to-bottom. The data can be unsigned char, unsigned short int, unsigned int, unsigned long, float, or double. Float and double require the pixels to be normalized to the range [0..1], otherwise the range is [0..MaxVal] where MaxVal is the maximum possible value for that type.

Note that for most 32-bit architectures the size of an unsigned long is the same as unsigned int, but for 64-bit architectures observing the LP64 standard, an unsigned long is 64 bits, while an unsigned int remains 32 bits. This should be considered when deciding if the data should be described as "Integer" or "Long".

For example, to create a 640x480 image from unsigned red-green-blue character data, use

image = new GM16ImageMBS(640, 480, "RGB", GM16ImageMBS.StorageTypeCharPixel, pixels);

width: width in pixels of the image.
height: height in pixels of the image.
map: This string reflects the expected ordering of the pixel array. It can be any combination or order of R = red, G = green, B = blue, A = alpha (same as Transparency), O = Opacity, T = Transparency, C = cyan, Y = yellow, M = magenta, K = black, or I = intensity (for grayscale). Specify "P" = pad, to skip over a quantum which is intentionally ignored. Creation of an alpha channel for CMYK images is currently not supported.
type: Define the data type of the pixels. Float and double types are expected to be normalized [0..1] otherwise [0..MaxRGB]. Choose from these types: StorageTypeCharPixel, StorageTypeShortPixel, StorageTypeIntegerPixel, StorageTypeLongPixel, StorageTypeFloatPixel, or StorageTypeDoublePixel.
pixels: This array of values contain the pixel components as defined by map and type. You must preallocate this array where the expected length varies depending on the values of width, height, map, and type.

See also:

Feedback, Comments & Corrections

GM16ImageMBS.reduceNoise
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Reduce noise in image using a noise peak elimination filter.
Example:
dim p as Picture = LogoMBS(500)
dim image as new GM16ImageMBS(p)

image.reduceNoise

Backdrop=image.CopyPicture

See also:

Feedback, Comments & Corrections

GM16ImageMBS.reduceNoise(order as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Reduce noise in image using a noise peak elimination filter.

See also:

Feedback, Comments & Corrections

GM16ImageMBS.renderingIntent as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: The type of rendering intent (used when applying an ICC color profile).
Notes: (Read and Write computed property)

Feedback, Comments & Corrections

GM16ImageMBS.resolutionUnits as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Units of image resolution.
Notes: (Read and Write computed property)

Feedback, Comments & Corrections

GM16ImageMBS.roll(columns as UInt32, rows as UInt32)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Roll image (rolls image vertically and horizontally) by specified number of columnms and rows).
Example:
dim p as Picture = LogoMBS(500)
dim image as new GM16ImageMBS(p)

image.roll(30,30)

Backdrop=image.CopyPicture

See also:

Feedback, Comments & Corrections

GM16ImageMBS.roll(roll as GM16GeometryMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Roll image (rolls image vertically and horizontally) by specified number of columnms and rows).
Example:
dim p as Picture = LogoMBS(500)
dim image as new GM16ImageMBS(p)

image.roll(GM16GeometryMBS.Make(0,0,30,30))

Backdrop=image.CopyPicture

See also:

Feedback, Comments & Corrections

GM16ImageMBS.rotate(degree as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Rotate image counter-clockwise by specified number of degrees.
Example:
dim p as Picture = LogoMBS(500)
dim image as new GM16ImageMBS(p)

image.rotate(30)

Backdrop=image.CopyPicture

Feedback, Comments & Corrections

GM16ImageMBS.rows as UInt32
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: The number of pixel rows in the image.
Example:
dim p as Picture = LogoMBS(500)
dim image as new GM16ImageMBS(p)

Title = str(image.columns)+" x "+str(image.rows)
Backdrop=image.CopyPicture

Feedback, Comments & Corrections

GM16ImageMBS.sample(geometry as GM16GeometryMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Resize image by using pixel sampling algorithm.
Example:
dim p as Picture = LogoMBS(500)
dim image as new GM16ImageMBS(p)

image.sample GM16GeometryMBS.make(100,100)

Backdrop=image.CopyPicture

Feedback, Comments & Corrections

GM16ImageMBS.scale(geometry as GM16GeometryMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Resize image by using simple ratio algorithm which provides good quality.
Example:
dim p as Picture = LogoMBS(500)
dim image as new GM16ImageMBS(p)

image.scale new GM16GeometryMBS(100,100)

Backdrop=image.CopyPicture

Feedback, Comments & Corrections

GM16ImageMBS.scene as UInt32
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Image scene number.
Notes: (Read and Write computed property)

Feedback, Comments & Corrections

GM16ImageMBS.segment(clusterThreshold as Double=1.0, smoothingThreshold as Double=1.5)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Segment (coalesce similar image components) by analyzing the histograms of the color components and identifying units that are homogeneous with the fuzzy c-means technique.
Example:
dim p as Picture = LogoMBS(500)
dim image as new GM16ImageMBS(p)

image.segment

image.type = image.TrueColorType

Backdrop=image.CopyPicture
Notes: A histogram is built for the image. This histogram is filtered to reduce noise and a second derivative of the histogram plot is built and used to identify potential cluster colors (peaks in the histogram). The cluster colors are then validated by scanning through all of the pixels to see how many pixels fall within each cluster. Some candidate cluster colors may not match any of the image pixels at all and should be discarded. Specify clusterThreshold, as the number of pixels matching a cluster color in order for the cluster to be considered valid. SmoothingThreshold eliminates noise in the second derivative of the histogram. As the value is increased, you can expect a smoother second derivative. The default is 1.5.

Feedback, Comments & Corrections

GM16ImageMBS.setChromaBluePrimary(x as Double, y as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Chromaticity blue primary point.
Notes: e.g. x=0.15, y=0.06

Feedback, Comments & Corrections

GM16ImageMBS.setchromaGreenPrimary(x as Double, y as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Chromaticity green primary point.
Notes: e.g. x=0.3, y=0.6

Feedback, Comments & Corrections

GM16ImageMBS.setchromaRedPrimary(x as Double, y as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Chromaticity red primary point
Notes: e.g. x=0.64, y=0.33

Feedback, Comments & Corrections

GM16ImageMBS.setchromaWhitePoint(x as Double, y as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Chromaticity white point
Notes: e.g. x=0.3127, y=0.329

Feedback, Comments & Corrections

GM16ImageMBS.SetPicture(pic as picture, x as Integer, y as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Copies the picture into the Image at the given position.

Feedback, Comments & Corrections

GM16ImageMBS.SetPictureMask(maskpic as picture, x as Integer, y as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Copies the picture into the Image's mask at the given position.
Example:
// this converts 32 bit PNG with alpha channel to BMP

dim f as FolderItem = SpecialFolder.Desktop.Child("test.png")
dim p as Picture = Picture.Open(f)

dim g as new GM16ImageMBS( new GM16GeometryMBS(p.Width, p.Height), new GM16ColorGrayMBS(1.0))

g.type = g.TrueColorMatteType
g.matte = True
g.magick = "BMP"

g.SetPicture(p, 0, 0)
g.SetPictureMask(p.mask.invertMBS, 0, 0)

f = SpecialFolder.Desktop.Child("test.bmp")
g.write(f)

Feedback, Comments & Corrections

GM16ImageMBS.setPixels(x as Integer, y as Integer, columns as Integer, rows as Integer) as Ptr
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 16.4 Yes Yes Yes Yes No
Function: Allocates a pixel cache region to store image pixels as defined by the region rectangle.
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.jpg")
dim g as new GM16ImageMBS(f)

// get pointer to some pixels to write
dim x as ptr = g.setPixels(0, 0, 100, 100)

// draw a red line to the pixel buffer
dim o as Integer
for i as Integer = 0 to 99
o = 100 * i + i
x.UInt32(o * 4) = &hFFFF0000
next

// write back
g.syncPixels

// show
me.Backdrop = g.CopyPicture
Notes: This area is subsequently transferred from the pixel cache to the image via syncPixels.

Feedback, Comments & Corrections

GM16ImageMBS.setStrokeDashArray(values() as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 16.4 Yes Yes Yes Yes No
Function: Sets stroke dash pattern.
Notes: Specify the pattern of dashes and gaps used to stroke paths. The strokeDashArray represents a zero-terminated array of numbers that specify the lengths of alternating dashes and gaps in pixels. If an odd number of values is provided, then the list of values is repeated to yield an even number of values. A typical strokeDashArray array might contain the members 5 3 2 0, where the zero value indicates the end of the pattern array.

Feedback, Comments & Corrections

GM16ImageMBS.shade(azimuth as Double=30.0, elevation as Double=30.0, colorShading as boolean=false)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Shade image using distant light source.
Notes: Specify azimuth and elevation as the position of the light source. By default, the shading results as a grayscale image.. Set colorShading to true to shade the red, green, and blue components of the image.

Feedback, Comments & Corrections

GM16ImageMBS.sharpen(radius as Double=0.0, sigma as Double=1.0)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Sharpen pixels in image.
Example:
dim p as Picture = LogoMBS(500)
dim image as new GM16ImageMBS(p)

image.sharpen

Backdrop=image.CopyPicture
Notes: The radius parameter specifies the radius of the Gaussian, in pixels, not counting the center pixel. The sigma parameter specifies the standard deviation of the Laplacian, in pixels.

Feedback, Comments & Corrections

GM16ImageMBS.sharpenChannel(channel as Integer, radius as Double=0.0, sigma as Double=1.0)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Sharpen pixels in image channel.
Notes: The radius parameter specifies the radius of the Gaussian, in pixels, not counting the center pixel. The sigma parameter specifies the standard deviation of the Laplacian, in pixels.

Feedback, Comments & Corrections

GM16ImageMBS.shave(geometry as GM16GeometryMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method GraphicsMagick MBS GraphicsMagick Plugin 14.1 Yes Yes Yes Yes No
Function: Shave pixels from image edges.
Example:
dim p as Picture = LogoMBS(500)
dim image as new GM16ImageMBS(p)

image.shave(new GM16GeometryMBS(200,200))

Backdrop=image.CopyPicture

Feedback, Comments & Corrections

Previous items Next items

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




Links
MBS Xojo Plugins