Back to index

scribus-ng  1.3.4.dfsg+svn20071115
art_render_misc.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /* This file is part of the KDE project.
00008  * art_render_misc.c: Here I store some routines I feel should be in libart :)
00009  *
00010  * Copyright (C) 2002, The Karbon Developers
00011  *
00012  * This code is adapted from :
00013  *
00014  * art_render_gradient.h: Gradient image source for modular rendering.
00015  *
00016  * Libart_LGPL - library of basic graphic primitives
00017  * Copyright (C) 2000 Raph Levien
00018  *
00019  * This library is free software; you can redistribute it and/or
00020  * modify it under the terms of the GNU Library General Public
00021  * License as published by the Free Software Foundation; either
00022  * version 2 of the License, or (at your option) any later version.
00023  *
00024  * This library is distributed in the hope that it will be useful,
00025  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00026  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00027  * Library General Public License for more details.
00028  *
00029  * You should have received a copy of the GNU Library General Public
00030  * License along with this library; if not, write to the
00031  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00032  * Boston, MA 02111-1307, USA.
00033  *
00034  * Authors: Raph Levien <raph@acm.org>
00035  *          Alexander Larsson <alla@lysator.liu.se>
00036  */
00037 
00038 #ifndef __ART_RENDER_MISC_H__
00039 #define __ART_RENDER_MISC_H__
00040 
00041 #ifdef LIBART_COMPILATION
00042 #include "art_filterlevel.h"
00043 #include "art_render.h"
00044 #else
00045 #include <libart_lgpl/art_filterlevel.h>
00046 #include <libart_lgpl/art_render.h>
00047 #endif
00048 
00049 #ifdef __cplusplus
00050 extern "C" {
00051 #endif /* __cplusplus */
00052 
00053 typedef struct _ArtGradientLinear ArtGradientLinear;
00054 typedef struct _ArtGradientRadial ArtGradientRadial;
00055 typedef struct _ArtGradientConical ArtGradientConical;
00056 typedef struct _ArtGradientStop ArtGradientStop;
00057 
00058 typedef enum {
00059   ART_GRADIENT_PAD,
00060   ART_GRADIENT_REFLECT,
00061   ART_GRADIENT_REPEAT
00062 } ArtGradientSpread;
00063 
00064 struct _ArtGradientLinear {
00065   double a;
00066   double b;
00067   double c;
00068   ArtGradientSpread spread;
00069   int n_stops;
00070   ArtGradientStop *stops;
00071 };
00072 
00073 struct _ArtGradientRadial {
00074   double affine[6]; /* transforms user coordinates to unit circle */
00075   double fx, fy;    /* focal point in unit circle coords */
00076   int n_stops;
00077   ArtGradientSpread spread;
00078   ArtGradientStop *stops;
00079 };
00080 
00081 struct _ArtGradientConical {
00082        double cx, cy;    /* focal point in unit circle coords */
00083        double r;         /* focal point in unit circle coords */
00084        ArtGradientSpread spread;
00085        art_u8 *buf;
00086        int n_stops;
00087        ArtGradientStop *stops;
00088 };
00089 
00090 
00091 struct _ArtGradientStop {
00092   double offset;
00093   ArtPixMaxDepth color[ART_MAX_CHAN + 1];
00094 };
00095 
00096 void
00097 art_karbon_render_gradient_linear (ArtRender *render,
00098                          const ArtGradientLinear *gradient,
00099                          ArtFilterLevel level);
00100 
00101 void
00102 art_karbon_render_gradient_radial (ArtRender *render,
00103                          const ArtGradientRadial *gradient,
00104                          ArtFilterLevel level);
00105 
00106 void
00107 art_karbon_render_gradient_conical (ArtRender *render,
00108                     const ArtGradientConical *gradient,
00109                     ArtFilterLevel level);
00110 
00111 #ifdef __cplusplus
00112 }
00113 #endif /* __cplusplus */
00114 
00115 #endif /* __ART_RENDER_MISC_H__ */