| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_UTILITY_MEDIA_GALLERIES_IMAGE_METADATA_EXTRACTOR_H_ | |
| 6 #define CHROME_UTILITY_MEDIA_GALLERIES_IMAGE_METADATA_EXTRACTOR_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/callback_forward.h" | |
| 12 | |
| 13 namespace media { | |
| 14 class DataSource; | |
| 15 } | |
| 16 | |
| 17 namespace net { | |
| 18 class DrainableIOBuffer; | |
| 19 } | |
| 20 | |
| 21 namespace metadata { | |
| 22 | |
| 23 class ImageMetadataExtractor { | |
| 24 public: | |
| 25 typedef base::Callback<void(bool)> DoneCallback; | |
| 26 | |
| 27 ImageMetadataExtractor(); | |
| 28 ~ImageMetadataExtractor(); | |
| 29 | |
| 30 // |callback| called with whether or not the extraction succeeded. Should | |
| 31 // only be called once. | |
| 32 void Extract(media::DataSource* source, const DoneCallback& callback); | |
| 33 | |
| 34 // Returns -1 if this could not be extracted. | |
| 35 int width() const; | |
| 36 int height() const; | |
| 37 | |
| 38 // In degrees. | |
| 39 int rotation() const; | |
| 40 | |
| 41 // In pixels per inch. | |
| 42 double x_resolution() const; | |
| 43 double y_resolution() const; | |
| 44 | |
| 45 const std::string& date() const; | |
| 46 | |
| 47 const std::string& camera_make() const; | |
| 48 const std::string& camera_model() const; | |
| 49 double exposure_time_sec() const; | |
| 50 bool flash_fired() const; | |
| 51 double f_number() const; | |
| 52 double focal_length_mm() const; | |
| 53 int iso_equivalent() const; | |
| 54 | |
| 55 private: | |
| 56 void FinishExtraction(const DoneCallback& callback, | |
| 57 net::DrainableIOBuffer* buffer); | |
| 58 | |
| 59 bool extracted_; | |
| 60 | |
| 61 int width_; | |
| 62 int height_; | |
| 63 | |
| 64 int rotation_; | |
| 65 | |
| 66 double x_resolution_; | |
| 67 double y_resolution_; | |
| 68 | |
| 69 std::string date_; | |
| 70 | |
| 71 std::string camera_make_; | |
| 72 std::string camera_model_; | |
| 73 double exposure_time_sec_; | |
| 74 bool flash_fired_; | |
| 75 double f_number_; | |
| 76 double focal_length_mm_; | |
| 77 int iso_equivalent_; | |
| 78 | |
| 79 DISALLOW_COPY_AND_ASSIGN(ImageMetadataExtractor); | |
| 80 }; | |
| 81 | |
| 82 } // namespace metadata | |
| 83 | |
| 84 #endif // CHROME_UTILITY_MEDIA_GALLERIES_IMAGE_METADATA_EXTRACTOR_H_ | |
| OLD | NEW |