cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 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 % |
cristy | de984cd | 2013-12-01 14:49:27 +0000 | [diff] [blame] | 16 | % Cristy % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 17 | % July 1999 % |
| 18 | % % |
| 19 | % % |
Cristy | 7ce65e7 | 2015-12-12 18:03:16 -0500 | [diff] [blame] | 20 | % Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization % |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 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 | % http://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 | Include declarations. |
| 40 | */ |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 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/resource_.h" |
| 57 | #include "MagickCore/quantum-private.h" |
| 58 | #include "MagickCore/static.h" |
| 59 | #include "MagickCore/string_.h" |
| 60 | #include "MagickCore/module.h" |
| 61 | #include "MagickCore/transform.h" |
| 62 | #include "MagickCore/utility.h" |
| 63 | #include "MagickCore/xml-tree.h" |
cristy | 433d118 | 2011-09-04 13:38:52 +0000 | [diff] [blame] | 64 | #include "MagickCore/xml-tree-private.h" |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 65 | |
| 66 | /* |
| 67 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 68 | % % |
| 69 | % % |
| 70 | % % |
| 71 | % R e a d D N G I m a g e % |
| 72 | % % |
| 73 | % % |
| 74 | % % |
| 75 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 76 | % |
| 77 | % ReadDNGImage() reads an binary file in the Digital Negative format and |
| 78 | % returns it. It allocates the memory necessary for the new Image structure |
| 79 | % and returns a pointer to the new image. |
| 80 | % |
| 81 | % The format of the ReadDNGImage method is: |
| 82 | % |
| 83 | % Image *ReadDNGImage(const ImageInfo *image_info, |
| 84 | % ExceptionInfo *exception) |
| 85 | % |
| 86 | % A description of each parameter follows: |
| 87 | % |
| 88 | % o image_info: the image info. |
| 89 | % |
| 90 | % o exception: return any errors or warnings in this structure. |
| 91 | % |
| 92 | */ |
| 93 | static Image *ReadDNGImage(const ImageInfo *image_info,ExceptionInfo *exception) |
| 94 | { |
| 95 | ExceptionInfo |
| 96 | *sans_exception; |
| 97 | |
| 98 | Image |
| 99 | *image; |
| 100 | |
| 101 | ImageInfo |
| 102 | *read_info; |
| 103 | |
| 104 | MagickBooleanType |
| 105 | status; |
| 106 | |
| 107 | /* |
| 108 | Open image file. |
| 109 | */ |
| 110 | assert(image_info != (const ImageInfo *) NULL); |
cristy | e1c94d9 | 2015-06-28 12:16:33 +0000 | [diff] [blame] | 111 | assert(image_info->signature == MagickCoreSignature); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 112 | if (image_info->debug != MagickFalse) |
| 113 | (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", |
| 114 | image_info->filename); |
| 115 | assert(exception != (ExceptionInfo *) NULL); |
cristy | e1c94d9 | 2015-06-28 12:16:33 +0000 | [diff] [blame] | 116 | assert(exception->signature == MagickCoreSignature); |
cristy | 9950d57 | 2011-10-01 18:22:35 +0000 | [diff] [blame] | 117 | image=AcquireImage(image_info,exception); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 118 | status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); |
| 119 | if (status == MagickFalse) |
| 120 | { |
| 121 | image=DestroyImageList(image); |
| 122 | return((Image *) NULL); |
| 123 | } |
| 124 | (void) CloseBlob(image); |
| 125 | (void) DestroyImageList(image); |
| 126 | /* |
| 127 | Convert DNG to PPM with delegate. |
| 128 | */ |
cristy | 9950d57 | 2011-10-01 18:22:35 +0000 | [diff] [blame] | 129 | image=AcquireImage(image_info,exception); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 130 | read_info=CloneImageInfo(image_info); |
cristy | 98f91ec | 2011-02-03 01:15:48 +0000 | [diff] [blame] | 131 | SetImageInfoBlob(read_info,(void *) NULL,0); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 132 | (void) InvokeDelegate(read_info,image,"dng:decode",(char *) NULL,exception); |
| 133 | image=DestroyImage(image); |
cristy | 151b66d | 2015-04-15 10:50:31 +0000 | [diff] [blame] | 134 | (void) FormatLocaleString(read_info->filename,MagickPathExtent,"%s.png", |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 135 | read_info->unique); |
| 136 | sans_exception=AcquireExceptionInfo(); |
| 137 | image=ReadImage(read_info,sans_exception); |
| 138 | sans_exception=DestroyExceptionInfo(sans_exception); |
| 139 | if (image == (Image *) NULL) |
| 140 | { |
cristy | 151b66d | 2015-04-15 10:50:31 +0000 | [diff] [blame] | 141 | (void) FormatLocaleString(read_info->filename,MagickPathExtent,"%s.ppm", |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 142 | read_info->unique); |
| 143 | image=ReadImage(read_info,exception); |
| 144 | } |
| 145 | (void) RelinquishUniqueFileResource(read_info->filename); |
| 146 | if (image != (Image *) NULL) |
| 147 | { |
| 148 | char |
cristy | 151b66d | 2015-04-15 10:50:31 +0000 | [diff] [blame] | 149 | filename[MagickPathExtent], |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 150 | *xml; |
| 151 | |
| 152 | ExceptionInfo |
| 153 | *sans; |
| 154 | |
cristy | 151b66d | 2015-04-15 10:50:31 +0000 | [diff] [blame] | 155 | (void) CopyMagickString(image->magick,read_info->magick,MagickPathExtent); |
| 156 | (void) FormatLocaleString(filename,MagickPathExtent,"%s.ufraw", |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 157 | read_info->unique); |
| 158 | sans=AcquireExceptionInfo(); |
cristy | 151b66d | 2015-04-15 10:50:31 +0000 | [diff] [blame] | 159 | xml=FileToString(filename,MagickPathExtent,sans); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 160 | (void) RelinquishUniqueFileResource(filename); |
| 161 | if (xml != (char *) NULL) |
| 162 | { |
| 163 | XMLTreeInfo |
cristy | ddbc41b | 2011-04-24 14:27:48 +0000 | [diff] [blame] | 164 | *ufraw; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 165 | |
| 166 | /* |
| 167 | Inject |
| 168 | */ |
| 169 | ufraw=NewXMLTree(xml,sans); |
| 170 | if (ufraw != (XMLTreeInfo *) NULL) |
| 171 | { |
| 172 | char |
| 173 | *content, |
cristy | 151b66d | 2015-04-15 10:50:31 +0000 | [diff] [blame] | 174 | property[MagickPathExtent]; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 175 | |
| 176 | const char |
| 177 | *tag; |
| 178 | |
| 179 | XMLTreeInfo |
| 180 | *next; |
| 181 | |
| 182 | if (image->properties == (void *) NULL) |
| 183 | ((Image *) image)->properties=NewSplayTree( |
| 184 | CompareSplayTreeString,RelinquishMagickMemory, |
| 185 | RelinquishMagickMemory); |
| 186 | next=GetXMLTreeChild(ufraw,(const char *) NULL); |
| 187 | while (next != (XMLTreeInfo *) NULL) |
| 188 | { |
| 189 | tag=GetXMLTreeTag(next); |
| 190 | if (tag == (char *) NULL) |
| 191 | tag="unknown"; |
cristy | 151b66d | 2015-04-15 10:50:31 +0000 | [diff] [blame] | 192 | (void) FormatLocaleString(property,MagickPathExtent,"dng:%s",tag); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 193 | content=ConstantString(GetXMLTreeContent(next)); |
| 194 | StripString(content); |
| 195 | if ((LocaleCompare(tag,"log") != 0) && |
| 196 | (LocaleCompare(tag,"InputFilename") != 0) && |
| 197 | (LocaleCompare(tag,"OutputFilename") != 0) && |
| 198 | (LocaleCompare(tag,"OutputType") != 0) && |
| 199 | (strlen(content) != 0)) |
| 200 | (void) AddValueToSplayTree((SplayTreeInfo *) |
| 201 | ((Image *) image)->properties,ConstantString(property), |
| 202 | content); |
| 203 | next=GetXMLTreeSibling(next); |
| 204 | } |
| 205 | ufraw=DestroyXMLTree(ufraw); |
| 206 | } |
| 207 | xml=DestroyString(xml); |
| 208 | } |
| 209 | sans=DestroyExceptionInfo(sans); |
| 210 | } |
| 211 | read_info=DestroyImageInfo(read_info); |
| 212 | return(image); |
| 213 | } |
| 214 | |
| 215 | /* |
| 216 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 217 | % % |
| 218 | % % |
| 219 | % % |
| 220 | % R e g i s t e r D N G I m a g e % |
| 221 | % % |
| 222 | % % |
| 223 | % % |
| 224 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 225 | % |
| 226 | % RegisterDNGImage() adds attributes for the DNG image format to |
| 227 | % the list of supported formats. The attributes include the image format |
| 228 | % tag, a method to read and/or write the format, whether the format |
| 229 | % supports the saving of more than one frame to the same file or blob, |
| 230 | % whether the format supports native in-memory I/O, and a brief |
| 231 | % description of the format. |
| 232 | % |
| 233 | % The format of the RegisterDNGImage method is: |
| 234 | % |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 235 | % size_t RegisterDNGImage(void) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 236 | % |
| 237 | */ |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 238 | ModuleExport size_t RegisterDNGImage(void) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 239 | { |
| 240 | MagickInfo |
| 241 | *entry; |
| 242 | |
dirk | 06b627a | 2015-04-06 18:59:17 +0000 | [diff] [blame] | 243 | entry=AcquireMagickInfo("DNG","3FR","Hasselblad CFV/H3D39II"); |
cristy | 94c8fe4 | 2009-10-06 01:57:36 +0000 | [diff] [blame] | 244 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
dirk | 08e9a11 | 2015-02-22 01:51:41 +0000 | [diff] [blame] | 245 | entry->flags^=CoderBlobSupportFlag; |
| 246 | entry->flags|=CoderSeekableStreamFlag; |
cristy | 94c8fe4 | 2009-10-06 01:57:36 +0000 | [diff] [blame] | 247 | entry->format_type=ExplicitFormatType; |
dirk | 06b627a | 2015-04-06 18:59:17 +0000 | [diff] [blame] | 248 | (void) RegisterMagickInfo(entry); |
| 249 | entry=AcquireMagickInfo("DNG","ARW","Sony Alpha Raw Image Format"); |
| 250 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
| 251 | entry->flags^=CoderBlobSupportFlag; |
| 252 | entry->flags|=CoderSeekableStreamFlag; |
| 253 | entry->format_type=ExplicitFormatType; |
| 254 | (void) RegisterMagickInfo(entry); |
| 255 | entry=AcquireMagickInfo("DNG","DNG","Digital Negative"); |
| 256 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
| 257 | entry->flags^=CoderBlobSupportFlag; |
| 258 | entry->flags|=CoderSeekableStreamFlag; |
| 259 | entry->format_type=ExplicitFormatType; |
| 260 | (void) RegisterMagickInfo(entry); |
| 261 | entry=AcquireMagickInfo("DNG","CR2","Canon Digital Camera Raw Image Format"); |
| 262 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
| 263 | entry->flags^=CoderBlobSupportFlag; |
| 264 | entry->flags|=CoderSeekableStreamFlag; |
| 265 | entry->format_type=ExplicitFormatType; |
| 266 | (void) RegisterMagickInfo(entry); |
| 267 | entry=AcquireMagickInfo("DNG","CRW","Canon Digital Camera Raw Image Format"); |
| 268 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
| 269 | entry->flags^=CoderBlobSupportFlag; |
| 270 | entry->flags|=CoderSeekableStreamFlag; |
| 271 | entry->format_type=ExplicitFormatType; |
| 272 | (void) RegisterMagickInfo(entry); |
| 273 | entry=AcquireMagickInfo("DNG","DCR","Kodak Digital Camera Raw Image File"); |
| 274 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
| 275 | entry->flags^=CoderBlobSupportFlag; |
| 276 | entry->flags|=CoderSeekableStreamFlag; |
| 277 | entry->format_type=ExplicitFormatType; |
| 278 | (void) RegisterMagickInfo(entry); |
| 279 | entry=AcquireMagickInfo("DNG","ERF","Epson RAW Format"); |
| 280 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
| 281 | entry->flags^=CoderBlobSupportFlag; |
| 282 | entry->flags|=CoderSeekableStreamFlag; |
| 283 | entry->format_type=ExplicitFormatType; |
| 284 | (void) RegisterMagickInfo(entry); |
| 285 | entry=AcquireMagickInfo("DNG","IIQ","Phase One Raw Image Format"); |
| 286 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
| 287 | entry->flags^=CoderBlobSupportFlag; |
| 288 | entry->flags|=CoderSeekableStreamFlag; |
| 289 | entry->format_type=ExplicitFormatType; |
cristy | 94c8fe4 | 2009-10-06 01:57:36 +0000 | [diff] [blame] | 290 | entry->module=ConstantString("DNG"); |
| 291 | (void) RegisterMagickInfo(entry); |
dirk | 06b627a | 2015-04-06 18:59:17 +0000 | [diff] [blame] | 292 | entry=AcquireMagickInfo("DNG","KDC","Kodak Digital Camera Raw Image Format"); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 293 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
dirk | 08e9a11 | 2015-02-22 01:51:41 +0000 | [diff] [blame] | 294 | entry->flags^=CoderBlobSupportFlag; |
| 295 | entry->flags|=CoderSeekableStreamFlag; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 296 | entry->format_type=ExplicitFormatType; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 297 | (void) RegisterMagickInfo(entry); |
dirk | 06b627a | 2015-04-06 18:59:17 +0000 | [diff] [blame] | 298 | entry=AcquireMagickInfo("DNG","K25","Kodak Digital Camera Raw Image Format"); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 299 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
dirk | 08e9a11 | 2015-02-22 01:51:41 +0000 | [diff] [blame] | 300 | entry->flags^=CoderBlobSupportFlag; |
| 301 | entry->flags|=CoderSeekableStreamFlag; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 302 | entry->format_type=ExplicitFormatType; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 303 | (void) RegisterMagickInfo(entry); |
dirk | 06b627a | 2015-04-06 18:59:17 +0000 | [diff] [blame] | 304 | entry=AcquireMagickInfo("DNG","MEF","Mamiya Raw Image File"); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 305 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
dirk | 08e9a11 | 2015-02-22 01:51:41 +0000 | [diff] [blame] | 306 | entry->flags^=CoderBlobSupportFlag; |
| 307 | entry->flags|=CoderSeekableStreamFlag; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 308 | entry->format_type=ExplicitFormatType; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 309 | (void) RegisterMagickInfo(entry); |
dirk | 06b627a | 2015-04-06 18:59:17 +0000 | [diff] [blame] | 310 | entry=AcquireMagickInfo("DNG","MRW","Sony (Minolta) Raw Image File"); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 311 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
dirk | 08e9a11 | 2015-02-22 01:51:41 +0000 | [diff] [blame] | 312 | entry->flags^=CoderBlobSupportFlag; |
| 313 | entry->flags|=CoderSeekableStreamFlag; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 314 | entry->format_type=ExplicitFormatType; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 315 | (void) RegisterMagickInfo(entry); |
dirk | 06b627a | 2015-04-06 18:59:17 +0000 | [diff] [blame] | 316 | entry=AcquireMagickInfo("DNG","NEF","Nikon Digital SLR Camera Raw Image File"); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 317 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
dirk | 08e9a11 | 2015-02-22 01:51:41 +0000 | [diff] [blame] | 318 | entry->flags^=CoderBlobSupportFlag; |
| 319 | entry->flags|=CoderSeekableStreamFlag; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 320 | entry->format_type=ExplicitFormatType; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 321 | (void) RegisterMagickInfo(entry); |
dirk | 06b627a | 2015-04-06 18:59:17 +0000 | [diff] [blame] | 322 | entry=AcquireMagickInfo("DNG","NRW","Nikon Digital SLR Camera Raw Image File"); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 323 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
dirk | 08e9a11 | 2015-02-22 01:51:41 +0000 | [diff] [blame] | 324 | entry->flags^=CoderBlobSupportFlag; |
| 325 | entry->flags|=CoderSeekableStreamFlag; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 326 | entry->format_type=ExplicitFormatType; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 327 | (void) RegisterMagickInfo(entry); |
dirk | 06b627a | 2015-04-06 18:59:17 +0000 | [diff] [blame] | 328 | entry=AcquireMagickInfo("DNG","ORF","Olympus Digital Camera Raw Image File"); |
cristy | a5338bb | 2014-11-05 18:25:16 +0000 | [diff] [blame] | 329 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
dirk | 08e9a11 | 2015-02-22 01:51:41 +0000 | [diff] [blame] | 330 | entry->flags^=CoderBlobSupportFlag; |
| 331 | entry->flags|=CoderSeekableStreamFlag; |
cristy | a5338bb | 2014-11-05 18:25:16 +0000 | [diff] [blame] | 332 | entry->format_type=ExplicitFormatType; |
cristy | a5338bb | 2014-11-05 18:25:16 +0000 | [diff] [blame] | 333 | (void) RegisterMagickInfo(entry); |
dirk | 06b627a | 2015-04-06 18:59:17 +0000 | [diff] [blame] | 334 | entry=AcquireMagickInfo("DNG","PEF","Pentax Electronic File"); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 335 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
dirk | 08e9a11 | 2015-02-22 01:51:41 +0000 | [diff] [blame] | 336 | entry->flags^=CoderBlobSupportFlag; |
| 337 | entry->flags|=CoderSeekableStreamFlag; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 338 | entry->format_type=ExplicitFormatType; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 339 | (void) RegisterMagickInfo(entry); |
dirk | 06b627a | 2015-04-06 18:59:17 +0000 | [diff] [blame] | 340 | entry=AcquireMagickInfo("DNG","RAF","Fuji CCD-RAW Graphic File"); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 341 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
dirk | 08e9a11 | 2015-02-22 01:51:41 +0000 | [diff] [blame] | 342 | entry->flags^=CoderBlobSupportFlag; |
| 343 | entry->flags|=CoderSeekableStreamFlag; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 344 | entry->format_type=ExplicitFormatType; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 345 | (void) RegisterMagickInfo(entry); |
dirk | 06b627a | 2015-04-06 18:59:17 +0000 | [diff] [blame] | 346 | entry=AcquireMagickInfo("DNG","RAW","Raw"); |
cristy | 1be98ec | 2012-01-30 16:51:12 +0000 | [diff] [blame] | 347 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
dirk | 08e9a11 | 2015-02-22 01:51:41 +0000 | [diff] [blame] | 348 | entry->flags^=CoderBlobSupportFlag; |
| 349 | entry->flags|=CoderSeekableStreamFlag; |
cristy | 1be98ec | 2012-01-30 16:51:12 +0000 | [diff] [blame] | 350 | entry->format_type=ExplicitFormatType; |
cristy | 1be98ec | 2012-01-30 16:51:12 +0000 | [diff] [blame] | 351 | (void) RegisterMagickInfo(entry); |
dirk | 06b627a | 2015-04-06 18:59:17 +0000 | [diff] [blame] | 352 | entry=AcquireMagickInfo("DNG","RMF","Raw Media Format"); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 353 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
dirk | 08e9a11 | 2015-02-22 01:51:41 +0000 | [diff] [blame] | 354 | entry->flags^=CoderBlobSupportFlag; |
| 355 | entry->flags|=CoderSeekableStreamFlag; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 356 | entry->format_type=ExplicitFormatType; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 357 | (void) RegisterMagickInfo(entry); |
dirk | 06b627a | 2015-04-06 18:59:17 +0000 | [diff] [blame] | 358 | entry=AcquireMagickInfo("DNG","RW2","Panasonic Lumix Raw Image"); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 359 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
dirk | 08e9a11 | 2015-02-22 01:51:41 +0000 | [diff] [blame] | 360 | entry->flags^=CoderBlobSupportFlag; |
| 361 | entry->flags|=CoderSeekableStreamFlag; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 362 | entry->format_type=ExplicitFormatType; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 363 | (void) RegisterMagickInfo(entry); |
dirk | 06b627a | 2015-04-06 18:59:17 +0000 | [diff] [blame] | 364 | entry=AcquireMagickInfo("DNG","SRF","Sony Raw Format"); |
cristy | cb8f0ae | 2012-03-02 12:26:21 +0000 | [diff] [blame] | 365 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
dirk | 08e9a11 | 2015-02-22 01:51:41 +0000 | [diff] [blame] | 366 | entry->flags^=CoderBlobSupportFlag; |
| 367 | entry->flags|=CoderSeekableStreamFlag; |
cristy | cb8f0ae | 2012-03-02 12:26:21 +0000 | [diff] [blame] | 368 | entry->format_type=ExplicitFormatType; |
cristy | cb8f0ae | 2012-03-02 12:26:21 +0000 | [diff] [blame] | 369 | (void) RegisterMagickInfo(entry); |
dirk | 06b627a | 2015-04-06 18:59:17 +0000 | [diff] [blame] | 370 | entry=AcquireMagickInfo("DNG","SR2","Sony Raw Format 2"); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 371 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
dirk | 08e9a11 | 2015-02-22 01:51:41 +0000 | [diff] [blame] | 372 | entry->flags^=CoderBlobSupportFlag; |
| 373 | entry->flags|=CoderSeekableStreamFlag; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 374 | entry->format_type=ExplicitFormatType; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 375 | (void) RegisterMagickInfo(entry); |
dirk | 06b627a | 2015-04-06 18:59:17 +0000 | [diff] [blame] | 376 | entry=AcquireMagickInfo("DNG","X3F","Sigma Camera RAW Picture File"); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 377 | entry->decoder=(DecodeImageHandler *) ReadDNGImage; |
dirk | 08e9a11 | 2015-02-22 01:51:41 +0000 | [diff] [blame] | 378 | entry->flags^=CoderBlobSupportFlag; |
| 379 | entry->flags|=CoderSeekableStreamFlag; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 380 | entry->format_type=ExplicitFormatType; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 381 | (void) RegisterMagickInfo(entry); |
| 382 | return(MagickImageCoderSignature); |
| 383 | } |
| 384 | |
| 385 | /* |
| 386 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 387 | % % |
| 388 | % % |
| 389 | % % |
| 390 | % U n r e g i s t e r D N G I m a g e % |
| 391 | % % |
| 392 | % % |
| 393 | % % |
| 394 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 395 | % |
| 396 | % UnregisterDNGImage() removes format registrations made by the |
| 397 | % BIM module from the list of supported formats. |
| 398 | % |
| 399 | % The format of the UnregisterBIMImage method is: |
| 400 | % |
| 401 | % UnregisterDNGImage(void) |
| 402 | % |
| 403 | */ |
| 404 | ModuleExport void UnregisterDNGImage(void) |
| 405 | { |
| 406 | (void) UnregisterMagickInfo("X3F"); |
| 407 | (void) UnregisterMagickInfo("SR2"); |
| 408 | (void) UnregisterMagickInfo("SRF"); |
cristy | 98aceb8 | 2012-10-20 21:24:00 +0000 | [diff] [blame] | 409 | (void) UnregisterMagickInfo("RW2"); |
cristy | 15e2296 | 2014-02-21 22:56:26 +0000 | [diff] [blame] | 410 | (void) UnregisterMagickInfo("RMF"); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 411 | (void) UnregisterMagickInfo("RAF"); |
| 412 | (void) UnregisterMagickInfo("PEF"); |
| 413 | (void) UnregisterMagickInfo("ORF"); |
cristy | cb8f0ae | 2012-03-02 12:26:21 +0000 | [diff] [blame] | 414 | (void) UnregisterMagickInfo("NRW"); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 415 | (void) UnregisterMagickInfo("NEF"); |
| 416 | (void) UnregisterMagickInfo("MRW"); |
cristy | 800c7c4 | 2012-01-30 16:51:59 +0000 | [diff] [blame] | 417 | (void) UnregisterMagickInfo("MEF"); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 418 | (void) UnregisterMagickInfo("K25"); |
| 419 | (void) UnregisterMagickInfo("KDC"); |
cristy | a5338bb | 2014-11-05 18:25:16 +0000 | [diff] [blame] | 420 | (void) UnregisterMagickInfo("IIQ"); |
| 421 | (void) UnregisterMagickInfo("ERF"); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 422 | (void) UnregisterMagickInfo("DCR"); |
| 423 | (void) UnregisterMagickInfo("CRW"); |
| 424 | (void) UnregisterMagickInfo("CR2"); |
| 425 | (void) UnregisterMagickInfo("DNG"); |
| 426 | (void) UnregisterMagickInfo("ARW"); |
cristy | 94c8fe4 | 2009-10-06 01:57:36 +0000 | [diff] [blame] | 427 | (void) UnregisterMagickInfo("3FR"); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 428 | } |