Kanzi Graphics Engine
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
kzc_image.h File Reference

Image component. More...

#include "kzc_etc.h"
#include <system/kzs_types.h>
#include <system/debug/kzs_error.h>
#include <system/kzs_header.h>

Typedefs

typedef kzsError(* KzuImageLoadImageCallback )(struct KzcInputStream *inputStream, void *userData, struct KzcImage **out_image)
 Function type definition for function that can load an image reference from .KZB input stream. More...
 

Enumerations

enum  KzcImageDataFormat {
  KZC_IMAGE_DATA_FORMAT_INVALID, KZC_IMAGE_DATA_FORMAT_RGB_565, KZC_IMAGE_DATA_FORMAT_RGB_888, KZC_IMAGE_DATA_FORMAT_RGBA_8888,
  KZC_IMAGE_DATA_FORMAT_RGB_FLOAT, KZC_IMAGE_DATA_FORMAT_RGBA_FLOAT, KZC_IMAGE_DATA_FORMAT_RGB_FLOAT16, KZC_IMAGE_DATA_FORMAT_RGBA_FLOAT16,
  KZC_IMAGE_DATA_FORMAT_ALPHA_8, KZC_IMAGE_DATA_FORMAT_ALPHA_FLOAT, KZC_IMAGE_DATA_FORMAT_GRAYSCALE_8, KZC_IMAGE_DATA_FORMAT_GRAYSCALE_FLOAT,
  KZC_IMAGE_DATA_FORMAT_GRAYSCALE_ALPHA_8, KZC_IMAGE_DATA_FORMAT_ETC, KZC_IMAGE_DATA_FORMAT_DXT1, KZC_IMAGE_DATA_FORMAT_DXT3,
  KZC_IMAGE_DATA_FORMAT_DXT5, KZC_IMAGE_DATA_FORMAT_ATC, KZC_IMAGE_DATA_FORMAT_ATC_EXPLICIT_ALPHA, KZC_IMAGE_DATA_FORMAT_ATC_INTERPOLATED_ALPHA,
  KZC_IMAGE_DATA_FORMAT_PVRTC1_RGB_4BPP, KZC_IMAGE_DATA_FORMAT_PVRTC1_RGBA_4BPP, KZC_IMAGE_DATA_FORMAT_PVRTC1_RGB_2BPP, KZC_IMAGE_DATA_FORMAT_PVRTC1_RGBA_2BPP,
  KZC_IMAGE_DATA_FORMAT_PVRTC2_RGBA_4BPP, KZC_IMAGE_DATA_FORMAT_PVRTC2_RGBA_2BPP
}
 List of data formats image may have. More...
 
enum  KzcImageResizeFilter { KZC_IMAGE_RESIZE_FILTER_NEAREST_NEIGHBOR, KZC_IMAGE_RESIZE_FILTER_BILINEAR, KZC_IMAGE_RESIZE_FILTER_WEIGHTED_AVERAGE }
 List of possible resizing filters. More...
 

Functions

kzsError kzcImageCreate (const struct KzcMemoryManager *memoryManager, struct KzcImage **out_image)
 Creates an image with no data. More...
 
kzsException kzcImageLoadPNG (const struct KzcMemoryManager *memoryManager, struct KzcInputStream *inputStream, kzBool flipInternally, struct KzcImage **out_image)
 Loads image from PNG file. More...
 
kzsException kzcImageLoadJPEG (const struct KzcMemoryManager *memoryManager, struct KzcInputStream *inputStream, kzBool flipInternally, struct KzcImage **out_image)
 Loads image from JPEG file. More...
 
kzsError kzcImageLoadRAW (const struct KzcMemoryManager *memoryManager, struct KzcInputStream *inputStream, kzBool flipInternally, kzUint width, kzUint height, enum KzcImageDataFormat colorFormat, struct KzcImage **out_image)
 Loads image from RAW format. More...
 
