MagickCore  7.0.8
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  if (index < 0)
603  {
604  p=GetLastImageInList(images);
605  for (i=(-1); p != (Image *) NULL; p=p->previous)
606  if (i-- == index)
607  break;
608  }
609  else
610  {
611  p=GetFirstImageInList(images);
612  for (i=0; p != (Image *) NULL; p=p->next)
613  if (i++ == index)
614  break;
615  }
616  return((Image *) p);
617 }
618 
619 /*
620 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
621 % %
622 % %
623 % %
624 % G e t I m a g e I n d e x I n L i s t %
625 % %
626 % %
627 % %
628 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
629 %
630 % GetImageIndexInList() returns the offset in the list of the specified image.
631 %
632 % The format of the GetImageIndexInList method is:
633 %
634 % ssize_t GetImageIndexInList(const Image *images)
635 %
636 % A description of each parameter follows:
637 %
638 % o images: the image list.
639 %
640 */
641 MagickExport ssize_t GetImageIndexInList(const Image *images)
642 {
643  register ssize_t
644  i;
645 
646  if (images == (const Image *) NULL)
647  return(-1);
648  assert(images->signature == MagickCoreSignature);
649  for (i=0; images->previous != (Image *) NULL; i++)
650  {
651  assert(images != images->previous);
652  images=images->previous;
653  }
654  return(i);
655 }
656 
657 /*
658 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
659 % %
660 % %
661 % %
662 % G e t I m a g e L i s t L e n g t h %
663 % %
664 % %
665 % %
666 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
667 %
668 % GetImageListLength() returns the length of the list (the number of images in
669 % the list).
670 %
671 % The format of the GetImageListLength method is:
672 %
673 % size_t GetImageListLength(const Image *images)
674 %
675 % A description of each parameter follows:
676 %
677 % o images: the image list.
678 %
679 */
680 MagickExport size_t GetImageListLength(const Image *images)
681 {
682  register ssize_t
683  i;
684 
685  if (images == (Image *) NULL)
686  return(0);
687  assert(images->signature == MagickCoreSignature);
688  if (images->debug != MagickFalse)
689  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
690  images=GetLastImageInList(images);
691  for (i=0; images != (Image *) NULL; images=images->previous)
692  {
693  assert(images != images->previous);
694  i++;
695  }
696  return((size_t) i);
697 }
698 
699 /*
700 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
701 % %
702 % %
703 % %
704 % G e t L a s t I m a g e I n L i s t %
705 % %
706 % %
707 % %
708 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
709 %
710 % GetLastImageInList() returns a pointer to the last image in the list.
711 %
712 % The format of the GetLastImageInList method is:
713 %
714 % Image *GetLastImageInList(const Image *images)
715 %
716 % A description of each parameter follows:
717 %
718 % o images: the image list.
719 %
720 */
722 {
723  register const Image
724  *p;
725 
726  if (images == (Image *) NULL)
727  return((Image *) NULL);
728  assert(images->signature == MagickCoreSignature);
729  for (p=images; p->next != (Image *) NULL; p=p->next) ;
730  return((Image *) p);
731 }
732 
733 /*
734 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
735 % %
736 % %
737 % %
738 % G e t N e x t I m a g e I n L i s t %
739 % %
740 % %
741 % %
742 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
743 %
744 % GetNextImageInList() returns the next image in the list.
745 %
746 % The format of the GetNextImageInList method is:
747 %
748 % Image *GetNextImageInList(const Image *images)
749 %
750 % A description of each parameter follows:
751 %
752 % o images: the image list.
753 %
754 */
756 {
757  if (images == (Image *) NULL)
758  return((Image *) NULL);
759  assert(images->signature == MagickCoreSignature);
760  if (images->debug != MagickFalse)
761  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
762  return(images->next);
763 }
764 
765 /*
766 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
767 % %
768 % %
769 % %
770 % G e t P r e v i o u s I m a g e I n L i s t %
771 % %
772 % %
773 % %
774 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
775 %
776 % GetPreviousImageInList() returns the previous image in the list.
777 %
778 % The format of the GetPreviousImageInList method is:
779 %
780 % Image *GetPreviousImageInList(const Image *images)
781 %
782 % A description of each parameter follows:
783 %
784 % o images: the image list.
785 %
786 */
788 {
789  if (images == (Image *) NULL)
790  return((Image *) NULL);
791  assert(images->signature == MagickCoreSignature);
792  return(images->previous);
793 }
794 
795 /*
796 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
797 % %
798 % %
799 % I m a g e L i s t T o A r r a y %
800 % %
801 % %
802 % %
803 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
804 %
805 % ImageListToArray() is a convenience method that converts an image list to
806 % a sequential array, with a NULL image pointer at the end of the array.
807 %
808 % The images remain part of the original image list, with the array providing
809 % an alternative means of indexing the image array.
810 %
811 % group = ImageListToArray(images, exception);
812 % while (i = 0; group[i] != (Image *) NULL; i++)
813 % printf("%s\n", group[i]->filename);
814 % printf("%d images\n", i);
815 % group = RelinquishMagickMemory(group);
816 %
817 % The format of the ImageListToArray method is:
818 %
819 % Image **ImageListToArray(const Image *images,ExceptionInfo *exception)
820 %
821 % A description of each parameter follows:
822 %
823 % o image: the image list.
824 %
825 % o exception: return any errors or warnings in this structure.
826 %
827 */
829  ExceptionInfo *exception)
830 {
831  Image
832  **group;
833 
834  register ssize_t
835  i;
836 
837  if (images == (Image *) NULL)
838  return((Image **) NULL);
839  assert(images->signature == MagickCoreSignature);
840  if (images->debug != MagickFalse)
841  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
842  group=(Image **) AcquireQuantumMemory((size_t) GetImageListLength(images)+1UL,
843  sizeof(*group));
844  if (group == (Image **) NULL)
845  {
846  (void) ThrowMagickException(exception,GetMagickModule(),
847  ResourceLimitError,"MemoryAllocationFailed","`%s'",images->filename);
848  return((Image **) NULL);
849  }
850  images=GetFirstImageInList(images);
851  for (i=0; images != (Image *) NULL; images=images->next)
852  {
853  assert(images != images->next);
854  group[i++]=(Image *) images;
855  }
856  group[i]=(Image *) NULL;
857  return(group);
858 }
859 
860 /*
861 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
862 % %
863 % %
864 % %
865 % I n s e r t I m a g e I n L i s t %
866 % %
867 % %
868 % %
869 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
870 %
871 % InsertImageInList() insert the given image or image list, into the first
872 % image list, immediately AFTER the image pointed to. The given image list
873 % pointer is left unchanged unless previously empty.
874 %
875 % The format of the InsertImageInList method is:
876 %
877 % InsertImageInList(Image **images,Image *insert)
878 %
879 % A description of each parameter follows:
880 %
881 % o images: the image list to insert into.
882 %
883 % o insert: the image list to insert.
884 %
885 */
887 {
888  Image
889  *split;
890 
891  assert(images != (Image **) NULL);
892  assert(insert != (Image *) NULL);
893  assert(insert->signature == MagickCoreSignature);
894  if (insert->debug != MagickFalse)
895  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",insert->filename);
896  if ((*images) == (Image *) NULL)
897  return;
898  assert((*images)->signature == MagickCoreSignature);
899  split=SplitImageList(*images);
900  AppendImageToList(images,insert);
901  AppendImageToList(images,split);
902 }
903 
904 /*
905 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
906 % %
907 % %
908 % %
909 % N e w I m a g e L i s t %
910 % %
911 % %
912 % %
913 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
914 %
915 % NewImageList() creates an empty image list.
916 %
917 % The format of the NewImageList method is:
918 %
919 % Image *NewImageList(void)
920 %
921 */
923 {
924  return((Image *) NULL);
925 }
926 
927 /*
928 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
929 % %
930 % %
931 % %
932 % P r e p e n d I m a g e T o L i s t %
933 % %
934 % %
935 % %
936 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
937 %
938 % PrependImageToList() prepends the image to the beginning of the list.
939 %
940 % The format of the PrependImageToList method is:
941 %
942 % PrependImageToList(Image *images,Image *image)
943 %
944 % A description of each parameter follows:
945 %
946 % o images: the image list.
947 %
948 % o image: the image.
949 %
950 */
952 {
953  if (*images == (Image *) NULL)
954  {
955  *images=prepend;
956  return;
957  }
958  AppendImageToList(&prepend,*images);
959 }
960 
961 /*
962 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
963 % %
964 % %
965 % %
966 % R e m o v e I m a g e F r o m L i s t %
967 % %
968 % %
969 % %
970 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
971 %
972 % RemoveImageFromList() removes and returns the image pointed to.
973 %
974 % The given image list pointer is set to point to the next image in list
975 % if it exists, otherwise it is set to the previous image, or NULL if list
976 % was emptied.
977 %
978 % The format of the RemoveImageFromList method is:
979 %
980 % Image *RemoveImageFromList(Image **images)
981 %
982 % A description of each parameter follows:
983 %
984 % o images: the image list.
985 %
986 */
988 {
989  register Image
990  *p;
991 
992  assert(images != (Image **) NULL);
993  if ((*images) == (Image *) NULL)
994  return((Image *) NULL);
995  assert((*images)->signature == MagickCoreSignature);
996  if ((*images)->debug != MagickFalse)
998  (*images)->filename);
999  p=(*images);
1000  if ((p->previous == (Image *) NULL) && (p->next == (Image *) NULL))
1001  *images=(Image *) NULL;
1002  else
1003  {
1004  if (p->previous != (Image *) NULL)
1005  {
1006  p->previous->next=p->next;
1007  *images=p->previous;
1008  }
1009  if (p->next != (Image *) NULL)
1010  {
1011  p->next->previous=p->previous;
1012  *images=p->next;
1013  }
1014  p->previous=(Image *) NULL;
1015  p->next=(Image *) NULL;
1016  }
1017  return(p);
1018 }
1019 
1020 /*
1021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1022 % %
1023 % %
1024 % %
1025 % R e m o v e F i r s t I m a g e F r o m L i s t %
1026 % %
1027 % %
1028 % %
1029 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1030 %
1031 % RemoveFirstImageFromList() removes and returns the first image in the list.
1032 %
1033 % If the given image list pointer pointed to the removed first image, it is
1034 % set to the new first image of list, or NULL if list was emptied, otherwise
1035 % it is left as is.
1036 %
1037 % The format of the RemoveFirstImageFromList method is:
1038 %
1039 % Image *RemoveFirstImageFromList(Image **images)
1040 %
1041 % A description of each parameter follows:
1042 %
1043 % o images: the image list.
1044 %
1045 */
1047 {
1048  Image
1049  *image;
1050 
1051  assert(images != (Image **) NULL);
1052  if ((*images) == (Image *) NULL)
1053  return((Image *) NULL);
1054  assert((*images)->signature == MagickCoreSignature);
1055  if ((*images)->debug != MagickFalse)
1057  (*images)->filename);
1058  image=(*images);
1059  while (image->previous != (Image *) NULL)
1060  image=image->previous;
1061  if (image == *images)
1062  *images=(*images)->next;
1063  if (image->next != (Image *) NULL)
1064  {
1065  image->next->previous=(Image *) NULL;
1066  image->next=(Image *) NULL;
1067  }
1068  return(image);
1069 }
1070 
1071 /*
1072 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1073 % %
1074 % %
1075 % %
1076 % R e m o v e L a s t I m a g e F r o m L i s t %
1077 % %
1078 % %
1079 % %
1080 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1081 %
1082 % RemoveLastImageFromList() removes and returns the last image from the list.
1083 %
1084 % If the given image list pointer pointed to the removed last image, it is
1085 % set to the new last image of list, or NULL if list was emptied, otherwise
1086 % it is left as is.
1087 %
1088 % The format of the RemoveLastImageFromList method is:
1089 %
1090 % Image *RemoveLastImageFromList(Image **images)
1091 %
1092 % A description of each parameter follows:
1093 %
1094 % o images: the image list.
1095 %
1096 */
1098 {
1099  Image
1100  *image;
1101 
1102  assert(images != (Image **) NULL);
1103  if ((*images) == (Image *) NULL)
1104  return((Image *) NULL);
1105  assert((*images)->signature == MagickCoreSignature);
1106  if ((*images)->debug != MagickFalse)
1108  (*images)->filename);
1109  image=(*images);
1110  while (image->next != (Image *) NULL)
1111  image=image->next;
1112  if (image == *images)
1113  *images=(*images)->previous;
1114  if (image->previous != (Image *) NULL)
1115  {
1116  image->previous->next=(Image *) NULL;
1117  image->previous=(Image *) NULL;
1118  }
1119  return(image);
1120 }
1121 
1122 /*
1123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1124 % %
1125 % %
1126 % %
1127 % R e p l a c e I m a g e I n L i s t %
1128 % %
1129 % %
1130 % %
1131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1132 %
1133 % ReplaceImageInList() replaces an image in the list with the given image, or
1134 % list of images. Old image is destroyed.
1135 %
1136 % The images list pointer is set to point to the first image of the inserted
1137 % list of images.
1138 %
1139 % The format of the ReplaceImageInList method is:
1140 %
1141 % ReplaceImageInList(Image **images,Image *replace)
1142 %
1143 % A description of each parameter follows:
1144 %
1145 % o images: the list and pointer to image to replace
1146 %
1147 % o replace: the image or image list replacing the original
1148 %
1149 */
1151 {
1152  assert(images != (Image **) NULL);
1153  assert(replace != (Image *) NULL);
1154  assert(replace->signature == MagickCoreSignature);
1155  if (replace->debug != MagickFalse)
1156  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",replace->filename);
1157  if ((*images) == (Image *) NULL)
1158  return;
1159  assert((*images)->signature == MagickCoreSignature);
1160 
1161  /* link next pointer */
1162  replace=GetLastImageInList(replace);
1163  replace->next=(*images)->next;
1164  if (replace->next != (Image *) NULL)
1165  replace->next->previous=replace;
1166 
1167  /* link previous pointer - set images position to first replacement image */
1168  replace=GetFirstImageInList(replace);
1169  replace->previous=(*images)->previous;
1170  if (replace->previous != (Image *) NULL)
1171  replace->previous->next=replace;
1172 
1173  /* destroy the replaced image that was in images */
1174  (void) DestroyImage(*images);
1175  (*images)=replace;
1176 }
1177 
1178 /*
1179 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1180 % %
1181 % %
1182 % %
1183 % 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 %
1184 % %
1185 % %
1186 % %
1187 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1188 %
1189 % ReplaceImageInListReturnLast() is exactly as ReplaceImageInList() except
1190 % the images pointer is set to the last image in the list of replacement
1191 % images.
1192 %
1193 % This allows you to simply use GetNextImageInList() to go to the image
1194 % that follows the just replaced image, even if a list of replacement images
1195 % was inserted.
1196 %
1197 % The format of the ReplaceImageInList method is:
1198 %
1199 % ReplaceImageInListReturnLast(Image **images,Image *replace)
1200 %
1201 % A description of each parameter follows:
1202 %
1203 % o images: the list and pointer to image to replace
1204 %
1205 % o replace: the image or image list replacing the original
1206 %
1207 */
1209 {
1210  assert(images != (Image **) NULL);
1211  assert(replace != (Image *) NULL);
1212  assert(replace->signature == MagickCoreSignature);
1213  if (replace->debug != MagickFalse)
1214  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",replace->filename);
1215  if ((*images) == (Image *) NULL)
1216  return;
1217  assert((*images)->signature == MagickCoreSignature);
1218 
1219  /* link previous pointer */
1220  replace=GetFirstImageInList(replace);
1221  replace->previous=(*images)->previous;
1222  if (replace->previous != (Image *) NULL)
1223  replace->previous->next=replace;
1224 
1225  /* link next pointer - set images position to last replacement image */
1226  replace=GetLastImageInList(replace);
1227  replace->next=(*images)->next;
1228  if (replace->next != (Image *) NULL)
1229  replace->next->previous=replace;
1230 
1231  /* destroy the replaced image that was in images */
1232  (void) DestroyImage(*images);
1233  (*images)=replace;
1234 }
1235 
1236 /*
1237 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1238 % %
1239 % %
1240 % %
1241 % R e v e r s e I m a g e L i s t %
1242 % %
1243 % %
1244 % %
1245 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1246 %
1247 % ReverseImageList() reverses the order of an image list.
1248 % The list pointer is reset to that start of the re-ordered list.
1249 %
1250 % The format of the ReverseImageList method is:
1251 %
1252 % void ReverseImageList(Image **images)
1253 %
1254 % A description of each parameter follows:
1255 %
1256 % o images: the image list.
1257 %
1258 */
1260 {
1261  Image
1262  *next;
1263 
1264  register Image
1265  *p;
1266 
1267  assert(images != (Image **) NULL);
1268  if ((*images) == (Image *) NULL)
1269  return;
1270  assert((*images)->signature == MagickCoreSignature);
1271  if ((*images)->debug != MagickFalse)
1273  (*images)->filename);
1274  for (p=(*images); p->next != (Image *) NULL; p=p->next) ;
1275  *images=p;
1276  for ( ; p != (Image *) NULL; p=p->next)
1277  {
1278  next=p->next;
1279  p->next=p->previous;
1280  p->previous=next;
1281  }
1282 }
1283 
1284 /*
1285 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1286 % %
1287 % %
1288 % %
1289 % S p l i c e I m a g e I n t o L i s t %
1290 % %
1291 % %
1292 % %
1293 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1294 %
1295 % SpliceImageIntoList() removes 'length' images from the list and replaces
1296 % them with the specified splice. Removed images are returned.
1297 %
1298 % The format of the SpliceImageIntoList method is:
1299 %
1300 % SpliceImageIntoList(Image **images,const size_t,
1301 % const Image *splice)
1302 %
1303 % A description of each parameter follows:
1304 %
1305 % o images: the image list.
1306 %
1307 % o length: the length of the image list to remove.
1308 %
1309 % o splice: Replace the removed image list with this list.
1310 %
1311 */
1313  const size_t length,const Image *splice)
1314 {
1315  Image
1316  *image,
1317  *split;
1318 
1319  register size_t
1320  i;
1321 
1322  assert(images != (Image **) NULL);
1323  assert(splice != (Image *) NULL);
1324  assert(splice->signature == MagickCoreSignature);
1325  if ((*images) == (Image *) NULL)
1326  return((Image *) NULL);
1327  assert((*images)->signature == MagickCoreSignature);
1328  if ((*images)->debug != MagickFalse)
1330  (*images)->filename);
1331  split=SplitImageList(*images);
1332  AppendImageToList(images,splice);
1333  image=(Image *) NULL;
1334  for (i=0; (i < length) && (split != (Image *) NULL); i++)
1335  AppendImageToList(&image,RemoveImageFromList(&split));
1336  AppendImageToList(images,split);
1337  return(image);
1338 }
1339 
1340 /*
1341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1342 % %
1343 % %
1344 % %
1345 % S p l i t I m a g e L i s t %
1346 % %
1347 % %
1348 % %
1349 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1350 %
1351 % SplitImageList() splits an image into two lists, after given image
1352 % The list that was split off is returned, which may be empty.
1353 %
1354 % The format of the SplitImageList method is:
1355 %
1356 % Image *SplitImageList(Image *images)
1357 %
1358 % A description of each parameter follows:
1359 %
1360 % o images: the image list.
1361 %
1362 */
1364 {
1365  if ((images == (Image *) NULL) || (images->next == (Image *) NULL))
1366  return((Image *) NULL);
1367  images=images->next;
1368  images->previous->next=(Image *) NULL;
1369  images->previous=(Image *) NULL;
1370  return(images);
1371 }
1372 
1373 /*
1374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1375 % %
1376 % %
1377 % %
1378 + S y n c I m a g e L i s t %
1379 % %
1380 % %
1381 % %
1382 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1383 %
1384 % SyncImageList() synchronizes the scene numbers in an image list.
1385 %
1386 % The format of the SyncImageList method is:
1387 %
1388 % void SyncImageList(Image *images)
1389 %
1390 % A description of each parameter follows:
1391 %
1392 % o images: the image list.
1393 %
1394 */
1396 {
1397  register Image
1398  *p,
1399  *q;
1400 
1401  if (images == (Image *) NULL)
1402  return;
1403  assert(images->signature == MagickCoreSignature);
1404  for (p=images; p != (Image *) NULL; p=p->next)
1405  {
1406  for (q=p->next; q != (Image *) NULL; q=q->next)
1407  if (p->scene == q->scene)
1408  break;
1409  if (q != (Image *) NULL)
1410  break;
1411  }
1412  if (p == (Image *) NULL)
1413  return;
1414  for (p=images->next; p != (Image *) NULL; p=p->next)
1415  p->scene=p->previous->scene+1;
1416 }
1417 
1418 /*
1419 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1420 % %
1421 % %
1422 % %
1423 + S y n c N e x t I m a g e I n L i s t %
1424 % %
1425 % %
1426 % %
1427 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1428 %
1429 % SyncNextImageInList() returns the next image in the list after the blob
1430 % referenced is synchronized with the current image.
1431 %
1432 % The format of the SyncNextImageInList method is:
1433 %
1434 % Image *SyncNextImageInList(const Image *images)
1435 %
1436 % A description of each parameter follows:
1437 %
1438 % o images: the image list.
1439 %
1440 */
1442 {
1443  if (images == (Image *) NULL)
1444  return((Image *) NULL);
1445  assert(images->signature == MagickCoreSignature);
1446  if (images->next == (Image *) NULL)
1447  return((Image *) NULL);
1448  if (images->blob != images->next->blob)
1449  {
1450  DestroyBlob(images->next);
1451  images->next->blob=ReferenceBlob(images->blob);
1452  }
1453  images->next->compression=images->compression;
1454  images->next->endian=images->endian;
1455  return(images->next);
1456 }
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:1046
EndianType endian
Definition: image.h:228
MagickExport void InsertImageInList(Image **images, Image *insert)
Definition: list.c:886
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:1312
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:787
#define MagickCoreSignature
MagickExport Image * GetFirstImageInList(const Image *images)
Definition: list.c:545
MagickExport Image * RemoveImageFromList(Image **images)
Definition: list.c:987
MagickBooleanType
Definition: magick-type.h:156
MagickExport Image * NewImageList(void)
Definition: list.c:922
size_t scene
Definition: image.h:240
MagickExport void ReplaceImageInListReturnLast(Image **images, Image *replace)
Definition: list.c:1208
MagickExport Image * SplitImageList(Image *images)
Definition: list.c:1363
MagickExport void * AcquireQuantumMemory(const size_t count, const size_t quantum)
Definition: memory.c:533
MagickExport Image * SyncNextImageInList(const Image *images)
Definition: list.c:1441
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:1064
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:721
MagickExport Image * DestroyImageList(Image *images)
Definition: list.c:446
MagickExport Image * RemoveLastImageFromList(Image **images)
Definition: list.c:1097
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:828
MagickExport void ReplaceImageInList(Image **images, Image *replace)
Definition: list.c:1150
MagickExport ssize_t GetImageIndexInList(const Image *images)
Definition: list.c:641
MagickExport Image * GetNextImageInList(const Image *images)
Definition: list.c:755
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:1395
MagickExport void * RelinquishMagickMemory(void *memory)
Definition: memory.c:1053
MagickExport BlobInfo * ReferenceBlob(BlobInfo *)
Definition: blob.c:4797
MagickExport void PrependImageToList(Image **images, Image *prepend)
Definition: list.c:951
#define MagickExport
MagickExport void DestroyBlob(Image *image)
Definition: blob.c:898
MagickExport void DeleteImageFromList(Image **images)
Definition: list.c:295
MagickExport size_t GetImageListLength(const Image *images)
Definition: list.c:680
MagickExport void ReverseImageList(Image **images)
Definition: list.c:1259
MagickExport Image * DestroyImage(Image *image)
Definition: image.c:1177
MagickExport Image * CloneImage(const Image *image, const size_t columns, const size_t rows, const MagickBooleanType detach, ExceptionInfo *exception)
Definition: image.c:794
MagickBooleanType debug
Definition: image.h:334