J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | /* |
| 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_ImageXor - xor two images (VIS version) |
| 30 | * |
| 31 | * SYNOPSIS |
| 32 | * mlib_status mlib_ImageXor(mlib_image *dst, |
| 33 | * const mlib_image *src1, |
| 34 | * const mlib_image *src2); |
| 35 | * |
| 36 | * ARGUMENT |
| 37 | * dst pointer to destination image |
| 38 | * src1 pointer to first source image |
| 39 | * src2 pointer to second source image |
| 40 | * |
| 41 | * RESTRICTION |
| 42 | * The src1, src2, and dst must be the same type and the same dsize. |
| 43 | * They can have 1, 2, 3, or 4 channels. |
| 44 | * They can be in MLIB_BYTE, MLIB_SHORT, MLIB_USHORT, MLIB_INT or MLIB_BIT data type. |
| 45 | * |
| 46 | * DESCRIPTION |
| 47 | * Xor two images for each band: dst = src1 ^ src2 |
| 48 | */ |
| 49 | |
| 50 | #include <mlib_image.h> |
| 51 | |
| 52 | /***************************************************************/ |
| 53 | |
| 54 | #if ! defined ( __MEDIALIB_OLD_NAMES ) |
| 55 | #if defined ( __SUNPRO_C ) |
| 56 | |
| 57 | #pragma weak mlib_ImageXor = __mlib_ImageXor |
| 58 | |
| 59 | #elif defined ( __GNUC__ ) /* defined ( __SUNPRO_C ) */ |
| 60 | __typeof__ (__mlib_ImageXor) mlib_ImageXor |
| 61 | __attribute__ ((weak,alias("__mlib_ImageXor"))); |
| 62 | |
| 63 | #else /* defined ( __SUNPRO_C ) */ |
| 64 | |
| 65 | #error "unknown platform" |
| 66 | |
| 67 | #endif /* defined ( __SUNPRO_C ) */ |
| 68 | #endif /* ! defined ( __MEDIALIB_OLD_NAMES ) */ |
| 69 | |
| 70 | /***************************************************************/ |
| 71 | |
| 72 | #define VIS_LOGIC(a1, a2) vis_fxor(a1, a2) |
| 73 | |
| 74 | #include <mlib_v_ImageLogic.h> |
| 75 | |
| 76 | /***************************************************************/ |
| 77 | |
| 78 | mlib_status __mlib_ImageXor(mlib_image *dst, |
| 79 | mlib_image *src1, |
| 80 | mlib_image *src2) |
| 81 | { |
| 82 | MLIB_IMAGE_CHECK(src1); |
| 83 | MLIB_IMAGE_CHECK(src2); |
| 84 | MLIB_IMAGE_CHECK(dst); |
| 85 | |
| 86 | return mlib_v_ImageLogic(dst, src1, src2); |
| 87 | } |
| 88 | |
| 89 | /***************************************************************/ |