![]() |
File Layer The PhotoJazz interface provides a suite of functions for each of two standard calling sequences: reading and writing. PhotoJazz files are tile-based, as is the PhotoJazz engine, and this is reflected in the calling sequences. In the JzRead sequence, you begin reading, read a tile at a time in scan order, and end reading; In the JzWrite sequence, you begin writing, write a tile at a time in scan order, and end writing. It's almost as trivial as it sounds. The tile loops can be a little tricky, but we give sample code. Of course, when you're writing a PhotoJazz file, you have to tell PhotoJazz the dimensions of the image and the tiles, and when you're reading a PhotoJazz file, you have to be able to find out these parameters from PhotoJazz. One way to do this would be to have you read and write this information directly from and to the file, but then you'd have to worry about byte order, alignment, data tags, CRC computation, and so on. A nicer way would be to have functions in the PhotoJazz engine that you call to read and write these parameters, but then you'd still have to worry about default values, order dependencies, and redundant specification. An even nicer way would be to have functions in the PhotoJazz engine that you call to get and set these parameters, and have PhotoJazz figure out whether and when to read and write it. This is what we've done, so in addition to the JzRead and JzWrite suites, there are JzGet and JzSet suites.
|