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

« back to all changes in this revision

Viewing changes to libs/libkdcraw/libraw/samples/4channels.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
/* -*- C++ -*-
2
2
 * File: 4channels.cpp
3
 
 * Copyright 2009 Alex Tutubalin <lexa@lexa.ru>
 
3
 * Copyright 2008-2009 LibRaw LLC (info@libraw.org)
4
4
 * Created: Mon Feb 09, 2009
5
5
 *
6
6
 * LibRaw sample
39
39
int main(int ac, char *av[])
40
40
{
41
41
    int  i, ret;
42
 
    int autoscale=0,filtering_mode=LIBRAW_FILTERING_DEFAULT,black_subtraction=1;
43
 
    char outfn[1024],thumbfn[1024]; 
 
42
    int autoscale=0,filtering_mode=LIBRAW_FILTERING_DEFAULT,black_subtraction=1, use_gamma=0;
 
43
    char outfn[1024]; 
44
44
 
45
45
    LibRaw RawProcessor;
46
46
    if(ac<2) 
85
85
                            OUT.shot_select=atoi(av[i]);
86
86
                        }
87
87
                    else if(av[i][1]=='g' && av[i][2]==0)
88
 
                        OUT.gamma_16bit=1;
 
88
                        use_gamma = 1;
89
89
                    else if(av[i][1]=='A' && av[i][2]==0)
90
90
                        autoscale=1;
91
91
                    else if(av[i][1]=='B' && av[i][2]==0)
99
99
                        goto usage;
100
100
                    continue;
101
101
                }
 
102
            if(!use_gamma)
 
103
                OUT.gamm[0] = OUT.gamm[1] = 1;
 
104
                
102
105
            if(filtering_mode)
103
106
                OUT.filtering_mode = (LibRaw_filtering) filtering_mode;
104
 
            int r,c;
 
107
            int c;
105
108
            printf("Processing file %s\n",av[i]);
106
109
            if( (ret = RawProcessor.open_file(av[i])) != LIBRAW_SUCCESS)
107
110
                {
165
168
                    char lname[8];
166
169
                    if(isrgb)
167
170
                      {
168
 
                        snprintf(lname,7,"%c",(char*)("RGBG")[layer]);
 
171
                        snprintf(lname,7,"%c",((char*)("RGBG"))[layer]);
169
172
                        if(layer==3)
170
173
                          strcat(lname,"2");
171
174
                      }
172
175
                    else
173
 
                      snprintf(lname,7,"%c",(char*)("GCMY")[layer]);
 
176
                      snprintf(lname,7,"%c",((char*)("GCMY"))[layer]);
174
177
 
175
178
                    if(OUT.shot_select)
176
179
                        snprintf(outfn,sizeof(outfn),"%s-%d.%s.tiff",av[i],OUT.shot_select,lname);