~ubuntu-branches/ubuntu/quantal/imagemagick/quantal

« back to all changes in this revision

Viewing changes to coders/exr.c

  • Committer: Bazaar Package Importer
  • Author(s): Muharem Hrnjadovic
  • Date: 2009-06-04 13:01:13 UTC
  • mfrom: (1.1.5 upstream) (6.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090604130113-my9114jxmafpwew3
Tags: 7:6.5.1.0-1.1ubuntu1
* Merge from debian unstable, remaining changes:
  - (Build-)depend on libltdl7-dev instead of libltdl3-dev (the armel buildds
    currently have both available).
  - Don't build-dep on librsvg, it brings in excessive dependencies

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
%                                 April 2007                                  %
18
18
%                                                                             %
19
19
%                                                                             %
20
 
%  Copyright 1999-2008 ImageMagick Studio LLC, a non-profit organization      %
 
20
%  Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization      %
21
21
%  dedicated to making software imaging solutions freely available.           %
22
22
%                                                                             %
23
23
%  You may not use this file except in compliance with the License.  You may  %
42
42
#include "magick/studio.h"
43
43
#include "magick/blob.h"
44
44
#include "magick/blob-private.h"
 
45
#include "magick/cache.h"
45
46
#include "magick/exception.h"
46
47
#include "magick/exception-private.h"
47
48
#include "magick/image.h"
208
209
      (void) CloseBlob(image);
209
210
      return(GetFirstImageInList(image));
210
211
    }
211
 
  if (SetImageExtent(image,0,0) == MagickFalse)
212
 
    {
213
 
      (void) ImfCloseInputFile(file);
214
 
      if (LocaleCompare(image_info->filename,read_info->filename) != 0)
215
 
        (void) RelinquishUniqueFileResource(read_info->filename);
216
 
      read_info=DestroyImageInfo(read_info);
217
 
      InheritException(exception,&image->exception);
218
 
      return(DestroyImageList(image));
219
 
    }
220
212
  scanline=(ImfRgba *) AcquireQuantumMemory(image->columns,sizeof(*scanline));
221
213
  if (scanline == (ImfRgba *) NULL)
222
214
    {
225
217
    }
226
218
  for (y=0; y < (long) image->rows; y++)
227
219
  {
228
 
    q=SetImagePixels(image,0,y,image->columns,1);
 
220
    q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
229
221
    if (q == (PixelPacket *) NULL)
230
222
      break;
231
223
    ImfInputSetFrameBuffer(file,scanline-min_x-image->columns*(min_y+y),1,
243
235
        ImfHalfToFloat(scanline[x].a));
244
236
      q++;
245
237
    }
246
 
    if (SyncImagePixels(image) == MagickFalse)
 
238
    if (SyncAuthenticPixels(image,exception) == MagickFalse)
247
239
      break;
248
240
  }
249
241
  scanline=(ImfRgba *) RelinquishMagickMemory(scanline);
291
283
#endif
292
284
  entry->magick=(IsImageFormatHandler *) IsEXR;
293
285
  entry->description=ConstantString("High Dynamic-range (HDR)");
 
286
  entry->blob_support=MagickFalse;
294
287
  entry->module=ConstantString("EXR");
295
288
  (void) RegisterMagickInfo(entry);
296
289
  return(MagickImageCoderSignature);
333
326
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
334
327
%
335
328
%  WriteEXRImage() writes an image to a file the in the high dynamic-range
336
 
% (HDR) file format developed by Industrial Light & Magic.
 
329
%  (HDR) file format developed by Industrial Light & Magic.
337
330
%
338
331
%  The format of the WriteEXRImage method is:
339
332
%
415
408
    }
416
409
  for (y=0; y < (long) image->rows; y++)
417
410
  {
418
 
    p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception);
 
411
    p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
419
412
    if (p == (const PixelPacket *) NULL)
420
413
      break;
421
414
    for (x=0; x < (long) image->columns; x++)