Exemplo n.º 1
0
bool MCImageBitmapToCGImage(MCImageBitmap *p_bitmap, bool p_copy, bool p_invert, CGImageRef &r_image)
{
	bool t_success = true;
	
	CGColorSpaceRef t_colorspace = nil;
	if (t_success)
		t_success = MCImageGetCGColorSpace(t_colorspace);
	
	if (t_success)
		t_success = MCImageBitmapToCGImage(p_bitmap, t_colorspace, p_copy, p_invert, r_image);
	
	CGColorSpaceRelease(t_colorspace);
	
	return t_success;
}
Exemplo n.º 2
0
bool MCGImageToCGImage(MCGImageRef p_src, const MCGIntegerRectangle &p_src_rect, bool p_invert, CGImageRef &r_image)
{
	bool t_success = true;
	
	/* OVERHAUL - REVISIT: for a grayscale image this should be CGColorSpaceCreateDeviceGray() */
	CGColorSpaceRef t_colorspace = nil;
	if (t_success)
		t_success = MCImageGetCGColorSpace(t_colorspace);
	
	if (t_success)
		t_success = MCGImageToCGImage(p_src, p_src_rect, t_colorspace, p_invert, r_image);
	
	CGColorSpaceRelease(t_colorspace);
	
	return t_success;
}
Exemplo n.º 3
0
bool MCTileCacheCoreGraphicsCompositorConfigure(MCTileCacheRef p_tilecache, MCTileCacheCompositor& r_compositor)
{
	MCTileCacheCoreGraphicsCompositorContext *t_context;
	if (!MCMemoryNew(t_context))
		return false;
	
	t_context -> tilecache = p_tilecache;
	/* UNCHECKED */ MCImageGetCGColorSpace(t_context -> colorspace);
	
	r_compositor . context = t_context;
	r_compositor . cleanup = MCTileCacheCoreGraphicsCompositor_Cleanup;
	r_compositor . allocate_tile = MCTileCacheCoreGraphicsCompositor_AllocateTile;
	r_compositor . deallocate_tile = MCTileCacheCoreGraphicsCompositor_DeallocateTile;
	r_compositor . begin_frame = MCTileCacheCoreGraphicsCompositor_BeginFrame;
	r_compositor . end_frame = MCTileCacheCoreGraphicsCompositor_EndFrame;
	r_compositor . begin_layer = MCTileCacheCoreGraphicsCompositor_BeginLayer;
	r_compositor . end_layer = MCTileCacheCoreGraphicsCompositor_EndLayer;
	r_compositor . composite_tile = MCTileCacheCoreGraphicsCompositor_CompositeTile;
	r_compositor . composite_rect = MCTileCacheCoreGraphicsCompositor_CompositeRect;
	
	return true;
}