Wikia

CHDK Wiki

CHDK Tools

Talk0
573pages on
this wiki
Revision as of 11:23, May 27, 2011 by Whim (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This page describes some tools and utilities used for the CHDK development...

Source code tools Edit

  • These tools are part of the CHDK source, they are available from the CHDK SVN repository.

rawconvert.c Edit

  • Resides here: /tools
  • Forum links: [1], [2]
  • Authors: reyalP, cppasm

This tool is intended to help porters verify their raw buffers and active area settings, by making 1:1 conversions of CHDK raw to easily viewable formats. It isn't built by default since it isn't normally needed. It can also be used to convert 10 to 12 bit or vice versa.

Unlike dcraw, it does absolutely no interpolation, cropping, beautifying, folding, spindling or mutilating.


Usage:

rawconvert -<op> -w=<width> -h=<height> [-noshift] [-pgm] <infile> <outfile>

where <op> is XtoY with X and Y being the source and destination BPP (Bits Per Pixel)

by default

converting to lower BPP discards the lower bits of the input value.
converting to higher BPP shifts the input so the a max value input pixel will be a max value output pixel
without -pgm, output is in pure raw format: a sequence of pixels of the specified size. 8 and 16 bit output are suitable for use with "open as raw" in Photoshop or irfanview, gimps "raw image data", or feeding to imagemagick.

if -noshift is specified

converting to a lower BPP discards the upper bits
converting to a higher BPP leaves the values unchanged

if -pgm is specified

converting into PGM (portable graymap) file format
8 and 16 bits per pixel are supported, but 16 bit is supported by limited subset of viewers so it's better to use 8 bit PGM
PGM output is enabled with -pgm option, and you must specify .PGM extension to output file.
Sample: rawconvert.exe -10to8 -pgm -w=2672 -h=1968 CRW_0005.RAW IMG_0005.PGM
PGM input is not supported.

NOTE:

- Host is assumed to be little endian!
- This is a debugging tool not an imaging tool.

yuvconvert.c Edit

Tool to convert UYVYYY live view data to easier to debug formats.

Usage:

yuvconvert -w=<width> -h=<height> [-split] [-rgb] [-skipy] <infile> <outbasename>

infile: dump of live viewport data, assumed UYVYYY with 8 bit elements.

outbasename: base name to use for various output files

-w=,-h=:

real width and height of input. Width is by counting Y values.

-rgb:

Output packed 24 bit RGB outbasename-<output width>.RGB

-skipy:

skip 50% of Y values in each row when making RGB to give correct aspect ratio on older cameras

-split:

produces outbasename.Y outbasename.U and outbasename.V as 8 bit greyscale
.Y will be full resolution, .U and .V will be 1/4 width of Y

NOTE:

- CHDK code frequently treats the viewport width as half the actual number of Y values.

dancingbits.c Edit

This tool makes a CHDK firmware image bootable.

There are 6 different methods available (cameras listings are not complete!):

1 // original flavor
2 // nacho cheese sx200is, ixus100_sd780, ixu95_sd1200, a1100, d10
3 // mesquite bbq ixus200_sd980, sx20 (dryos r39)
4 // cool ranch a3100 (dryos r43)
5 // cajun chicken s95 (dryos r45)
6 // spicy wasabi sx220 (dryos r47)

dumpchk.c Edit

Find the code normally found at the start of ROM. Default mode detects dryos or vxworks. If -fix is given, re-write the dump file after removing anything before the start sig

If -vxworks or -dryos is given, just check that the corresponding sig is found at the start of the dump, and print a message/return status -quiet will suppress the message and only return status.

If you have a tree full of dumps you want to check/fix, use find, e.g.

find . -path ./*sub/* \! -path *.svn* -type d -exec dumpchk '{}/primary.bin' \;

will check primary.bin in each of the platform/sub directories, skipping .svn, reporting missing or zero sized files.

You can use -fix with the above command if you feel lucky.

Note that -fix DOES NOT MAKE ANY BACKUP, and is NOT PARTICULARLY SAFE.

Around Wikia's network

Random Wiki