Picasso API  2.2
picasso.h
Go to the documentation of this file.
00001 
00019 #ifndef _PICASSO_H_
00020 #define _PICASSO_H_
00021 
00022 #ifdef DLL_EXPORT
00023     #if defined(WIN32) || defined(WINCE)
00024         #ifdef EXPORT
00025             #define PICAPI  __stdcall
00026             #define PEXPORT __declspec(dllexport)
00027         #else
00028             #define PICAPI  __stdcall
00029             #define PEXPORT __declspec(dllimport)
00030         #endif
00031     #else
00032         #define PICAPI
00033         #if (defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))) || (defined(__clang__))
00034             #define PEXPORT __attribute__((visibility("default")))
00035         #else
00036             #define PEXPORT
00037         #endif
00038     #endif
00039 #else
00040 #define PICAPI
00041 #define PEXPORT
00042 #endif
00043 
00044 #include "pconfig.h"
00045 #include <stdint.h>
00046 
00047 #if defined(ENABLE_GLES1)
00048 #include <EGL/egl.h>
00049 #include <GLES/gl.h>
00050 #elif defined(ENABLE_GLES2)
00051 #include <EGL/egl.h>
00052 #include <GLES2/gl2.h>
00053 #endif
00054 
00055 #ifdef __cplusplus
00056 extern "C" {
00057 #endif /* __cplusplus */
00058 
00069 typedef int ps_bool;
00070 
00076 #define True    1
00077 
00083 #define False   0
00084 
00090 typedef uint16_t ps_uchar16;
00091 
00097 typedef int16_t ps_schar16;
00098 
00104 typedef uint8_t ps_byte;
00105 
00118 typedef struct _ps_context ps_context;
00119 
00125 typedef struct _ps_canvas ps_canvas;
00126 
00132 typedef struct _ps_image ps_image;
00133 
00139 typedef struct _ps_pattern ps_pattern;
00140 
00146 typedef struct _ps_gradient ps_gradient;
00147 
00153 typedef struct _ps_matrix ps_matrix;
00154 
00160 typedef struct _ps_path ps_path;
00161 
00167 typedef struct _ps_mask ps_mask;
00168 
00174 typedef struct _ps_font ps_font;
00175 
00179 typedef struct _ps_glyph {
00181     void* glyph;
00182 }ps_glyph;
00183 
00187 typedef struct _ps_size {
00189     float w;
00191     float h;
00192 }ps_size;
00193 
00197 typedef struct _ps_rect {
00199     float x;
00201     float y;
00203     float w;
00205     float h;
00206 }ps_rect;
00207 
00211 typedef struct _ps_point {
00213     float x;
00215     float y;
00216 }ps_point;
00217 
00221 typedef struct _ps_color {
00223     float r;
00225     float g;
00227     float b;
00229     float a;
00230 }ps_color;
00231 
00245 PEXPORT int PICAPI ps_version(void);
00246 
00257 PEXPORT ps_bool PICAPI ps_initialize(void);
00258 
00267 PEXPORT void PICAPI ps_shutdown(void);
00268 
00272 typedef enum _ps_status {
00276     STATUS_SUCCEED,
00280     STATUS_OUT_OF_MEMORY,
00284     STATUS_INVALID_ARGUMENT,
00288     STATUS_NOT_SUPPORT,
00292     STATUS_DEVICE_ERROR,
00296     STATUS_MISMATCHING_FORMAT,
00300     STATUS_UNKNOWN_ERROR,
00301 }ps_status;
00302 
00308 PEXPORT ps_status PICAPI ps_last_status(void);
00336 PEXPORT ps_context* PICAPI ps_context_create(ps_canvas* canvas, ps_context* shared_context);
00337 
00351 PEXPORT ps_context* PICAPI ps_context_ref(ps_context* ctx);
00352 
00362 PEXPORT void PICAPI ps_context_unref(ps_context* ctx);
00363 
00378 PEXPORT ps_canvas* PICAPI ps_context_set_canvas(ps_context* ctx, ps_canvas* canvas);
00379 
00393 PEXPORT ps_canvas* PICAPI ps_context_get_canvas(ps_context* ctx);
00394 
00405 typedef enum _ps_color_format {
00409     COLOR_FORMAT_RGBA,
00413     COLOR_FORMAT_ARGB,
00417     COLOR_FORMAT_ABGR,
00421     COLOR_FORMAT_BGRA,
00425     COLOR_FORMAT_RGB,
00429     COLOR_FORMAT_BGR,
00433     COLOR_FORMAT_RGB565,
00437     COLOR_FORMAT_RGB555,
00441     COLOR_FORMAT_UNKNOWN,
00442 }ps_color_format;
00443 
00460 PEXPORT ps_canvas* PICAPI ps_canvas_create(ps_color_format fmt, int width, int height);
00461 
00481 PEXPORT ps_canvas* PICAPI ps_canvas_create_with_data(ps_byte* data, ps_color_format fmt,
00482                                                             int width, int height, int pitch);
00483 
00502 PEXPORT ps_canvas* PICAPI ps_canvas_create_compatible(const ps_canvas* canvas,
00503                                                                 int width, int height);
00504 
00521 PEXPORT ps_canvas* PICAPI ps_canvas_create_from_canvas(ps_canvas* canvas, const ps_rect* rect);
00522 
00539 PEXPORT ps_canvas* PICAPI ps_canvas_create_from_image(ps_image* img, const ps_rect* rect);
00540 
00541 #if defined(ENABLE_GLES1) || defined(ENABLE_GLES2)
00542 
00557 PEXPORT ps_canvas* PICAPI ps_canvas_create_with_egl(EGLSurface surface, EGLContext context);
00558 #endif
00559 
00582 PEXPORT ps_canvas* PICAPI ps_canvas_replace_data(ps_canvas* canvas, ps_byte* data,
00583                                                  ps_color_format fmt, int width, int height, int pitch);
00584 
00599 PEXPORT ps_canvas* PICAPI ps_canvas_ref(ps_canvas* canvas);
00600 
00611 PEXPORT void PICAPI ps_canvas_unref(ps_canvas* canvas);
00612 
00626 PEXPORT ps_bool PICAPI ps_canvas_get_size(const ps_canvas* canvas, ps_size* rsize);
00627 
00641 PEXPORT ps_color_format PICAPI ps_canvas_get_format(const ps_canvas* canvas);
00642 
00652 PEXPORT void PICAPI ps_canvas_set_mask(ps_canvas* canvas, const ps_mask* mask);
00653 
00662 PEXPORT void PICAPI ps_canvas_reset_mask(ps_canvas* canvas);
00663 
00679 PEXPORT void PICAPI ps_canvas_bitblt(ps_canvas* src, const ps_rect* rect,
00680                                                 ps_canvas* dst, const ps_point* location);
00704 PEXPORT ps_image* PICAPI ps_image_create(ps_color_format fmt, int width, int height);
00705 
00725 PEXPORT ps_image* PICAPI ps_image_create_with_data(ps_byte* data, ps_color_format fmt,
00726                                 int width, int height, int pitch);
00746 PEXPORT ps_image* PICAPI ps_image_create_from_data(ps_byte* data, ps_color_format fmt,
00747                                 int width, int height, int pitch);
00766 PEXPORT ps_image* PICAPI ps_image_create_compatible(const ps_canvas* canvas, int width, int height);
00767 
00784 PEXPORT ps_image* PICAPI ps_image_create_from_canvas(ps_canvas* canvas, const ps_rect* rect);
00785 
00802 PEXPORT ps_image* PICAPI ps_image_create_from_image(ps_image* img, const ps_rect* rect);
00803 
00818 PEXPORT ps_image* PICAPI ps_image_ref(ps_image* img);
00819 
00830 PEXPORT void PICAPI ps_image_unref(ps_image* img);
00831 
00841 PEXPORT void PICAPI ps_image_set_allow_transparent(ps_image* img, ps_bool allow);
00842 
00852 PEXPORT void PICAPI ps_image_set_transparent_color(ps_image* img, const ps_color* color);
00853 
00867 PEXPORT ps_bool PICAPI ps_image_get_size(const ps_image* img, ps_size* rsize);
00868 
00882 PEXPORT ps_color_format PICAPI ps_image_get_format(const ps_image* img);
00883 
00894 typedef enum _ps_wrap_type {
00898     WRAP_TYPE_REPEAT,
00902     WRAP_TYPE_REFLECT,
00903 }ps_wrap_type;
00904 
00922 PEXPORT ps_pattern* PICAPI ps_pattern_create_image(const ps_image* img, ps_wrap_type x_wrap,
00923                                                 ps_wrap_type y_wrap, const ps_matrix* transform);
00924 
00934 PEXPORT void PICAPI ps_pattern_transform(ps_pattern* pattern, const ps_matrix* matrix);
00935 
00949 PEXPORT ps_pattern* PICAPI ps_pattern_ref(ps_pattern* pattern);
00950 
00960 PEXPORT void PICAPI ps_pattern_unref(ps_pattern* pattern);
00961 
00972 typedef enum _ps_gradient_spread {
00976     GRADIENT_SPREAD_PAD,
00980     GRADIENT_SPREAD_REPEAT,
00984     GRADIENT_SPREAD_REFLECT,
00985 }ps_gradient_spread;
00986 
01003 PEXPORT ps_gradient* PICAPI ps_gradient_create_linear(ps_gradient_spread spread,
01004                                                     const ps_point* start, const ps_point* end);
01005 
01024 PEXPORT ps_gradient* PICAPI ps_gradient_create_radial(ps_gradient_spread spread,
01025                         const ps_point* start, float sradius, const ps_point* end, float eradius);
01026 
01044 PEXPORT ps_gradient* PICAPI ps_gradient_create_conic(ps_gradient_spread spread,
01045                                     const ps_point* origin, float sangle);
01046 
01057 PEXPORT void PICAPI ps_gradient_transform(ps_gradient* gradient, const ps_matrix* matrix);
01058 
01073 PEXPORT ps_gradient* PICAPI ps_gradient_ref(ps_gradient* gradient);
01074 
01085 PEXPORT void PICAPI ps_gradient_unref(ps_gradient* gradient);
01086 
01097 PEXPORT void PICAPI ps_gradient_add_color_stop(ps_gradient* gradient,
01098                                                 float offset, const ps_color* color);
01099 
01108 PEXPORT void PICAPI ps_gradient_clear_color_stops(ps_gradient* gradient);
01109 
01134 PEXPORT ps_mask* PICAPI ps_mask_create_with_data(ps_byte* data, int width, int height);
01135 
01149 PEXPORT ps_mask* PICAPI ps_mask_ref(ps_mask* mask);
01150 
01160 PEXPORT void PICAPI ps_mask_unref(ps_mask* mask);
01161 
01172 PEXPORT void PICAPI ps_mask_add_color_filter(ps_mask* mask, const ps_color* color);
01173 
01182 PEXPORT void PICAPI ps_mask_clear_color_filters(ps_mask* mask);
01183 
01205 PEXPORT void PICAPI ps_set_source_color(ps_context* ctx, const ps_color* color);
01206 
01216 PEXPORT void PICAPI ps_set_source_image(ps_context* ctx, const ps_image* image);
01217 
01227 PEXPORT void PICAPI ps_set_source_pattern(ps_context* ctx, const ps_pattern* pattern);
01228 
01238 PEXPORT void PICAPI ps_set_source_gradient(ps_context* ctx, const ps_gradient* gradient);
01239 
01249 PEXPORT void PICAPI ps_set_source_canvas(ps_context* ctx, const ps_canvas* canvas);
01250 
01261 typedef enum _ps_line_cap {
01265     LINE_CAP_BUTT,
01269     LINE_CAP_ROUND,
01273     LINE_CAP_SQUARE,
01274 }ps_line_cap;
01275 
01286 PEXPORT void PICAPI ps_set_line_cap(ps_context* ctx, ps_line_cap line_cap);
01287 
01291 typedef enum _ps_line_join {
01295     LINE_JOIN_MITER,
01299     LINE_JOIN_MITER_REVERT,
01303     LINE_JOIN_MITER_ROUND,
01307     LINE_JOIN_ROUND,
01311     LINE_JOIN_BEVEL,
01312 }ps_line_join;
01313 
01324 PEXPORT void PICAPI ps_set_line_join(ps_context* ctx, ps_line_join line_join);
01325 
01329 typedef enum _ps_line_inner_join {
01333     LINE_INNER_MITER,
01337     LINE_INNER_BEVEL,
01341     LINE_INNER_JAG,
01345     LINE_INNER_ROUND,
01346 }ps_line_inner_join;
01347 
01358 PEXPORT void PICAPI ps_set_line_inner_join(ps_context* ctx, ps_line_inner_join line_inner_join);
01359 
01375 PEXPORT float PICAPI ps_set_line_width(ps_context* ctx, float width);
01376 
01392 PEXPORT float PICAPI ps_set_miter_limit(ps_context* ctx, float limit);
01393 
01405 PEXPORT void PICAPI ps_set_stroke_color(ps_context* ctx, const ps_color* color);
01406 
01418 PEXPORT void PICAPI ps_set_stroke_image(ps_context* ctx, const ps_image* image);
01419 
01431 PEXPORT void PICAPI ps_set_stroke_pattern(ps_context* ctx, const ps_pattern* pattern);
01432 
01444 PEXPORT void PICAPI ps_set_stroke_gradient(ps_context* ctx, const ps_gradient* gradient);
01445 
01457 PEXPORT void PICAPI ps_set_stroke_canvas(ps_context* ctx, const ps_canvas* canvas);
01458 
01472 PEXPORT void PICAPI ps_set_line_dash(ps_context* ctx, float start,
01473                                         const float* dashes, unsigned int num_dashes);
01474 
01484 PEXPORT void PICAPI ps_reset_line_dash(ps_context* ctx);
01485 
01504 PEXPORT void PICAPI ps_set_shadow(ps_context* ctx, float x_offset, float y_offset, float blur);
01505 
01515 PEXPORT void PICAPI ps_set_shadow_color(ps_context* ctx, const ps_color* color);
01516 
01525 PEXPORT void PICAPI ps_reset_shadow(ps_context* ctx);
01526 
01536 typedef enum _ps_composite {
01538     COMPOSITE_CLEAR,
01540     COMPOSITE_SRC,
01542     COMPOSITE_SRC_OVER,
01544     COMPOSITE_SRC_IN,
01546     COMPOSITE_SRC_OUT,
01548     COMPOSITE_SRC_ATOP,
01550     COMPOSITE_DST,
01552     COMPOSITE_DST_OVER,
01554     COMPOSITE_DST_IN,
01556     COMPOSITE_DST_OUT,
01558     COMPOSITE_DST_ATOP,
01560     COMPOSITE_XOR,
01562     COMPOSITE_DARKEN,
01564     COMPOSITE_LIGHTEN,
01566     COMPOSITE_OVERLAY,
01568     COMPOSITE_SCREEN,
01570     COMPOSITE_MULTIPLY,
01572     COMPOSITE_PLUS,
01574     COMPOSITE_MINUS,
01576     COMPOSITE_EXCLUSION,
01578     COMPOSITE_DIFFERENCE,
01580     COMPOSITE_SOFTLIGHT,
01582     COMPOSITE_HARDLIGHT,
01584     COMPOSITE_BURN,
01586     COMPOSITE_DODGE,
01588     COMPOSITE_CONTRAST,
01590     COMPOSITE_INVERT,
01592     COMPOSITE_INVERT_BLEND,
01594     COMPOSITE_HUE,
01596     COMPOSITE_SATURATION,
01598     COMPOSITE_COLOR,
01600     COMPOSITE_LUMINOSITY,
01602     COMPOSITE_ERROR,
01603 }ps_composite;
01604 
01619 PEXPORT ps_composite PICAPI ps_set_composite_operator(ps_context* ctx, ps_composite composite);
01620 
01624 typedef enum _ps_filter {
01628     FILTER_NEAREST,
01632     FILTER_BILINEAR,
01636     FILTER_GAUSSIAN,
01640     FILTER_UNKNOWN,
01641 }ps_filter;
01642 
01657 PEXPORT ps_filter PICAPI ps_set_filter(ps_context* ctx, ps_filter filter);
01658 
01662 typedef enum _ps_fill_rule {
01666     FILL_RULE_WINDING,
01670     FILL_RULE_EVEN_ODD,
01674     FILL_RULE_ERROR,
01675 }ps_fill_rule;
01676 
01691 PEXPORT ps_fill_rule PICAPI ps_set_fill_rule(ps_context* ctx, ps_fill_rule rule);
01692 
01708 PEXPORT float PICAPI ps_set_alpha(ps_context* ctx, float alpha);
01709 
01725 PEXPORT float PICAPI ps_set_gamma(ps_context* ctx, float gamma);
01726 
01736 PEXPORT void PICAPI ps_set_antialias(ps_context* ctx, ps_bool antialias);
01737 
01753 PEXPORT float PICAPI ps_set_blur(ps_context* ctx, float blur);
01754 
01771 PEXPORT void PICAPI ps_stroke(ps_context* ctx);
01772 
01782 PEXPORT void PICAPI ps_fill(ps_context* ctx);
01783 
01793 PEXPORT void PICAPI ps_paint(ps_context* ctx);
01794 
01803 PEXPORT void PICAPI ps_clear(ps_context* ctx);
01804 
01821 PEXPORT void PICAPI ps_clip(ps_context* ctx);
01822 
01833 PEXPORT void PICAPI ps_clip_path(ps_context* ctx, const ps_path* path, ps_fill_rule rule);
01834 
01844 PEXPORT void PICAPI ps_clip_rect(ps_context* ctx, const ps_rect* rect);
01845 
01858 PEXPORT void PICAPI ps_clip_device_rect(ps_context* ctx, const ps_rect* rect);
01859 
01870 PEXPORT void PICAPI ps_clip_rects(ps_context* ctx, const ps_rect* rects, unsigned int num_rects);
01871 
01880 PEXPORT void PICAPI ps_reset_clip(ps_context* ctx);
01881 
01916 PEXPORT void PICAPI ps_save(ps_context* ctx);
01917 
01926 PEXPORT void PICAPI ps_restore(ps_context* ctx);
01927 
01939 typedef enum _ps_charset {
01943     CHARSET_ANSI,
01947     CHARSET_UNICODE,
01948 }ps_charset;
01949 
01953 typedef enum _ps_font_weight {
01957     FONT_WEIGHT_REGULAR = 400,
01961     FONT_WEIGHT_MEDIUM = 500,
01965     FONT_WEIGHT_BOLD = 700,
01969     FONT_WEIGHT_HEAVY = 900,
01970 }ps_font_weight;
01971 
01989 PEXPORT ps_font* PICAPI ps_font_create(const char* name, ps_charset charset,
01990                                                     float size, int weight, ps_bool italic);
01991 
02005 PEXPORT ps_font* PICAPI ps_font_create_copy(const ps_font* font);
02006 
02020 PEXPORT ps_font* PICAPI ps_font_ref(ps_font* font);
02021 
02031 PEXPORT void PICAPI ps_font_unref(ps_font* font);
02032 
02043 PEXPORT void PICAPI ps_font_set_size(ps_font* font, float size);
02044 
02055 PEXPORT void PICAPI ps_font_set_weight(ps_font* font, int weight);
02056 
02067 PEXPORT void PICAPI ps_font_set_italic(ps_font* font, ps_bool italic);
02068 
02079 PEXPORT void PICAPI ps_font_set_charset(ps_font* font, ps_charset charset);
02080 
02091 PEXPORT void PICAPI ps_font_set_hint(ps_font* font, ps_bool hint);
02092 
02103 PEXPORT void PICAPI ps_font_set_flip(ps_font* font, ps_bool flip);
02104 
02108 typedef struct _ps_font_info {
02112     float size;
02116     float ascent;
02120     float descent;
02124     float leading;
02128     unsigned int unitsEM;
02129 }ps_font_info;
02130 
02142 PEXPORT ps_bool PICAPI ps_get_font_info(ps_context* ctx, ps_font_info* info);
02143 
02158 PEXPORT ps_font* PICAPI ps_set_font(ps_context* ctx, const ps_font* font);
02159 
02170 typedef enum _ps_text_type {
02174     TEXT_TYPE_SMOOTH,
02178     TEXT_TYPE_MONO,
02182     TEXT_TYPE_STROKE,
02183 }ps_text_type;
02184 
02200 PEXPORT ps_bool PICAPI ps_get_text_extent(ps_context* ctx, const void* text, unsigned int length, ps_size* rsize);
02201 
02212 PEXPORT void PICAPI ps_set_text_color(ps_context* ctx, const ps_color * color);
02213 
02224 PEXPORT void PICAPI ps_set_text_stroke_color(ps_context* ctx, const ps_color * color);
02225 
02238 PEXPORT void PICAPI ps_text_transform(ps_context* ctx, const ps_matrix* matrix);
02239 
02252 PEXPORT void PICAPI ps_set_text_matrix(ps_context* ctx, const ps_matrix* matrix);
02253 
02264 PEXPORT void PICAPI ps_set_text_render_type(ps_context* ctx, ps_text_type type);
02265 
02276 PEXPORT void PICAPI ps_set_text_antialias(ps_context* ctx, ps_bool antialias);
02277 
02288 PEXPORT void PICAPI ps_set_text_kerning(ps_context* ctx, ps_bool kerning);
02289 
02302 PEXPORT void PICAPI ps_text_out_length(ps_context* ctx, float x, float y,
02303                                                 const char* text, unsigned int length);
02304 
02317 PEXPORT void PICAPI ps_wide_text_out_length(ps_context* ctx, float x, float y,
02318                                                 const ps_uchar16* text, unsigned int length);
02322 typedef enum _ps_draw_text_type {
02326     DRAW_TEXT_FILL,
02330     DRAW_TEXT_STROKE,
02334     DRAW_TEXT_BOTH,
02335 }ps_draw_text_type;
02336 
02340 typedef enum _ps_text_align {
02344     TEXT_ALIGN_CENTER = 0,
02348     TEXT_ALIGN_TOP       = 1,
02352     TEXT_ALIGN_BOTTOM = 2,
02356     TEXT_ALIGN_LEFT   = 4,
02360     TEXT_ALIGN_RIGHT  = 8,
02361 }ps_text_align;
02362 
02377 PEXPORT void PICAPI ps_draw_text(ps_context* ctx, const ps_rect* area, const void* text,
02378                                 unsigned int length, ps_draw_text_type type, ps_text_align align);
02379 
02392 PEXPORT ps_bool PICAPI ps_get_glyph(ps_context* ctx, int ch, ps_glyph* glyph);
02393 
02406 PEXPORT void PICAPI ps_show_glyphs(ps_context* ctx, float x, float y,
02407                                                     ps_glyph* glyphs, unsigned int length);
02408 
02421 PEXPORT ps_bool PICAPI ps_get_path_from_glyph(ps_context* ctx,
02422                                         const ps_glyph* glyph, ps_path* path);
02423 
02437 PEXPORT ps_bool PICAPI ps_glyph_get_extent(const ps_glyph* glyph, ps_size* rsize);
02438 
02456 PEXPORT void PICAPI ps_translate(ps_context* ctx, float tx, float ty);
02457 
02468 PEXPORT void PICAPI ps_scale(ps_context* ctx, float sx, float sy);
02469 
02480 PEXPORT void PICAPI ps_shear(ps_context* ctx, float shx, float shy);
02481 
02491 PEXPORT void PICAPI ps_rotate(ps_context* ctx, float angle);
02492 
02501 PEXPORT void PICAPI ps_identity(ps_context* ctx);
02502 
02512 PEXPORT void PICAPI ps_transform(ps_context* ctx, const ps_matrix* matrix);
02513 
02523 PEXPORT void PICAPI ps_set_matrix(ps_context* ctx, const ps_matrix* matrix);
02524 
02536 PEXPORT ps_bool PICAPI ps_get_matrix(ps_context* ctx, ps_matrix* matrix);
02537 
02547 PEXPORT void PICAPI ps_world_to_viewport(ps_context* ctx, ps_point* point);
02548 
02558 PEXPORT void PICAPI ps_viewport_to_world(ps_context* ctx, ps_point* point);
02559 
02578 PEXPORT ps_matrix* PICAPI ps_matrix_create(void);
02579 
02599 PEXPORT ps_matrix* PICAPI ps_matrix_create_init(float sx, float shy, float shx,
02600                                                             float sy, float tx, float ty);
02601 
02615 PEXPORT ps_matrix* PICAPI ps_matrix_create_copy(const ps_matrix* matrix);
02616 
02630 PEXPORT ps_matrix* PICAPI ps_matrix_ref(ps_matrix* matrix);
02631 
02641 PEXPORT void PICAPI ps_matrix_unref(ps_matrix* matrix);
02642 
02658 PEXPORT void PICAPI ps_matrix_init(ps_matrix* matrix, float sx, float shy,
02659                                             float shx, float sy, float tx, float ty);
02660 
02671 PEXPORT void PICAPI ps_matrix_translate(ps_matrix* matrix, float tx, float ty);
02672 
02683 PEXPORT void PICAPI ps_matrix_scale(ps_matrix* matrix, float sx, float sy);
02684 
02694 PEXPORT void PICAPI ps_matrix_rotate(ps_matrix* matrix, float angle);
02695 
02706 PEXPORT void PICAPI ps_matrix_shear(ps_matrix* matrix, float shx, float shy);
02707 
02716 PEXPORT void PICAPI ps_matrix_invert(ps_matrix* matrix);
02717 
02726 PEXPORT void PICAPI ps_matrix_reset(ps_matrix* matrix);
02727 
02736 PEXPORT void PICAPI ps_matrix_flip_x(ps_matrix* matrix);
02737 
02746 PEXPORT void PICAPI ps_matrix_flip_y(ps_matrix* matrix);
02747 
02758 PEXPORT void PICAPI ps_matrix_multiply(ps_matrix* result, const ps_matrix* a, const ps_matrix* b);
02759 
02770 PEXPORT ps_bool PICAPI ps_matrix_is_identity(const ps_matrix* matrix);
02771 
02783 PEXPORT ps_bool PICAPI ps_matrix_is_equal(const ps_matrix* a, const ps_matrix* b);
02784 
02795 PEXPORT float PICAPI ps_matrix_get_determinant(const ps_matrix* matrix);
02796 
02807 PEXPORT void PICAPI ps_matrix_set_translate_factor(ps_matrix* matrix, float tx, float ty);
02808 
02821 PEXPORT ps_bool PICAPI ps_matrix_get_translate_factor(ps_matrix* matrix, float *tx, float *ty);
02822 
02833 PEXPORT void PICAPI ps_matrix_set_scale_factor(ps_matrix* matrix, float sx, float sy);
02834 
02847 PEXPORT ps_bool PICAPI ps_matrix_get_scale_factor(ps_matrix* matrix, float *sx, float *sy);
02848 
02859 PEXPORT void PICAPI ps_matrix_set_shear_factor(ps_matrix* matrix, float shx, float shy);
02860 
02873 PEXPORT ps_bool PICAPI ps_matrix_get_shear_factor(ps_matrix* matrix, float *shx, float *shy);
02874 
02884 PEXPORT void PICAPI ps_matrix_transform_point(const ps_matrix* matrix, ps_point* point);
02885 
02895 PEXPORT void PICAPI ps_matrix_transform_rect(const ps_matrix* matrix, ps_rect* rect);
02896 
02906 PEXPORT void PICAPI ps_matrix_transform_path(const ps_matrix* matrix, ps_path* path);
02907 
02923 PEXPORT void PICAPI ps_new_path(ps_context* ctx);
02924 
02933 PEXPORT void PICAPI ps_new_sub_path(ps_context* ctx);
02934 
02944 PEXPORT void PICAPI ps_add_sub_path(ps_context* ctx, const ps_path* path);
02945 
02955 PEXPORT void PICAPI ps_set_path(ps_context* ctx, const ps_path* path);
02956 
02968 PEXPORT ps_bool PICAPI ps_get_path(ps_context* ctx, ps_path* path);
02969 
02978 PEXPORT void PICAPI ps_close_path(ps_context* ctx);
02979 
02990 PEXPORT void PICAPI ps_move_to(ps_context* ctx, const ps_point* point);
02991 
03002 PEXPORT void PICAPI ps_line_to(ps_context* ctx, const ps_point* point);
03003 
03017 PEXPORT void PICAPI ps_bezier_curve_to(ps_context* ctx, const ps_point* fcp,
03018                                            const ps_point* scp, const ps_point* ep);
03019 
03031 PEXPORT void PICAPI ps_quad_curve_to(ps_context* ctx, const ps_point* cp, const ps_point* ep);
03032 
03048 PEXPORT void PICAPI ps_arc(ps_context* ctx, const ps_point* cp, float radius,
03049                                            float sangle, float eangle, ps_bool clockwise);
03050 
03063 PEXPORT void PICAPI ps_tangent_arc(ps_context* ctx, const ps_rect* rect, float sangle, float sweep);
03064 
03075 PEXPORT void PICAPI ps_rectangle(ps_context* ctx, const ps_rect* rect);
03076 
03096 PEXPORT void PICAPI ps_rounded_rect(ps_context* ctx, const ps_rect* rect, float ltx,
03097                       float lty, float rtx, float rty, float lbx, float lby, float rbx, float rby);
03098 
03109 PEXPORT void PICAPI ps_ellipse(ps_context* ctx, const ps_rect* rect);
03110 
03129 PEXPORT ps_path* PICAPI ps_path_create(void);
03130 
03144 PEXPORT ps_path* PICAPI ps_path_create_copy(const ps_path* path);
03145 
03159 PEXPORT ps_path* PICAPI ps_path_ref(ps_path* path);
03160 
03170 PEXPORT void PICAPI ps_path_unref(ps_path* path);
03171 
03182 PEXPORT void PICAPI ps_path_move_to(ps_path* path, const ps_point* point);
03183 
03194 PEXPORT void PICAPI ps_path_line_to(ps_path* path, const ps_point* point);
03195 
03208 PEXPORT void PICAPI ps_path_tangent_arc_to(ps_path* path, float radius,
03209                                             const ps_point* tp, const ps_point* ep);
03210 
03227 PEXPORT void PICAPI ps_path_arc_to(ps_path* path, float radiusX, float radiusY, float angle,
03228                                         ps_bool large_arc, ps_bool clockwise, const ps_point* ep);
03229 
03242 PEXPORT void PICAPI ps_path_bezier_to(ps_path* path, const ps_point* fcp,
03243                                                  const ps_point* scp, const ps_point* ep);
03244 
03256 PEXPORT void PICAPI ps_path_quad_to(ps_path* path, const ps_point* cp, const ps_point* ep);
03257 
03266 PEXPORT void PICAPI ps_path_sub_close(ps_path* path);
03267 
03281 PEXPORT float PICAPI ps_path_get_length(const ps_path* path);
03282 
03291 PEXPORT void PICAPI ps_path_clear(ps_path* path);
03292 
03301 PEXPORT ps_bool PICAPI ps_path_is_empty(const ps_path* path);
03302 
03316 PEXPORT unsigned int PICAPI ps_path_get_vertex_count(const ps_path* path);
03317 
03321 typedef enum _ps_path_cmd {
03325     PATH_CMD_STOP     = 0,
03329     PATH_CMD_MOVE_TO  = 1,
03333     PATH_CMD_LINE_TO  = 2,
03337     PATH_CMD_CURVE3   = 3,
03341     PATH_CMD_CURVE4   = 4,
03345     PATH_CMD_END_POLY = 0x0F,
03346 }ps_path_cmd;
03347 
03363 PEXPORT ps_path_cmd PICAPI ps_path_get_vertex(const ps_path* path,
03364                                                 unsigned int index, ps_point * point);
03365 
03379 PEXPORT ps_bool PICAPI ps_path_bounding_rect(const ps_path* path, ps_rect* rect);
03380 
03393 PEXPORT ps_bool PICAPI ps_path_contains(const ps_path* path,
03394                                         const ps_point* point, ps_fill_rule rule);
03395 
03408 PEXPORT ps_bool PICAPI ps_path_stroke_contains(const ps_path* path,
03409                                         const ps_point* point, float width);
03410 
03421 PEXPORT void PICAPI ps_path_add_line(ps_path* path, const ps_point* p1, const ps_point* p2);
03422 
03437 PEXPORT void PICAPI ps_path_add_arc(ps_path* path, const ps_point* cp, float radius,
03438                                             float sangle, float eangle, ps_bool clockwise);
03439 
03449 PEXPORT void PICAPI ps_path_add_rect(ps_path* path, const ps_rect* rect);
03450 
03460 PEXPORT void PICAPI ps_path_add_ellipse(ps_path* path, const ps_rect* rect);
03461 
03480 PEXPORT void PICAPI ps_path_add_rounded_rect(ps_path* path, const ps_rect* rect, float ltx,
03481                       float lty, float rtx, float rty, float lbx, float lby, float rbx, float rby);
03482 
03492 PEXPORT void PICAPI ps_path_add_sub_path(ps_path* path, const ps_path* spath);
03493 
03497 typedef enum _ps_path_op {
03501     PATH_OP_UNION,
03505     PATH_OP_INTERSECT,
03509     PATH_OP_XOR,
03513     PATH_OP_DIFF,
03514 }ps_path_operation;
03515 
03528 PEXPORT void PICAPI ps_path_clipping(ps_path* result, ps_path_operation op,
03529                                                 const ps_path* a, const ps_path* b);
03530 
03534 #ifdef __cplusplus
03535 }
03536 #endif /* __cplusplus */
03537 
03538 #endif /*_PICASSO_H_*/