Mali OpenCL SDK v1.1.0
 All Classes Files Functions Variables Macros Pages
image.h
Go to the documentation of this file.
1 /*
2  * This confidential and proprietary software may be used only as
3  * authorised by a licensing agreement from ARM Limited
4  * (C) COPYRIGHT 2013 ARM Limited
5  * ALL RIGHTS RESERVED
6  * The entire notice above must be reproduced on all authorised
7  * copies and copies may only be made to the extent permitted
8  * by a licensing agreement from ARM Limited.
9  */
10 
11 #ifndef IMAGE_H
12 #define IMAGE_H
13 
14 #include <CL/cl.h>
15 #include <string>
16 
27 {
28  unsigned char magic[2];
29 };
30 
36 {
37  uint32_t fileSize;
38  uint16_t creator1;
39  uint16_t creator2;
40  uint32_t offset;
41 };
42 
48 {
49  uint32_t size;
50  int32_t width;
51  int32_t height;
53  uint16_t bitsPerPixel;
54  uint32_t compressionType;
55  uint32_t rawBitmapSize;
58  uint32_t numberOfColors;
60 };
61 
73 bool saveToBitmap(std::string filename, int width, int height, const unsigned char* imageData);
74 
86 bool loadFromBitmap(std::string filename, int* width, int* height, unsigned char **imageData);
87 
99 bool luminanceToRGB(const unsigned char* luminanceData, unsigned char* rgbData, int width, int height);
100 
112 bool RGBToLuminance(const unsigned char* rgbData, unsigned char* luminanceData, int width, int height);
113 
114 
125 bool RGBToRGBA(const unsigned char* rgbData, unsigned char* rgbaData, int width, int height);
126 
137 bool RGBAToRGB(const unsigned char* rgbaData, unsigned char* rgbData, int width, int height);
138 
139 #endif