sl@0: /* Copyright (c) 2009 The Khronos Group Inc. sl@0: * Portions copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies) sl@0: * sl@0: * Permission is hereby granted, free of charge, to any person obtaining a sl@0: * copy of this software and/or associated documentation files (the sl@0: * "Materials"), to deal in the Materials without restriction, including sl@0: * without limitation the rights to use, copy, modify, merge, publish, sl@0: * distribute, sublicense, and/or sell copies of the Materials, and to sl@0: * permit persons to whom the Materials are furnished to do so, subject to sl@0: * the following conditions: sl@0: * sl@0: * The above copyright notice and this permission notice shall be included sl@0: * in all copies or substantial portions of the Materials. sl@0: * sl@0: * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, sl@0: * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF sl@0: * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. sl@0: * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY sl@0: * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, sl@0: * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE sl@0: * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. sl@0: */ sl@0: sl@0: #ifndef OWFIMAGE_H_ sl@0: #define OWFIMAGE_H_ sl@0: sl@0: #include "owftypes.h" sl@0: sl@0: #ifdef __cplusplus sl@0: extern "C" { sl@0: #endif sl@0: sl@0: typedef void* OWF_DISPCTX; sl@0: sl@0: sl@0: #undef USE_FLOAT_PIXEL sl@0: sl@0: /* sl@0: * This is and always should be the only place where USE_FLOAT_PIXEL is sl@0: * defined so if #define USE_FLOAT_PIXEL is absent in owfimage.h then it sl@0: * can be assumed it is not defined elsewhere. sl@0: */ sl@0: //#define USE_FLOAT_PIXEL sl@0: sl@0: /* -- sl@0: * internal pixel format sl@0: */ sl@0: #ifdef USE_FLOAT_PIXEL sl@0: #define OWF_IMAGE_INTERNAL_PIXEL_IS_FLOAT sl@0: sl@0: typedef OWFfloat OWFsubpixel; /* subpixel representation */ sl@0: sl@0: #define OWF_RED_MIN_VALUE 0.0f sl@0: #define OWF_RED_MAX_VALUE 1.0f sl@0: #define OWF_GREEN_MIN_VALUE 0.0f sl@0: #define OWF_GREEN_MAX_VALUE 1.0f sl@0: #define OWF_BLUE_MIN_VALUE 0.0f sl@0: #define OWF_BLUE_MAX_VALUE 1.0f sl@0: #define OWF_ALPHA_MIN_VALUE 0.0f sl@0: #define OWF_ALPHA_MAX_VALUE 1.0f sl@0: sl@0: #define OWF_FULLY_OPAQUE OWF_ALPHA_MAX_VALUE sl@0: #define OWF_FULLY_TRANSPARENT OWF_ALPHA_MIN_VALUE sl@0: sl@0: #define OWF_BYTE_MAX_VALUE 255.0f sl@0: #define OWF_BILINEAR_ROUNDING_VALUE 0.0f sl@0: #define OWF_BLEND_ROUNDING_VALUE 0.0f sl@0: #define OWF_PREMUL_ROUNDING_FACTOR 0.0f sl@0: #define OWF_SOURCE_CONVERSION_ROUNDING_VALUE 0.0f sl@0: sl@0: #else sl@0: #undef OWF_IMAGE_INTERNAL_PIXEL_IS_FLOAT sl@0: sl@0: typedef OWFuint8 OWFsubpixel; /* subpixel representation */ sl@0: sl@0: #define OWF_RED_MIN_VALUE 0 sl@0: #define OWF_RED_MAX_VALUE 255 sl@0: #define OWF_GREEN_MIN_VALUE 0 sl@0: #define OWF_GREEN_MAX_VALUE 255 sl@0: #define OWF_BLUE_MIN_VALUE 0 sl@0: #define OWF_BLUE_MAX_VALUE 255 sl@0: #define OWF_ALPHA_MIN_VALUE 0 sl@0: #define OWF_ALPHA_MAX_VALUE 255 sl@0: #define OWF_FULLY_OPAQUE OWF_ALPHA_MAX_VALUE sl@0: #define OWF_FULLY_TRANSPARENT OWF_ALPHA_MIN_VALUE sl@0: sl@0: #define OWF_BYTE_MAX_VALUE 255 sl@0: sl@0: #define OWF_BILINEAR_ROUNDING_VALUE 0.5f sl@0: #define OWF_SOURCE_CONVERSION_ROUNDING_VALUE 0.5f sl@0: #define OWF_BLEND_ROUNDING_VALUE (OWF_ALPHA_MAX_VALUE/2) sl@0: #define OWF_PREMUL_ROUNDING_FACTOR (OWF_ALPHA_MAX_VALUE/2) sl@0: sl@0: #endif sl@0: sl@0: /* sl@0: * Byte order of different color formats sl@0: * these are used when converting from/to sl@0: * internal format sl@0: */ sl@0: sl@0: #define ARGB8888_ALPHA_MASK 0xFF000000 sl@0: #define ARGB8888_RED_MASK 0x00FF0000 sl@0: #define ARGB8888_GREEN_MASK 0x0000FF00 sl@0: #define ARGB8888_BLUE_MASK 0x000000FF sl@0: #define ARGB8888_ALPHA_SHIFT 24 sl@0: #define ARGB8888_RED_SHIFT 16 sl@0: #define ARGB8888_GREEN_SHIFT 8 sl@0: #define ARGB8888_BLUE_SHIFT 0 sl@0: sl@0: #define RGB565_ALPHA_MASK 0xFFFF sl@0: #define RGB565_RED_MASK 0xF800 sl@0: #define RGB565_GREEN_MASK 0x07E0 sl@0: #define RGB565_BLUE_MASK 0x001F sl@0: sl@0: /* These are used when converting from RGB565 to ARGB8888. */ sl@0: #define RGB565_ALPHA_SHIFT 16 sl@0: #define RGB565_RED_SHIFT 11 sl@0: #define RGB565_GREEN_SHIFT 5 sl@0: sl@0: /* subpixels per pixel */ sl@0: #define OWF_PIXEL_SIZE 4 sl@0: sl@0: /* subpixel in bytes */ sl@0: #define OWF_SUBPIXEL_SIZE sizeof(OWFsubpixel) sl@0: #define OWF_BYTES_PER_PIXEL (OWF_PIXEL_SIZE * OWF_SUBPIXEL_SIZE) sl@0: sl@0: #pragma pack(push, 1) sl@0: typedef union { sl@0: struct { sl@0: OWFsubpixel blue; sl@0: OWFsubpixel green; sl@0: OWFsubpixel red; sl@0: OWFsubpixel alpha; sl@0: } color; sl@0: OWFsubpixel subpixel[OWF_PIXEL_SIZE]; sl@0: OWFuint8 pixelbytes[OWF_BYTES_PER_PIXEL]; sl@0: } OWFpixel; sl@0: #pragma pack(pop) sl@0: sl@0: /* -- */ sl@0: sl@0: /* filters used in OWF_Image_Stretch */ sl@0: typedef enum { sl@0: OWF_FILTER_POINT_SAMPLING, /* nearest pixel */ sl@0: OWF_FILTER_BILINEAR /* nearest 4 */ sl@0: } OWF_FILTERING; sl@0: sl@0: typedef struct { sl@0: OWFint width; sl@0: OWFint height; sl@0: OWFint stride; /* number of bytes per line */ sl@0: OWFint pixelSize; /* pixel size in bytes */ sl@0: OWF_IMAGE_FORMAT format; sl@0: OWFboolean foreign; sl@0: OWFint dataMax; /* data buffer max size */ sl@0: void* data; sl@0: } OWF_IMAGE; sl@0: sl@0: /* This typedef denotes an owned OWF_IMAGE, as opposed to a temporary association. sl@0: * Owned instances must be destroyed when the containing object is destroyed. sl@0: */ sl@0: typedef OWF_IMAGE* OWF_IMAGE_INST; sl@0: sl@0: typedef enum { sl@0: OWF_FLIP_NONE, sl@0: OWF_FLIP_VERTICALLY = 1, sl@0: OWF_FLIP_HORIZONTALLY = 2 sl@0: } OWF_FLIP_DIRECTION; sl@0: sl@0: typedef enum { sl@0: OWF_ROTATION_0 = 0, sl@0: OWF_ROTATION_90 = 90, sl@0: OWF_ROTATION_180 = 180, sl@0: OWF_ROTATION_270 = 270 sl@0: } OWF_ROTATION; sl@0: sl@0: typedef enum { sl@0: OWF_TRANSPARENCY_NONE, sl@0: OWF_TRANSPARENCY_GLOBAL_ALPHA = (1 << 0), sl@0: OWF_TRANSPARENCY_SOURCE_ALPHA = (1 << 1), sl@0: OWF_TRANSPARENCY_MASK = (1 << 2), sl@0: OWF_TRANSPARENCY_COLOR_KEY = (1 << 3) sl@0: } OWF_TRANSPARENCY; sl@0: sl@0: typedef struct _OWF_BLEND_INFO { sl@0: struct { sl@0: OWF_IMAGE* image; sl@0: OWF_RECTANGLE* rectangle; sl@0: } destination; sl@0: sl@0: struct { sl@0: OWF_IMAGE* image; sl@0: OWF_RECTANGLE* rectangle; sl@0: } source; sl@0: sl@0: OWF_IMAGE* mask; sl@0: OWFsubpixel globalAlpha; sl@0: } OWF_BLEND_INFO; sl@0: sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Initialize image object sl@0: * sl@0: * \param image Image object to initialize sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL void sl@0: OWF_Image_Init(OWF_IMAGE* image); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Creates new reference counted image object sl@0: * sl@0: * \param width Image width (in pixels) sl@0: * \param height Image height (in pixels) sl@0: * \param format Image format (\see OWF_IMAGE_FORMAT) sl@0: * \param buffer Pointer to image pixel data. If NULL, then a new sl@0: * buffer is allocated for storing image pixel data. sl@0: * Allocated buffer is owned by the image. If non-NULL, sl@0: * then the image will be a "foreign" one, that doesn't sl@0: * own the pixel data but merely uses it. sl@0: * \param minimumStride Minimum number of bytes per scanline (may be zero) sl@0: * sl@0: * sl@0: * \return New image object or NULL if error occured. sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_PUBLIC OWF_IMAGE* sl@0: OWF_Image_Create(OWFint width, sl@0: OWFint height, sl@0: const OWF_IMAGE_FORMAT* format, sl@0: void* buffer, sl@0: OWFint minimumStride); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Destroy image object. Rather than actually destroying the image sl@0: * immediately, this decrements image's reference count by one and once the sl@0: * counter reaches zero, the actual deletion will occur. sl@0: * sl@0: * \param image Image to destroy sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_PUBLIC void sl@0: OWF_Image_Destroy(OWF_IMAGE* image); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Create a pixel-perfect copy (clone) of the image. The copy will be sl@0: * totally independent from the original image, i.e. doesn't share pixel sl@0: * buffers or anything. sl@0: * sl@0: * \param image Image to copy sl@0: * sl@0: * \param Copy of the image or NULL if error occured. sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL OWF_IMAGE* sl@0: OWF_Image_Copy(const OWF_IMAGE* image); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Set image size. This doesn't modify the pixel data in anyway, sl@0: * merely just changes the image header. Mostly used for (recycling) foreign sl@0: * images that point to external pixel buffers. sl@0: * sl@0: * If the new pixel count (width * height) exceeds sl@0: * current values, the pixel buffer will NOT be resized, but the call will FAIL. sl@0: * sl@0: * \param image Image to resize sl@0: * \param width New width of the image sl@0: * \param height New height of the image sl@0: * sl@0: * sl@0: * \return Boolean value indicating success of the operation. In case of sl@0: * failure, no modifications are done to original image. sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL OWFboolean sl@0: OWF_Image_SetSize(OWF_IMAGE* image, sl@0: OWFint width, sl@0: OWFint height); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Set internal mode flags. This doesn't modify the pixel data in anyway, sl@0: * merely just changes the image header. Mostly used for (recycling) foreign sl@0: * images that point to external pixel buffers. sl@0: * sl@0: * sl@0: * \param image Image to resize sl@0: * \param premultiply Image data is premultiplied sl@0: * \param linear Image colour data is linear sl@0: * sl@0: * sl@0: * \return Boolean value indicating success of the operation. In case of sl@0: * failure, no modifications are done to original image. sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL void sl@0: OWF_Image_SetFlags(OWF_IMAGE* image, sl@0: OWFboolean premultiply, sl@0: OWFboolean linear); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Set the pixel buffer to an alternate location. sl@0: * All other parameters remain the same. sl@0: * sl@0: * \param image Image to resize sl@0: * \param buffer Image data source to start using sl@0: * sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL void sl@0: OWF_Image_SetPixelBuffer(OWF_IMAGE* image, void* buffer); sl@0: sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Blit (1:1 copy) pixels from image to another w/ clipping. sl@0: * sl@0: * \param dst Destination image sl@0: * \param dstRect Destination rectangle sl@0: * \param src Source image sl@0: * \param srcRect Source rectangle sl@0: * sl@0: * \return Boolean value indicating whether pixels were copied or not. If not, sl@0: * it means that either of the rectangles is outside its respective image's sl@0: * bounds. sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL OWFboolean sl@0: OWF_Image_Blit(OWF_IMAGE* dst, sl@0: OWF_RECTANGLE const* dstRect, sl@0: OWF_IMAGE const* src, sl@0: OWF_RECTANGLE const* srcRect); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Stretch-blit (scaled copy) pixels from image to another w/ clipping. sl@0: * sl@0: * \param dst Destination image sl@0: * \param dstRect Destination rectangle sl@0: * \param src Source image sl@0: * \param srcRect Source rectangle sl@0: * sl@0: * \return Boolean value indicating whether pixels were copied or not. If not, sl@0: * it means that either of the rectangles is outside its respective image's sl@0: * bounds. sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL OWFboolean sl@0: OWF_Image_Stretch(OWF_IMAGE* dst, sl@0: OWF_RECTANGLE* dstRect, sl@0: OWF_IMAGE* src, sl@0: OWFfloat* srcRect, sl@0: OWF_FILTERING filter); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Multiply pixels' alpha value into rgb-color components. sl@0: * Multiplies only if image source image is non-premultiplied. sl@0: * \param image Image to convert to pre-multiplied domain. sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL void sl@0: OWF_Image_PremultiplyAlpha(OWF_IMAGE* image); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Divide pixels' rgb-color components by its alpha value. sl@0: * sl@0: * \param image Image to convert to nonpre-multiplied domain. sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL void sl@0: OWF_Image_UnpremultiplyAlpha(OWF_IMAGE* image); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Linearizes image pixel data sl@0: * sl@0: * \param image Image to convert to linear domain sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL void sl@0: OWF_Image_LinearizeData(OWF_IMAGE* image); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Non-linearizes image pixel data sl@0: * sl@0: * \param image Image to convert to non-linear domain sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL void sl@0: OWF_Image_NonLinearizeData(OWF_IMAGE* image); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Apply gamma correction to image pixel values sl@0: * sl@0: * \param image Image to operate on sl@0: * \param gamma Gamma value sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL void sl@0: OWF_Image_Gamma(OWF_IMAGE* image, OWFfloat gamma); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Flip (mirror) image about one or both of its center axes. sl@0: * sl@0: * \param image Image to flip sl@0: * \param dir Flip direction. Valid values are sl@0: * OWF_FLIP_NONE, OWF_FLIP_HORIZONTALLY, sl@0: * OWF_FLIP_VERTICALLY or any bitwise-or combination sl@0: * of the former. sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL void sl@0: OWF_Image_Flip(OWF_IMAGE* image, sl@0: OWF_FLIP_DIRECTION dir); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Rotate image n*90 degrees about its center sl@0: * sl@0: * \param dst Result (rotated) image. sl@0: * \param src Source image. sl@0: * \param rotation Rotation angle (OWF_ROTATION_0, OWF_ROTATION_90, sl@0: * OWF_ROTATION_180, or OWF_ROTATION_270) sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL void sl@0: OWF_Image_Rotate(OWF_IMAGE* dst, sl@0: OWF_IMAGE* src, sl@0: OWF_ROTATION rotation); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief sl@0: * sl@0: * \param sl@0: * sl@0: * \return sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL void sl@0: OWF_Image_Blend(OWF_BLEND_INFO* blend, sl@0: OWF_TRANSPARENCY transparency); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief sl@0: * sl@0: * \param sl@0: * sl@0: * \return sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL void sl@0: OWF_Image_Clear(OWF_IMAGE* image, sl@0: OWFsubpixel red, sl@0: OWFsubpixel green, sl@0: OWFsubpixel blue, sl@0: OWFsubpixel alpha); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Convert image data from internal color format to destination format sl@0: * sl@0: * \param dst sl@0: * \param src sl@0: * sl@0: * \return sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL OWFboolean sl@0: OWF_Image_DestinationFormatConversion(OWF_IMAGE* dst, sl@0: OWF_IMAGE* src); sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Test whether it will be possible to convert to destination format. sl@0: * Note, no IMAGE object yet extists. This is effectively a "static" member method. sl@0: * \param format proposed destination format sl@0: * sl@0: * \return boolean true if image lib can convert image data from internal color format sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL OWFboolean sl@0: OWF_Image_IsValidDestinationFormat(OWF_IMAGE_FORMAT* format); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Convert image data from source format to internal format sl@0: * sl@0: * \param src sl@0: * \param dst sl@0: * sl@0: * \return sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL OWFboolean sl@0: OWF_Image_SourceFormatConversion(OWF_IMAGE* dst, sl@0: OWF_IMAGE* src); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief sl@0: * sl@0: * \param sl@0: * sl@0: * \return sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL void* sl@0: OWF_Image_AllocData(OWF_DISPCTX dc, OWFint width, sl@0: OWFint height, sl@0: OWF_PIXEL_FORMAT format); sl@0: sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief sl@0: * sl@0: * \param sl@0: * sl@0: * \return sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL void sl@0: OWF_Image_FreeData(OWF_DISPCTX dc, void** buffer); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief sl@0: * sl@0: * \param sl@0: * sl@0: * \return sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL OWFint sl@0: OWF_Image_GetFormatPixelSize(OWF_PIXEL_FORMAT format); sl@0: sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Return stride (aligned row size in bytes) calculated from image sl@0: * width and pixelSize. If pixelSize is negative image width must be divisible sl@0: * by pixelSize. sl@0: * sl@0: * \param width Width of image sl@0: * \param pixelSize Size of single pixel in bytes. Negative size sl@0: * means value is a divisor (i.e. 1/pixelSize) sl@0: * \param padding Number of bits each row is padded to. sl@0: sl@0: * \return Row size in bytes. sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_PUBLIC OWFint sl@0: OWF_Image_GetStride(OWFint width, sl@0: const OWF_IMAGE_FORMAT* format,OWFint minimumStride); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief sl@0: * sl@0: * \param sl@0: * sl@0: * \return sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL OWFint sl@0: OWF_Image_GetFormatPadding(OWF_PIXEL_FORMAT format); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Swap image width & height values in image header. Doesn't modify sl@0: * image pixel data. sl@0: * sl@0: * \param image Image to operate on. sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL void sl@0: OWF_Image_SwapWidthAndHeight(OWF_IMAGE* image); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Convert mask from external format to internal 8bpp format. sl@0: * sl@0: * \param output Result (converted) mask image sl@0: * \param input Input mask image to convert. sl@0: * sl@0: * \return Boolean value indicating operation success. OWF_FALSE means that sl@0: * input mask is either invalid or unsupported, or degenerate in some other sl@0: * fascinating way. sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL OWFboolean sl@0: OWF_Image_ConvertMask(OWF_IMAGE* output, sl@0: OWF_IMAGE* input); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Return pointer to given pixel in image. sl@0: * sl@0: * \param image Image sl@0: * \param x X-coordinate of the pixel (0..width-1) sl@0: * \param y Y-coordinate of the pixel (0..height-1) sl@0: * sl@0: * The x & y coordinates will be clamped to [0..width-1, 0..height-1] sl@0: * sl@0: * \return Pointer to given pixel sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL OWFpixel* sl@0: OWF_Image_GetPixelPtr(OWF_IMAGE* image, sl@0: OWFint x, sl@0: OWFint y); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Read single pixel from image sl@0: * sl@0: * \param image Image sl@0: * \param x Pixel x coordinate sl@0: * \param y Pixel y coordinate sl@0: * \param pixel Where to store the pixel color value sl@0: * sl@0: * Coordinates are clamped to region (0..width-1, 0..height-1) sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL void sl@0: OWF_Image_GetPixel(OWF_IMAGE* image, sl@0: OWFint x, sl@0: OWFint y, sl@0: OWFpixel* pixel); sl@0: sl@0: /*!--------------------------------------------------------------------------- sl@0: * \brief Write a pixel into image sl@0: * sl@0: * \param image Image sl@0: * \param x Pixel x coordinate sl@0: * \param y Pixel y coordinate sl@0: * \param pixel Color of the pixel sl@0: * sl@0: * Coordinates are clamped to region (0..width-1, 0..height-1) sl@0: *----------------------------------------------------------------------------*/ sl@0: OWF_API_CALL void sl@0: OWF_Image_SetPixel(OWF_IMAGE* image, sl@0: OWFint x, sl@0: OWFint y, sl@0: OWFpixel const* pixel); sl@0: sl@0: #ifdef __cplusplus sl@0: } sl@0: #endif sl@0: sl@0: #endif