RAW data format - RAW Shooting and Processing - CHDK Forum supplierdeeply

RAW data format

  • 2 Replies
  • 2668 Views
RAW data format
« on: 27 / July / 2008, 05:21:15 »
Advertisements
Situation:

I am trying to view the RAW raw data in the CRW using python and when i read the lines, it outputs a sequence of characters like this:

\xc1\x07\x80\xf0\x1f\x10\xc2\0

what does this mean?

My guess: if crw is supposed to be 10-bit depth, and if i convert the \xc1 to hex, it would mean that its only 8-bit long? Am i wrong?

Re: RAW data format
« Reply #1 on: 28 / July / 2008, 22:31:32 »
If you are writing some code please check the source code of raw_merge.c.
If you are just trying to display the picture dcraw.c is a good starting point.

General idea: Let's say that you have 8 values of 10bits. Put them end to end in a 80 bit stream. Slice the 80 bit stream into 10 bytes. Swap the bytes around (depending on the endianess of the CPU). You will then get the mix here.

Have fun...

*

Offline LjL

  • ****
  • 266
  • A720IS
Re: RAW data format
« Reply #2 on: 29 / July / 2008, 08:11:22 »
\xc1 is already a hexadecimal value. It's "C1" preceeded by a standard escape sequence.

And yes, any two-digits hexadecimal number fits in one byte. Look at this snipped of raw_merge.c, specifically, for the details on reading Canon raw.

 

Related Topics