view dstep/applicationservices/coregraphics/CGImage.d @ 12:9f0b49a2f64e

Added the ApplicationServices frameworks: ATS, ColorSync and CoreGraphics
author Jacob Carlborg <doob@me.com>
date Mon, 03 Aug 2009 14:00:21 +0200
parents
children
line wrap: on
line source

/**
 * Copyright: Copyright (c) 2009 Jacob Carlborg.
 * Authors: Jacob Carlborg
 * Version: Initial created: Aug 1, 2009 
 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
 */
module dstep.applicationservices.coregraphics.CGImage;

import dstep.applicationservices.coregraphics.CGBase;
import dstep.applicationservices.coregraphics.CGColorSpace;
import dstep.applicationservices.coregraphics.CGDataProvider;
import dstep.applicationservices.coregraphics.CGGeometry;

struct CGImage;

alias CGImage* CGImageRef;
alias int CGImageAlphaInfo;
alias uint CGBitmapInfo;

enum /*CGImageAlphaInfo*/ 
{
	kCGImageAlphaNone,
	kCGImageAlphaPremultipliedLast,
	kCGImageAlphaPremultipliedFirst,
	kCGImageAlphaLast,
	kCGImageAlphaFirst,
	kCGImageAlphaNoneSkipLast,
	kCGImageAlphaNoneSkipFirst,
	kCGImageAlphaOnly
}

enum
{
	kCGBitmapAlphaInfoMask = 0x1F,
	kCGBitmapFloatComponents = (1 << 8),
	kCGBitmapByteOrderMask = 0x7000,
	kCGBitmapByteOrderDefault = (0 << 12),
	kCGBitmapByteOrder16Little = (1 << 12),
	kCGBitmapByteOrder32Little = (2 << 12),
	kCGBitmapByteOrder16Big = (3 << 12),
	kCGBitmapByteOrder32Big = (4 << 12)
}

extern (C)
{
	uint CGImageGetTypeID ();
	CGImageRef CGImageCreate (uint width, uint height, uint bitsPerComponent, uint bitsPerPixel, uint bytesPerRow, CGColorSpaceRef colorspace, uint bitmapInfo, CGDataProviderRef provider, CGFloat* decode, bool shouldInterpolate, int intent);
	CGImageRef CGImageMaskCreate (uint width, uint height, uint bitsPerComponent, uint bitsPerPixel, uint bytesPerRow, CGDataProviderRef provider, CGFloat* decode, bool shouldInterpolate);
	CGImageRef CGImageCreateCopy (CGImageRef image);
	CGImageRef CGImageCreateWithJPEGDataProvider (CGDataProviderRef source, CGFloat* decode, bool shouldInterpolate, int intent);
	CGImageRef CGImageCreateWithPNGDataProvider (CGDataProviderRef source, CGFloat* decode, bool shouldInterpolate, int intent);
	CGImageRef CGImageCreateWithImageInRect (CGImageRef image, CGRect rect);
	CGImageRef CGImageCreateWithMask (CGImageRef image, CGImageRef mask);
	CGImageRef CGImageCreateWithMaskingColors (CGImageRef image, CGFloat* components);
	CGImageRef CGImageCreateCopyWithColorSpace (CGImageRef image, CGColorSpaceRef colorspace);
	CGImageRef CGImageRetain (CGImageRef image);
	void CGImageRelease (CGImageRef image);
	bool CGImageIsMask (CGImageRef image);
	uint CGImageGetWidth (CGImageRef image);
	uint CGImageGetHeight (CGImageRef image);
	uint CGImageGetBitsPerComponent (CGImageRef image);
	uint CGImageGetBitsPerPixel (CGImageRef image);
	uint CGImageGetBytesPerRow (CGImageRef image);
	CGColorSpaceRef CGImageGetColorSpace (CGImageRef image);
	int CGImageGetAlphaInfo (CGImageRef image);
	CGDataProviderRef CGImageGetDataProvider (CGImageRef image);
	CGFloat* CGImageGetDecode (CGImageRef image);
	bool CGImageGetShouldInterpolate (CGImageRef image);
	int CGImageGetRenderingIntent (CGImageRef image);
	uint CGImageGetBitmapInfo (CGImageRef image);
}