found a helper function for dataless ipl images; use it
[sparrow.git] / play.c
blobfabea54e4668d6d068a2d0a68aee45f5c693afe3
1 /* Copyright (C) <2010> Douglas Bagnall <douglas@halo.gen.nz>
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Library General Public
5 * License as published by the Free Software Foundation; either
6 * version 2 of the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Library General Public License for more details.
13 * You should have received a copy of the GNU Library General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 * Boston, MA 02111-1307, USA.
19 #include "sparrow.h"
20 #include "gstsparrow.h"
22 #include <string.h>
23 #include <math.h>
26 UNUSED
27 static void
28 simple_negation(guint8 * bytes, guint size){
29 guint i;
30 guint32 * data = (guint32 *)bytes;
31 //could use sse for superspeed
32 for (i = 0; i < size / 4; i++){
33 data[i] = ~data[i];
37 UNUSED
38 static void
39 gamma_negation(GstSparrow *sparrow, guint8 *in, guint8 *out){
40 //guint i;
41 //XXX could try oil_tablelookup_u8
42 //for (i = 0; i < size; i++){
43 // out[i] = sparrow_rgb_gamma_full_range_REVERSE[in[i]];
44 // }
47 INVISIBLE sparrow_state
48 mode_play(GstSparrow *sparrow, guint8 *in, guint8 *out){
49 //do actual stuff here
50 memcpy(out, in, sparrow->out.size);
51 simple_negation(out, sparrow->out.size);
53 return SPARROW_STATUS_QUO;
56 INVISIBLE void init_play(GstSparrow *sparrow){}
57 INVISIBLE void finalise_play(GstSparrow *sparrow){}