Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / utility / cloud_print / bitmap_image.cc
index 2a2cf9f..5d43ee7 100644 (file)
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "base/logging.h"
 #include "chrome/utility/cloud_print/bitmap_image.h"
 
 namespace cloud_print {
@@ -24,4 +25,10 @@ uint8 BitmapImage::channels() const {
   return kCurrentlySupportedNumberOfChannels;
 }
 
+const uint8* BitmapImage::GetPixel(const gfx::Point& point) const {
+  DCHECK_LT(point.x(), size_.width());
+  DCHECK_LT(point.y(), size_.height());
+  return data_.get() + (point.y() * size_.width() + point.x()) * channels();
+}
+
 }  // namespace cloud_print