1 /**************************************************************************
3 * Copyright 2009 VMware, Inc. All Rights Reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sub license, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
21 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 **************************************************************************/
30 #include "vg_context.h"
31 #include "pipe/p_state.h"
39 struct vg_object base
;
44 struct vg_image
*parent
;
46 struct pipe_sampler_view
*sampler_view
;
47 struct pipe_sampler_state sampler
;
49 struct array
*children_array
;
52 struct vg_image
*image_create(VGImageFormat format
,
53 VGint width
, VGint height
);
54 void image_destroy(struct vg_image
*img
);
56 void image_clear(struct vg_image
*img
,
57 VGint x
, VGint y
, VGint width
, VGint height
);
59 void image_sub_data(struct vg_image
*image
,
62 VGImageFormat dataFormat
,
64 VGint width
, VGint height
);
66 void image_get_sub_data(struct vg_image
* image
,
69 VGImageFormat dataFormat
,
71 VGint width
, VGint height
);
73 struct vg_image
*image_child_image(struct vg_image
*parent
,
75 VGint width
, VGint height
);
77 void image_copy(struct vg_image
*dst
, VGint dx
, VGint dy
,
78 struct vg_image
*src
, VGint sx
, VGint sy
,
79 VGint width
, VGint height
,
82 void image_draw(struct vg_image
*img
);
84 void image_set_pixels(VGint dx
, VGint dy
,
85 struct vg_image
*src
, VGint sx
, VGint sy
,
86 VGint width
, VGint height
);
87 void image_get_pixels(struct vg_image
*dst
, VGint dx
, VGint dy
,
89 VGint width
, VGint height
);
91 VGint
image_bind_samplers(struct vg_image
*dst
, struct pipe_sampler_state
**samplers
,
92 struct pipe_sampler_view
**sampler_views
);
94 VGboolean
vg_image_overlaps(struct vg_image
*dst
,
95 struct vg_image
*src
);
97 VGint
image_sampler_filter(struct vg_context
*ctx
);
99 void vg_copy_surface(struct vg_context
*ctx
,
100 struct pipe_surface
*dst
, VGint dx
, VGint dy
,
101 struct pipe_surface
*src
, VGint sx
, VGint sy
,
102 VGint width
, VGint height
);