Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Unified Diff: printing/image.cc

Issue 5139006: FBTF: Remove unneeded headers from base/ (part 10) (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac, cros build Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « printing/image.h ('k') | printing/image_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/image.cc
===================================================================
--- printing/image.cc (revision 67155)
+++ printing/image.cc (working copy)
@@ -4,7 +4,10 @@
#include "printing/image.h"
+#include <algorithm>
+
#include "base/file_util.h"
+#include "base/logging.h"
#include "base/md5.h"
#include "base/string_number_conversions.h"
#include "gfx/codec/png_codec.h"
@@ -131,6 +134,14 @@
return static_cast<double>(pixels_different) / total_pixels * 100.;
}
+uint32 Image::pixel_at(int x, int y) const {
+ DCHECK(x >= 0 && x < size_.width());
+ DCHECK(y >= 0 && y < size_.height());
+ const uint32* data = reinterpret_cast<const uint32*>(&*data_.begin());
+ const uint32* data_row = data + y * row_length_ / sizeof(uint32);
+ return Color(data_row[x]);
+}
+
bool Image::LoadPng(const std::string& compressed) {
int w;
int h;
« no previous file with comments | « printing/image.h ('k') | printing/image_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698