loaders: PNG: Handle gamma on 16bpp conversion
[gfxprim.git] / libs / gfx / GP_VLineAA.c
blob37117a0216e5ea326587b4b933d9eceeb5b2502a
1 /*****************************************************************************
2 * This file is part of gfxprim library. *
3 * *
4 * Gfxprim is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU Lesser General Public *
6 * License as published by the Free Software Foundation; either *
7 * version 2.1 of the License, or (at your option) any later version. *
8 * *
9 * Gfxprim is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
12 * Lesser General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU Lesser General Public *
15 * License along with gfxprim; if not, write to the Free Software *
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
17 * Boston, MA 02110-1301 USA *
18 * *
19 * Copyright (C) 2009-2012 Cyril Hrubis <metan@ucw.cz> *
20 * *
21 *****************************************************************************/
23 #include "core/GP_GetPutPixel.h"
24 #include "core/GP_FnPerBpp.h"
26 #include "gfx/GP_VLineAA.h"
27 #include "gfx/GP_HLineAA.h"
30 void GP_VLineXYY_Raw(GP_Pixmap *pixmap, GP_Coord x, GP_Coord y0,
31 GP_Coord y1, GP_Pixel pixel)
33 GP_CHECK_PIXMAP(pixmap);
35 GP_FN_PER_BPP_PIXMAP(GP_VLine, pixmap, pixmap, x, y0, y1, pixel);
39 void GP_VLineAA(GP_Pixmap *pixmap, GP_Coord x, GP_Coord y0,
40 GP_Coord y1, GP_Pixel pixel)
42 GP_CHECK_PIXMAP(pixmap);
44 if (pixmap->axes_swap) {
45 GP_TRANSFORM_Y_FP(pixmap, x);
46 GP_TRANSFORM_X_FP(pixmap, y0);
47 GP_TRANSFORM_X_FP(pixmap, y1);
48 GP_HLineAA_Raw(pixmap, y0, y1, x, pixel);
49 } else {
50 GP_TRANSFORM_X_FP(pixmap, x);
51 GP_TRANSFORM_Y_FP(pixmap, y0);
52 GP_TRANSFORM_Y_FP(pixmap, y1);
53 GP_VLineAA_Raw(pixmap, x, y0, y1, pixel);