How to "paint" the data layer of a CD using a CD drive?
You don't have to write "proper" data to the disc... you can write arbitrary data by simply creating a file of appropriate size.
To start, let's assume we're using a CD to write on (rewritable hopefully, 'cause we're gonna make some coasters!!), so our desired data image size is about 700 meg.
Create a file with 10 meg chunks of alternating 0x00's and 0xff's.. this would show you the 'on/off' pattern of the data in a simple form.
Modulate the data in the image file... Disc's are written from the center out... so more data is contained in the outer (faster!) diameter than the inner, and you should be able to calculate the approximate point to change your data patterns in the image file by using some creative patterns.
Once you figure out the 'zones', you should be able to create even more complex data patterns to compensate for the rotational speed and data density on the outer 'track' (CD/DVD is actually just a tight spiral). Fun Fun Fun!!
Well... that's how I'd start, if I were looking to discover things about pattern writing on CD/DVD data surfaces.
(dang it... where's that old spindle of CD's I've never used...)
Oh yeah... the commands involved:
CD: wodim dev=/dev/sr0 -eject -v -data=MYIMAGE.img
DVD: growisofs -Z /dev/sr0=MYIMAGE.img
This looks like it does what you want, it includes 2 MATLAB files which I don't quite understand the magic of. I'd love to see an updated version!
http://www.instructables.com/id/Burning-visible-images-onto-CD-Rs-with-data-beta/step2/Convert-a-picture-to-data/
I had some success with Red Book CD Audio using bytes (8-bit characters) of 171 decimal for dark areas and 48 decimal using the Img2CD program. I couldn't get the calibration perfect, but for line-art you can see images in the CD-RW. No hacking is needed, all it is is a WAV music file with this non-musical signal--it's as real as a music CD as the rewritables will allow for (older CD players can't even play CD-RWs with human listenal music on them!). When you're done you can then play the CD-RW on a newer audio CD player that plays rewritable discs and listen to the picture. And if you get tired of the image, just blank the disc and re-write something new. The disc is best viewed under direct sunlight.
To directly burn an .ISO or similar data disc image to CD, remember that the drive encodes and decodes the physical pixels using CIRC (Cross-Interleaved Reed–Solomon Coding) to allow for read error correction. You would need to figure out what data bytes correspond with encoded written-pixel-data streams.
http://www.eccpage.com/reed_solomon_codes.html
http://programmersheaven.com/discussion/427831/circ-cross-interleaved-reed-solomon-code-verification?S=B10000
http://www.idea2ic.com/File_Formats/ReedSolomon.pdf
https://pypi.python.org/pypi/reedsolo
http://rscode.sourceforge.net
The last one, rscode, has an explanation here: http://rscode.sourceforge.net/rs.html
which mentions CD usage, based on rscode's example.txt I believe the code to implement CD-type encoding (what the error-correction encoded pixels on a CD-R would read) might be:
unsigned char codeword1[28];
unsigned char codeword2[32];
unsigned char msg[24];
encode_data(msg, sizeof(msg), codeword1);
encode_data(codeword1, sizeof(codeword1), codeword2);
I e-mailed the author of rscode, and will update this answer if he responds.