Photos¶
iTunes syncs photos onto the iPod already resized for it. The device reads a database of its own and a handful of thumbnail atlases, and the Photos app is the ordinary media-list machinery with a photo model behind it. Chikuma reproduces the database reader, the menu, the grid, the large photo and the slideshow, and stores the slideshow settings where the original stores them.
The Photo Database¶
A synced library looks like this:
Photos/Photo Database the database
Photos/Thumbs/*.ithmb one atlas per picture size
The database belongs to the same mh** record family as the album-art database and the iTunesDB, so
Chikuma's artwork reader was extended to read it. It has three sets:
| Set | Holds |
|---|---|
| images | one record per photo, naming its place in every atlas: a correlation id, a byte offset and the picture's size |
| albums | a name and the list of images in each album |
| files | the atlases, by correlation id |
The atlases¶
Each atlas holds one fixed-size cell per photo, packed one after another, in RGB565 like album art. A synced library showed three sizes:
| Cell | Used for |
|---|---|
| 64x64 | the grid |
| 320x240 | the large view on the panel |
| 720x480 | the full-size picture behind it |
A photo rarely has the cell's shape, so the larger cells are padded. The reader is tested against a real synced database.
The Photos menu¶
The Photos menu is a dynamic list, as measured in the original: All Photos, then one row per album expanded from a template, then Settings.
A photo model answers its rows through the same calls every media list makes: count, set the current row, refresh. No photo-only screen class does its own drawing. In the firmware those are three calls.
The browse screens¶
The grid¶
Selecting an album opens a grid of 64-pixel thumbnails, five across the panel, with a yellow selection border. The album name is the title, with a count ("5 Photos") and a date. Each cell is the smallest atlas's, unscaled.
The grid was measured by photographing the original's screen on the same library, and its numbers were then checked in the code.
The large photo¶
The browse screen has three layouts: grid, small and large. The browse verbs switch between them. The large view's picture comes through a binding measured on the original.
The slideshow¶
Play on the grid starts the slideshow. In the original the photograph is no view at all. The display pipe composites it in its own window, as it does album art, and the slideshow's resting layout stays empty above it, with Now Playing's own overlays for volume and brightness.
Chikuma does the same, and double-buffers the full-size picture. The pipe scans the buffer it is given, so refilling that buffer in place would tear the frame on screen.
Home's preview¶
The Photos row on Home shows photos in its preview, from the same database.
Photos > Settings¶
| Setting | Choices | Default |
|---|---|---|
| Time Per Slide | Manual, 2, 3, 5, 10 or 20 seconds | 3 seconds |
| Transitions | None, Random and five effects | Random |
Each choice is mapped and stored in the preferences exactly as the original stores it. On the same library, both firmwares open the pickers on the same rows and return to Settings the same way.
What is Chikuma's own¶
A slideshow changes a pipe window and leaves the interface layer alone, so it raises no event that would wake Chikuma's interface loop. While a slideshow runs, the loop takes a short timed sleep. The original gets woken by a one-shot kernel timer per photo.
Not built yet¶
The transitions are not drawn. The chosen transition is stored, and the slideshow cuts. Decoding is still synchronous, with photos decoded on the interface's own task.
The database is only partly read: the per-image trailer, and the album and file records at the field level.