Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Blend.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2010, The Cinder Project, All rights reserved.
3 
4  This code is intended for use with the Cinder C++ library: http://libcinder.org
5 
6  Redistribution and use in source and binary forms, with or without modification, are permitted provided that
7  the following conditions are met:
8 
9  * Redistributions of source code must retain the above copyright notice, this list of conditions and
10  the following disclaimer.
11  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
12  the following disclaimer in the documentation and/or other materials provided with the distribution.
13 
14  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
15  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
16  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
17  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
18  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
20  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
21  POSSIBILITY OF SUCH DAMAGE.
22 */
23 
24 #pragma once
25 
26 #include "cinder/Cinder.h"
27 #include "cinder/Area.h"
28 #include "cinder/Vector.h"
29 #include "cinder/Surface.h"
30 
31 namespace cinder { namespace ip {
32 
33 void blend( Surface *background, const Surface &foreground, const Area &srcArea, const Vec2i &dstRelativeOffset = Vec2i::zero() );
34 inline void blend( Surface *background, const Surface &foreground ) { blend( background, foreground, background->getBounds(), Vec2i::zero() ); }
35 void blend( Surface32f *background, const Surface32f &foreground, const Area &srcArea, const Vec2i &dstRelativeOffset = Vec2i::zero() );
36 inline void blend( Surface32f *background, const Surface32f &foreground ) { blend( background, foreground, background->getBounds(), Vec2i::zero() ); }
37 
38 
39 } } // namespace cinder::ip
Area getBounds() const
Returns the bounding Area of the Surface in pixels: [0,0]-(width,height)
Definition: Surface.h:153
An in-memory representation of an image. Implicitly shared object.
Definition: Surface.h:92
Definition: Area.h:37
static Vec2< int > zero()
Definition: Vector.h:295
void blend(Surface *background, const Surface &foreground, const Area &srcArea, const Vec2i &dstRelativeOffset=Vec2i::zero())
Definition: Blend.cpp:188
Definition: Vector.h:68