~ubuntu-branches/ubuntu/maverick/kdegraphics/maverick-proposed

« back to all changes in this revision

Viewing changes to libs/libkdcraw/libraw/internal/foveon.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2009-12-02 14:03:43 UTC
  • mfrom: (1.1.35 upstream)
  • Revision ID: james.westby@ubuntu.com-20091202140343-2732gbkj69g89arq
Tags: 4:4.3.80-0ubuntu1
* New upstream beta release:
  - Add build-depend on shared-desktop-ontologies for nepomuk integration
  - Bump .so versions for libkexiv, libkdcraw and libkipi
  - Update various .install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* 
2
2
   GENERATED FILE, DO NOT EDIT
3
 
   Generated from dcraw/dcraw.c at Tue Apr  7 15:14:48 2009
 
3
   Generated from dcraw/dcraw.c at Sat Nov 21 12:39:09 2009
4
4
   Look into original file (probably http://cybercom.net/~dcoffin/dcraw/dcraw.c)
5
5
   for copyright information.
6
6
*/
16
16
#define SRC_USES_CURVE
17
17
#include "internal/var_defines.h"
18
18
#define sget4(s) sget4((uchar *)s)
 
19
#ifndef M_PI
 
20
#define M_PI            3.14159265358979323846
 
21
#endif
19
22
 
20
23
/* RESTRICTED code starts here */
21
24
 
32
35
  if (!code) {
33
36
    for (i=0; i < size; i++)
34
37
      huff[i] = get4();
35
 
    init_decoder();
 
38
    memset (first_decode, 0, sizeof first_decode);
 
39
    free_decode = first_decode;
36
40
  }
37
41
  cur = free_decode++;
38
42
  if (free_decode > first_decode+2048) {
61
65
#endif
62
66
}
63
67
 
64
 
void CLASS foveon_thumb (FILE *tfp)
 
68
void CLASS foveon_thumb()
65
69
{
66
70
  unsigned bwide, row, col, bitbuf=0, bit=1, c, i;
67
71
  char *buf;
69
73
  short pred[3];
70
74
 
71
75
  bwide = get4();
72
 
  fprintf (tfp, "P6\n%d %d\n255\n", thumb_width, thumb_height);
 
76
  fprintf (ofp, "P6\n%d %d\n255\n", thumb_width, thumb_height);
73
77
  if (bwide > 0) {
74
78
    if (bwide < thumb_width*3) return;
75
79
    buf = (char *) malloc (bwide);
76
80
    merror (buf, "foveon_thumb()");
77
81
    for (row=0; row < thumb_height; row++) {
78
82
      fread  (buf, 1, bwide, ifp);
79
 
      fwrite (buf, 3, thumb_width, tfp);
 
83
      fwrite (buf, 3, thumb_width, ofp);
80
84
    }
81
85
    free (buf);
82
86
    return;
95
99
          dindex = dindex->branch[bitbuf >> bit & 1];
96
100
        }
97
101
        pred[c] += dindex->leaf;
98
 
        fputc (pred[c], tfp);
 
102
        fputc (pred[c], ofp);
99
103
      }
100
104
  }
101
105
}