blob: 0c65916c577e491c3885d6ed7ca0cfc36de4ed62 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
2 * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26
27/*
28 * FUNCTION
29 * mlib_ImageConstXor - image logical operation with constant
30 *
31 * SYNOPSIS
32 * mlib_status mlib_ImageConstXor(mlib_image *dst,
33 * const mlib_image *src,
34 * const mlib_s32 *c);
35 *
36 * ARGUMENT
37 * dst Pointer to destination image
38 * src Pointer to source image
39 * c Array of constants for each channel
40 *
41 * RESTRICTION
42 * The src and dst must be the same type and the same size.
43 * They can have 1, 2, 3, or 4 channels.
44 * They can be in MLIB_BIT, MLIB_BYTE, MLIB_SHORT, MLIB_USHORT or MLIB_INT
45 * data type.
46 *
47 * DESCRIPTION
48 * File for one of the following operations:
49 *
50 * And dst(i,j) = c & src(i,j)
51 * Or dst(i,j) = c | src(i,j)
52 * Xor dst(i,j) = c ^ src(i,j)
53 * NotAnd dst(i,j) = ~(c & src(i,j))
54 * NotOr dst(i,j) = ~(c | src(i,j))
55 * NotXor dst(i,j) = ~(c ^ src(i,j))
56 * AndNot dst(i,j) = c & (~src(i,j))
57 * OrNot dst(i,j) = c & (~src(i,j))
58 */
59
60#include <mlib_image.h>
61
62/***************************************************************/
63
64#if ! defined ( __MEDIALIB_OLD_NAMES )
65#if defined ( __SUNPRO_C )
66
67#pragma weak mlib_ImageConstXor = __mlib_ImageConstXor
68
69#elif defined ( __GNUC__ ) /* defined ( __SUNPRO_C ) */
70 __typeof__ (__mlib_ImageConstXor) mlib_ImageConstXor
71 __attribute__ ((weak,alias("__mlib_ImageConstXor")));
72
73#else /* defined ( __SUNPRO_C ) */
74
75#error "unknown platform"
76
77#endif /* defined ( __SUNPRO_C ) */
78#endif /* ! defined ( __MEDIALIB_OLD_NAMES ) */
79
80/***************************************************************/
81
82#define VIS_CONSTLOGIC(c, a) vis_fxor(a, c)
83
84#include <mlib_v_ImageConstLogic.h>
85
86/***************************************************************/
87
88mlib_status __mlib_ImageConstXor(mlib_image *dst,
89 mlib_image *src,
90 mlib_s32 *c)
91{
92 return mlib_v_ImageConstLogic(dst, src, c);
93}
94
95/***************************************************************/