OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. |
| 4 * |
| 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are |
| 7 * met: |
| 8 * |
| 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. |
| 11 * * Redistributions in binary form must reproduce the above |
| 12 * copyright notice, this list of conditions and the following disclaimer |
| 13 * in the documentation and/or other materials provided with the |
| 14 * distribution. |
| 15 * * Neither the name of Google Inc. nor the names of its |
| 16 * contributors may be used to endorse or promote products derived from |
| 17 * this software without specific prior written permission. |
| 18 * |
| 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 */ |
| 31 |
| 32 |
| 33 namespace o3d { |
| 34 |
| 35 %[ |
| 36 Bitmap provides an interface for basic image operations on bitmap, |
| 37 including scale and crop. The contents of bitmap can be created from |
| 38 RawData via pack.createBitmapFromRawData(), and also can be transfered |
| 39 to mip of a Texure2D or a specific face of TextureCUBE via methods |
| 40 in Texture. |
| 41 %] |
| 42 |
| 43 [nocpp, include="core/cross/bitmap.h"] |
| 44 class Bitmap : ParamObject { |
| 45 %[ |
| 46 enum ImageFileType { |
| 47 \li UNKNOWN, Image type unknown. |
| 48 \li TGA, image in TGA format. |
| 49 \li JPEG, image in JPEG format. |
| 50 \li PNG, image in PNG format. |
| 51 \li DDS, image in DDS format. |
| 52 }; |
| 53 %] |
| 54 enum ImageFileType { |
| 55 UNKNOWN, |
| 56 TGA, |
| 57 JPEG, |
| 58 PNG, |
| 59 DDS |
| 60 }; |
| 61 |
| 62 %[ |
| 63 Copy pixels from source bitmap. Scales if the width and height of source |
| 64 and dest do not match. |
| 65 \param source_img source bitmap which would be drawn. |
| 66 \param source_x x-coordinate of the starting pixel in the source image. |
| 67 \param source_y y-coordinate of the starting pixel in the source image. |
| 68 \param source_width width of the source image to draw. |
| 69 \param source_height Height of the source image to draw. |
| 70 \param dest_x x-coordinate of the starting pixel in the dest image. |
| 71 \param dest_y y-coordinate of the starting pixel in the dest image. |
| 72 \param dest_width width of the dest image to draw. |
| 73 \param dest_height height of the dest image to draw. |
| 74 %] |
| 75 void DrawImage(Bitmap source_img, int source_x, int source_y, |
| 76 int source_width, int source_height, |
| 77 int dest_x, int dest_y, |
| 78 int dest_width, int dest_height); |
| 79 |
| 80 %[ |
| 81 The width of the bitmap (read only). |
| 82 %] |
| 83 [getter] int width_; |
| 84 |
| 85 %[ |
| 86 The height of the bitmap (read only). |
| 87 %] |
| 88 [getter] int height_; |
| 89 |
| 90 }; // Bitmap |
| 91 |
| 92 } // namespace o3d |
OLD | NEW |