Code

Merging from trunk
[inkscape.git] / src / display / nr-arena-image.h
1 #ifndef __NR_ARENA_IMAGE_H__
2 #define __NR_ARENA_IMAGE_H__
4 /*
5  * RGBA display list system for inkscape
6  *
7  * Author:
8  *   Lauris Kaplinski <lauris@kaplinski.com>
9  *
10  * Copyright (C) 2001-2002 Lauris Kaplinski
11  * Copyright (C) 2001 Ximian, Inc.
12  *
13  * Released under GNU GPL, read the file 'COPYING' for more information
14  */
16 #define NR_TYPE_ARENA_IMAGE (nr_arena_image_get_type ())
17 #define NR_ARENA_IMAGE(o) (NR_CHECK_INSTANCE_CAST ((o), NR_TYPE_ARENA_IMAGE, NRArenaImage))
18 #define NR_IS_ARENA_IMAGE(o) (NR_CHECK_INSTANCE_TYPE ((o), NR_TYPE_ARENA_IMAGE))
20 #include <libnr/nr-matrix.h>
21 #include "nr-arena-item.h"
22 #include "style.h"
24 NRType nr_arena_image_get_type (void);
26 struct NRArenaImage : public NRArenaItem {
27     unsigned char *px;
28     unsigned int pxw;
29     unsigned int pxh;
30     unsigned int pxrs;
32     double x, y;
33     double width, height;
35     Geom::Point c00, c01, c11, c10; // all 4 corners of the image, for outline mode rect
37     /* From GRID to PIXELS */
38     Geom::Matrix grid2px;
40     SPStyle *style;
42     static NRArenaImage *create(NRArena *arena) {
43         NRArenaImage *obj=reinterpret_cast<NRArenaImage *>(nr_object_new(NR_TYPE_ARENA_IMAGE));
44         obj->init(arena);
45         return obj;
46     }
47 };
49 struct NRArenaImageClass {
50     NRArenaItemClass parent_class;
51 };
53 void nr_arena_image_set_pixels (NRArenaImage *image, unsigned char const *px, unsigned int pxw, unsigned int pxh, unsigned int pxrs);
54 void nr_arena_image_set_geometry (NRArenaImage *image, double x, double y, double width, double height);
55 void nr_arena_image_set_style (NRArenaImage *image, SPStyle *style);
58 #endif
60 /*
61   Local Variables:
62   mode:c++
63   c-file-style:"stroustrup"
64   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
65   indent-tabs-mode:nil
66   fill-column:99
67   End:
68 */
69 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :