[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

raster graphics



I'm not on the special interest mailing list for graphics, so I don't
know if this has been touched on.

I encourage people who are considering proposing a CL graphics extension
to read the Symbolics 6.1 Release Notes regarding changes to arrays,
section 2.1.2, pages 5 through 12.  The important concept is the
abstraction of 2 dimentional arrays of pixels into things called
rasters.  The problem is that arrays are indexed by row,column and
rasters are indexed by x,y, but x=column,y=row.  Therefore, if you
simply wrote raster code using AREF it would look awkward:
	(aref some-array y x)
Along the same lines, rasters have width and height (generally thought
of in that order), but 2D arrays have rows and columns, and again, the
two are exchanged.  The documentation includes a variety of functions to
deal with this, for example,
	(raster-aref some-raster x y)
which turns into the appropriate aref, and
	(decode-raster-array some-raster)
which returns as multiple values the width and height.

One reason we did this was to aid in the conversion from the
Release-6-and-before column major system to the CL-and-Release-7 row
major system.  It allowed user source code to run in either system,
since the system provided the correct abstraction for each.  I have
since come to believe the abstraction is worthy in its own right, and
hope that something like it would appear as part of a CL graphics
extension.