kzsError kzcImageLoadMemory (const struct KzcMemoryManager *memoryManager, kzUint width, kzUint height, enum KzcImageDataFormat colorFormat, const void *data, struct KzcImage **out_image)
 Loads image from memory. More...
 
kzsError kzcImageLoadMemoryAssignData (const struct KzcMemoryManager *memoryManager, kzUint width, kzUint height, enum KzcImageDataFormat colorFormat, void *data, struct KzcImage **out_image)
 Creates image from data, data not copied. More...
 
kzsException kzcImageLoadResource (const struct KzcMemoryManager *memoryManager, kzString resourcePath, struct KzcImage **out_image)
 Loads image from resource. More...
 
kzsException kzcImageLoadFile (const struct KzcMemoryManager *memoryManager, kzString filePath, struct KzcImage **out_image)
 Loads image from file. More...
 
kzsException kzcImageLoadResourceFlipped (const struct KzcMemoryManager *memoryManager, kzString resourcePath, struct KzcImage **out_image)
 Loads image from resource. More...
 
kzsException kzcImageLoadFileFlipped (const struct KzcMemoryManager *memoryManager, kzString filePath, struct KzcImage **out_image)
 Loads image from file. More...
 
kzsError kzcImageCreateMipmapImage (const struct KzcMemoryManager *memoryManager, kzUint levelCount, struct KzcImage *const *mipmapImages, struct KzcImage **out_image)
 Creates mipmap image out of list of mipmap images. More...
 
kzsError kzcImageDelete (struct KzcImage *image)
 Deletes image. More...
 
kzsException kzcImageLoadPNGFromKZB (struct KzcImage *image, struct KzcInputStream *inputStream, kzBool flipInternally)
 Loads PNG image from KZB. More...
 
kzsError kzcImageLoadJPEGFromKZB (struct KzcImage *image, struct KzcInputStream *inputStream, kzBool flipInternally)
 Loads JPEG image from KZB. More...
 
kzsError kzcImageLoadETCFromKZB (struct KzcImage *image, struct KzcInputStream *inputStream, kzBool flippedInternally)
 Loads ETC image from KZB. More...
 
kzsError kzcImageLoadDXTFromKZB (struct KzcImage *image, struct KzcInputStream *inputStream, kzBool flippedInternally)
 Loads DXT image from KZB. More...
 
kzsError kzcImageLoadATCFromKZB (struct KzcImage *image, struct KzcInputStream *inputStream, kzBool flippedInternally)
 Loads ATC compressed image from KZB. More...
 
kzsError kzcImageLoadPVRTCFromKZB (struct KzcImage *image, struct KzcInputStream *inputStream, kzBool flippedInternally)
 Loads PVRTC compressed image from KZB. More...
 
kzsError kzcImageLoadRaw2DFromKZB (struct KzcImage *image, struct KzcInputStream *inputStream, kzBool flipInternally)
 Loads RAW 2D image from KZB. More...
 
kzsError kzcImageCopySubImage (const struct KzcImage *targetImage, const struct KzcImage *sourceImage, kzUint targetRectX, kzUint targetRectY, kzUint sourceRectX, kzUint sourceRectY, kzUint width, kzUint height)
 Copies data from sourceImage to targetImage. More...
 
kzsError kzcImageCopySubImageData (const struct KzcImage *targetImage, void *sourceData, kzUint targetRectX, kzUint targetRectY, kzUint sourceRectX, kzUint sourceRectY, kzUint sourceImageWidth, kzUint width, kzUint height)
 Copies sourceImage data to targetImage. More...
 
kzsError kzcImageSavePNG (const struct KzcImage *image, struct KzcOutputStream *outputStream)
 Saves an image to an output stream in the PNG format. More...
 
kzsError kzcImageSaveJPEG (const struct KzcImage *image, struct KzcOutputStream *outputStream, kzFloat quality)
 Saves an image to an output stream in the JPEG format. More...
 
kzsError kzcImageSaveRAW (const struct KzcImage *image, struct KzcOutputStream *outputStream)
 Saves raw image to specific output stream. More...
 
