MagickCore  7.0.7
Convert, Edit, Or Compose Bitmap Images
list.c
Go to the documentation of this file.
1 /*
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 % %
4 % %
5 % %
6 % L IIIII SSSSS TTTTT %
7 % L I SS T %
8 % L I SSS T %
9 % L I SS T %
10 % LLLLL IIIII SSSSS T %
11 % %
12 % %
13 % MagickCore Image List Methods %
14 % %
15 % Software Design %
16 % Cristy %
17 % December 2002 %
18 % %
19 % %
20 % Copyright 1999-2018 ImageMagick Studio LLC, a non-profit organization %
21 % dedicated to making software imaging solutions freely available. %
22 % %
23 % You may not use this file except in compliance with the License. You may %
24 % obtain a copy of the License at %
25 % %
26 % https://www.imagemagick.org/script/license.php %
27 % %
28 % Unless required by applicable law or agreed to in writing, software %
29 % distributed under the License is distributed on an "AS IS" BASIS, %
30 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
31 % See the License for the specific language governing permissions and %
32 % limitations under the License. %
33 % %
34 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
35 %
36 %
37 %
38 */
39 
40 /*
41  Include declarations.
42 */
43 #include "MagickCore/studio.h"
44 #include "MagickCore/blob.h"
46 #include "MagickCore/exception.h"
48 #include "MagickCore/list.h"
49 #include "MagickCore/memory_.h"
50 #include "MagickCore/string_.h"
51 
52 /*
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
54 % %
55 % %
56 % %
57 % A p p e n d I m a g e T o L i s t %
58 % %
59 % %
60 % %
61 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
62 %
63 % AppendImageToList() appends the second image list to the end of the first
64 % list. The given image list pointer is left unchanged, unless it was empty.
65 %
66 % The format of the AppendImageToList method is:
67 %
68 % AppendImageToList(Image *images,const Image *image)
69 %
70 % A description of each parameter follows:
71 %
72 % o images: the image list to be appended to.
73 %
74 % o image: the appended image or image list.
75 %
76 */
77 MagickExport void AppendImageToList(Image **images,const Image *append)
78 {
79  register Image
80  *p,
81  *q;
82 
83  assert(images != (Image **) NULL);
84  if (append == (Image *) NULL)
85  return;
86  assert(append->signature == MagickCoreSignature);
87  if (append->debug != MagickFalse)
88  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",append->filename);
89  if ((*images) == (Image *) NULL)
90  {
91  *images=(Image *) append;
92  return;
93  }
94  assert((*images)->signature == MagickCoreSignature);
95  p=GetLastImageInList(*images);
96  q=GetFirstImageInList(append);
97  p->next=q;
98  q->previous=p;
99 }
100 
101 /*
102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
103 % %
104 % %
105 % %
106 % C l o n e I m a g e L i s t %
107 % %
108 % %
109 % %
110 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
111 %
112 % CloneImageList() returns a duplicate of the image list.
113 %
114 % The format of the CloneImageList method is:
115 %
116 % Image *CloneImageList(const Image *images,ExceptionInfo *exception)
117 %
118 % A description of each parameter follows:
119 %
120 % o images: the image list.
121 %
122 % o exception: return any errors or warnings in this structure.
123 %
124 */
126 {
127  Image
128  *clone,
129  *image;
130 
131  register Image
132  *p;
133 
134  if (images == (Image *) NULL)
135  return((Image *) NULL);
136  assert(images->signature == MagickCoreSignature);
137  while (images->previous != (Image *) NULL)
138  {
139  assert(images != images->previous);
140  images=images->previous;
141  }
142  image=(Image *) NULL;
143  for (p=(Image *) NULL; images != (Image *) NULL; images=images->next)
144  {
145  assert(images != images->next);
146  clone=CloneImage(images,0,0,MagickTrue,exception);
147  if (clone == (Image *) NULL)
148  {
149  if (image != (Image *) NULL)
150  image=DestroyImageList(image);
151  return((Image *) NULL);
152  }
153  if (image == (Image *) NULL)
154  {
155  image=clone;
156  p=image;
157  continue;
158  }
159  p->next=clone;
160  clone->previous=p;
161  p=p->next;
162  }
163  return(image);
164 }
165 
166 /*
167 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
168 % %
169 % %
170 % %
171 % C l o n e I m a g e s %
172 % %
173 % %
174 % %
175 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
176 %
177 % CloneImages() clones one or more images from an image sequence, using a
178 % comma separated list of image numbers or ranges.
179 %
180 % The numbers start at 0 for the first image in the list, while negative
181 % numbers refer to images starting counting from the end of the range. Images
182 % may be refered to multiple times to clone them multiple times. Images
183 % refered beyond the available number of images in list are ignored.
184 %
185 % Images referenced may be reversed, and results in a clone of those images
186 % also being made with a reversed order.
187 %
188 % The format of the CloneImages method is:
189 %
190 % Image *CloneImages(const Image *images,const char *scenes,
191 % ExceptionInfo *exception)
192 %
193 % A description of each parameter follows:
194 %
195 % o images: the image sequence.
196 %
197 % o scenes: This character string specifies which scenes to clone
198 % (e.g. 1,3-5,7-3,2).
199 %
200 % o exception: return any errors or warnings in this structure.
201 %
202 */
203 MagickExport Image *CloneImages(const Image *images,const char *scenes,
204  ExceptionInfo *exception)
205 {
206  char
207  *p;
208 
209  const Image
210  *next;
211 
212  Image
213  *clone_images,
214  *image;
215 
216  long
217  first,
218  last,
219  step;
220 
221  register ssize_t
222  i;
223 
224  size_t
225  length;
226 
227  assert(images != (const Image *) NULL);
228  assert(images->signature == MagickCoreSignature);
229  assert(scenes != (char *) NULL);
230  if (images->debug != MagickFalse)
231  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
232  assert(exception != (ExceptionInfo *) NULL);
233  assert(exception->signature == MagickCoreSignature);
234  clone_images=NewImageList();
235  images=GetFirstImageInList(images);
236  length=GetImageListLength(images);
237  for (p=(char *) scenes; *p != '\0';)
238  {
239  while ((isspace((int) ((unsigned char) *p)) != 0) || (*p == ','))
240  p++;
241  first=strtol(p,&p,10);
242  if (first < 0)
243  first+=(long) length;
244  last=first;
245  while (isspace((int) ((unsigned char) *p)) != 0)
246  p++;
247  if (*p == '-')
248  {
249  last=strtol(p+1,&p,10);
250  if (last < 0)
251  last+=(long) length;
252  }
253  for (step=first > last ? -1 : 1; first != (last+step); first+=step)
254  {
255  i=0;
256  for (next=images; next != (Image *) NULL; next=GetNextImageInList(next))
257  {
258  if (i == (ssize_t) first)
259  {
260  image=CloneImage(next,0,0,MagickTrue,exception);
261  if (image == (Image *) NULL)
262  break;
263  AppendImageToList(&clone_images,image);
264  }
265  i++;
266  }
267  }
268  }
269  return(GetFirstImageInList(clone_images));
270 }
271 
272 /*
273 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
274 % %
275 % %
276 % %
277 % D e l e t e I m a g e F r o m L i s t %
278 % %
279 % %
280 % %
281 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
282 %
283 % DeleteImageFromList() deletes an image from the list. List pointer
284 % is moved to the next image, if one is present. See RemoveImageFromList().
285 %
286 % The format of the DeleteImageFromList method is:
287 %
288 % DeleteImageFromList(Image **images)
289 %
290 % A description of each parameter follows:
291 %
292 % o images: the image list.
293 %
294 */
296 {
297  Image
298  *image;
299 
300  image=RemoveImageFromList(images);
301  if (image != (Image *) NULL)
302  (void) DestroyImage(image);
303 }
304 
305 /*
306 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
307 % %
308 % %
309 % %
310 % D e l e t e I m a g e s %
311 % %
312 % %
313 % %
314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
315 %
316 % DeleteImages() deletes one or more images from an image sequence, using a
317 % comma separated list of image numbers or ranges.
318 %
319 % The numbers start at 0 for the first image, while negative numbers refer to
320 % images starting counting from the end of the range. Images may be refered to
321 % multiple times without problems. Image refered beyond the available number
322 % of images in list are ignored.
323 %
324 % If the referenced images are in the reverse order, that range will be
325 % completely ignored, unlike CloneImages().
326 %
327 % The format of the DeleteImages method is:
328 %
329 % DeleteImages(Image **images,const char *scenes,ExceptionInfo *exception)
330 %
331 % A description of each parameter follows:
332 %
333 % o images: the image sequence.
334 %
335 % o scenes: This character string specifies which scenes to delete
336 % (e.g. 1,3-5,-2-6,2).
337 %
338 % o exception: return any errors or warnings in this structure.
339 %
340 */
341 MagickExport void DeleteImages(Image **images,const char *scenes,
342  ExceptionInfo *exception)
343 {
344  char
345  *p;
346 
347  Image
348  *image;
349 
350  long
351  first,
352  last;
353 
355  *delete_list;
356 
357  register ssize_t
358  i;
359 
360  size_t
361  length;
362 
363  assert(images != (Image **) NULL);
364  assert((*images)->signature == MagickCoreSignature);
365  assert(scenes != (char *) NULL);
366  if ((*images)->debug != MagickFalse)
368  (*images)->filename);
369  assert(exception != (ExceptionInfo *) NULL);
370  assert(exception->signature == MagickCoreSignature);
371  *images=GetFirstImageInList(*images);
372  length=GetImageListLength(*images);
373  delete_list=(MagickBooleanType *) AcquireQuantumMemory(length,
374  sizeof(*delete_list));
375  if (delete_list == (MagickBooleanType *) NULL)
376  {
377  (void) ThrowMagickException(exception,GetMagickModule(),
378  ResourceLimitError,"MemoryAllocationFailed","`%s'",(*images)->filename);
379  return;
380  }
381  image=(*images);
382  for (i=0; i < (ssize_t) length; i++)
383  delete_list[i]=MagickFalse;
384  /*
385  Note which images will be deleted, avoid duplicates.
386  */
387  for (p=(char *) scenes; *p != '\0';)
388  {
389  while ((isspace((int) ((unsigned char) *p)) != 0) || (*p == ','))
390  p++;
391  first=strtol(p,&p,10);
392  if (first < 0)
393  first+=(long) length;
394  last=first;
395  while (isspace((int) ((unsigned char) *p)) != 0)
396  p++;
397  if (*p == '-')
398  {
399  last=strtol(p+1,&p,10);
400  if (last < 0)
401  last+=(long) length;
402  }
403  if (first > last)
404  continue;
405  for (i=(ssize_t) first; i <= (ssize_t) last; i++)
406  if ((i >= 0) && (i < (ssize_t) length))
407  delete_list[i]=MagickTrue;
408  }
409  /*
410  Delete images marked for deletion, once only.
411  */
412  image=(*images);
413  for (i=0; i < (ssize_t) length; i++)
414  {
415  *images=image;
416  image=GetNextImageInList(image);
417  if (delete_list[i] != MagickFalse)
418  DeleteImageFromList(images);
419  }
420  (void) RelinquishMagickMemory(delete_list);
421  *images=GetFirstImageInList(*images);
422 }
423 
424 /*
425 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
426 % %
427 % %
428 % %
429 % D e s t r o y I m a g e L i s t %
430 % %
431 % %
432 % %
433 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
434 %
435 % DestroyImageList() destroys an image list.
436 %
437 % The format of the DestroyImageList method is:
438 %
439 % Image *DestroyImageList(Image *image)
440 %
441 % A description of each parameter follows:
442 %
443 % o image: the image sequence.
444 %
445 */
447 {
448  if (images == (Image *) NULL)
449  return((Image *) NULL);
450  assert(images->signature == MagickCoreSignature);
451  if (images->debug != MagickFalse)
452  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
453  while (images != (Image *) NULL)
454  DeleteImageFromList(&images);
455  return((Image *) NULL);
456 }
457 
458 /*
459 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
460 % %
461 % %
462 % %
463 % D u p l i c a t e I m a g e s %
464 % %
465 % %
466 % %
467 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
468 %
469 % DuplicateImages() duplicates one or more images from an image sequence,
470 % using a count and a comma separated list of image numbers or ranges.
471 %
472 % The numbers start at 0 for the first image, while negative numbers refer to
473 % images starting counting from the end of the range. Images may be refered to
474 % multiple times without problems. Image refered beyond the available number
475 % of images in list are ignored.
476 %
477 % The format of the DuplicateImages method is:
478 %
479 % Image *DuplicateImages(Image *images,const size_t number_duplicates,
480 % const char *scenes,ExceptionInfo *exception)
481 %
482 % A description of each parameter follows:
483 %
484 % o images: the image sequence.
485 %
486 % o number_duplicates: duplicate the image sequence this number of times.
487 %
488 % o scenes: This character string specifies which scenes to duplicate (e.g.
489 % 1,3-5,-2-6,2).
490 %
491 % o exception: return any errors or warnings in this structure.
492 %
493 */
495  const size_t number_duplicates,const char *scenes,ExceptionInfo *exception)
496 {
497  Image
498  *clone_images,
499  *duplicate_images;
500 
501  register ssize_t
502  i;
503 
504  /*
505  Duplicate images.
506  */
507  assert(images != (Image *) NULL);
508  assert(images->signature == MagickCoreSignature);
509  assert(scenes != (char *) NULL);
510  if (images->debug != MagickFalse)
511  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
512  assert(exception != (ExceptionInfo *) NULL);
513  assert(exception->signature == MagickCoreSignature);
514  duplicate_images=NewImageList();
515  for (i=0; i < (ssize_t) number_duplicates; i++)
516  {
517  clone_images=CloneImages(images,scenes,exception);
518  AppendImageToList(&duplicate_images,clone_images);
519  }
520  return(duplicate_images);
521 }
522 
523 /*
524 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
525 % %
526 % %
527 % %
528 % G e t F i r s t I m a g e I n L i s t %
529 % %
530 % %
531 % %
532 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
533 %
534 % GetFirstImageInList() returns a pointer to the first image in the list.
535 %
536 % The format of the GetFirstImageInList method is:
537 %
538 % Image *GetFirstImageInList(const Image *images)
539 %
540 % A description of each parameter follows:
541 %
542 % o images: the image list.
543 %
544 */
546 {
547  register const Image
548  *p;
549 
550  if (images == (Image *) NULL)
551  return((Image *) NULL);
552  assert(images->signature == MagickCoreSignature);
553  for (p=images; p->previous != (Image *) NULL; p=p->previous) ;
554  return((Image *) p);
555 }
556 
557 /*
558 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
559 % %
560 % %
561 % %
562 % G e t I m a g e F r o m L i s t %
563 % %
564 % %
565 % %
566 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
567 %
568 % GetImageFromList() returns an image at the specified index from the image
569 % list. Starting with 0 as the first image in the list.
570 %
571 % A negative offset will return the image from the end of the list, such that
572 % an index of -1 is the last image.
573 %
574 % If no such image exists at the specified offset a NULL image pointer is
575 % returned. This will only happen if index is less that the negative of
576 % the list length, or larger than list length -1. EG: ( -N to N-1 )
577 %
578 % The format of the GetImageFromList method is:
579 %
580 % Image *GetImageFromList(const Image *images,const ssize_t index)
581 %
582 % A description of each parameter follows:
583 %
584 % o images: the image list.
585 %
586 % o index: the position within the list.
587 %
588 */
589 MagickExport Image *GetImageFromList(const Image *images,const ssize_t index)
590 {
591  register const Image
592  *p;
593 
594  register ssize_t
595  i;
596 
597  if (images == (Image *) NULL)
598  return((Image *) NULL);
599  assert(images->signature == MagickCoreSignature);
600  if (images->debug != MagickFalse)
601  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
602 
603  /*
604  Designed to efficiently find first image (index == 0), or last image
605  (index == -1) as appropriate, without to go through the whole image list.
606  That is it tries to avoid 'counting the whole list' to handle the
607  most common image indexes.
608  */
609  if ( index < 0 )
610  {
611  p=GetLastImageInList(images);
612  for (i=-1; p != (Image *) NULL; p=p->previous)
613  if (i-- == index)
614  break;
615  }
616  else
617  {
618  p=GetFirstImageInList(images);
619  for (i=0; p != (Image *) NULL; p=p->next)
620  if (i++ == index)
621  break;
622  }
623  return((Image *) p);
624 }
625 
626 /*
627 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
628 % %
629 % %
630 % %
631 % G e t I m a g e I n d e x I n L i s t %
632 % %
633 % %
634 % %
635 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
636 %
637 % GetImageIndexInList() returns the offset in the list of the specified image.
638 %
639 % The format of the GetImageIndexInList method is:
640 %
641 % ssize_t GetImageIndexInList(const Image *images)
642 %
643 % A description of each parameter follows:
644 %
645 % o images: the image list.
646 %
647 */
648 MagickExport ssize_t GetImageIndexInList(const Image *images)
649 {
650  register ssize_t
651  i;
652 
653  if (images == (const Image *) NULL)
654  return(-1);
655  assert(images->signature == MagickCoreSignature);
656  for (i=0; images->previous != (Image *) NULL; i++)
657  {
658  assert(images != images->previous);
659  images=images->previous;
660  }
661  return(i);
662 }
663 
664 /*
665 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
666 % %
667 % %
668 % %
669 % G e t I m a g e L i s t L e n g t h %
670 % %
671 % %
672 % %
673 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
674 %
675 % GetImageListLength() returns the length of the list (the number of images in
676 % the list).
677 %
678 % The format of the GetImageListLength method is:
679 %
680 % size_t GetImageListLength(const Image *images)
681 %
682 % A description of each parameter follows:
683 %
684 % o images: the image list.
685 %
686 */
687 MagickExport size_t GetImageListLength(const Image *images)
688 {
689  register ssize_t
690  i;
691 
692  if (images == (Image *) NULL)
693  return(0);
694  assert(images->signature == MagickCoreSignature);
695  if (images->debug != MagickFalse)
696  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
697  images=GetLastImageInList(images);
698  for (i=0; images != (Image *) NULL; images=images->previous)
699  {
700  assert(images != images->previous);
701  i++;
702  }
703  return((size_t) i);
704 }
705 
706 /*
707 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
708 % %
709 % %
710 % %
711 % G e t L a s t I m a g e I n L i s t %
712 % %
713 % %
714 % %
715 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
716 %
717 % GetLastImageInList() returns a pointer to the last image in the list.
718 %
719 % The format of the GetLastImageInList method is:
720 %
721 % Image *GetLastImageInList(const Image *images)
722 %
723 % A description of each parameter follows:
724 %
725 % o images: the image list.
726 %
727 */
729 {
730  register const Image
731  *p;
732 
733  if (images == (Image *) NULL)
734  return((Image *) NULL);
735  assert(images->signature == MagickCoreSignature);
736  for (p=images; p->next != (Image *) NULL; p=p->next) ;
737  return((Image *) p);
738 }
739 
740 /*
741 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
742 % %
743 % %
744 % %
745 % G e t N e x t I m a g e I n L i s t %
746 % %
747 % %
748 % %
749 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
750 %
751 % GetNextImageInList() returns the next image in the list.
752 %
753 % The format of the GetNextImageInList method is:
754 %
755 % Image *GetNextImageInList(const Image *images)
756 %
757 % A description of each parameter follows:
758 %
759 % o images: the image list.
760 %
761 */
763 {
764  if (images == (Image *) NULL)
765  return((Image *) NULL);
766  assert(images->signature == MagickCoreSignature);
767  if (images->debug != MagickFalse)
768  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
769  return(images->next);
770 }
771 
772 /*
773 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
774 % %
775 % %
776 % %
777 % G e t P r e v i o u s I m a g e I n L i s t %
778 % %
779 % %
780 % %
781 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
782 %
783 % GetPreviousImageInList() returns the previous image in the list.
784 %
785 % The format of the GetPreviousImageInList method is:
786 %
787 % Image *GetPreviousImageInList(const Image *images)
788 %
789 % A description of each parameter follows:
790 %
791 % o images: the image list.
792 %
793 */
795 {
796  if (images == (Image *) NULL)
797  return((Image *) NULL);
798  assert(images->signature == MagickCoreSignature);
799  return(images->previous);
800 }
801 
802 /*
803 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
804 % %
805 % %
806 % I m a g e L i s t T o A r r a y %
807 % %
808 % %
809 % %
810 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
811 %
812 % ImageListToArray() is a convenience method that converts an image list to
813 % a sequential array, with a NULL image pointer at the end of the array.
814 %
815 % The images remain part of the original image list, with the array providing
816 % an alternative means of indexing the image array.
817 %
818 % group = ImageListToArray(images, exception);
819 % while (i = 0; group[i] != (Image *) NULL; i++)
820 % printf("%s\n", group[i]->filename);
821 % printf("%d images\n", i);
822 % group = RelinquishMagickMemory(group);
823 %
824 % The format of the ImageListToArray method is:
825 %
826 % Image **ImageListToArray(const Image *images,ExceptionInfo *exception)
827 %
828 % A description of each parameter follows:
829 %
830 % o image: the image list.
831 %
832 % o exception: return any errors or warnings in this structure.
833 %
834 */
836  ExceptionInfo *exception)
837 {
838  Image
839  **group;
840 
841  register ssize_t
842  i;
843 
844  if (images == (Image *) NULL)
845  return((Image **) NULL);
846  assert(images->signature == MagickCoreSignature);
847  if (images->debug != MagickFalse)
848  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
849  group=(Image **) AcquireQuantumMemory((size_t) GetImageListLength(images)+1UL,
850  sizeof(*group));
851  if (group == (Image **) NULL)
852  {
853  (void) ThrowMagickException(exception,GetMagickModule(),
854  ResourceLimitError,"MemoryAllocationFailed","`%s'",images->filename);
855  return((Image **) NULL);
856  }
857  images=GetFirstImageInList(images);
858  for (i=0; images != (Image *) NULL; images=images->next)
859  {
860  assert(images != images->next);
861  group[i++]=(Image *) images;
862  }
863  group[i]=(Image *) NULL;
864  return(group);
865 }
866 
867 /*
868 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
869 % %
870 % %
871 % %
872 % I n s e r t I m a g e I n L i s t %
873 % %
874 % %
875 % %
876 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
877 %
878 % InsertImageInList() insert the given image or image list, into the first
879 % image list, immediately AFTER the image pointed to. The given image list
880 % pointer is left unchanged unless previously empty.
881 %
882 % The format of the InsertImageInList method is:
883 %
884 % InsertImageInList(Image **images,Image *insert)
885 %
886 % A description of each parameter follows:
887 %
888 % o images: the image list to insert into.
889 %
890 % o insert: the image list to insert.
891 %
892 */
894 {
895  Image
896  *split;
897 
898  assert(images != (Image **) NULL);
899  assert(insert != (Image *) NULL);
900  assert(insert->signature == MagickCoreSignature);
901  if (insert->debug != MagickFalse)
902  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",insert->filename);
903  if ((*images) == (Image *) NULL)
904  return;
905  assert((*images)->signature == MagickCoreSignature);
906  split=SplitImageList(*images);
907  AppendImageToList(images,insert);
908  AppendImageToList(images,split);
909 }
910 
911 /*
912 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
913 % %
914 % %
915 % %
916 % N e w I m a g e L i s t %
917 % %
918 % %
919 % %
920 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
921 %
922 % NewImageList() creates an empty image list.
923 %
924 % The format of the NewImageList method is:
925 %
926 % Image *NewImageList(void)
927 %
928 */
930 {
931  return((Image *) NULL);
932 }
933 
934 /*
935 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
936 % %
937 % %
938 % %
939 % P r e p e n d I m a g e T o L i s t %
940 % %
941 % %
942 % %
943 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
944 %
945 % PrependImageToList() prepends the image to the beginning of the list.
946 %
947 % The format of the PrependImageToList method is:
948 %
949 % PrependImageToList(Image *images,Image *image)
950 %
951 % A description of each parameter follows:
952 %
953 % o images: the image list.
954 %
955 % o image: the image.
956 %
957 */
959 {
960  if (*images == (Image *) NULL)
961  {
962  *images=prepend;
963  return;
964  }
965  AppendImageToList(&prepend,*images);
966 }
967 
968 /*
969 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
970 % %
971 % %
972 % %
973 % R e m o v e I m a g e F r o m L i s t %
974 % %
975 % %
976 % %
977 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
978 %
979 % RemoveImageFromList() removes and returns the image pointed to.
980 %
981 % The given image list pointer is set to point to the next image in list
982 % if it exists, otherwise it is set to the previous image, or NULL if list
983 % was emptied.
984 %
985 % The format of the RemoveImageFromList method is:
986 %
987 % Image *RemoveImageFromList(Image **images)
988 %
989 % A description of each parameter follows:
990 %
991 % o images: the image list.
992 %
993 */
995 {
996  register Image
997  *p;
998 
999  assert(images != (Image **) NULL);
1000  if ((*images) == (Image *) NULL)
1001  return((Image *) NULL);
1002  assert((*images)->signature == MagickCoreSignature);
1003  if ((*images)->debug != MagickFalse)
1005  (*images)->filename);
1006  p=(*images);
1007  if ((p->previous == (Image *) NULL) && (p->next == (Image *) NULL))
1008  *images=(Image *) NULL;
1009  else
1010  {
1011  if (p->previous != (Image *) NULL)
1012  {
1013  p->previous->next=p->next;
1014  *images=p->previous;
1015  }
1016  if (p->next != (Image *) NULL)
1017  {
1018  p->next->previous=p->previous;
1019  *images=p->next;
1020  }
1021  p->previous=(Image *) NULL;
1022  p->next=(Image *) NULL;
1023  }
1024  return(p);
1025 }
1026 
1027 /*
1028 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1029 % %
1030 % %
1031 % %
1032 % R e m o v e F i r s t I m a g e F r o m L i s t %
1033 % %
1034 % %
1035 % %
1036 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1037 %
1038 % RemoveFirstImageFromList() removes and returns the first image in the list.
1039 %
1040 % If the given image list pointer pointed to the removed first image, it is
1041 % set to the new first image of list, or NULL if list was emptied, otherwise
1042 % it is left as is.
1043 %
1044 % The format of the RemoveFirstImageFromList method is:
1045 %
1046 % Image *RemoveFirstImageFromList(Image **images)
1047 %
1048 % A description of each parameter follows:
1049 %
1050 % o images: the image list.
1051 %
1052 */
1054 {
1055  Image
1056  *image;
1057 
1058  assert(images != (Image **) NULL);
1059  if ((*images) == (Image *) NULL)
1060  return((Image *) NULL);
1061  assert((*images)->signature == MagickCoreSignature);
1062  if ((*images)->debug != MagickFalse)
1064  (*images)->filename);
1065  image=(*images);
1066  while (image->previous != (Image *) NULL)
1067  image=image->previous;
1068  if (image == *images)
1069  *images=(*images)->next;
1070  if (image->next != (Image *) NULL)
1071  {
1072  image->next->previous=(Image *) NULL;
1073  image->next=(Image *) NULL;
1074  }
1075  return(image);
1076 }
1077 
1078 /*
1079 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1080 % %
1081 % %
1082 % %
1083 % R e m o v e L a s t I m a g e F r o m L i s t %
1084 % %
1085 % %
1086 % %
1087 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1088 %
1089 % RemoveLastImageFromList() removes and returns the last image from the list.
1090 %
1091 % If the given image list pointer pointed to the removed last image, it is
1092 % set to the new last image of list, or NULL if list was emptied, otherwise
1093 % it is left as is.
1094 %
1095 % The format of the RemoveLastImageFromList method is:
1096 %
1097 % Image *RemoveLastImageFromList(Image **images)
1098 %
1099 % A description of each parameter follows:
1100 %
1101 % o images: the image list.
1102 %
1103 */
1105 {
1106  Image
1107  *image;
1108 
1109  assert(images != (Image **) NULL);
1110  if ((*images) == (Image *) NULL)
1111  return((Image *) NULL);
1112  assert((*images)->signature == MagickCoreSignature);
1113  if ((*images)->debug != MagickFalse)
1115  (*images)->filename);
1116  image=(*images);
1117  while (image->next != (Image *) NULL)
1118  image=image->next;
1119  if (image == *images)
1120  *images=(*images)->previous;
1121  if (image->previous != (Image *) NULL)
1122  {
1123  image->previous->next=(Image *) NULL;
1124  image->previous=(Image *) NULL;
1125  }
1126  return(image);
1127 }
1128 
1129 /*
1130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1131 % %
1132 % %
1133 % %
1134 % R e p l a c e I m a g e I n L i s t %
1135 % %
1136 % %
1137 % %
1138 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1139 %
1140 % ReplaceImageInList() replaces an image in the list with the given image, or
1141 % list of images. Old image is destroyed.
1142 %
1143 % The images list pointer is set to point to the first image of the inserted
1144 % list of images.
1145 %
1146 % The format of the ReplaceImageInList method is:
1147 %
1148 % ReplaceImageInList(Image **images,Image *replace)
1149 %
1150 % A description of each parameter follows:
1151 %
1152 % o images: the list and pointer to image to replace
1153 %
1154 % o replace: the image or image list replacing the original
1155 %
1156 */
1158 {
1159  assert(images != (Image **) NULL);
1160  assert(replace != (Image *) NULL);
1161  assert(replace->signature == MagickCoreSignature);
1162  if (replace->debug != MagickFalse)
1163  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",replace->filename);
1164  if ((*images) == (Image *) NULL)
1165  return;
1166  assert((*images)->signature == MagickCoreSignature);
1167 
1168  /* link next pointer */
1169  replace=GetLastImageInList(replace);
1170  replace->next=(*images)->next;
1171  if (replace->next != (Image *) NULL)
1172  replace->next->previous=replace;
1173 
1174  /* link previous pointer - set images position to first replacement image */
1175  replace=GetFirstImageInList(replace);
1176  replace->previous=(*images)->previous;
1177  if (replace->previous != (Image *) NULL)
1178  replace->previous->next=replace;
1179 
1180  /* destroy the replaced image that was in images */
1181  (void) DestroyImage(*images);
1182  (*images)=replace;
1183 }
1184 
1185 /*
1186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1187 % %
1188 % %
1189 % %
1190 % R e p l a c e I m a g e I n L i s t R e t u r n L a s t %
1191 % %
1192 % %
1193 % %
1194 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1195 %
1196 % ReplaceImageInListReturnLast() is exactly as ReplaceImageInList() except
1197 % the images pointer is set to the last image in the list of replacement
1198 % images.
1199 %
1200 % This allows you to simply use GetNextImageInList() to go to the image
1201 % that follows the just replaced image, even if a list of replacement images
1202 % was inserted.
1203 %
1204 % The format of the ReplaceImageInList method is:
1205 %
1206 % ReplaceImageInListReturnLast(Image **images,Image *replace)
1207 %
1208 % A description of each parameter follows:
1209 %
1210 % o images: the list and pointer to image to replace
1211 %
1212 % o replace: the image or image list replacing the original
1213 %
1214 */
1216 {
1217  assert(images != (Image **) NULL);
1218  assert(replace != (Image *) NULL);
1219  assert(replace->signature == MagickCoreSignature);
1220  if (replace->debug != MagickFalse)
1221  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",replace->filename);
1222  if ((*images) == (Image *) NULL)
1223  return;
1224  assert((*images)->signature == MagickCoreSignature);
1225 
1226  /* link previous pointer */
1227  replace=GetFirstImageInList(replace);
1228  replace->previous=(*images)->previous;
1229  if (replace->previous != (Image *) NULL)
1230  replace->previous->next=replace;
1231 
1232  /* link next pointer - set images position to last replacement image */
1233  replace=GetLastImageInList(replace);
1234  replace->next=(*images)->next;
1235  if (replace->next != (Image *) NULL)
1236  replace->next->previous=replace;
1237 
1238  /* destroy the replaced image that was in images */
1239  (void) DestroyImage(*images);
1240  (*images)=replace;
1241 }
1242 
1243 /*
1244 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1245 % %
1246 % %
1247 % %
1248 % R e v e r s e I m a g e L i s t %
1249 % %
1250 % %
1251 % %
1252 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1253 %
1254 % ReverseImageList() reverses the order of an image list.
1255 % The list pointer is reset to that start of the re-ordered list.
1256 %
1257 % The format of the ReverseImageList method is:
1258 %
1259 % void ReverseImageList(Image **images)
1260 %
1261 % A description of each parameter follows:
1262 %
1263 % o images: the image list.
1264 %
1265 */
1267 {
1268  Image
1269  *next;
1270 
1271  register Image
1272  *p;
1273 
1274  assert(images != (Image **) NULL);
1275  if ((*images) == (Image *) NULL)
1276  return;
1277  assert((*images)->signature == MagickCoreSignature);
1278  if ((*images)->debug != MagickFalse)
1280  (*images)->filename);
1281  for (p=(*images); p->next != (Image *) NULL; p=p->next) ;
1282  *images=p;
1283  for ( ; p != (Image *) NULL; p=p->next)
1284  {
1285  next=p->next;
1286  p->next=p->previous;
1287  p->previous=next;
1288  }
1289 }
1290 
1291 /*
1292 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1293 % %
1294 % %
1295 % %
1296 % S p l i c e I m a g e I n t o L i s t %
1297 % %
1298 % %
1299 % %
1300 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1301 %
1302 % SpliceImageIntoList() removes 'length' images from the list and replaces
1303 % them with the specified splice. Removed images are returned.
1304 %
1305 % The format of the SpliceImageIntoList method is:
1306 %
1307 % SpliceImageIntoList(Image **images,const size_t,
1308 % const Image *splice)
1309 %
1310 % A description of each parameter follows:
1311 %
1312 % o images: the image list.
1313 %
1314 % o length: the length of the image list to remove.
1315 %
1316 % o splice: Replace the removed image list with this list.
1317 %
1318 */
1320  const size_t length,const Image *splice)
1321 {
1322  Image
1323  *image,
1324  *split;
1325 
1326  register size_t
1327  i;
1328 
1329  assert(images != (Image **) NULL);
1330  assert(splice != (Image *) NULL);
1331  assert(splice->signature == MagickCoreSignature);
1332  if ((*images) == (Image *) NULL)
1333  return((Image *) NULL);
1334  assert((*images)->signature == MagickCoreSignature);
1335  if ((*images)->debug != MagickFalse)
1337  (*images)->filename);
1338  split=SplitImageList(*images);
1339  AppendImageToList(images,splice);
1340  image=(Image *) NULL;
1341  for (i=0; (i < length) && (split != (Image *) NULL); i++)
1342  AppendImageToList(&image,RemoveImageFromList(&split));
1343  AppendImageToList(images,split);
1344  return(image);
1345 }
1346 
1347 /*
1348 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1349 % %
1350 % %
1351 % %
1352 % S p l i t I m a g e L i s t %
1353 % %
1354 % %
1355 % %
1356 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1357 %
1358 % SplitImageList() splits an image into two lists, after given image
1359 % The list that was split off is returned, which may be empty.
1360 %
1361 % The format of the SplitImageList method is:
1362 %
1363 % Image *SplitImageList(Image *images)
1364 %
1365 % A description of each parameter follows:
1366 %
1367 % o images: the image list.
1368 %
1369 */
1371 {
1372  if ((images == (Image *) NULL) || (images->next == (Image *) NULL))
1373  return((Image *) NULL);
1374  images=images->next;
1375  images->previous->next=(Image *) NULL;
1376  images->previous=(Image *) NULL;
1377  return(images);
1378 }
1379 
1380 /*
1381 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1382 % %
1383 % %
1384 % %
1385 + S y n c I m a g e L i s t %
1386 % %
1387 % %
1388 % %
1389 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1390 %
1391 % SyncImageList() synchronizes the scene numbers in an image list.
1392 %
1393 % The format of the SyncImageList method is:
1394 %
1395 % void SyncImageList(Image *images)
1396 %
1397 % A description of each parameter follows:
1398 %
1399 % o images: the image list.
1400 %
1401 */
1403 {
1404  register Image
1405  *p,
1406  *q;
1407 
1408  if (images == (Image *) NULL)
1409  return;
1410  assert(images->signature == MagickCoreSignature);
1411  for (p=images; p != (Image *) NULL; p=p->next)
1412  {
1413  for (q=p->next; q != (Image *) NULL; q=q->next)
1414  if (p->scene == q->scene)
1415  break;
1416  if (q != (Image *) NULL)
1417  break;
1418  }
1419  if (p == (Image *) NULL)
1420  return;
1421  for (p=images->next; p != (Image *) NULL; p=p->next)
1422  p->scene=p->previous->scene+1;
1423 }
1424 
1425 /*
1426 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1427 % %
1428 % %
1429 % %
1430 + S y n c N e x t I m a g e I n L i s t %
1431 % %
1432 % %
1433 % %
1434 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1435 %
1436 % SyncNextImageInList() returns the next image in the list after the blob
1437 % referenced is synchronized with the current image.
1438 %
1439 % The format of the SyncNextImageInList method is:
1440 %
1441 % Image *SyncNextImageInList(const Image *images)
1442 %
1443 % A description of each parameter follows:
1444 %
1445 % o images: the image list.
1446 %
1447 */
1449 {
1450  if (images == (Image *) NULL)
1451  return((Image *) NULL);
1452  assert(images->signature == MagickCoreSignature);
1453  if (images->next == (Image *) NULL)
1454  return((Image *) NULL);
1455  if (images->blob != images->next->blob)
1456  {
1457  DestroyBlob(images->next);
1458  images->next->blob=ReferenceBlob(images->blob);
1459  }
1460  images->next->compression=images->compression;
1461  images->next->endian=images->endian;
1462  return(images->next);
1463 }
MagickExport Image * CloneImages(const Image *images, const char *scenes, ExceptionInfo *exception)
Definition: list.c:203
MagickExport Image * GetImageFromList(const Image *images, const ssize_t index)
Definition: list.c:589
size_t signature
Definition: exception.h:123
MagickExport Image * RemoveFirstImageFromList(Image **images)
Definition: list.c:1053
EndianType endian
Definition: image.h:228
MagickExport void InsertImageInList(Image **images, Image *insert)
Definition: list.c:893
MagickExport void DeleteImages(Image **images, const char *scenes, ExceptionInfo *exception)
Definition: list.c:341
MagickExport Image * SpliceImageIntoList(Image **images, const size_t length, const Image *splice)
Definition: list.c:1319
CompressionType compression
Definition: image.h:160
MagickExport Image * DuplicateImages(Image *images, const size_t number_duplicates, const char *scenes, ExceptionInfo *exception)
Definition: list.c:494
Definition: log.h:52
Definition: image.h:151
MagickExport Image * GetPreviousImageInList(const Image *images)
Definition: list.c:794
#define MagickCoreSignature
MagickExport Image * GetFirstImageInList(const Image *images)
Definition: list.c:545
MagickExport Image * RemoveImageFromList(Image **images)
Definition: list.c:994
MagickBooleanType
Definition: magick-type.h:156
MagickExport Image * NewImageList(void)
Definition: list.c:929
size_t scene
Definition: image.h:240
MagickExport void ReplaceImageInListReturnLast(Image **images, Image *replace)
Definition: list.c:1215
MagickExport Image * SplitImageList(Image *images)
Definition: list.c:1370
MagickExport void * AcquireQuantumMemory(const size_t count, const size_t quantum)
Definition: memory.c:533
MagickExport Image * SyncNextImageInList(const Image *images)
Definition: list.c:1448
struct _Image * previous
Definition: image.h:348
MagickExport MagickBooleanType ThrowMagickException(ExceptionInfo *exception, const char *module, const char *function, const size_t line, const ExceptionType severity, const char *tag, const char *format,...)
Definition: exception.c:1058
MagickExport MagickBooleanType LogMagickEvent(const LogEventType type, const char *module, const char *function, const size_t line, const char *format,...)
Definition: log.c:1397
size_t signature
Definition: image.h:354
struct _Image * next
Definition: image.h:348
MagickExport Image * GetLastImageInList(const Image *images)
Definition: list.c:728
MagickExport Image * DestroyImageList(Image *images)
Definition: list.c:446
MagickExport Image * RemoveLastImageFromList(Image **images)
Definition: list.c:1104
char filename[MagickPathExtent]
Definition: image.h:319
ElementInfo * next
Definition: linked-list.c:75
#define GetMagickModule()
Definition: log.h:28
MagickExport Image * CloneImageList(const Image *images, ExceptionInfo *exception)
Definition: list.c:125
MagickExport Image ** ImageListToArray(const Image *images, ExceptionInfo *exception)
Definition: list.c:835
MagickExport void ReplaceImageInList(Image **images, Image *replace)
Definition: list.c:1157
MagickExport ssize_t GetImageIndexInList(const Image *images)
Definition: list.c:648
MagickExport Image * GetNextImageInList(const Image *images)
Definition: list.c:762
MagickExport void AppendImageToList(Image **images, const Image *append)
Definition: list.c:77
BlobInfo * blob
Definition: image.h:328
MagickExport void SyncImageList(Image *images)
Definition: list.c:1402
MagickExport void * RelinquishMagickMemory(void *memory)
Definition: memory.c:1027
MagickExport BlobInfo * ReferenceBlob(BlobInfo *)
Definition: blob.c:4613
MagickExport void PrependImageToList(Image **images, Image *prepend)
Definition: list.c:958
#define MagickExport
MagickExport void DestroyBlob(Image *image)
Definition: blob.c:894
MagickExport void DeleteImageFromList(Image **images)
Definition: list.c:295
MagickExport size_t GetImageListLength(const Image *images)
Definition: list.c:687
MagickExport void ReverseImageList(Image **images)
Definition: list.c:1266
MagickExport Image * DestroyImage(Image *image)
Definition: image.c:1183
MagickExport Image * CloneImage(const Image *image, const size_t columns, const size_t rows, const MagickBooleanType detach, ExceptionInfo *exception)
Definition: image.c:800
MagickBooleanType debug
Definition: image.h:334