================================================================ CCD Astrocamera format DOT for CCDDOTV Software ================================================================ Preamble ---------- The early CCD cameras were for astronomy buffs with a lot of money to spare, monochrome and quite small. Image processing software could hardly be found and it was even harder to bring the money together to buy it. Some amateurs wrote dedicated programs and saved the processed pictures in newly invented file formats. The CCDTOOLS [1] - a suite of astro CCD image processing software - were developed by myself in the early 90s. A DOS application only, but quite comprehensiv, very fast, extremly cheap (gratis) and thus rather popular. At first, I could not do cross section presentations and invented the Dotogram instead. Later, when I had implemented the cross section presentation, I kept the Dotogram because it is at times a supperior to show the data. The file format used is simple enough. A DOT file may contain a Dotogram or a cross section picture. The DOT format ---------------- A Dotogram is 640 pixels wide and 350 pixels high and has 224'000 dots. Since it is a two color picture, one bit suffices to store a dot. The 640 column bits are combined into 80 bytes and there are 350 lines made up that way. The bits are rotated from right to left into the byte. Actually, the 28'000 bytes are a dump of the EGA video RAM at segment A000 hex. The DOT format has the file extension DOT. There is a 5 byte file head and data compression is employed. The encoding type is a blend of Hewlett Packards Run Length Encoding (RLE) as found in printer software [2], and Run Length Limitation Encoding (RLLE) initially developed by Mark Zachmann of ZSoft [3,4], later to be found in Microsofts Paintbrush PCX image file format. +--------------+-------------------------+ ¦ 5 bytes Head ¦ n bytes RLCE image data ¦ +--------------+-------------------------+ The DOT file can contain image data for pictures of 350 lines with 640 columns each. The dots are organized from left to right, top to bottom. File Head ----------- Bytes 0 & 1: Integer value (Intel format, i.e. low-high) containing the file size. Bytes 2 & 3: Integer value containing the number of pixel values in the file. Byte 4: First Counter. Run Length Count Encoding (RLCE) ---------------------------------- RLCE combines the advantages of RLE and RLLE while evading their disadvantages. Byte 4, the 5th byte in the file, is the first counter. Bits 0 thru 6 make up the counter. A value of 0 is prohibitted and flags a corrupted file. Bit 7 is special. If bit 7 is 0: If this is the very first counter (byte 4 in the file), this means that all data following it are uncompressed pixel values. If it is any other counter, bit 7 = 0 means that the following number of bytes as is the value of bit 0 thru 6 of this counter byte, must be copied. The next counter byte will follow immediately after the number of bytes to be copied. Bit 7 = 1 means that the following byte has to be replicated as many times, as is the value of bit 0 thru 6 of this counter byte. The byte after the byte following the counter is the next counter. The file size is between 705 and 28'500 bytes. REFERENCES ------------ [1] Wernli, Hans-Ruedi; Die CCD Astrokamera für den Amateur, 1995, Birkhäuser. ISBN 3-7643-5218-3. [2] Hewlett Packard, Deskjet 500/500C Technical Reference Manual, February 1992, Part Number C2114-90008. [3] Pohl, Martin; Eriksdottar Holger; Die wunderbare Welt der Grafikformate; 1991, Wolfram's, ISBN 3-925328-05-x. [4] Born, Günter; Referenzhandbuch Dateiformate, 1992, Addison-Wesley, ISBN 3-89319-446-0. Author -------- hans-rudolf.wernli@bluewin.ch http://mypage.bluewin.ch/horo/ 05. August 2002