kzUint kzcImageGetWidth (const struct KzcImage *image)
 Returns image width. More...
 
kzUint kzcImageGetHeight (const struct KzcImage *image)
 Returns image height. More...
 
void kzcImageSetFlippedInternally (struct KzcImage *image, kzBool flipped)
 Sets a flag to indicate that the data in the image is vertically flipped. More...
 
kzBool kzcImageIsFlippedInternally (const struct KzcImage *image)
 Returns the flag which indicates if the data in the image is vertically flipped or not. More...
 
void kzcImageSetPremultipliedAlpha (struct KzcImage *image, kzBool premultipliedAlpha)
 Sets a flag to indicate that the RGB data in the image has premultiplied alpha. More...
 
kzBool kzcImageIsPremultipliedAlpha (const struct KzcImage *image)
 Returns the flag which indicates if the RGB data in the image has premultiplied alpha. More...
 
enum KzcImageDataFormat kzcImageGetDataFormat (const struct KzcImage *image)
 Returns color format from image. More...
 
voidkzcImageGetData (const struct KzcImage *image)
 Returns image data from image. More...
 
kzUint kzcImageGetDataSize (const struct KzcImage *image)
 Returns the size of the image data from image. More...
 
kzUint kzcImageGetBytesPerPixelFromFormat (enum KzcImageDataFormat dataFormat)
 Gets bytes per pixel from data format. More...
 
kzUint kzcImageGetMipmapLevelCount (const struct KzcImage *image)
 Gets mipmap level count from image. More...
 
struct KzcImagekzcImageGetMipmapLevel (const struct KzcImage *image, kzUint mipmapLevelIndex)
 Gets mipmap level from image. More...
 
kzBool kzcImageIsMipmapImage (const struct KzcImage *image)
 Returns if this image is mipmap image. More...
 
kzsError kzcImageCopy (const struct KzcMemoryManager *memoryManager, const struct KzcImage *sourceImage, struct KzcImage **out_targetImage)
 Copy operator for image. More...
 
kzsException kzcImageConvert (struct KzcImage *sourceImage, enum KzcImageDataFormat colorFormat)
 Converts an image to the specified image data format. More...
 
kzsError kzcImageConvertToETC (struct KzcImage *sourceImage, enum KzcEtcCompressionMode compressionMode)
 Converts an image to the ETC compressed format. More...
 
kzsError kzcImageSetName (struct KzcImage *image, kzString name)
 Sets name for the image. More...
 
kzString kzcImageGetName (const struct KzcImage *image)
 Gets name of the image. More...
 
kzsException kzcImageBlit (const struct KzcImage *destination, const struct KzcImage *source, kzUint sourceOffsetX, kzUint sourceOffsetY, kzUint destOffsetX, kzUint destOffsetY, kzUint width, kzUint height)
 Blit an image into another. More...
 
kzsError kzcImageResize (struct KzcImage *image, kzUint newWidth, kzUint newHeight, enum KzcImageResizeFilter resizeFilter)
 Resizes image by specified parameters. More...
 
kzsError kzcImageCrop (struct KzcImage *image, kzUint x, kzUint y, kzUint width, kzUint height)
 Crops image by using (x, y, width, height) area. More...
 
kzsError kzcImageFlipHorizontally (const struct KzcImage *image)
 Flips image horizontally. More...
 
kzsError kzcImageFlipVertically (const struct KzcImage *image)
 Flips image vertically. More...
 
kzsError kzcImagePremultiplyAlpha (const struct KzcImage *image)
 Pre-multiplies the RGB data of the image with the alpha component. More...
 
kzsError kzcImageCreateMipmapLevels (struct KzcImage *image)
 Creates mipmap levels for the given image. More...
 
kzsError kzcImageAssignMipmapLevels (struct KzcImage *image, kzUint levelCount, struct KzcImage *const *mipmapImages)
 Assigns mipmap levels for the given images. More...
 
kzsError kzcImageCreateMipmapImages (const struct KzcMemoryManager *memoryManager, const struct KzcImage *image, struct KzcImage ***out_mipmapImages)
 Creates mipmap images from source image and returns them. More...
 
