[email protected] | 267c03d | 2011-02-02 23:03:07 | [diff] [blame^] | 1 | // Copyright (c) 2009 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 UI_GFX_GDI_UTIL_H_ |
| 6 | #define UI_GFX_GDI_UTIL_H_ |
| 7 | #pragma once |
| 8 | |
| 9 | #include <vector> |
| 10 | #include <windows.h> |
| 11 | |
| 12 | #include "gfx/rect.h" |
| 13 | |
| 14 | namespace gfx { |
| 15 | |
| 16 | // Creates a BITMAPINFOHEADER structure given the bitmap's size. |
| 17 | void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr); |
| 18 | |
| 19 | // Creates a BITMAPINFOHEADER structure given the bitmap's size and |
| 20 | // color depth in bits per pixel. |
| 21 | void CreateBitmapHeaderWithColorDepth(int width, int height, int color_depth, |
| 22 | BITMAPINFOHEADER* hdr); |
| 23 | |
| 24 | // Creates a BITMAPV4HEADER structure given the bitmap's size. You probably |
| 25 | // only need to use BMP V4 if you need transparency (alpha channel). This |
| 26 | // function sets the AlphaMask to 0xff000000. |
| 27 | void CreateBitmapV4Header(int width, int height, BITMAPV4HEADER* hdr); |
| 28 | |
| 29 | // Creates a monochrome bitmap header. |
| 30 | void CreateMonochromeBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr); |
| 31 | |
| 32 | // Modify the given hrgn by subtracting the given rectangles. |
| 33 | void SubtractRectanglesFromRegion(HRGN hrgn, |
| 34 | const std::vector<gfx::Rect>& cutouts); |
| 35 | |
| 36 | } // namespace gfx |
| 37 | |
| 38 | #endif // UI_GFX_GDI_UTIL_H_ |