Home | History | Annotate | Download | only in coders

Lines Matching refs:image

17 %                   Read/Write Scanalytics IPLab Image Format                 %
52 #include "MagickCore/image.h"
53 #include "MagickCore/image-private.h"
85 WriteIPLImage(const ImageInfo *,Image *,ExceptionInfo *);
110 % IsIPL() returns MagickTrue if the image format type, identified by the
119 % o magick: compare image format pattern against these bytes.
144 % ReadIPLImage() reads a Scanalytics IPLab image file and returns it. It
145 % allocates the memory necessary for the new Image structure and returns a
146 % pointer to the new image.
149 % { t, z, c, y, x }. When we return the image, the latter three are folded
150 % into the standard "Image" structure. The "scenes" (image_info->scene)
156 % Image *ReadIPLImage(const ImageInfo *image_info,ExceptionInfo *exception)
160 % o image_info: The image info.
166 static void SetHeaderFromIPL(Image *image, IPLInfo *ipl){
167 image->columns = ipl->width;
168 image->rows = ipl->height;
169 image->depth = ipl->depth;
170 image->resolution.x = 1;
171 image->resolution.y = 1;
175 static Image *ReadIPLImage(const ImageInfo *image_info,ExceptionInfo *exception)
181 Image *image;
200 Open Image
210 image=AcquireImage(image_info,exception);
211 status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
214 image=DestroyImageList(image);
215 return((Image *) NULL);
219 Read IPL image
226 count=ReadBlob(image,4,magick);
229 image->endian=LSBEndian;
232 image->endian=MSBEndian;
238 count=ReadBlob(image, 8, magick);
242 count=ReadBlob(image,4,magick);
245 ipl_info.size=ReadBlobLong(image);
246 ipl_info.width=ReadBlobLong(image);
247 ipl_info.height=ReadBlobLong(image);
250 ipl_info.colors=ReadBlobLong(image);
251 if(ipl_info.colors == 3){ SetImageColorspace(image,sRGBColorspace,exception);}
252 else { image->colorspace = GRAYColorspace; }
253 ipl_info.z=ReadBlobLong(image);
254 ipl_info.time=ReadBlobLong(image);
256 ipl_info.byteType=ReadBlobLong(image);
300 Set number of scenes of image
303 SetHeaderFromIPL(image, &ipl_info);
308 (void) CloseBlob(image);
309 return(GetFirstImageInList(image));
311 length=image->columns;
312 quantum_type=GetQuantumType(image,exception);
315 SetHeaderFromIPL(image, &ipl_info);
318 if (image->scene >= (image_info->scene+image_info->number_scenes-1))
320 status=SetImageExtent(image,image->columns,image->rows,exception);
322 return(DestroyImageList(image));
325 image->depth);
327 quantum_info=AcquireQuantumInfo(image_info,image);
330 status=SetQuantumFormat(image,quantum_info,quantum_format);
334 if(image->columns != ipl_info.width){
337 (double) ipl_info.width, (double) image->columns);
346 for(y = 0; y < (ssize_t) image->rows; y++){
347 (void) ReadBlob(image, length*image->depth/8, pixels);
348 q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
351 (void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
353 if (SyncAuthenticPixels(image,exception) == MagickFalse)
358 for(y = 0; y < (ssize_t) image->rows; y++){
359 (void) ReadBlob(image, length*image->depth/8, pixels);
360 q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
363 (void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
365 if (SyncAuthenticPixels(image,exception) == MagickFalse)
368 for(y = 0; y < (ssize_t) image->rows; y++){
369 (void) ReadBlob(image, length*image->depth/8, pixels);
370 q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
373 (void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
375 if (SyncAuthenticPixels(image,exception) == MagickFalse)
378 for(y = 0; y < (ssize_t) image->rows; y++){
379 (void) ReadBlob(image, length*image->depth/8, pixels);
380 q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
383 (void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
385 if (SyncAuthenticPixels(image,exception) == MagickFalse)
389 SetQuantumImageType(image,quantum_type);
394 if (EOFBlob(image) != MagickFalse)
397 image->filename);
402 Proceed to next image.
404 AcquireNextImage(image_info,image,exception);
405 if (GetNextImageInList(image) == (Image *) NULL)
407 image=DestroyImageList(image);
408 return((Image *) NULL);
410 image=SyncNextImageInList(image);
411 status=SetImageProgress(image,LoadImagesTag,TellBlob(image),
412 GetBlobSize(image));
417 CloseBlob(image);
418 return(GetFirstImageInList(image));
432 % RegisterIPLImage() add attributes for the Scanalytics IPL image format to the
442 entry=AcquireMagickInfo("IPL","IPL","IPL Image Sequence");
486 % WriteIPLImage() writes an image to a file in Scanalytics IPLabimage format.
490 % MagickBooleanType WriteIPLImage(const ImageInfo *image_info,Image *image)
491 % Image *image,ExceptionInfo *exception)
495 % o image_info: The image info.
497 % o image: The image.
502 static MagickBooleanType WriteIPLImage(const ImageInfo *image_info,Image *image,
527 Open output image file.
531 assert(image != (Image *) NULL);
532 assert(image->signature == MagickCoreSignature);
533 if (image->debug != MagickFalse)
534 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
537 status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
543 quantum_info=AcquireQuantumInfo(image_info,image);
545 (IsHighDynamicRangeImage(image,exception) != MagickFalse))
546 SetQuantumFormat(image,quantum_info,FloatingPointQuantumFormat);
575 ipl_info.z = (unsigned int) GetImageListLength(image);
578 ipl_info.width = (unsigned int) image->columns;
579 ipl_info.height = (unsigned int) image->rows;
580 (void) TransformImageColorspace(image,sRGBColorspace,exception);
581 if(IssRGBCompatibleColorspace(image->colorspace) != MagickFalse) { ipl_info.colors = 3; }
585 ((image->depth)/8)*ipl_info.height*ipl_info.width*ipl_info.colors*ipl_info.z);
597 (void) WriteBlob(image, 4, (const unsigned char *) "mmmm");
599 image->endian = LSBEndian;
600 (void) WriteBlob(image, 4, (const unsigned char *) "iiii");
602 (void) WriteBlobLong(image, 4);
603 (void) WriteBlob(image, 4, (const unsigned char *) "100f");
604 (void) WriteBlob(image, 4, (const unsigned char *) "data");
605 (void) WriteBlobLong(image, ipl_info.size);
606 (void) WriteBlobLong(image, ipl_info.width);
607 (void) WriteBlobLong(image, ipl_info.height);
608 (void) WriteBlobLong(image, ipl_info.colors);
610 (void) WriteBlobLong(image, 1);
612 (void) WriteBlobLong(image, ipl_info.z);
613 (void) WriteBlobLong(image, ipl_info.time);
614 (void) WriteBlobLong(image, ipl_info.byteType);
625 p=GetVirtualPixels(image,0,y,image->columns,1,exception);
628 (void) ExportQuantumPixels(image,(CacheView *) NULL, quantum_info,
630 (void) WriteBlob(image, image->columns*image->depth/8, pixels);
637 p=GetVirtualPixels(image,0,y,image->columns,1,exception);
640 (void) ExportQuantumPixels(image,(CacheView *) NULL, quantum_info,
642 (void) WriteBlob(image, image->columns*image->depth/8, pixels);
647 p=GetVirtualPixels(image,0,y,image->columns,1,exception);
650 (void) ExportQuantumPixels(image,(CacheView *) NULL, quantum_info,
652 (void) WriteBlob(image, image->columns*image->depth/8, pixels);
656 p=GetVirtualPixels(image,0,y,image->columns,1,exception);
659 (void) ExportQuantumPixels(image,(CacheView *) NULL, quantum_info,
661 (void) WriteBlob(image, image->columns*image->depth/8, pixels);
662 if (image->previous == (Image *) NULL)
664 status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
665 image->rows);
672 if (GetNextImageInList(image) == (Image *) NULL)
674 image=SyncNextImageInList(image);
675 status=SetImageProgress(image,SaveImagesTag,scene++,
676 GetImageListLength(image));
681 (void) WriteBlob(image, 4, (const unsigned char *) "fini");
682 (void) WriteBlobLong(image, 0);
684 CloseBlob(image);