kzBool kzcImageIsCompressedFormat (const struct KzcImage *image)
 Returns is image is in compressed format. More...
 
kzBool kzcImageIsDataFormatCompressed (enum KzcImageDataFormat dataFormat)
 Returns if image data format is in compressed format. More...
 

Detailed Description

Image component.

Handles loading and saving images.

Copyright 2008-2019 by Rightware. All rights reserved.

Typedef Documentation

typedef kzsError(* KzuImageLoadImageCallback)(struct KzcInputStream *inputStream, void *userData, struct KzcImage **out_image)

Function type definition for function that can load an image reference from .KZB input stream.

Enumeration Type Documentation

List of data formats image may have.

Enumerator
KZC_IMAGE_DATA_FORMAT_INVALID 

Invalid data format.

KZC_IMAGE_DATA_FORMAT_RGB_565 

RGB565 format.

KZC_IMAGE_DATA_FORMAT_RGB_888 

RGB 8 bit format.

KZC_IMAGE_DATA_FORMAT_RGBA_8888 

RGBA 8 bit format.

KZC_IMAGE_DATA_FORMAT_RGB_FLOAT 

RGB float format.

KZC_IMAGE_DATA_FORMAT_RGBA_FLOAT 

RGBA float format.

KZC_IMAGE_DATA_FORMAT_RGB_FLOAT16 

RGB half float format.

KZC_IMAGE_DATA_FORMAT_RGBA_FLOAT16 

RGBA half float format.

KZC_IMAGE_DATA_FORMAT_ALPHA_8 

Alpha 8 bit image.

KZC_IMAGE_DATA_FORMAT_ALPHA_FLOAT 

Alpha float image.

KZC_IMAGE_DATA_FORMAT_GRAYSCALE_8 

Grayscale 8 bit image.

KZC_IMAGE_DATA_FORMAT_GRAYSCALE_FLOAT 

Grayscale float image.

KZC_IMAGE_DATA_FORMAT_GRAYSCALE_ALPHA_8 

Grayscale alpha 8 bit image.

KZC_IMAGE_DATA_FORMAT_ETC 

Ericsson texture compressed image.

KZC_IMAGE_DATA_FORMAT_DXT1 

DXT1 compressed image.

KZC_IMAGE_DATA_FORMAT_DXT3 

DXT3 compressed image.

KZC_IMAGE_DATA_FORMAT_DXT5 

DXT5 compressed image.

KZC_IMAGE_DATA_FORMAT_ATC 

ATC compressed image.

KZC_IMAGE_DATA_FORMAT_ATC_EXPLICIT_ALPHA 

ATC compressed image with explicit alpha.

KZC_IMAGE_DATA_FORMAT_ATC_INTERPOLATED_ALPHA 

ATC compressed image with interpolated alpha.

KZC_IMAGE_DATA_FORMAT_PVRTC1_RGB_4BPP 

RGB PVRTC1 4 bits per pixel compressed image.

KZC_IMAGE_DATA_FORMAT_PVRTC1_RGBA_4BPP 

RBGA PVRTC1 4 bits per pixel compressed image.

KZC_IMAGE_DATA_FORMAT_PVRTC1_RGB_2BPP 

RGB PVRTC1 2 bits per pixel compressed image.

KZC_IMAGE_DATA_FORMAT_PVRTC1_RGBA_2BPP 

RGBA PVRTC1 2 bits per pixel compressed image.

KZC_IMAGE_DATA_FORMAT_PVRTC2_RGBA_4BPP 

RGBA PVRTC2 4 bits per pixel compressed image.

KZC_IMAGE_DATA_FORMAT_PVRTC2_RGBA_2BPP 

RGBA PVRTC2 2 bits per pixel compressed image.

List of possible resizing filters.

Enumerator
KZC_IMAGE_RESIZE_FILTER_NEAREST_NEIGHBOR 

Nearest neighbor filter.

