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

Side by Side Diff: chrome/utility/cloud_print/bitmap_image.cc

Issue 1548153002: Switch to standard integer types in chrome/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 months 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 unified diff | Download patch
« no previous file with comments | « chrome/utility/cloud_print/bitmap_image.h ('k') | chrome/utility/cloud_print/pwg_encoder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/logging.h" 5 #include "base/logging.h"
6 #include "chrome/utility/cloud_print/bitmap_image.h" 6 #include "chrome/utility/cloud_print/bitmap_image.h"
7 7
8 namespace cloud_print { 8 namespace cloud_print {
9 9
10 namespace { 10 namespace {
11 const uint8 kCurrentlySupportedNumberOfChannels = 4; 11 const uint8_t kCurrentlySupportedNumberOfChannels = 4;
12 } 12 }
13 13
14 BitmapImage::BitmapImage(const gfx::Size& size, 14 BitmapImage::BitmapImage(const gfx::Size& size, Colorspace colorspace)
15 Colorspace colorspace)
16 : size_(size), 15 : size_(size),
17 colorspace_(colorspace), 16 colorspace_(colorspace),
18 data_(new uint8[size.GetArea() * channels()]) { 17 data_(new uint8_t[size.GetArea() * channels()]) {}
19 }
20 18
21 BitmapImage::~BitmapImage() { 19 BitmapImage::~BitmapImage() {
22 } 20 }
23 21
24 uint8 BitmapImage::channels() const { 22 uint8_t BitmapImage::channels() const {
25 return kCurrentlySupportedNumberOfChannels; 23 return kCurrentlySupportedNumberOfChannels;
26 } 24 }
27 25
28 const uint8* BitmapImage::GetPixel(const gfx::Point& point) const { 26 const uint8_t* BitmapImage::GetPixel(const gfx::Point& point) const {
29 DCHECK_LT(point.x(), size_.width()); 27 DCHECK_LT(point.x(), size_.width());
30 DCHECK_LT(point.y(), size_.height()); 28 DCHECK_LT(point.y(), size_.height());
31 return data_.get() + (point.y() * size_.width() + point.x()) * channels(); 29 return data_.get() + (point.y() * size_.width() + point.x()) * channels();
32 } 30 }
33 31
34 } // namespace cloud_print 32 } // namespace cloud_print
OLDNEW
« no previous file with comments | « chrome/utility/cloud_print/bitmap_image.h ('k') | chrome/utility/cloud_print/pwg_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698