Boost logo

Boost :

From: Lubomir Bourdev (lbourdev_at_[hidden])
Date: 2006-10-06 17:24:53


Andy Little wrote:
>Lets look at your image and view concepts.
>AFAICS the image is some sequence(s) of more or less raw data
>The view turns the raw data into a 2D matrix.
>
>Is that correct so far?

 
Not quite.
 
An image is a container of pixels. Its only purpose is to hold the pixels (allocate/deallocate/deep-copy). It models STL's random access container concept (_almost_ models it actually, because GIL's pixel iterators are random-traversal iterators)
An image can also return an image view of its pixels.
 
An image view is a lightweight representation of the 2D grid of pixels. Unlike the image, it is lightweight; it doesn't own or copy its data. Image views are what algorithms operate on. An image view is like a 2D equivalent of STL's range.
 
As for the dimensionality, inherently all data is, of course, one-dimensional as the RAM is 1D. The image provides 1D interface to the pixels (because that's what STL's random access container does). The image view provides both 1D and 2D interface to its pixels.
 
Lubomir
 
 
 
 




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk