From 381bc458bfc58a239f3dfe69b008c6d3522869a2 Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Tue, 30 Nov 2010 03:04:46 +0000 Subject: FBTF: Remove unneeded headers from base/ (part 10) BUG=none TEST=none Review URL: http://codereview.chromium.org/5139006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67662 0039d316-1c4b-4281-b951-d872f2087c98 --- printing/image.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'printing/image.cc') diff --git a/printing/image.cc b/printing/image.cc index dd52380..affd5db 100644 --- a/printing/image.cc +++ b/printing/image.cc @@ -4,7 +4,10 @@ #include "printing/image.h" +#include + #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 @@ double Image::PercentageDifferent(const Image& rhs) const { return static_cast(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(&*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; -- cgit v1.1