1 /* 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3 % % 4 % % 5 % % 6 % DDDD N N GGGG % 7 % D D NN N GS % 8 % D D N N N G GG % 9 % D D N NN G G % 10 % DDDD N N GGGG % 11 % % 12 % % 13 % Read the Digital Negative Image Format % 14 % % 15 % Software Design % 16 % Cristy % 17 % July 1999 % 18 % % 19 % % 20 % Copyright 1999-2019 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://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 Include declarations. 40 */ 41 #include "MagickCore/studio.h" 42 #include "MagickCore/blob.h" 43 #include "MagickCore/blob-private.h" 44 #include "MagickCore/constitute.h" 45 #include "MagickCore/delegate.h" 46 #include "MagickCore/exception.h" 47 #include "MagickCore/exception-private.h" 48 #include "MagickCore/geometry.h" 49 #include "MagickCore/image.h" 50 #include "MagickCore/image-private.h" 51 #include "MagickCore/layer.h" 52 #include "MagickCore/list.h" 53 #include "MagickCore/log.h" 54 #include "MagickCore/magick.h" 55 #include "MagickCore/memory_.h" 56 #include "MagickCore/monitor.h" 57 #include "MagickCore/monitor-private.h" 58 #include "MagickCore/opencl.h" 59 #include "MagickCore/pixel-accessor.h" 60 #include "MagickCore/profile.h" 61 #include "MagickCore/property.h" 62 #include "MagickCore/quantum-private.h" 63 #include "MagickCore/resource_.h" 64 #include "MagickCore/static.h" 65 #include "MagickCore/string_.h" 66 #include "MagickCore/module.h" 67 #include "MagickCore/transform.h" 68 #include "MagickCore/utility.h" 69 #include "MagickCore/xml-tree.h" 70 #include "MagickCore/xml-tree-private.h" 71 #if defined(MAGICKCORE_RAW_R_DELEGATE) 72 #include <libraw.h> 73 #endif 74 75 /* 77 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 78 % % 79 % % 80 % % 81 % R e a d D N G I m a g e % 82 % % 83 % % 84 % % 85 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 86 % 87 % ReadDNGImage() reads an binary file in the Digital Negative format and 88 % returns it. It allocates the memory necessary for the new Image structure 89 % and returns a pointer to the new image. 90 % 91 % The format of the ReadDNGImage method is: 92 % 93 % Image *ReadDNGImage(const ImageInfo *image_info, 94 % ExceptionInfo *exception) 95 % 96 % A description of each parameter follows: 97 % 98 % o image_info: the image info. 99 % 100 % o exception: return any errors or warnings in this structure. 101 % 102 */ 103 104 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(MAGICKCORE_OPENCL_SUPPORT) 105 static void InitializeDcrawOpenCL(ExceptionInfo *exception) 106 { 107 MagickBooleanType 108 opencl_disabled; 109 110 MagickCLDevice 111 *devices; 112 113 size_t 114 length; 115 116 ssize_t 117 i; 118 119 (void) SetEnvironmentVariable("DCR_CL_PLATFORM",NULL); 120 (void) SetEnvironmentVariable("DCR_CL_DEVICE",NULL); 121 (void) SetEnvironmentVariable("DCR_CL_DISABLED",NULL); 122 if (GetOpenCLEnabled() == MagickFalse) 123 { 124 (void) SetEnvironmentVariable("DCR_CL_DISABLED","1"); 125 return; 126 } 127 devices=GetOpenCLDevices(&length,exception); 128 if (devices == (MagickCLDevice *) NULL) 129 return; 130 for (i=0; i < (ssize_t) length; i++) 131 { 132 const char 133 *name; 134 135 MagickCLDevice 136 device; 137 138 device=devices[i]; 139 if (GetOpenCLDeviceEnabled(device) == MagickFalse) 140 continue; 141 name=GetOpenCLDeviceVendorName(device); 142 if (name != (const char *) NULL) 143 (void) SetEnvironmentVariable("DCR_CL_PLATFORM",name); 144 name=GetOpenCLDeviceName(device); 145 if (name != (const char *) NULL) 146 (void) SetEnvironmentVariable("DCR_CL_DEVICE",name); 147 return; 148 } 149 } 150 #else 151 static void InitializeDcrawOpenCL(ExceptionInfo *magick_unused(exception)) 152 { 153 magick_unreferenced(exception); 154 #if defined(MAGICKCORE_WINDOWS_SUPPORT) 155 (void) SetEnvironmentVariable("DCR_CL_DISABLED","1"); 156 #endif 157 } 158 #endif 159 160 #if defined(MAGICKCORE_RAW_R_DELEGATE) 161 static void SetDNGProperties(Image *image,const libraw_data_t *raw_info, 162 ExceptionInfo *exception) 163 { 164 char 165 property[MagickPathExtent], 166 timestamp[MagickPathExtent]; 167 168 (void) SetImageProperty(image,"dng:make",raw_info->idata.make,exception); 169 (void) SetImageProperty(image,"dng:camera.model.name",raw_info->idata.model, 170 exception); 171 (void) FormatMagickTime(raw_info->other.timestamp,MagickPathExtent,timestamp); 172 (void) SetImageProperty(image,"dng:create.date",timestamp,exception); 173 (void) FormatLocaleString(property,MagickPathExtent,"%0.1f", 174 raw_info->other.iso_speed); 175 (void) SetImageProperty(image,"dng:iso.setting",property,exception); 176 #if LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0,18) 177 (void) SetImageProperty(image,"dng:software",raw_info->idata.software, 178 exception); 179 if (*raw_info->shootinginfo.BodySerial != '\0') 180 (void) SetImageProperty(image,"dng:serial.number", 181 raw_info->shootinginfo.BodySerial,exception); 182 (void) FormatLocaleString(property,MagickPathExtent,"%0.2f", 183 raw_info->other.FlashEC); 184 (void) SetImageProperty(image,"dng:flash.exposure.compensation",property, 185 exception); 186 (void) FormatLocaleString(property,MagickPathExtent,"1/%0.1f", 187 1.0/raw_info->other.shutter); 188 (void) SetImageProperty(image,"dng:exposure.time",property,exception); 189 (void) FormatLocaleString(property,MagickPathExtent,"%0.1f", 190 raw_info->other.aperture); 191 (void) SetImageProperty(image,"dng:f.number",property,exception); 192 (void) FormatLocaleString(property,MagickPathExtent,"%0.1f", 193 raw_info->lens.EXIF_MaxAp); 194 (void) SetImageProperty(image,"dng:max.aperture.value",property,exception); 195 (void) FormatLocaleString(property,MagickPathExtent,"%0.1f", 196 raw_info->other.focal_len); 197 (void) SetImageProperty(image,"dng:focal.length",property,exception); 198 (void) FormatLocaleString(property,MagickPathExtent,"%f %f %f %f", 199 raw_info->color.cam_mul[0],raw_info->color.cam_mul[2], 200 raw_info->color.cam_mul[1],raw_info->color.cam_mul[3]); 201 (void) SetImageProperty(image,"dng:wb.rb.levels",property,exception); 202 (void) SetImageProperty(image,"dng:lens.type", 203 raw_info->lens.makernotes.LensFeatures_suf,exception); 204 (void) FormatLocaleString(property,MagickPathExtent, 205 "%0.1f-%0.1fmm f/%0.1f-%0.1f",raw_info->lens.makernotes.MinFocal, 206 raw_info->lens.makernotes.MaxFocal,raw_info->lens.makernotes.MaxAp4MinFocal, 207 raw_info->lens.makernotes.MaxAp4MaxFocal); 208 (void) SetImageProperty(image,"dng:lens",property,exception); 209 (void) FormatLocaleString(property,MagickPathExtent,"%0.2f", 210 raw_info->lens.makernotes.LensFStops); 211 (void) SetImageProperty(image,"dng:lens.f.stops",property,exception); 212 (void) FormatLocaleString(property,MagickPathExtent,"%0.1f mm", 213 raw_info->lens.makernotes.MinFocal); 214 (void) SetImageProperty(image,"dng:min.focal.length",property,exception); 215 (void) FormatLocaleString(property,MagickPathExtent,"%0.1f mm", 216 raw_info->lens.makernotes.MaxFocal); 217 (void) SetImageProperty(image,"dng:max.focal.length",property,exception); 218 (void) FormatLocaleString(property,MagickPathExtent,"%0.1f", 219 raw_info->lens.makernotes.MaxAp4MinFocal); 220 (void) SetImageProperty(image,"dng:max.aperture.at.min.focal",property, 221 exception); 222 (void) FormatLocaleString(property,MagickPathExtent,"%0.1f", 223 raw_info->lens.makernotes.MaxAp4MaxFocal); 224 (void) SetImageProperty(image,"dng:max.aperture.at.max.focal",property, 225 exception); 226 (void) FormatLocaleString(property,MagickPathExtent,"%d mm", 227 raw_info->lens.FocalLengthIn35mmFormat); 228 (void) SetImageProperty(image,"dng:focal.length.in.35mm.format",property, 229 exception); 230 #endif 231 } 232 #endif 233 234 static Image *InvokeDNGDelegate(const ImageInfo *image_info,Image *image, 235 ExceptionInfo *exception) 236 { 237 ExceptionInfo 238 *sans_exception; 239 240 ImageInfo 241 *read_info; 242 243 /* 244 Convert DNG to PPM with delegate. 245 */ 246 (void) DestroyImageList(image); 247 InitializeDcrawOpenCL(exception); 248 image=AcquireImage(image_info,exception); 249 read_info=CloneImageInfo(image_info); 250 SetImageInfoBlob(read_info,(void *) NULL,0); 251 (void) InvokeDelegate(read_info,image,"dng:decode",(char *) NULL,exception); 252 image=DestroyImage(image); 253 (void) FormatLocaleString(read_info->filename,MagickPathExtent,"%s.png", 254 read_info->unique); 255 sans_exception=AcquireExceptionInfo(); 256 image=ReadImage(read_info,sans_exception); 257 sans_exception=DestroyExceptionInfo(sans_exception); 258 if (image == (Image *) NULL) 259 { 260 (void) FormatLocaleString(read_info->filename,MagickPathExtent,"%s.ppm", 261 read_info->unique); 262 image=ReadImage(read_info,exception); 263 } 264 (void) RelinquishUniqueFileResource(read_info->filename); 265 if (image != (Image *) NULL) 266 { 267 char 268 filename[MagickPathExtent], 269 *xml; 270 271 ExceptionInfo 272 *sans; 273 274 (void) CopyMagickString(image->magick,read_info->magick, 275 MagickPathExtent); 276 (void) FormatLocaleString(filename,MagickPathExtent,"%s.ufraw", 277 read_info->unique); 278 sans=AcquireExceptionInfo(); 279 xml=FileToString(filename,MagickPathExtent,sans); 280 (void) RelinquishUniqueFileResource(filename); 281 if (xml != (char *) NULL) 282 { 283 XMLTreeInfo 284 *ufraw; 285 286 /* 287 Inject. 288 */ 289 ufraw=NewXMLTree(xml,sans); 290 if (ufraw != (XMLTreeInfo *) NULL) 291 { 292 char 293 *content, 294 property[MagickPathExtent]; 295 296 const char 297 *tag; 298 299 XMLTreeInfo 300 *next; 301 302 if (image->properties == (void *) NULL) 303 image->properties=NewSplayTree(CompareSplayTreeString, 304 RelinquishMagickMemory,RelinquishMagickMemory); 305 next=GetXMLTreeChild(ufraw,(const char *) NULL); 306 while (next != (XMLTreeInfo *) NULL) 307 { 308 tag=GetXMLTreeTag(next); 309 if (tag == (char *) NULL) 310 tag="unknown"; 311 (void) FormatLocaleString(property,MagickPathExtent,"dng:%s", 312 tag); 313 content=ConstantString(GetXMLTreeContent(next)); 314 StripString(content); 315 if ((LocaleCompare(tag,"log") != 0) && 316 (LocaleCompare(tag,"InputFilename") != 0) && 317 (LocaleCompare(tag,"OutputFilename") != 0) && 318 (LocaleCompare(tag,"OutputType") != 0) && 319 (strlen(content) != 0)) 320 (void) AddValueToSplayTree((SplayTreeInfo *) 321 image->properties,ConstantString(property),content); 322 next=GetXMLTreeSibling(next); 323 } 324 ufraw=DestroyXMLTree(ufraw); 325 } 326 xml=DestroyString(xml); 327 } 328 sans=DestroyExceptionInfo(sans); 329 } 330 read_info=DestroyImageInfo(read_info); 331 return(image); 332 } 333 334 static Image *ReadDNGImage(const ImageInfo *image_info,ExceptionInfo *exception) 335 { 336 Image 337 *image; 338 339 MagickBooleanType 340 status; 341 342 /* 343 Open image file. 344 */ 345 assert(image_info != (const ImageInfo *) NULL); 346 assert(image_info->signature == MagickCoreSignature); 347 if (image_info->debug != MagickFalse) 348 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", 349 image_info->filename); 350 assert(exception != (ExceptionInfo *) NULL); 351 assert(exception->signature == MagickCoreSignature); 352 image=AcquireImage(image_info,exception); 353 status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); 354 if (status == MagickFalse) 355 { 356 image=DestroyImageList(image); 357 return((Image *) NULL); 358 } 359 (void) CloseBlob(image); 360 if (LocaleCompare(image_info->magick,"DCRAW") == 0) 361 return(InvokeDNGDelegate(image_info,image,exception)); 362 #if defined(MAGICKCORE_RAW_R_DELEGATE) 363 { 364 int 365 errcode; 366 367 libraw_data_t 368 *raw_info; 369 370 libraw_processed_image_t 371 *raw_image; 372 373 register ssize_t 374 y; 375 376 StringInfo 377 *profile; 378 379 unsigned short 380 *p; 381 382 errcode=0; 383 raw_info=libraw_init(0); 384 if (raw_info == (libraw_data_t *) NULL) 385 { 386 (void) ThrowMagickException(exception,GetMagickModule(),CoderError, 387 libraw_strerror(errcode),"`%s'",image->filename); 388 libraw_close(raw_info); 389 return(DestroyImageList(image)); 390 } 391 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && defined(_MSC_VER) && (_MSC_VER > 1310) 392 { 393 wchar_t 394 fileName[MagickPathExtent]; 395 396 MultiByteToWideChar(CP_UTF8,0,image->filename,-1,fileName, 397 MagickPathExtent); 398 errcode=libraw_open_wfile(raw_info,fileName); 399 } 400 #else 401 errcode=libraw_open_file(raw_info,image->filename); 402 #endif 403 if (errcode != LIBRAW_SUCCESS) 404 { 405 (void) ThrowMagickException(exception,GetMagickModule(),CoderError, 406 libraw_strerror(errcode),"`%s'",image->filename); 407 libraw_close(raw_info); 408 return(DestroyImageList(image)); 409 } 410 image->columns=raw_info->sizes.width; 411 image->rows=raw_info->sizes.height; 412 image->page.width=raw_info->sizes.raw_width; 413 image->page.height=raw_info->sizes.raw_height; 414 image->page.x=raw_info->sizes.left_margin; 415 image->page.y=raw_info->sizes.top_margin; 416 if (image_info->ping != MagickFalse) 417 { 418 libraw_close(raw_info); 419 return(image); 420 } 421 status=SetImageExtent(image,image->columns,image->rows,exception); 422 if (status == MagickFalse) 423 { 424 libraw_close(raw_info); 425 return(image); 426 } 427 errcode=libraw_unpack(raw_info); 428 if (errcode != LIBRAW_SUCCESS) 429 { 430 (void) ThrowMagickException(exception,GetMagickModule(),CoderError, 431 libraw_strerror(errcode),"`%s'",image->filename); 432 libraw_close(raw_info); 433 return(DestroyImageList(image)); 434 } 435 raw_info->params.output_bps=16; 436 errcode=libraw_dcraw_process(raw_info); 437 if (errcode != LIBRAW_SUCCESS) 438 { 439 (void) ThrowMagickException(exception,GetMagickModule(),CoderError, 440 libraw_strerror(errcode),"`%s'",image->filename); 441 libraw_close(raw_info); 442 return(DestroyImageList(image)); 443 } 444 raw_image=libraw_dcraw_make_mem_image(raw_info,&errcode); 445 if ((errcode != LIBRAW_SUCCESS) || 446 (raw_image == (libraw_processed_image_t *) NULL) || 447 (raw_image->type != LIBRAW_IMAGE_BITMAP) || (raw_image->bits != 16) || 448 (raw_image->colors < 3) || (raw_image->colors > 4)) 449 { 450 if (raw_image != (libraw_processed_image_t *) NULL) 451 libraw_dcraw_clear_mem(raw_image); 452 (void) ThrowMagickException(exception,GetMagickModule(),CoderError, 453 libraw_strerror(errcode),"`%s'",image->filename); 454 libraw_close(raw_info); 455 return(DestroyImageList(image)); 456 } 457 image->columns=raw_image->width; 458 image->rows=raw_image->height; 459 image->depth=raw_image->bits; 460 status=SetImageExtent(image,image->columns,image->rows,exception); 461 if (status == MagickFalse) 462 { 463 libraw_dcraw_clear_mem(raw_image); 464 libraw_close(raw_info); 465 return(DestroyImageList(image)); 466 } 467 p=(unsigned short *) raw_image->data; 468 for (y=0; y < (ssize_t) image->rows; y++) 469 { 470 register Quantum 471 *q; 472 473 register ssize_t 474 x; 475 476 q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); 477 if (q == (Quantum *) NULL) 478 break; 479 for (x=0; x < (ssize_t) image->columns; x++) 480 { 481 SetPixelRed(image,ScaleShortToQuantum(*p++),q); 482 SetPixelGreen(image,ScaleShortToQuantum(*p++),q); 483 SetPixelBlue(image,ScaleShortToQuantum(*p++),q); 484 if (raw_image->colors > 3) 485 SetPixelAlpha(image,ScaleShortToQuantum(*p++),q); 486 q+=GetPixelChannels(image); 487 } 488 if (SyncAuthenticPixels(image,exception) == MagickFalse) 489 break; 490 if (image->previous == (Image *) NULL) 491 { 492 status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, 493 image->rows); 494 if (status == MagickFalse) 495 break; 496 } 497 } 498 libraw_dcraw_clear_mem(raw_image); 499 /* 500 Set DNG image metadata. 501 */ 502 if (raw_info->color.profile != NULL) 503 { 504 profile=BlobToStringInfo(raw_info->color.profile, 505 raw_info->color.profile_length); 506 if (profile != (StringInfo *) NULL) 507 { 508 SetImageProfile(image,"ICC",profile,exception); 509 profile=DestroyStringInfo(profile); 510 } 511 } 512 #if LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0,18) 513 if (raw_info->idata.xmpdata != NULL) 514 { 515 profile=BlobToStringInfo(raw_info->idata.xmpdata, 516 raw_info->idata.xmplen); 517 if (profile != (StringInfo *) NULL) 518 { 519 SetImageProfile(image,"XMP",profile,exception); 520 profile=DestroyStringInfo(profile); 521 } 522 } 523 #endif 524 SetDNGProperties(image,raw_info,exception); 525 libraw_close(raw_info); 526 return(image); 527 } 528 #else 529 return(InvokeDNGDelegate(image_info,image,exception)); 530 #endif 531 } 532 533 /* 535 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 536 % % 537 % % 538 % % 539 % R e g i s t e r D N G I m a g e % 540 % % 541 % % 542 % % 543 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 544 % 545 % RegisterDNGImage() adds attributes for the DNG image format to 546 % the list of supported formats. The attributes include the image format 547 % tag, a method to read and/or write the format, whether the format 548 % supports the saving of more than one frame to the same file or blob, 549 % whether the format supports native in-memory I/O, and a brief 550 % description of the format. 551 % 552 % The format of the RegisterDNGImage method is: 553 % 554 % size_t RegisterDNGImage(void) 555 % 556 */ 557 ModuleExport size_t RegisterDNGImage(void) 558 { 559 MagickInfo 560 *entry; 561 562 entry=AcquireMagickInfo("DNG","3FR","Hasselblad CFV/H3D39II"); 563 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 564 entry->flags|=CoderDecoderSeekableStreamFlag; 565 entry->flags^=CoderBlobSupportFlag; 566 entry->format_type=ExplicitFormatType; 567 (void) RegisterMagickInfo(entry); 568 entry=AcquireMagickInfo("DNG","ARW","Sony Alpha Raw Image Format"); 569 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 570 entry->flags|=CoderDecoderSeekableStreamFlag; 571 entry->flags^=CoderBlobSupportFlag; 572 entry->format_type=ExplicitFormatType; 573 (void) RegisterMagickInfo(entry); 574 entry=AcquireMagickInfo("DNG","DNG","Digital Negative"); 575 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 576 entry->flags|=CoderDecoderSeekableStreamFlag; 577 entry->flags^=CoderBlobSupportFlag; 578 entry->format_type=ExplicitFormatType; 579 (void) RegisterMagickInfo(entry); 580 entry=AcquireMagickInfo("DNG","CR2","Canon Digital Camera Raw Image Format"); 581 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 582 entry->flags|=CoderDecoderSeekableStreamFlag; 583 entry->flags^=CoderBlobSupportFlag; 584 entry->format_type=ExplicitFormatType; 585 (void) RegisterMagickInfo(entry); 586 entry=AcquireMagickInfo("DNG","CRW","Canon Digital Camera Raw Image Format"); 587 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 588 entry->flags|=CoderDecoderSeekableStreamFlag; 589 entry->flags^=CoderBlobSupportFlag; 590 entry->format_type=ExplicitFormatType; 591 (void) RegisterMagickInfo(entry); 592 entry=AcquireMagickInfo("DNG","DCR","Kodak Digital Camera Raw Image File"); 593 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 594 entry->flags|=CoderDecoderSeekableStreamFlag; 595 entry->flags^=CoderBlobSupportFlag; 596 entry->format_type=ExplicitFormatType; 597 (void) RegisterMagickInfo(entry); 598 entry=AcquireMagickInfo("DNG","DCRAW","Raw Photo Decoder (dcraw)"); 599 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 600 entry->flags|=CoderDecoderSeekableStreamFlag; 601 entry->flags^=CoderBlobSupportFlag; 602 entry->format_type=ExplicitFormatType; 603 (void) RegisterMagickInfo(entry); 604 entry=AcquireMagickInfo("DNG","ERF","Epson RAW Format"); 605 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 606 entry->flags|=CoderDecoderSeekableStreamFlag; 607 entry->flags^=CoderBlobSupportFlag; 608 entry->format_type=ExplicitFormatType; 609 (void) RegisterMagickInfo(entry); 610 entry=AcquireMagickInfo("DNG","IIQ","Phase One Raw Image Format"); 611 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 612 entry->flags|=CoderDecoderSeekableStreamFlag; 613 entry->flags^=CoderBlobSupportFlag; 614 entry->format_type=ExplicitFormatType; 615 (void) RegisterMagickInfo(entry); 616 entry=AcquireMagickInfo("DNG","KDC","Kodak Digital Camera Raw Image Format"); 617 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 618 entry->flags|=CoderDecoderSeekableStreamFlag; 619 entry->flags^=CoderBlobSupportFlag; 620 entry->format_type=ExplicitFormatType; 621 (void) RegisterMagickInfo(entry); 622 entry=AcquireMagickInfo("DNG","K25","Kodak Digital Camera Raw Image Format"); 623 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 624 entry->flags|=CoderDecoderSeekableStreamFlag; 625 entry->flags^=CoderBlobSupportFlag; 626 entry->format_type=ExplicitFormatType; 627 (void) RegisterMagickInfo(entry); 628 entry=AcquireMagickInfo("DNG","MEF","Mamiya Raw Image File"); 629 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 630 entry->flags|=CoderDecoderSeekableStreamFlag; 631 entry->flags^=CoderBlobSupportFlag; 632 entry->format_type=ExplicitFormatType; 633 (void) RegisterMagickInfo(entry); 634 entry=AcquireMagickInfo("DNG","MRW","Sony (Minolta) Raw Image File"); 635 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 636 entry->flags|=CoderDecoderSeekableStreamFlag; 637 entry->flags^=CoderBlobSupportFlag; 638 entry->format_type=ExplicitFormatType; 639 (void) RegisterMagickInfo(entry); 640 entry=AcquireMagickInfo("DNG","NEF", 641 "Nikon Digital SLR Camera Raw Image File"); 642 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 643 entry->flags|=CoderDecoderSeekableStreamFlag; 644 entry->flags^=CoderBlobSupportFlag; 645 entry->format_type=ExplicitFormatType; 646 (void) RegisterMagickInfo(entry); 647 entry=AcquireMagickInfo("DNG","NRW", 648 "Nikon Digital SLR Camera Raw Image File"); 649 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 650 entry->flags|=CoderDecoderSeekableStreamFlag; 651 entry->flags^=CoderBlobSupportFlag; 652 entry->format_type=ExplicitFormatType; 653 (void) RegisterMagickInfo(entry); 654 entry=AcquireMagickInfo("DNG","ORF","Olympus Digital Camera Raw Image File"); 655 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 656 entry->flags|=CoderDecoderSeekableStreamFlag; 657 entry->flags^=CoderBlobSupportFlag; 658 entry->format_type=ExplicitFormatType; 659 (void) RegisterMagickInfo(entry); 660 entry=AcquireMagickInfo("DNG","PEF","Pentax Electronic File"); 661 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 662 entry->flags|=CoderDecoderSeekableStreamFlag; 663 entry->flags^=CoderBlobSupportFlag; 664 entry->format_type=ExplicitFormatType; 665 (void) RegisterMagickInfo(entry); 666 entry=AcquireMagickInfo("DNG","RAF","Fuji CCD-RAW Graphic File"); 667 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 668 entry->flags|=CoderDecoderSeekableStreamFlag; 669 entry->flags^=CoderBlobSupportFlag; 670 entry->format_type=ExplicitFormatType; 671 (void) RegisterMagickInfo(entry); 672 entry=AcquireMagickInfo("DNG","RAW","Raw"); 673 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 674 entry->flags|=CoderDecoderSeekableStreamFlag; 675 entry->flags^=CoderBlobSupportFlag; 676 entry->format_type=ExplicitFormatType; 677 (void) RegisterMagickInfo(entry); 678 entry=AcquireMagickInfo("DNG","RMF","Raw Media Format"); 679 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 680 entry->flags|=CoderDecoderSeekableStreamFlag; 681 entry->flags^=CoderBlobSupportFlag; 682 entry->format_type=ExplicitFormatType; 683 (void) RegisterMagickInfo(entry); 684 entry=AcquireMagickInfo("DNG","RW2","Panasonic Lumix Raw Image"); 685 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 686 entry->flags|=CoderDecoderSeekableStreamFlag; 687 entry->flags^=CoderBlobSupportFlag; 688 entry->format_type=ExplicitFormatType; 689 (void) RegisterMagickInfo(entry); 690 entry=AcquireMagickInfo("DNG","SRF","Sony Raw Format"); 691 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 692 entry->flags|=CoderDecoderSeekableStreamFlag; 693 entry->flags^=CoderBlobSupportFlag; 694 entry->format_type=ExplicitFormatType; 695 (void) RegisterMagickInfo(entry); 696 entry=AcquireMagickInfo("DNG","SR2","Sony Raw Format 2"); 697 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 698 entry->flags|=CoderDecoderSeekableStreamFlag; 699 entry->flags^=CoderBlobSupportFlag; 700 entry->format_type=ExplicitFormatType; 701 (void) RegisterMagickInfo(entry); 702 entry=AcquireMagickInfo("DNG","X3F","Sigma Camera RAW Picture File"); 703 entry->decoder=(DecodeImageHandler *) ReadDNGImage; 704 entry->flags|=CoderDecoderSeekableStreamFlag; 705 entry->flags^=CoderBlobSupportFlag; 706 entry->format_type=ExplicitFormatType; 707 (void) RegisterMagickInfo(entry); 708 return(MagickImageCoderSignature); 709 } 710 711 /* 713 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 714 % % 715 % % 716 % % 717 % U n r e g i s t e r D N G I m a g e % 718 % % 719 % % 720 % % 721 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 722 % 723 % UnregisterDNGImage() removes format registrations made by the 724 % BIM module from the list of supported formats. 725 % 726 % The format of the UnregisterBIMImage method is: 727 % 728 % UnregisterDNGImage(void) 729 % 730 */ 731 ModuleExport void UnregisterDNGImage(void) 732 { 733 (void) UnregisterMagickInfo("X3F"); 734 (void) UnregisterMagickInfo("SR2"); 735 (void) UnregisterMagickInfo("SRF"); 736 (void) UnregisterMagickInfo("RW2"); 737 (void) UnregisterMagickInfo("RMF"); 738 (void) UnregisterMagickInfo("RAF"); 739 (void) UnregisterMagickInfo("PEF"); 740 (void) UnregisterMagickInfo("ORF"); 741 (void) UnregisterMagickInfo("NRW"); 742 (void) UnregisterMagickInfo("NEF"); 743 (void) UnregisterMagickInfo("MRW"); 744 (void) UnregisterMagickInfo("MEF"); 745 (void) UnregisterMagickInfo("K25"); 746 (void) UnregisterMagickInfo("KDC"); 747 (void) UnregisterMagickInfo("IIQ"); 748 (void) UnregisterMagickInfo("ERF"); 749 (void) UnregisterMagickInfo("DCR"); 750 (void) UnregisterMagickInfo("CRW"); 751 (void) UnregisterMagickInfo("CR2"); 752 (void) UnregisterMagickInfo("DNG"); 753 (void) UnregisterMagickInfo("ARW"); 754 (void) UnregisterMagickInfo("3FR"); 755 } 756