Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kImage.h
Go to the documentation of this file.
1
10 #ifndef K_API_IMAGE_H
11 #define K_API_IMAGE_H
12
13 #include <kApi/kApiDef.h>
14
15 kBeginHeader()
16
17
56 //typedef kObject kImage; --forward-declared in kApiDef.x.h
57
58
69 kFx(kStatus) kImage_Construct(kImage* image, kType pixelType, kSize width, kSize height, kAlloc allocator);
70
82 kFx(kStatus) kImage_Import(kImage *image, const char* fileName, kAlloc allocator);
83
94 kFx(kStatus) kImage_Export(kImage image, const char* fileName);
95
106 kFx(kStatus) kImage_Allocate(kImage image, kType pixelType, kSize width, kSize height);
107
122 kFx(kStatus) kImage_Attach(kImage image, void* pixels, kType pixelType, kSize width, kSize height, kSize stride);
123
132 kFx(kStatus) kImage_Assign(kImage image, kImage source);
133
141 kFx(kStatus) kImage_Zero(kImage image);
142
151 kFx(kStatus) kImage_SetPixelFormat(kImage image, kPixelFormat format);
152
160 kFx(kPixelFormat) kImage_PixelFormat(kImage image);
161
170 kFx(kStatus) kImage_SetCfa(kImage image, kCfa cfa);
171
179 kFx(kCfa) kImage_Cfa(kImage image);
180
194 kFx(kStatus) kImage_SetPixel(kImage image, kSize x, kSize y, const void* pixel);
195
209 kFx(kStatus) kImage_Pixel(kImage image, kSize x, kSize y, void* pixel);
210
218 kFx(void*) kImage_Data(kImage image);
219
227 kFx(kSize) kImage_DataSize(kImage image);
228
238 kFx(void*) kImage_At(kImage image, kSize x, kSize y);
239
248 kFx(void*) kImage_RowAt(kImage image, kSize y);
249
257 kFx(kType) kImage_PixelType(kImage image);
258
266 kFx(kSize) kImage_PixelSize(kImage image);
267
275 kFx(kSize) kImage_Width(kImage image);
276
284 kFx(kSize) kImage_Height(kImage image);
285
295 kFx(kSize) kImage_Area(kImage image);
296
304 kFx(kSize) kImage_Stride(kImage image);
305
308 #define kImage_Data_(IMAGE) kxImage_Data_(IMAGE)
309 #define kImage_DataSize_(IMAGE) kxImage_DataSize_(IMAGE)
310 #define kImage_At_(IMAGE, X, Y) kxImage_At_(IMAGE, X, Y)
311 #define kImage_RowAt_(IMAGE, Y) kxImage_RowAt_(IMAGE, Y)
312 #define kImage_PixelType_(IMAGE) kxImage_PixelType_(IMAGE)
313 #define kImage_PixelSize_(IMAGE) kxImage_PixelSize_(IMAGE)
314 #define kImage_Width_(IMAGE) kxImage_Width_(IMAGE)
315 #define kImage_Height_(IMAGE) kxImage_Height_(IMAGE)
316 #define kImage_Area_(IMAGE) kxImage_Area_(IMAGE)
317 #define kImage_Stride_(IMAGE) kxImage_Stride_(IMAGE)
318 #define kImage_PixelFormat_(IMAGE) kxImage_PixelFormat_(IMAGE)
319 #define kImage_Cfa_(IMAGE) kxImage_Cfa_(IMAGE)
320
321
322 #define kImage_As_(IMAGE, X, Y, TYPE) kxImage_As_(IMAGE, X, Y, TYPE)
323
326 kEndHeader()
327
328 #include <kApi/Data/kImage.x.h>
329
330 #endif
kImage::kImage_Assign
kStatus kImage_Assign(kImage image, kImage source)
Copies a given source image into this image.
kImage::kImage_SetPixel
kStatus kImage_SetPixel(kImage image, kSize x, kSize y, const void *pixel)
Sets the value of a pixel.
kImage::kImage_Pixel
kStatus kImage_Pixel(kImage image, kSize x, kSize y, void *pixel)
Gets the value of a pixel.
kImage::kImage_RowAt
void * kImage_RowAt(kImage image, kSize y)
Returns a pointer to the specified row in the pixel buffer.
kImage::kImage_PixelFormat
kPixelFormat kImage_PixelFormat(kImage image)
Gets the optional pixel format descriptor associated with this image.
kImage::kImage_Data
void * kImage_Data(kImage image)
Returns a pointer to the first row in the pixel buffer.
kImage::kImage_Area
kSize kImage_Area(kImage image)
Returns the area of the image, in pixels.
kImage::kImage_PixelSize
kSize kImage_PixelSize(kImage image)
Returns the pixel size.
kSize
Represents an unsigned integer that can store a pointer address.
kAlloc
Abstract base class for memory allocator types.
kImage::kImage_Construct
kStatus kImage_Construct(kImage *image, kType pixelType, kSize width, kSize height, kAlloc allocator)
Constructs a kImage object.
kImage::kImage_DataSize
kSize kImage_DataSize(kImage image)
Reports the size, in bytes, of the pixel buffer.
kImage::kImage_At
void * kImage_At(kImage image, kSize x, kSize y)
Returns a pointer to the specified pixel in the pixel buffer.
kPixelFormat
Pixel format descriptor.
kImage::kImage_Attach
kStatus kImage_Attach(kImage image, void *pixels, kType pixelType, kSize width, kSize height, kSize stride)
Attaches the image to an external pixel buffer.
kImage::kImage_SetCfa
kStatus kImage_SetCfa(kImage image, kCfa cfa)
Sets the color filter array type associated with this image.
kApiDef.h
Core Zen type declarations.
kImage::kImage_PixelType
kType kImage_PixelType(kImage image)
Returns the pixel type.
kImage::kImage_Export
kStatus kImage_Export(kImage image, const char *fileName)
Saves an image to file.
kImage::kImage_Allocate
kStatus kImage_Allocate(kImage image, kType pixelType, kSize width, kSize height)
Reallocates the internal pixel buffer.
kImage::kImage_Width
kSize kImage_Width(kImage image)
Returns the width of the image, in pixels.
kType
Represents metadata about a type (class, interface, or value).
kImage::kImage_Import
kStatus kImage_Import(kImage *image, const char *fileName, kAlloc allocator)
Loads an image from file.
kImage
Represents a 2D collection of pixels.
kImage::kImage_Cfa
kCfa kImage_Cfa(kImage image)
Gets the color filter array type associated with this image.
kStatus
Represents an error code.
kImage::kImage_Height
kSize kImage_Height(kImage image)
Returns the height of the image, in pixels.
kCfa
Image color filter array type.
kImage::kImage_Zero
kStatus kImage_Zero(kImage image)
Sets all pixel bits to zero.
kImage::kImage_SetPixelFormat
kStatus kImage_SetPixelFormat(kImage image, kPixelFormat format)
Sets the optional pixel format descriptor associated with this image.
kImage::kImage_Stride
kSize kImage_Stride(kImage image)
Returns the size of an image row, including alignment padding bytes, in bytes.