KZC_IMAGE_RESIZE_FILTER_BILINEAR 

Bilinear filter.

KZC_IMAGE_RESIZE_FILTER_WEIGHTED_AVERAGE 

Weighted average filter.

Function Documentation

kzsError kzcImageCreate ( const struct KzcMemoryManager memoryManager,
struct KzcImage **  out_image 
)

Creates an image with no data.

kzsException kzcImageLoadPNG ( const struct KzcMemoryManager memoryManager,
struct KzcInputStream inputStream,
kzBool  flipInternally,
struct KzcImage **  out_image 
)

Loads image from PNG file.

Color format is output in either RGB8 or RGBA8. The image is optionally flipped on load (to conform with OpenGL default texture coordinates).

kzsException kzcImageLoadJPEG ( const struct KzcMemoryManager memoryManager,
struct KzcInputStream inputStream,
kzBool  flipInternally,
struct KzcImage **  out_image 
)

Loads image from JPEG file.

Color format is output in RGB8. The image is optionally flipped on load (to conform with OpenGL default texture coordinates).

kzsError kzcImageLoadRAW ( const struct KzcMemoryManager memoryManager,
struct KzcInputStream inputStream,
kzBool  flipInternally,
kzUint  width,
kzUint  height,
enum KzcImageDataFormat  colorFormat,
struct KzcImage **  out_image 
)

Loads image from RAW format.

Width, height and format needs to be specified manually. Throws error if dimension and format mismatches the RAW file size. The image is optionally flipped on load (to conform with OpenGL default texture coordinates).

kzsError kzcImageLoadMemory ( const struct KzcMemoryManager memoryManager,
kzUint  width,
kzUint  height,
enum KzcImageDataFormat  colorFormat,
const void data,
struct KzcImage **  out_image 
)

Loads image from memory.

Data is copied.

kzsError kzcImageLoadMemoryAssignData ( const struct KzcMemoryManager memoryManager,
kzUint  width,
kzUint  height,
enum KzcImageDataFormat  colorFormat,
void data,
struct KzcImage **  out_image 
)

Creates image from data, data not copied.

kzsException kzcImageLoadResource ( const struct KzcMemoryManager memoryManager,
kzString  resourcePath,
struct KzcImage **  out_image 
)

Loads image from resource.

PNG and JPEG are supported. If the image will be used as a 2D texture, consider using kzcImageLoadResourceFlipped instead.

kzsException kzcImageLoadFile ( const struct KzcMemoryManager memoryManager,
kzString  filePath,
struct KzcImage **  out_image 
)

Loads image from file.

PNG and JPEG are supported. If the image will be used as a 2D texture, consider using kzcImageLoadFileFlipped instead.

kzsException kzcImageLoadResourceFlipped ( const struct KzcMemoryManager memoryManager,
kzString  resourcePath,
struct KzcImage **  out_image 
)

Loads image from resource.

PNG and JPEG are supported. This function flips the image data vertically while loading to make it compatible with OpenGL 2D textures. If this function is used instead of kzcImageLoadResource, deploying the image to a 2D texture will be faster and use less memory.

kzsException kzcImageLoadFileFlipped ( const struct KzcMemoryManager memoryManager,
kzString  filePath,
struct KzcImage **  out_image 
)

Loads image from file.

PNG and JPEG are supported. This function flips the image data vertically while loading to make it compatible with OpenGL 2D textures. If this function is used instead of kzcImageLoadFile, deploying the image to a 2D texture will be faster and use less memory.

kzsError kzcImageCreateMipmapImage ( const struct KzcMemoryManager memoryManager,
kzUint  levelCount,
struct KzcImage *const *  mipmapImages,
struct KzcImage **  out_image 
)

Creates mipmap image out of list of mipmap images.

kzsError kzcImageDelete ( struct KzcImage image)

Deletes image.

kzsException kzcImageLoadPNGFromKZB ( struct KzcImage image,
struct KzcInputStream inputStream,
kzBool  flipInternally 
)

Loads PNG image from KZB.

