Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
conversionutils.h
Go to the documentation of this file.
1 
18 #ifndef ION_IMAGE_CONVERSIONUTILS_H_
19 #define ION_IMAGE_CONVERSIONUTILS_H_
20 
29 
30 #include <vector>
31 
32 #include "base/integral_types.h"
33 #include "ion/base/allocator.h"
34 #include "ion/gfx/image.h"
35 
36 namespace ion {
37 namespace image {
38 
42 };
43 
71 ION_API const gfx::ImagePtr ConvertImage(
72  const gfx::ImagePtr& image, gfx::Image::Format target_format,
73  bool is_wipeable,
74  const base::AllocatorPtr& allocator,
75  const base::AllocatorPtr& temporary_allocator);
76 
122  const void* data, size_t data_size, bool flip_vertically, bool is_wipeable,
123  const base::AllocatorPtr& allocator);
124 
126 ION_API bool IsIonRawImageFormat(const void* data, size_t data_size);
127 
132 ION_API const std::vector<uint8> ConvertToExternalImageData(
133  const gfx::ImagePtr& image, ExternalImageFormat external_format,
134  bool flip_vertically);
135 
142 ION_API const gfx::ImagePtr DownsampleImage2x(
143  const gfx::ImagePtr& image, bool is_wipeable,
144  const base::AllocatorPtr& allocator);
145 
151 ION_API const gfx::ImagePtr ResizeImage(
152  const gfx::ImagePtr& image, uint32 out_width, uint32 out_height,
153  bool is_wipeable, const base::AllocatorPtr& allocator);
154 
157 ION_API void FlipImage(const gfx::ImagePtr& image);
158 
161 ION_API void FlipImageHorizontally(const gfx::ImagePtr& image);
162 
166 
167 } // namespace image
168 } // namespace ion
169 
170 #endif // ION_IMAGE_CONVERSIONUTILS_H_
Format
Supported image formats.
Definition: image.h:38
bool ION_API IsIonRawImageFormat(const void *data, size_t data_size)
Returns true if "Ion raw" format header is detected in data.
const ImagePtr ION_API ConvertImage(const ImagePtr &image, Image::Format target_format, bool is_wipeable, const base::AllocatorPtr &allocator, const base::AllocatorPtr &temporary_allocator)
Public functions.
ExternalImageFormat
External image formats supported by ConvertToExternalImageData().
const ImagePtr ION_API DownsampleImage2x(const ImagePtr &image, bool is_wipeable, const base::AllocatorPtr &allocator)
const ImagePtr ION_API ConvertFromExternalImageData(const void *data, size_t data_size, bool flip_vertically, bool is_wipeable, const base::AllocatorPtr &allocator)
Converts external image data to an ImagePtr with data in canonical format.
ION_API void StraightAlphaFromPremultipliedAlpha(const gfx::ImagePtr &image)
Converts a "pre-multiplied alpha" RGBA image into a "straight alpha" RGBA image.
ION_API void FlipImageHorizontally(const gfx::ImagePtr &image)
Flips an image horizontally in place.
const Grid & image
The original monochrome image data, as doubles (0 - 1).
Definition: sdfutils.cc:90
A SharedPtr is a smart shared pointer to an instance of some class that implements reference counting...
Definition: sharedptr.h:60
const std::vector< uint8 > ION_API ConvertToExternalImageData(const ImagePtr &image, ExternalImageFormat external_format, bool flip_vertically)
ION_API void FlipImage(const gfx::ImagePtr &image)
Flips an image vertically in place.
const gfx::ImagePtr ResizeImage(const gfx::ImagePtr &image, uint32 out_width, uint32 out_height, bool is_wipeable, const base::AllocatorPtr &allocator)
Returns a copy of image scaled to the specified dimensions.