Image Adaptors are an implementation of the Adaptor Design Pattern. They are designed to present an image of a particular type as being an image of a different type. Adaptors perform simple operations on pixel values for which is not easy to justify the use of an image filter.
One of the principal tasks of ImageAdaptors is to perform casting.
For example: you have an image whose pixels are of type unsigned char and you need to feed this image in a process that expects pixels of type double. You have the option of using and ImageFilter that convert the input unsigned char image into another of pixel type double. However this filter will allocate memory for this second image and will need to be executed. Image Adaptors allow to simulate that you have made the conversion but will avoid the overhead in memory. There is however a penalty in performance.
The mechanism used by image adaptors is to provide a simple function that will be used by ImageIterator (see Image Iterators) to convert the value of a pixel, in a pixel-by-pixel basis.
Image Adaptors are implementations of the Adaptor Design Pattern, designed to present an image of a particular type as being an image of a different type. They perform simple operations on pixel values for which it's not easy to justify the use of an image filter. A key task of Image Adaptors is to perform casting, such as converting unsigned char pixels to double for processes expecting double type pixels, thus avoiding memory overhead but at the cost of performance.
424

被折叠的 条评论
为什么被折叠?