kzsError kzcImageLoadJPEGFromKZB ( struct KzcImage image,
struct KzcInputStream inputStream,
kzBool  flipInternally 
)

Loads JPEG image from KZB.

kzsError kzcImageLoadETCFromKZB ( struct KzcImage image,
struct KzcInputStream inputStream,
kzBool  flippedInternally 
)

Loads ETC image from KZB.

kzsError kzcImageLoadDXTFromKZB ( struct KzcImage image,
struct KzcInputStream inputStream,
kzBool  flippedInternally 
)

Loads DXT image from KZB.

kzsError kzcImageLoadATCFromKZB ( struct KzcImage image,
struct KzcInputStream inputStream,
kzBool  flippedInternally 
)

Loads ATC compressed image from KZB.

kzsError kzcImageLoadPVRTCFromKZB ( struct KzcImage image,
struct KzcInputStream inputStream,
kzBool  flippedInternally 
)

Loads PVRTC compressed image from KZB.

kzsError kzcImageLoadRaw2DFromKZB ( struct KzcImage image,
struct KzcInputStream inputStream,
kzBool  flipInternally 
)

Loads RAW 2D image from KZB.

kzsError kzcImageCopySubImage ( const struct KzcImage targetImage,
const struct KzcImage sourceImage,
kzUint  targetRectX,
kzUint  targetRectY,
kzUint  sourceRectX,
kzUint  sourceRectY,
kzUint  width,
kzUint  height 
)

Copies data from sourceImage to targetImage.

Data is copied from sourceImage area [sourceRectX, sourceRectY, sourceRectX + width, sourceRectY + height] to targetImage area [targetRectX, targetRectY, targetRectX + width, targetRectY + height] Error is returned if area is out of bounds of image.

kzsError kzcImageCopySubImageData ( const struct KzcImage targetImage,
void sourceData,
kzUint  targetRectX,
kzUint  targetRectY,
kzUint  sourceRectX,
kzUint  sourceRectY,
kzUint  sourceImageWidth,
kzUint  width,
kzUint  height 
)

Copies sourceImage data to targetImage.

kzsError kzcImageSavePNG ( const struct KzcImage image,
struct KzcOutputStream outputStream 
)

Saves an image to an output stream in the PNG format.

The only supported image formats are KZC_IMAGE_DATA_FORMAT_RGB_888 and KZC_IMAGE_DATA_FORMAT_RGBA_8888. Output stream must be closed manually.

kzsError kzcImageSaveJPEG ( const struct KzcImage image,
struct KzcOutputStream outputStream,
kzFloat  quality 
)

Saves an image to an output stream in the JPEG format.

Output stream must be closed manually. Quality within range [0,1]

kzsError kzcImageSaveRAW ( const struct KzcImage image,
struct KzcOutputStream outputStream 
)

Saves raw image to specific output stream.

Output image will be in raw byte format.

kzUint kzcImageGetWidth ( const struct KzcImage image)

Returns image width.

kzUint kzcImageGetHeight ( const struct KzcImage image)

Returns image height.

void kzcImageSetFlippedInternally ( struct KzcImage image,
kzBool  flipped 
)

Sets a flag to indicate that the data in the image is vertically flipped.

kzBool kzcImageIsFlippedInternally ( const struct KzcImage image)

Returns the flag which indicates if the data in the image is vertically flipped or not.

void kzcImageSetPremultipliedAlpha ( struct KzcImage image,
kzBool  premultipliedAlpha 
)

Sets a flag to indicate that the RGB data in the image has premultiplied alpha.

kzBool kzcImageIsPremultipliedAlpha ( const struct KzcImage image)

Returns the flag which indicates if the RGB data in the image has premultiplied alpha.

enum KzcImageDataFormat kzcImageGetDataFormat ( const struct KzcImage image)

Returns color format from image.

void* kzcImageGetData ( const struct KzcImage image)

Returns image data from image.

kzUint kzcImageGetDataSize ( const struct KzcImage image)

Returns the size of the image data from image.

