Platforms to show: All Mac Windows Linux Cross-Platform
Back to PictureConvolutionMBS class.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Graphics & Pictures | MBS Picture Plugin | 4.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
There is no need to call this method except you want to free all resources of this object now without waiting for Xojo to do it for you.
PictureConvolutionMBS.Hor(index as UInt32) as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Graphics & Pictures | MBS Picture Plugin | 4.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Index from 0 to 19.
(Read and Write computed property)
PictureConvolutionMBS.Run(channels as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Graphics & Pictures | MBS Picture Plugin | 4.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Fails if the pictures are not bitmap pictures. Source and Destination can be equal. If you provide a destination picture, the dimenstions of source and destination must be equal.
Channels is a combination of 1, 2 and 4. 1 for Red, 2 for Green and 4 for Blue.
The border (one pixel thick) is not filled in the destination picture.
This method does the following for each pixel:
// first horizontal fill the temporary picture
r=0
g=0
b=0
if RedChannel then
r = r + sourcepicture.pixel(x-1,y).red * Hor(0)
r = r + sourcepicture.pixel(x ,y).red * Hor(1)
r = r + sourcepicture.pixel(x+1,y).red * Hor(2)
else
r = sourcepicture.pixel(x,y)
end if
if GreenChannel then
g = g + sourcepicture.pixel(x-1,y).green * Hor(0)
g = g + sourcepicture.pixel(x ,y).green * Hor(1)
g = g + sourcepicture.pixel(x+1,y).green * Hor(2)
else
g = sourcepicture.pixel(x,y)
end if
if BlueChannel then
b = b + sourcepicture.pixel(x-1,y).blue * Hor(0)
b = b + sourcepicture.pixel(x ,y).blue * Hor(1)
b = b + sourcepicture.pixel(x+1,y).blue * Hor(2)
else
b = sourcepicture.pixel(x,y)
end if
temppicture.pixel(x,y)=rgb(r,g,b)
// now back from temporary picture to the destination picture
r=0
g=0
b=0
if RedChannel then
r = r + temppicture.pixel(x,y-1).red * Ver(0)
r = r + temppicture.pixel(x,y ).red * Ver(1)
r = r + temppicture.pixel(x,y+1).red * Ver(2)
else
r = temppicture.pixel(x,y)
end if
if GreenChannel then
g = g + temppicture.pixel(x,y-1).green * Ver(0)
g = g + temppicture.pixel(x,y ).green * Ver(1)
g = g + temppicture.pixel(x,y+1).green * Ver(2)
else
g = temppicture.pixel(x,y)
end if
if BlueChannel then
b = b + temppicture.pixel(x,y-1).blue * Ver(0)
b = b + temppicture.pixel(x,y ).blue * Ver(1)
b = b + temppicture.pixel(x,y+1).blue * Ver(2)
else
b = temppicture.pixel(x,y)
end if
destinationpicture.pixel(x,y)=rgb(r,g,b)
PictureConvolutionMBS.Ver(index as UInt32) as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Graphics & Pictures | MBS Picture Plugin | 4.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Index from 0 to 19.
(Read and Write computed property)
The items on this page are in the following plugins: MBS Picture Plugin.