@CompileStatic class ImageEngine
ImageEngine provides a means of processing images in JPG and other standard formats and applying image transformations by means of kernel operations. The process has been designed so that the output from an ImageEngine can form the input to another so that a sequence of transformations can be undertaken on a sequence of images.
Though primarily designed for image processing the engine can also be used for any file based input where the data is processed once and then output, possibly to another ImageEngine for subsequent processing where the transformation output does not have to be written to file between each transformation but is saved in a memory based object. A reference to the object is passed between ImageEngines.
The ImageEngine comprises, internally, an ImageRoot or manager process and a number of ImageNode processes that each carry out the required operation on a partition of the complete image. Each partition must access a distinct part of the total data structure. Each partition will be processed by one of the ImageNode processes. The number of ImageNodes equals the number of partitions. The architecture assumes the data structure is double buffered in that a transformation reads from one buffer to the other buffer. The way in which the kernel convolution operation is carried out is left to the programmer as that is part of the sequential code that has to be written. In addition to convolutions the engine can carry out a scaler operation such as convert to grey scale; these are defined by a function. An ImageEngine can carry out a function or a convolution but not both, hence the ability to chain ImageEngines together.
input
- The channel used to read the object containing the imageoutput
- The channel used to write the object after transformationnodes
- The number of ImageNode processespartitionMethod
- The name of the method that is used to partition the image.
The partitioning structure is saved within the image object.convolutionMethod
- The name of the method that undertakes the convolution operationconvolutionData
- Any further data required by the convolution method; typically the kernel and
other kernel paramters that are required.funtionMethod
- The name of a function that carries out a scaler operation on the image. For an instance of
an ImageEngine only ONE of ConvolutionMethod and FunctionMethod must be specified.functionData
- Any further data required by the functionupdateImageIndexMethod
- The name of the method used to modify the index of the current buffer holding
the transformed image. This means that internal buffering methods can be utilised that require more
than double buffering. The method is only called if an instance of ImageEngine specifies the method name;
it defualts to the empty string. An Image object may have more than one updateImageIndexMethod
depending on the application, but only one can be called by a specific ImageEngine instance.logPhaseName
- an optional string property, which if specified indicates that the process should be logged
otherwise the process will not be loggedlogPropertyName
- the name of a property in the input object that will uniquely identify an instance of the object.
LogPropertyName must be specified if logPhaseName is specifiedAn example of the use of ImageEngine can be found at ..
Type | Name and description |
---|---|
List |
convolutionData |
String |
convolutionMethod |
List |
functionData |
String |
functionMethod |
ChannelInput |
input |
String |
logPhaseName |
String |
logPropertyName |
int |
nodes |
ChannelOutput |
output |
String |
partitionMethod |
String |
updateImageIndexMethod |
Constructor and description |
---|
ImageEngine
() |
GPP - Groovy Parallel Patterns generated 07-09-2017 by Jon Kerridge, Edinburgh Napier University - j.kerridge@napier.ac.uk