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

« back to all changes in this revision

Viewing changes to coders/dib.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
%                                 July 1992                                   %
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/color.h"
46
47
#include "magick/color-private.h"
47
48
#include "magick/colorspace.h"
600
601
  /*
601
602
    Read image data.
602
603
  */
603
 
  if (SetImageExtent(image,0,0) == MagickFalse)
604
 
    {
605
 
      InheritException(exception,&image->exception);
606
 
      return(DestroyImageList(image));
607
 
    }
608
604
  if (dib_info.compression == BI_RLE4)
609
605
    dib_info.bits_per_pixel<<=1;
610
606
  bytes_per_line=4*((image->columns*dib_info.bits_per_pixel+31)/32);
649
645
      for (y=(long) image->rows-1; y >= 0; y--)
650
646
      {
651
647
        p=pixels+(image->rows-y-1)*bytes_per_line;
652
 
        q=SetImagePixels(image,0,y,image->columns,1);
 
648
        q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
653
649
        if (q == (PixelPacket *) NULL)
654
650
          break;
655
 
        indexes=GetIndexes(image);
 
651
        indexes=GetAuthenticIndexQueue(image);
656
652
        for (x=0; x < ((long) image->columns-7); x+=8)
657
653
        {
658
654
          for (bit=0; bit < 8; bit++)
673
669
            }
674
670
            p++;
675
671
          }
676
 
        if (SyncImagePixels(image) == MagickFalse)
 
672
        if (SyncAuthenticPixels(image,exception) == MagickFalse)
677
673
          break;
678
674
        if (image->previous == (Image *) NULL)
679
675
          {
693
689
      for (y=(long) image->rows-1; y >= 0; y--)
694
690
      {
695
691
        p=pixels+(image->rows-y-1)*bytes_per_line;
696
 
        q=SetImagePixels(image,0,y,image->columns,1);
 
692
        q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
697
693
        if (q == (PixelPacket *) NULL)
698
694
          break;
699
 
        indexes=GetIndexes(image);
 
695
        indexes=GetAuthenticIndexQueue(image);
700
696
        for (x=0; x < ((long) image->columns-1); x+=2)
701
697
        {
702
698
          index=ConstrainColormapIndex(image,(*p >> 4) & 0xf);
714
710
            *q++=image->colormap[(long) index];
715
711
            p++;
716
712
          }
717
 
        if (SyncImagePixels(image) == MagickFalse)
 
713
        if (SyncAuthenticPixels(image,exception) == MagickFalse)
718
714
          break;
719
715
        if (image->previous == (Image *) NULL)
720
716
          {
737
733
      for (y=(long) image->rows-1; y >= 0; y--)
738
734
      {
739
735
        p=pixels+(image->rows-y-1)*bytes_per_line;
740
 
        q=SetImagePixels(image,0,y,image->columns,1);
 
736
        q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
741
737
        if (q == (PixelPacket *) NULL)
742
738
          break;
743
 
        indexes=GetIndexes(image);
 
739
        indexes=GetAuthenticIndexQueue(image);
744
740
        for (x=0; x < (long) image->columns; x++)
745
741
        {
746
742
          index=ConstrainColormapIndex(image,*p);
749
745
          p++;
750
746
          q++;
751
747
        }
752
 
        if (SyncImagePixels(image) == MagickFalse)
 
748
        if (SyncAuthenticPixels(image,exception) == MagickFalse)
753
749
          break;
754
750
        if (image->previous == (Image *) NULL)
755
751
          {
775
771
      for (y=(long) image->rows-1; y >= 0; y--)
776
772
      {
777
773
        p=pixels+(image->rows-y-1)*bytes_per_line;
778
 
        q=SetImagePixels(image,0,y,image->columns,1);
 
774
        q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
779
775
        if (q == (PixelPacket *) NULL)
780
776
          break;
781
777
        for (x=0; x < (long) image->columns; x++)
802
798
            }
803
799
          q++;
804
800
        }
805
 
        if (SyncImagePixels(image) == MagickFalse)
 
801
        if (SyncAuthenticPixels(image,exception) == MagickFalse)
806
802
          break;
807
803
        if (image->previous == (Image *) NULL)
808
804
          {
823
819
      for (y=(long) image->rows-1; y >= 0; y--)
824
820
      {
825
821
        p=pixels+(image->rows-y-1)*bytes_per_line;
826
 
        q=SetImagePixels(image,0,y,image->columns,1);
 
822
        q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
827
823
        if (q == (PixelPacket *) NULL)
828
824
          break;
829
825
        for (x=0; x < (long) image->columns; x++)
835
831
            q->opacity=ScaleCharToQuantum(*p++);
836
832
          q++;
837
833
        }
838
 
        if (SyncImagePixels(image) == MagickFalse)
 
834
        if (SyncAuthenticPixels(image,exception) == MagickFalse)
839
835
          break;
840
836
        if (image->previous == (Image *) NULL)
841
837
          {
976
972
  MagickBooleanType
977
973
    status;
978
974
 
 
975
  register const IndexPacket
 
976
    *indexes;
 
977
 
979
978
  register const PixelPacket
980
979
    *p;
981
980
 
982
 
  register IndexPacket
983
 
    *indexes;
984
 
 
985
981
  register long
986
982
    i,
987
983
    x;
1082
1078
      */
1083
1079
      for (y=0; y < (long) image->rows; y++)
1084
1080
      {
1085
 
        p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception);
 
1081
        p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
1086
1082
        if (p == (const PixelPacket *) NULL)
1087
1083
          break;
1088
 
        indexes=GetIndexes(image);
 
1084
        indexes=GetVirtualIndexQueue(image);
1089
1085
        q=pixels+(image->rows-y-1)*bytes_per_line;
1090
1086
        bit=0;
1091
1087
        byte=0;
1122
1118
      */
1123
1119
      for (y=0; y < (long) image->rows; y++)
1124
1120
      {
1125
 
        p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception);
 
1121
        p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
1126
1122
        if (p == (const PixelPacket *) NULL)
1127
1123
          break;
1128
 
        indexes=GetIndexes(image);
 
1124
        indexes=GetVirtualIndexQueue(image);
1129
1125
        q=pixels+(image->rows-y-1)*bytes_per_line;
1130
1126
        for (x=0; x < (long) image->columns; x++)
1131
1127
          *q++=(unsigned char) indexes[x];
1146
1142
      */
1147
1143
      for (y=0; y < (long) image->rows; y++)
1148
1144
      {
1149
 
        p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception);
 
1145
        p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
1150
1146
        if (p == (const PixelPacket *) NULL)
1151
1147
          break;
1152
1148
        q=pixels+(image->rows-y-1)*bytes_per_line;
1176
1172
      */
1177
1173
      for (y=0; y < (long) image->rows; y++)
1178
1174
      {
1179
 
        p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception);
 
1175
        p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
1180
1176
        if (p == (const PixelPacket *) NULL)
1181
1177
          break;
1182
1178
        q=pixels+(image->rows-y-1)*bytes_per_line;