kzUint kzcImageGetBytesPerPixelFromFormat ( enum KzcImageDataFormat  dataFormat)

Gets bytes per pixel from data format.

kzUint kzcImageGetMipmapLevelCount ( const struct KzcImage image)

Gets mipmap level count from image.

struct KzcImage* kzcImageGetMipmapLevel ( const struct KzcImage image,
kzUint  mipmapLevelIndex 
)

Gets mipmap level from image.

kzBool kzcImageIsMipmapImage ( const struct KzcImage image)

Returns if this image is mipmap image.

kzsError kzcImageCopy ( const struct KzcMemoryManager memoryManager,
const struct KzcImage sourceImage,
struct KzcImage **  out_targetImage 
)

Copy operator for image.

kzsException kzcImageConvert ( struct KzcImage sourceImage,
enum KzcImageDataFormat  colorFormat 
)

Converts an image to the specified image data format.

Parameters
sourceImageThe image to convert.
colorFormatThe image data format to convert to. Compressed formats are not supported.
Returns
KZS_SUCCESS on success.
kzsError kzcImageConvertToETC ( struct KzcImage sourceImage,
enum KzcEtcCompressionMode  compressionMode 
)

Converts an image to the ETC compressed format.

Parameters
sourceImageThe image to convert.
[in]compressionModemode to use for compression. See kzc_etc.h for possible values.
Returns
KZS_SUCCESS on success.
kzsError kzcImageSetName ( struct KzcImage image,
kzString  name 
)

Sets name for the image.

kzString kzcImageGetName ( const struct KzcImage image)

Gets name of the image.

KZ_NULL if not assigned.

kzsException kzcImageBlit ( const struct KzcImage destination,
const struct KzcImage source,
kzUint  sourceOffsetX,
kzUint  sourceOffsetY,
kzUint  destOffsetX,
kzUint  destOffsetY,
kzUint  width,
kzUint  height 
)

Blit an image into another.

The images must have the same format. Only the image data format KZC_IMAGE_DATA_FORMAT_RGBA_8888 is supported.

Parameters
destinationThe image to write to.
sourceThe image to read from.
sourceOffsetXX offset to the source.
sourceOffsetYY offset to the source.
destOffsetXX offset to the destination.
destOffsetYY offset to the destination.
widthThe width (in pixels) to blit.
heightThe height (in pixels) to blit.
Returns
KZS_SUCCESS on success.
kzsError kzcImageResize ( struct KzcImage image,
kzUint  newWidth,
kzUint  newHeight,
enum KzcImageResizeFilter  resizeFilter 
)

Resizes image by specified parameters.

If the image is a mipmap image, all the mipmap levels are lost.

kzsError kzcImageCrop ( struct KzcImage image,
kzUint  x,
kzUint  y,
kzUint  width,
kzUint  height 
)

Crops image by using (x, y, width, height) area.

kzsError kzcImageFlipHorizontally ( const struct KzcImage image)

Flips image horizontally.

kzsError kzcImageFlipVertically ( const struct KzcImage image)

Flips image vertically.

kzsError kzcImagePremultiplyAlpha ( const struct KzcImage image)

Pre-multiplies the RGB data of the image with the alpha component.

kzsError kzcImageCreateMipmapLevels ( struct KzcImage image)

Creates mipmap levels for the given image.

kzsError kzcImageAssignMipmapLevels ( struct KzcImage image,
kzUint  levelCount,
struct KzcImage *const *  mipmapImages 
)

Assigns mipmap levels for the given images.

kzsError kzcImageCreateMipmapImages ( const struct KzcMemoryManager memoryManager,
const struct KzcImage image,
struct KzcImage ***  out_mipmapImages 
)

Creates mipmap images from source image and returns them.

kzBool kzcImageIsCompressedFormat ( const struct KzcImage image)

Returns is image is in compressed format.

kzBool kzcImageIsDataFormatCompressed ( enum KzcImageDataFormat  dataFormat)

Returns if image data format is in compressed format.