Home | History | Annotate | Download | only in cloud_print
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_UTILITY_CLOUD_PRINT_BITMAP_IMAGE_H_
      6 #define CHROME_UTILITY_CLOUD_PRINT_BITMAP_IMAGE_H_
      7 
      8 #include "base/memory/scoped_ptr.h"
      9 #include "ui/gfx/size.h"
     10 
     11 namespace cloud_print {
     12 
     13 class BitmapImage {
     14  public:
     15   enum Colorspace {
     16     // These are the only types PWGEncoder currently supports.
     17     RGBA,
     18     BGRA
     19   };
     20 
     21   BitmapImage(const gfx::Size& size, Colorspace colorspace);
     22   ~BitmapImage();
     23 
     24   uint8 channels() const;
     25   const gfx::Size& size() const { return size_; }
     26   Colorspace colorspace() const { return colorspace_; }
     27 
     28   const uint8* pixel_data() const { return data_.get(); }
     29   uint8* pixel_data() { return data_.get(); }
     30 
     31  private:
     32   gfx::Size size_;
     33   Colorspace colorspace_;
     34   scoped_ptr<uint8[]> data_;
     35 
     36   DISALLOW_COPY_AND_ASSIGN(BitmapImage);
     37 };
     38 
     39 }  // namespace cloud_print
     40 
     41 #endif  // CHROME_UTILITY_CLOUD_PRINT_BITMAP_IMAGE_H_
     42