aseprite/src/doc/blend_funcs.h
David Capello d4faf04946 Add a rgba_blender_normal() version without opacity
This can be used to speed up text rendering and rotation algorithm.
2016-03-22 18:40:47 -03:00

35 lines
1.1 KiB
C++

// Aseprite Document Library
// Copyright (c) 2001-2016 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef DOC_BLEND_FUNCS_H_INCLUDED
#define DOC_BLEND_FUNCS_H_INCLUDED
#pragma once
#include "doc/blend_mode.h"
#include "doc/color.h"
namespace doc {
typedef color_t (*BlendFunc)(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_normal(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_normal(color_t backdrop, color_t src);
color_t rgba_blender_merge(color_t backdrop, color_t src, int opacity);
color_t rgba_blender_neg_bw(color_t backdrop, color_t src, int opacity);
color_t graya_blender_normal(color_t backdrop, color_t src, int opacity);
color_t graya_blender_normal(color_t backdrop, color_t src);
color_t graya_blender_merge(color_t backdrop, color_t src, int opacity);
color_t graya_blender_neg_bw(color_t backdrop, color_t src, int opacity);
BlendFunc get_rgba_blender(BlendMode blendmode);
BlendFunc get_graya_blender(BlendMode blendmode);
BlendFunc get_indexed_blender(BlendMode blendmode);
} // namespace doc
#endif