Mercurial > hg > octave-thorsten
comparison src/DLD-FUNCTIONS/__magick_read__.cc @ 11586:12df7854fa7c
strip trailing whitespace from source files
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 20 Jan 2011 17:24:59 -0500 |
parents | 1473d0cf86d2 |
children | 4ced6b90fffb |
comparison
equal
deleted
inserted
replaced
11585:1473d0cf86d2 | 11586:12df7854fa7c |
---|---|
426 Array<int> frameidx; | 426 Array<int> frameidx; |
427 bool all_frames = false; | 427 bool all_frames = false; |
428 | 428 |
429 if (args.length () == 2 && args(1).is_real_type ()) | 429 if (args.length () == 2 && args(1).is_real_type ()) |
430 frameidx = args(1).int_vector_value(); | 430 frameidx = args(1).int_vector_value(); |
431 else if (args.length () == 3 && args(1).is_string () | 431 else if (args.length () == 3 && args(1).is_string () |
432 && args(1).string_value() == "frames") | 432 && args(1).string_value() == "frames") |
433 { | 433 { |
434 if (args(2).is_string () && args(2).string_value() == "all") | 434 if (args(2).is_string () && args(2).string_value() == "all") |
435 all_frames = true; | 435 all_frames = true; |
436 else if (args(2).is_real_type ()) | 436 else if (args(2).is_real_type ()) |
497 int i = 1; | 497 int i = 1; |
498 while (depth >>= 1) | 498 while (depth >>= 1) |
499 i++; | 499 i++; |
500 depth = 1 << i; | 500 depth = 1 << i; |
501 } | 501 } |
502 | 502 |
503 switch (depth) | 503 switch (depth) |
504 { | 504 { |
505 case 1: | 505 case 1: |
506 output = read_images<boolNDArray> (imvec, frameidx, depth); | 506 output = read_images<boolNDArray> (imvec, frameidx, depth); |
507 break; | 507 break; |
1021 try | 1021 try |
1022 { | 1022 { |
1023 // Read the file. | 1023 // Read the file. |
1024 std::vector<Magick::Image> imvec; | 1024 std::vector<Magick::Image> imvec; |
1025 Magick::readImages (&imvec, args(0).string_value ()); | 1025 Magick::readImages (&imvec, args(0).string_value ()); |
1026 int nframes = imvec.size (); | 1026 int nframes = imvec.size (); |
1027 | 1027 |
1028 // Create the right size for the output. | 1028 // Create the right size for the output. |
1029 | 1029 |
1030 static const char *fields[] = | 1030 static const char *fields[] = |
1031 { | 1031 { |
1032 "Filename", | 1032 "Filename", |
1080 // For each frame in the image (some images contain multiple | 1080 // For each frame in the image (some images contain multiple |
1081 // layers, each to be treated like a separate image). | 1081 // layers, each to be treated like a separate image). |
1082 for (int frame = 0; frame < nframes; frame++) | 1082 for (int frame = 0; frame < nframes; frame++) |
1083 { | 1083 { |
1084 Magick::Image im = imvec[frame]; | 1084 Magick::Image im = imvec[frame]; |
1085 | 1085 |
1086 // Add file name and timestamp. | 1086 // Add file name and timestamp. |
1087 info.contents ("Filename")(frame,0) = filename; | 1087 info.contents ("Filename")(frame,0) = filename; |
1088 info.contents ("FileModDate")(frame,0) = filetime; | 1088 info.contents ("FileModDate")(frame,0) = filetime; |
1089 | 1089 |
1090 // Annoying CamelCase naming is for Matlab compatibility. | 1090 // Annoying CamelCase naming is for Matlab compatibility. |
1091 GET_PARAM (fileSize, "FileSize") | 1091 GET_PARAM (fileSize, "FileSize") |
1092 GET_PARAM (rows, "Height") | 1092 GET_PARAM (rows, "Height") |
1093 GET_PARAM (columns, "Width") | 1093 GET_PARAM (columns, "Width") |
1094 GET_PARAM (depth, "BitDepth") | 1094 GET_PARAM (depth, "BitDepth") |