OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 bool LoadFromRawData(RawData *raw_data, | 235 bool LoadFromRawData(RawData *raw_data, |
236 image::ImageFileType file_type, | 236 image::ImageFileType file_type, |
237 bool generate_mipmaps); | 237 bool generate_mipmaps); |
238 | 238 |
239 // Flips a bitmap vertically in place. | 239 // Flips a bitmap vertically in place. |
240 // This is needed instead of just using DrawImage because flipping DXT formats | 240 // This is needed instead of just using DrawImage because flipping DXT formats |
241 // using generic algorithms would be lossy and extremely slow to reconvert | 241 // using generic algorithms would be lossy and extremely slow to reconvert |
242 // from a flippable format back to a DXT format. | 242 // from a flippable format back to a DXT format. |
243 void FlipVertically(); | 243 void FlipVertically(); |
244 | 244 |
245 // Saves to a PNG file. The image must be of the ARGB8 format, be a 2D image | 245 // Returns the contents of the bitmap as a data URL |
246 // with no mip-maps (only the base level). | |
247 // Parameters: | |
248 // filename: the name of the file to into. | |
249 // Returns: | 246 // Returns: |
250 // true if successful. | 247 // A data url that represents the content of the bitmap. |
251 bool SaveToPNGFile(const char* filename); | 248 String ToDataURL(); |
252 | 249 |
253 // Checks that the alpha channel for the entire bitmap is 1.0 | 250 // Checks that the alpha channel for the entire bitmap is 1.0 |
254 bool CheckAlphaIsOne() const; | 251 bool CheckAlphaIsOne() const; |
255 | 252 |
256 // Copy pixels from source bitmap. Scales if the width and height of source | 253 // Copy pixels from source bitmap. Scales if the width and height of source |
257 // and dest do not match. | 254 // and dest do not match. |
258 // Parameters: | 255 // Parameters: |
259 // source_img: source bitmap which would be drawn. | 256 // source_img: source bitmap which would be drawn. |
260 // source_x: x-coordinate of the starting pixel in the source image. | 257 // source_x: x-coordinate of the starting pixel in the source image. |
261 // source_x: y-coordinate of the starting pixel in the source image. | 258 // source_x: y-coordinate of the starting pixel in the source image. |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 public: | 400 public: |
404 explicit BitmapDXT5(ServiceLocator* service_locator); | 401 explicit BitmapDXT5(ServiceLocator* service_locator); |
405 | 402 |
406 private: | 403 private: |
407 DISALLOW_COPY_AND_ASSIGN(BitmapDXT5); | 404 DISALLOW_COPY_AND_ASSIGN(BitmapDXT5); |
408 }; | 405 }; |
409 | 406 |
410 } // namespace o3d | 407 } // namespace o3d |
411 | 408 |
412 #endif // O3D_CORE_CROSS_BITMAP_H_ | 409 #endif // O3D_CORE_CROSS_BITMAP_H_ |
OLD | NEW |