78 const std::string format = img.magick ();
79 if (img.classType () == Magick::PseudoClass
82 ||
const_cast<Magick::Image&
> (img).attribute (
"PNG:IHDR.color-type-orig") ==
"3"))
108 && img.channelDepth (Magick::RedChannel) == 1
109 && img.channelDepth (Magick::CyanChannel) == 1
110 && img.channelDepth (Magick::OpacityChannel) == 1
111 && img.channelDepth (Magick::GrayChannel) == 1)
130 output =
Range (value, value);
133 error (
"__magick_read__: unknow datatype for Region option");
138 static std::map<std::string, octave_idx_type>
141 std::map<std::string, octave_idx_type> region;
147 region[
"row_start"] = rows.
base () -1;
148 region[
"col_start"] = cols.
base () -1;
149 region[
"row_end"] = rows.
max () -1;
150 region[
"col_end"] = cols.
max () -1;
154 region[
"row_cache"] = region[
"row_end"] - region[
"row_start"] +1;
155 region[
"col_cache"] = region[
"col_end"] - region[
"col_start"] +1;
158 region[
"row_shift"] = region[
"col_cache"] * rows.
inc ();
159 region[
"col_shift"] = region[
"col_cache"] *
160 (region[
"row_cache"] + rows.
inc () -1) - cols.
inc ();
163 region[
"row_out"] = rows.
nelem ();
164 region[
"col_out"] = cols.
nelem ();
178 const Magick::ColorRGB c = img.colorMap (i);
179 cmap(i,0) = c.red ();
180 cmap(i,1) = c.green ();
181 cmap(i,2) = c.blue ();
182 amap(i) = c.alpha ();
197 typedef typename T::element_type P;
211 T img = T (
dim_vector (nRows, nCols, 1, nFrames));
212 P* img_fvec = img.fortran_vec ();
227 imvec[frameidx(frame)].getConstPixels (col_start, row_start,
228 col_cache, row_cache);
230 const Magick::IndexPacket *pix
231 = imvec[frameidx(frame)].getConstIndexes ();
237 img_fvec[idx++] =
static_cast<P
> (*pix);
254 read_maps (const_cast<Magick::Image&> (imvec[frameidx(def_elem)]));
259 if (imvec[def_elem].matte () && nargout >= 3)
261 const Matrix amap = maps(1).matrix_value ();
271 alpha_fvec[pix] = 1 - amap_fvec[static_cast<int> (img_fvec[3])];
291 typedef typename T::element_type P;
332 if (imvec[def_elem].depth () == 32)
335 divisor = MaxRGB / ((uint64_t (1) << imvec[def_elem].depth ()) - 1);
344 Magick::ImageType
type = imvec[def_elem].type ();
345 if (type == Magick::BilevelType && imvec[def_elem].matte ())
346 type = Magick::GrayscaleMatteType;
355 if (imvec[0].magick () ==
"PNG")
365 const std::string type_str
366 = imvec[0].attribute (
"PNG:IHDR.color-type-orig");
369 type = Magick::GrayscaleType;
370 else if (type_str ==
"2")
371 type = Magick::TrueColorType;
372 else if (type_str ==
"6")
373 type = Magick::TrueColorMatteType;
374 else if (type_str ==
"4")
375 type = Magick::GrayscaleMatteType;
381 if (imvec[0].matte ())
383 if (type == Magick::GrayscaleType)
384 type = Magick::GrayscaleMatteType;
385 else if (type == Magick::TrueColorType)
386 type = Magick::TrueColorMatteType;
396 case Magick::GrayscaleMatteType:
397 type = Magick::GrayscaleType;
400 case Magick::PaletteMatteType:
401 type = Magick::PaletteType;
404 case Magick::TrueColorMatteType:
405 type = Magick::TrueColorType;
408 case Magick::ColorSeparationMatteType:
409 type = Magick::ColorSeparationType;
421 case Magick::BilevelType:
422 case Magick::GrayscaleType:
424 img = T (
dim_vector (nRows, nCols, 1, nFrames));
425 P *img_fvec = img.fortran_vec ();
430 const Magick::PixelPacket *pix
431 = imvec[frameidx(frame)].getConstPixels (col_start, row_start,
432 col_cache, row_cache);
438 img_fvec[idx++] = pix->red / divisor;
447 case Magick::GrayscaleMatteType:
449 img = T (
dim_vector (nRows, nCols, 1, nFrames));
450 T alpha (
dim_vector (nRows, nCols, 1, nFrames));
451 P *img_fvec = img.fortran_vec ();
452 P *a_fvec = alpha.fortran_vec ();
457 const Magick::PixelPacket *pix
458 = imvec[frameidx(frame)].getConstPixels (col_start, row_start,
459 col_cache, row_cache);
465 img_fvec[idx] = pix->red / divisor;
466 a_fvec[idx] = (MaxRGB - pix->opacity) / divisor;
477 case Magick::PaletteType:
478 case Magick::TrueColorType:
480 img = T (
dim_vector (nRows, nCols, 3, nFrames));
481 P *img_fvec = img.fortran_vec ();
485 const Magick::PixelPacket *pix
486 = imvec[frameidx(frame)].getConstPixels (col_start, row_start,
487 col_cache, row_cache);
490 img_fvec += nRows * nCols * frame;
492 P *gbuf = img_fvec + nRows * nCols;
493 P *bbuf = img_fvec + nRows * nCols * 2;
499 rbuf[idx] = pix->red / divisor;
500 gbuf[idx] = pix->green / divisor;
501 bbuf[idx] = pix->blue / divisor;
511 case Magick::PaletteMatteType:
512 case Magick::TrueColorMatteType:
514 img = T (
dim_vector (nRows, nCols, 3, nFrames));
515 T alpha (
dim_vector (nRows, nCols, 1, nFrames));
516 P *img_fvec = img.fortran_vec ();
517 P *a_fvec = alpha.fortran_vec ();
524 const Magick::PixelPacket *pix
525 = imvec[frameidx(frame)].getConstPixels (col_start, row_start,
526 col_cache, row_cache);
529 img_fvec += nRows * nCols * frame;
531 P *gbuf = img_fvec + nRows * nCols;
532 P *bbuf = img_fvec + nRows * nCols * 2;
538 rbuf[idx] = pix->red / divisor;
539 gbuf[idx] = pix->green / divisor;
540 bbuf[idx] = pix->blue / divisor;
541 a_fvec[a_idx++] = (MaxRGB - pix->opacity) / divisor;
552 case Magick::ColorSeparationType:
554 img = T (
dim_vector (nRows, nCols, 4, nFrames));
555 P *img_fvec = img.fortran_vec ();
559 const Magick::PixelPacket *pix
560 = imvec[frameidx(frame)].getConstPixels (col_start, row_start,
561 col_cache, row_cache);
564 img_fvec += nRows * nCols * frame;
566 P *mbuf = img_fvec + nRows * nCols;
567 P *ybuf = img_fvec + nRows * nCols * 2;
568 P *kbuf = img_fvec + nRows * nCols * 3;
574 cbuf[idx] = pix->red / divisor;
575 mbuf[idx] = pix->green / divisor;
576 ybuf[idx] = pix->blue / divisor;
577 kbuf[idx] = pix->opacity / divisor;
588 case Magick::ColorSeparationMatteType:
590 img = T (
dim_vector (nRows, nCols, 4, nFrames));
591 T alpha (
dim_vector (nRows, nCols, 1, nFrames));
592 P *img_fvec = img.fortran_vec ();
593 P *a_fvec = alpha.fortran_vec ();
600 const Magick::PixelPacket *pix
601 = imvec[frameidx(frame)].getConstPixels (col_start, row_start,
602 col_cache, row_cache);
605 const Magick::IndexPacket *apix
606 = imvec[frameidx(frame)].getConstIndexes ();
609 img_fvec += nRows * nCols * frame;
611 P *mbuf = img_fvec + nRows * nCols;
612 P *ybuf = img_fvec + nRows * nCols * 2;
613 P *kbuf = img_fvec + nRows * nCols * 3;
619 cbuf[idx] = pix->red / divisor;
620 mbuf[idx] = pix->green / divisor;
621 ybuf[idx] = pix->blue / divisor;
622 kbuf[idx] = pix->opacity / divisor;
623 a_fvec[a_idx++] = (MaxRGB - *apix) / divisor;
635 error (
"__magick_read__: unknown Magick++ image type");
645 read_file (
const std::string& filename, std::vector<Magick::Image>& imvec)
649 Magick::readImages (&imvec, filename);
651 catch (Magick::Warning&
w)
653 warning (
"Magick++ warning: %s", w.what ());
655 catch (Magick::Exception& e)
657 error (
"Magick++ exception: %s", e.what ());
671 const char *static_locale = setlocale (LC_ALL, NULL);
672 const std::string locale (static_locale);
674 const std::string program_name
676 Magick::InitializeMagick (program_name.c_str ());
679 setlocale (LC_ALL, locale.c_str ());
681 if (QuantumDepth < 32)
682 warning (
"your version of %s limits images to %d bits per pixel",
683 MagickPackageName, QuantumDepth);
692 @deftypefn {Loadable Function} {[@var{img}, @var{map}, @var{alpha}] =} __magick_read__ (@var{fname}, @var{options})\n\
693 Read image with GraphicsMagick or ImageMagick.\n\
695 This is a private internal function not intended for direct use. Instead\n\
696 use @code{imread}.\n\
698 @seealso{imfinfo, imformats, imread, imwrite}\n\
709 if (args.length () != 2 || ! args(0).is_string ())
718 error (
"__magick_read__: OPTIONS must be a struct");
722 std::vector<Magick::Image> imvec;
723 read_file (args(0).string_value (), imvec);
742 error (
"__magick_read__: invalid value for Index/Frame");
751 if (frameidx(i) < 0 || frameidx(i) > nFrames - 1)
756 error (
"imread: index/frames specified are outside the number of images");
767 const unsigned int nRows = imvec[frameidx(0)].rows ();
768 const unsigned int nCols = imvec[frameidx(0)].columns ();
772 if (nRows != imvec[frameidx(frame)].rows () ||
773 nCols != imvec[frameidx(frame)].columns ())
775 error (
"imread: all frames must have the same size but frame %i is different",
786 output = read_indexed_images<boolNDArray> (imvec, frameidx,
789 output = read_indexed_images<uint8NDArray> (imvec, frameidx,
791 else if (depth <= 16)
792 output = read_indexed_images<uint16NDArray> (imvec, frameidx,
796 error (
"imread: indexed images with depths greater than 16-bit are not supported");
804 output = read_images<boolNDArray> (imvec, frameidx, nargout, options);
806 output = read_images<uint8NDArray> (imvec, frameidx, nargout, options);
807 else if (depth <= 16)
808 output = read_images<uint16NDArray> (imvec, frameidx, nargout, options);
809 else if (depth <= 32)
810 output = read_images<FloatNDArray> (imvec, frameidx, nargout, options);
813 error (
"imread: reading of images with %i-bit depth is not supported",
833 typedef typename T::element_type P;
837 const P* img_fvec = img.fortran_vec ();
842 out_fvec[idx] = img_fvec[idx] * max;
853 typedef typename T::element_type P;
855 sizeof (P) * std::numeric_limits<unsigned char>::digits;
862 const Magick::ImageType&
type,
863 const Magick::ClassType& klass)
865 Magick::Image img (Magick::Geometry (nCols, nRows),
"black");
869 img.classType (klass);
873 img.depth (bitdepth);
876 case Magick::GrayscaleMatteType:
877 case Magick::TrueColorMatteType:
878 case Magick::ColorSeparationMatteType:
879 case Magick::PaletteMatteType:
896 typedef typename T::element_type P;
905 std::vector<Magick::ColorRGB> colormap;
911 colormap.push_back (Magick::ColorRGB (cmap_fvec[map_idx],
912 cmap_fvec[map_idx + G_offset],
913 cmap_fvec[map_idx + B_offset]));
920 Magick::PseudoClass);
923 m_img.colorMapSize (cmap_size);
925 m_img.colorMap (map_idx, colormap[map_idx]);
936 Magick::PixelPacket* pix = m_img.getPixels (0, 0, nCols, nRows);
937 Magick::IndexPacket* ind = m_img.getIndexes ();
938 const P* img_fvec = img.fortran_vec ();
945 ind[GM_idx] =
double (*img_fvec);
946 pix[GM_idx] = m_img.colorMap (
double (*img_fvec));
950 GM_idx -= nCols * nRows - 1;
955 imvec.push_back (m_img);
967 const Magick::Color white (
"white");
978 Magick::GrayscaleType,
979 Magick::DirectClass);
981 Magick::PixelPacket *pix = m_img.getPixels (0, 0, nCols, nRows);
987 if (img_fvec[img_idx])
993 GM_idx -= nCols * nRows - 1;
999 m_img.type (Magick::BilevelType);
1000 imvec.push_back (m_img);
1007 const T& img,
const T& alpha)
1009 typedef typename T::element_type P;
1010 const octave_idx_type channels = img.ndims () < 3 ? 1 : img.dims ()(2);
1011 const octave_idx_type nFrames = img.ndims () < 4 ? 1 : img.dims ()(3);
1016 Magick::ImageType
type;
1017 const bool has_alpha = ! alpha.is_empty ();
1022 type = Magick::GrayscaleMatteType;
1024 type = Magick::GrayscaleType;
1029 type = Magick::TrueColorMatteType;
1031 type = Magick::TrueColorType;
1036 type = Magick::ColorSeparationMatteType;
1038 type = Magick::ColorSeparationType;
1044 error (
"__magick_write__: wrong size on 3rd dimension");
1056 const double divisor =
static_cast<double>((uint64_t (1) << bitdepth) - 1)
1059 const P *img_fvec = img.fortran_vec ();
1060 const P *a_fvec = alpha.fortran_vec ();
1063 case Magick::GrayscaleType:
1070 Magick::DirectClass);
1072 Magick::PixelPacket *pix = m_img.getPixels (0, 0, nCols, nRows);
1078 c.redQuantum (
double (*img_fvec) / divisor);
1083 GM_idx -= nCols * nRows - 1;
1086 m_img.syncPixels ();
1087 imvec.push_back (m_img);
1092 case Magick::GrayscaleMatteType:
1099 Magick::DirectClass);
1101 Magick::PixelPacket *pix = m_img.getPixels (0, 0, nCols, nRows);
1107 c.redQuantum (
double (*img_fvec) / divisor);
1108 c.alphaQuantum (MaxRGB - (
double (*a_fvec) / divisor));
1114 GM_idx -= nCols * nRows - 1;
1117 m_img.syncPixels ();
1118 imvec.push_back (m_img);
1123 case Magick::TrueColorType:
1133 Magick::DirectClass);
1135 Magick::PixelPacket *pix = m_img.getPixels (0, 0, nCols, nRows);
1140 Magick::Color c (
double (*img_fvec) / divisor,
1141 double (img_fvec[G_offset]) / divisor,
1142 double (img_fvec[B_offset]) / divisor);
1147 GM_idx -= nCols * nRows - 1;
1150 m_img.syncPixels ();
1151 imvec.push_back (m_img);
1156 case Magick::TrueColorMatteType:
1166 Magick::DirectClass);
1168 Magick::PixelPacket *pix = m_img.getPixels (0, 0, nCols, nRows);
1173 Magick::Color c (
double (*img_fvec) / divisor,
1174 double (img_fvec[G_offset]) / divisor,
1175 double (img_fvec[B_offset]) / divisor,
1176 MaxRGB - (
double (*a_fvec) / divisor));
1182 GM_idx -= nCols * nRows - 1;
1185 m_img.syncPixels ();
1186 imvec.push_back (m_img);
1191 case Magick::ColorSeparationType:
1202 Magick::DirectClass);
1204 Magick::PixelPacket *pix = m_img.getPixels (0, 0, nCols, nRows);
1209 Magick::Color c (
double (*img_fvec) / divisor,
1210 double (img_fvec[M_offset]) / divisor,
1211 double (img_fvec[Y_offset]) / divisor,
1212 double (img_fvec[K_offset]) / divisor);
1217 GM_idx -= nCols * nRows - 1;
1220 m_img.syncPixels ();
1221 imvec.push_back (m_img);
1226 case Magick::ColorSeparationMatteType:
1237 Magick::DirectClass);
1239 Magick::PixelPacket *pix = m_img.getPixels (0, 0, nCols, nRows);
1240 Magick::IndexPacket *ind = m_img.getIndexes ();
1245 Magick::Color c (
double (*img_fvec) / divisor,
1246 double (img_fvec[M_offset]) / divisor,
1247 double (img_fvec[Y_offset]) / divisor,
1248 double (img_fvec[K_offset]) / divisor);
1250 ind[GM_idx] = MaxRGB - (
double (*a_fvec) / divisor);
1255 GM_idx -= nCols * nRows - 1;
1258 m_img.syncPixels ();
1259 imvec.push_back (m_img);
1266 error (
"__magick_write__: unrecognized Magick::ImageType");
1274 static std::map<octave_idx_type, std::string>
1292 static std::map<octave_idx_type, std::string> methods;
1293 if (methods.empty ())
1295 methods[0] =
"doNotSpecify";
1296 methods[1] =
"leaveInPlace";
1297 methods[2] =
"restoreBG";
1298 methods[3] =
"restorePrevious";
1302 static std::map<std::string, octave_idx_type>
1305 static std::map<std::string, octave_idx_type> methods;
1306 if (methods.empty ())
1308 methods[
"donotspecify"] = 0;
1309 methods[
"leaveinplace"] = 1;
1310 methods[
"restorebg"] = 2;
1311 methods[
"restoreprevious"] = 3;
1318 const std::string& ext,
1319 std::vector<Magick::Image>& imvec)
1323 Magick::writeImages (imvec.begin (), imvec.end (), ext +
":" + filename);
1325 catch (Magick::Warning&
w)
1327 warning (
"Magick++ warning: %s", w.what ());
1329 catch (Magick::ErrorCoder& e)
1331 warning (
"Magick++ coder error: %s", e.what ());
1333 catch (Magick::Exception& e)
1335 error (
"Magick++ exception: %s", e.what ());
1344 @deftypefn {Loadable Function} {} __magick_write__ (@var{fname}, @var{fmt}, @var{img}, @var{map}, @var{options})\n\
1345 Write image with GraphicsMagick or ImageMagick.\n\
1347 This is a private internal function not intended for direct use. Instead\n\
1348 use @code{imwrite}.\n\
1350 @seealso{imfinfo, imformats, imread, imwrite}\n\
1361 if (args.length () != 5 || ! args(0).is_string () || ! args(1).is_string ())
1366 const std::string filename = args(0).string_value ();
1367 const std::string ext = args(1).string_value ();
1372 error (
"__magick_write__: OPTIONS must be a struct");
1377 const Matrix cmap = args(3).matrix_value ();
1380 error (
"__magick_write__: invalid IMG or MAP");
1384 std::vector<Magick::Image> imvec;
1411 clip_img = img_float2uint<FloatNDArray>
1413 clip_alpha = img_float2uint<FloatNDArray>
1418 clip_img = img_float2uint<NDArray> (img.
array_value ());
1419 clip_alpha = img_float2uint<NDArray> (alpha.
array_value ());
1421 encode_uint_image<uint32NDArray> (imvec, clip_img, clip_alpha);
1425 error (
"__magick_write__: image type not supported");
1442 error (
"__magick_write__: indexed image must be uint8, uint16 or float.");
1446 static std::map<std::string, octave_idx_type> disposal_methods
1456 imvec[i].quality (quality);
1457 imvec[i].animationDelay (delaytime(i));
1458 imvec[i].gifDisposeMethod (disposal_methods[disposalmethod(i)]);
1466 std::vector<Magick::Image> ini_imvec;
1470 if (ini_imvec.size () > 0)
1472 ini_imvec.insert (ini_imvec.end (), imvec.begin (), imvec.end ());
1473 ini_imvec.swap (imvec);
1522 @deftypefn {Loadable Function} {} __magick_ping__ (@var{fname}, @var{idx})\n\
1523 Ping image information with GraphicsMagick or ImageMagick.\n\
1525 This is a private internal function not intended for direct use.\n\
1527 @seealso{imfinfo}\n\
1536 if (args.length () < 1 || ! args(0).is_string ())
1543 if (args.length () > 1)
1544 idx = args(1).int_value () -1;
1553 img.ping (filename);
1555 catch (Magick::Warning&
w)
1557 warning (
"Magick++ warning: %s", w.what ());
1559 catch (Magick::Exception& e)
1561 error (
"Magick++ exception: %s", e.what ());
1565 static const char *fields[] = {
"rows",
"columns",
"format", 0};
1581 case Magick::NoCompression:
1583 case Magick::BZipCompression:
1585 case Magick::FaxCompression:
1587 case Magick::Group4Compression:
1589 case Magick::JPEGCompression:
1591 case Magick::LZWCompression:
1593 case Magick::RLECompression:
1597 case Magick::ZipCompression:
1624 case Magick::LSBEndian:
1626 case Magick::MSBEndian:
1639 case Magick::TopLeftOrientation:
1641 case Magick::TopRightOrientation:
1643 case Magick::BottomRightOrientation:
1645 case Magick::BottomLeftOrientation:
1647 case Magick::LeftTopOrientation:
1649 case Magick::RightTopOrientation:
1651 case Magick::RightBottomOrientation:
1653 case Magick::LeftBottomOrientation:
1665 case Magick::PixelsPerInchResolution:
1667 case Magick::PixelsPerCentimeterResolution:
1679 return (! val.empty () && val !=
"unknown");
1684 const std::string& key)
1686 const std::string attr = img.attribute (
"EXIF:" + key);
1694 const std::string& key)
1696 const std::string attr = img.attribute (
"EXIF:" + key);
1701 ColumnVector values (std::count (attr.begin (), attr.end (),
',') +1);
1703 std::istringstream sstream (attr);
1705 while (std::getline (sstream, sub,
char (
',')))
1707 sscanf (sub.c_str (),
"%f", &number);
1708 values(n++) = number;
1717 const std::string& key)
1719 const std::string attr = img.attribute (
"EXIF:" + key);
1725 ColumnVector values (std::count (attr.begin (), attr.end (),
',') +1);
1727 std::istringstream sstream (attr);
1729 while (std::getline (sstream, sub,
','))
1731 sscanf (sub.c_str (),
"%i/%i", &numerator, &denominator);
1732 values(n++) =
double (numerator) /
double (denominator);
1743 @deftypefn {Loadable Function} {} __magick_finfo__ (@var{fname})\n\
1744 Read image information with GraphicsMagick or ImageMagick.\n\
1746 This is a private internal function not intended for direct use. Instead\n\
1747 use @code{imfinfo}.\n\
1749 @seealso{imfinfo, imformats, imread, imwrite}\n\
1759 if (args.length () < 1 || ! args(0).is_string ())
1766 std::vector<Magick::Image> imvec;
1771 const std::string format = imvec[0].magick ();
1791 static const char *fields[] =
1858 const std::string filetime = mtime.
strftime (
"%e-%b-%Y %H:%M:%S");
1865 error (
"imfinfo: error reading '%s': %s",
1866 filename.c_str (), fs.
error ().c_str ());
1873 const Magick::Image img = imvec[frame];
1883 std::string color_type;
1887 color_type =
"indexed";
1889 read_maps (const_cast<Magick::Image&> (img))(0).matrix_value ();
1893 switch (img.type ())
1895 case Magick::BilevelType:
1896 case Magick::GrayscaleType:
1897 case Magick::GrayscaleMatteType:
1898 color_type =
"grayscale";
1901 case Magick::TrueColorType:
1902 case Magick::TrueColorMatteType:
1903 color_type =
"truecolor";
1906 case Magick::PaletteType:
1907 case Magick::PaletteMatteType:
1909 color_type =
"indexed";
1912 case Magick::ColorSeparationType:
1913 case Magick::ColorSeparationMatteType:
1914 color_type =
"CMYK";
1918 color_type =
"undefined";
1930 double* chroma_fvec = chromaticities.
fortran_vec ();
1931 img.chromaWhitePoint (&chroma_fvec[0], &chroma_fvec[1]);
1932 img.chromaRedPrimary (&chroma_fvec[2], &chroma_fvec[3]);
1933 img.chromaGreenPrimary (&chroma_fvec[4], &chroma_fvec[5]);
1934 img.chromaBluePrimary (&chroma_fvec[6], &chroma_fvec[7]);
1935 if (chromaticities.
nnz () == 0)
1949 info_frame.
setfield (
"Compression",
1951 info_frame.
setfield (
"Orientation",
1953 info_frame.
setfield (
"ResolutionUnit",
1962 Magick::Image& cimg =
const_cast<Magick::Image&
> (img);
1971 static const char *base_exif_str_fields[] =
1982 static const string_vector base_exif_str (base_exif_str_fields);
1986 info_frame.
setfield (base_exif_str[field],
1988 fill_exif (info_frame, cimg, base_exif_str[field]);
1993 if (! cimg.attribute (
"EXIF:ExifVersion").empty ())
1999 static const char *exif_str_fields[] =
2003 "DateTimeDigitized",
2006 "SubSecTimeOriginal",
2007 "SubSecTimeDigitized",
2014 "SpectralSensitivity",
2024 fill_exif (camera, cimg, exif_str[field]);
2027 static const char *exif_int_fields[] =
2032 "PhotographicSensitivity",
2033 "StandardOutputSensitivity",
2034 "RecommendedExposureIndex",
2036 "ISOSpeedLatitudeyyy",
2037 "ISOSpeedLatitudezzz",
2038 "FocalPlaneResolutionUnit",
2039 "FocalLengthIn35mmFilm",
2062 "SubjectDistanceRange",
2071 static const char *exif_float_fields[] =
2074 "CompressedBitsPerPixel",
2077 "ShutterSpeedValue",
2080 "ExposureBiasValue",
2085 "FocalPlaneXResolution",
2086 "FocalPlaneYResolution",
2090 "LensSpecification",
2101 if (cimg.attribute (
"EXIF:GPSInfo") !=
"unknown")
2107 static const char *gps_str_fields[] =
2117 "GPSImgDirectionRef",
2119 "GPSDestLatitudeRef",
2120 "GPSDestLongitudeRef",
2121 "GPSDestBearingRef",
2122 "GPSDestDistanceRef",
2131 static const char *gps_int_fields[] =
2141 static const char *gps_float_fields[] =
2150 "GPSHPositioningError",
2173 if (format ==
"GIF")
2175 static std::map<octave_idx_type, std::string> disposal_methods
2179 methods[frame] = disposal_methods[imvec[frame].gifDisposeMethod ()];
2198 @deftypefn {Loadable Function} {} __magick_imformats__ (@var{formats})\n\
2199 Fill formats info with GraphicsMagick CoderInfo.\n\
2201 @seealso{imfinfo, imformats, imread, imwrite}\n\
2208 if (args.length () != 1 || ! args(0).is_map ())
2224 fmt.
setfield (
"multipage", coder.isMultiFrame () ?
true :
false);
2227 if (! coder.isReadable ())
2229 if (! coder.isWritable ())
2233 catch (Magick::Exception& e)