3 * libneuro, a light weight abstraction of high or lower libraries
4 * and toolkit for applications.
5 * Copyright (C) 2005-2006 Nicholas Niro, Robert Lemay
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 * not yet included in the main stream, this is a dormant module
28 /*-------------------- Extern Headers Including --------------------*/
31 /*-------------------- Local Headers Including ---------------------*/
32 #include <extlib.h> /* Lib_PutPixel and Lib_GetPixel */
34 /*-------------------- Main Module Header --------------------------*/
38 /*-------------------- Other ----------------------------*/
40 /*-------------------- Global Variables ----------------------------*/
42 /*-------------------- Static Variables ----------------------------*/
44 /* 1 is that the pixels will be cleaned during this cycle and 0 is no it won't */
45 static u8 clean_pixel_in_this_cycle
;
47 /* the pixels buffer */
50 typedef struct PIXEL_ENGINE
55 /*-------------------- Static Prototypes ---------------------------*/
59 /*-------------------- Static Functions ----------------------------*/
71 current
= Neuro_GiveEBufCount(tmp
);
77 if (!Neuro_EBufIsEmpty(tmp
))
81 pix
= Neuro_GiveEBuf(tmp
, current
);
89 Neuro_CleanEBuf(&_Pixel
);
92 /*-------------------- Global Functions ----------------------------*/
95 Neuro_PutPixel(v_object
*vobj
, u32 x
, u32 y
, u32 pixel
)
108 if (secureBoundsCheck(&check))
110 printf("Unsecure Pixel position have been catched, dropping the instruction\n");
115 Neuro_AllocEBuf(tmp, sizeof(PIXEL_ENGINE*), sizeof(PIXEL_ENGINE));
117 current = Neuro_GiveEBufCount(tmp);
118 buf = Neuro_GiveEBuf(tmp, current);*/
120 Lib_PutPixel(vobj
, x
, y
, pixel
);
128 Neuro_GetPixel(v_object
*vobj
, u32 x
, u32 y
)
130 return Lib_GetPixel(vobj
, x
, y
);
136 clean_pixel_in_this_cycle
= 1;
139 /*-------------------- Poll ----------------------------------------*/
147 /*-------------------- Constructor Destructor ----------------------*/
152 Neuro_CreateEBuf(&_Pixel
);
160 Neuro_CleanEBuf(&_Pixel
);