Displaying 20 results from an estimated 20 matches for "swfdec_color_apply_transform".
2010 Jan 17
1
screenshot of swf file
Hi,
Im trying to thumbnail a swf file based on this found at
http://www.mail-archive.com/swfdec at lists.freedesktop.org/msg00821.html.
#include <stdlib.h>
#include <stdio.h>
#include <swfdec/swfdec.h>
#include <cairo.h>
void swfdec_player_save (SwfdecPlayer *player, guint width, guint
height, const char *filename) {
cairo_surface_t *surface;
cairo_t *cr;
2007 Oct 17
0
libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h libswfdec/swfdec_text_field_movie.c
...;&
- !swfdec_color_transform_is_identity (trans))
- {
- SwfdecColor color;
- PangoColor pcolor;
-
- pcolor = ((PangoAttrColor *)attr)->color;
- color = SWFDEC_COLOR_COMBINE (pcolor.red >> 8, pcolor.green >> 8,
- pcolor.blue >> 8, 255);
- color = swfdec_color_apply_transform (color, trans);
- pcolor.red = SWFDEC_COLOR_R (color) << 8;
- pcolor.green = SWFDEC_COLOR_G (color) << 8;
- pcolor.blue = SWFDEC_COLOR_B (color) << 8;
- ((PangoAttrColor *)attr)->color = pcolor;
- }
- attr->start_index = (attr->start_index > block-&...
2007 Oct 27
1
libswfdec/swfdec_text_field_movie.c
libswfdec/swfdec_text_field_movie.c | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit 27e0f570ff653063b78efc89a604236e7fe03ece
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Sat Oct 27 17:14:06 2007 +0300
Init TextField's native properties when TextField is created from a tag
diff --git a/libswfdec/swfdec_text_field_movie.c
2007 Nov 01
0
2 commits - libswfdec/swfdec_text_field_movie.c test/image
...-- a/libswfdec/swfdec_text_field_movie.c
+++ b/libswfdec/swfdec_text_field_movie.c
@@ -593,7 +593,8 @@ swfdec_text_field_movie_render (SwfdecMovie *movie, cairo_t *cr,
if (text->background) {
cairo_rectangle (cr, limit.x0, limit.y0, limit.x1 - limit.x0, limit.y1 - limit.y0);
color = swfdec_color_apply_transform (text_movie->background_color, trans);
- swfdec_color_set_source (cr, color);
+ // always use full alpha
+ swfdec_color_set_source (cr, (color & 0xffffff) + (255 << 24));
cairo_fill (cr);
}
@@ -604,7 +605,8 @@ swfdec_text_field_movie_render (SwfdecMovie *movie, cairo...
2007 Feb 06
0
21 commits - configure.ac libswfdec/swfdec_audio_event.c libswfdec/swfdec_bits.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_compiler.c libswfdec/swfdec_edittext.c libswfdec/swfdec_image.c
...N!
sheesh
diff --git a/libswfdec/swfdec_image.c b/libswfdec/swfdec_image.c
index 4463228..fc0b1f1 100644
--- a/libswfdec/swfdec_image.c
+++ b/libswfdec/swfdec_image.c
@@ -657,7 +657,7 @@ swfdec_image_create_surface_transformed
for (i = 0; i < n; i++) {
((guint32 *) tdata)[i] = swfdec_color_apply_transform_premultiplied (((guint32 *) sdata)[i], trans);
/* optimization: check for alpha channel to speed up compositing */
- has_alpha != tdata[4 * i + SWFDEC_COLOR_INDEX_ALPHA] != 0xFF;
+ has_alpha = tdata[4 * i + SWFDEC_COLOR_INDEX_ALPHA] != 0xFF;
}
surface = cairo_image_surface_create_f...
2007 Nov 01
0
5 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_object.c libswfdec/swfdec_text_field_movie.c test/image
...19 +591,23 @@ swfdec_text_field_movie_render (SwfdecMovie *movie, cairo_t *cr,
cairo_clip (cr);
if (text->background) {
- cairo_rectangle (cr, limit.x0, limit.y0, limit.x1, limit.y1);
+ cairo_rectangle (cr, limit.x0, limit.y0, limit.x1 - limit.x0, limit.y1 - limit.y0);
color = swfdec_color_apply_transform (text_movie->background_color, trans);
swfdec_color_set_source (cr, color);
cairo_fill (cr);
}
if (text->border) {
- cairo_rectangle (cr, movie->original_extents.x0,
- movie->original_extents.y0, movie->original_extents.x1,
- movie->original_extents.y1);
+...
2007 Oct 14
1
libswfdec/swfdec_text_field.c
libswfdec/swfdec_text_field.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
New commits:
commit 13a1f11d9aebddc8d2e24c94878547589c485832
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Sun Oct 14 18:22:17 2007 +0300
Implement aligning TextField lines even when wordWrap is off
diff --git a/libswfdec/swfdec_text_field.c
2007 Feb 06
0
Branch 'interpreter' - 15 commits - configure.ac libswfdec/swfdec_audio_event.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_compiler.c libswfdec/swfdec_image.c libswfdec/swfdec_sprite_movie.c
...N!
sheesh
diff --git a/libswfdec/swfdec_image.c b/libswfdec/swfdec_image.c
index 4463228..fc0b1f1 100644
--- a/libswfdec/swfdec_image.c
+++ b/libswfdec/swfdec_image.c
@@ -657,7 +657,7 @@ swfdec_image_create_surface_transformed
for (i = 0; i < n; i++) {
((guint32 *) tdata)[i] = swfdec_color_apply_transform_premultiplied (((guint32 *) sdata)[i], trans);
/* optimization: check for alpha channel to speed up compositing */
- has_alpha != tdata[4 * i + SWFDEC_COLOR_INDEX_ALPHA] != 0xFF;
+ has_alpha = tdata[4 * i + SWFDEC_COLOR_INDEX_ALPHA] != 0xFF;
}
surface = cairo_image_surface_create_f...
2007 Jan 26
0
libswfdec/swfdec_image.c libswfdec/swfdec_image.h libswfdec/swfdec_pattern.c
...attern_paint (SwfdecPatter
cairo_matrix_t mat;
cairo_surface_t *surface;
- surface = swfdec_image_get_surface (image->image);
+ surface = swfdec_image_get_surface_for_target (image->image,
+ cairo_get_target (cr));
cairo_append_path (cr, (cairo_path_t *) path);
color = swfdec_color_apply_transform (0xFFFFFFFF, trans);
pattern = cairo_pattern_create_for_surface (surface);
2007 Feb 06
0
Branch 'interpreter' - 8 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_edittext.c libswfdec/swfdec_image.c libswfdec/swfdec_image.h libswfdec/swfdec_pattern.c libswfdec/swfdec_sprite.c test/dump.c
...rm_init_color (SwfdecColorTransform *trans, SwfdecColor color);
+gboolean swfdec_color_transform_is_identity (const SwfdecColorTransform * trans);
void swfdec_color_transform_chain (SwfdecColorTransform *dest,
const SwfdecColorTransform *last, const SwfdecColorTransform *first);
unsigned int swfdec_color_apply_transform (unsigned int in,
diff-tree 180879c4af107625b53f37ba8bcc990eb20baf8b (from fa335acfbd3526f57dfb66c68e59334a79d90901)
Author: Benjamin Otte <otte@gnome.org>
Date: Sun Feb 4 14:33:59 2007 +0100
rework images to be correctly color transformed
- use new SWFDEC_COLOR_INDEX variable...
2007 Dec 03
0
12 commits - libswfdec/Makefile.am libswfdec/swfdec_as_strings.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h libswfdec/swfdec_gradient_pattern.c libswfdec/swfdec_gradient_pattern.h libswfdec/swfdec_movie_as_drawing.c libswfdec/swfdec_pattern.c
..._set_extend (pattern, gradient->extend);
+ /* we check here that ratios increase linearly, because both gradients parsed
+ * from the SWF and gradients created with beginGradientFill have this
+ * behavior */
+ ratio = 0;
for (i = 0; i < gradient->n_gradients; i++){
color = swfdec_color_apply_transform (gradient->gradient[i].color,
trans);
- offset = gradient->gradient[i].ratio / 255.0;
+ ratio = MAX (ratio, gradient->gradient[i].ratio);
+ offset = ratio / 255.0;
cairo_pattern_add_color_stop_rgba (pattern, offset,
SWFDEC_COLOR_R(color) / 255.0, SWFDEC_COLOR_G(color) / 2...
2007 Apr 13
0
5 commits - libswfdec/Makefile.am libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_font.c libswfdec/swfdec_loadertarget.c libswfdec/swfdec_movie.h libswfdec/swfdec_pattern.c libswfdec/swfdec_pattern.h libswfdec/swfdec_player.c
...ecColorTransform *trans, guint ratio)
-{
- SwfdecColor color;
- double width;
- SwfdecStrokePattern *stroke = SWFDEC_STROKE_PATTERN (pattern);
-
- swfdec_pattern_append_path_snapped (cr, path);
- color = swfdec_color_apply_morph (stroke->start_color, stroke->end_color, ratio);
- color = swfdec_color_apply_transform (color, trans);
- swfdec_color_set_source (cr, color);
- if (ratio == 0) {
- width = stroke->start_width;
- } else if (ratio == 65535) {
- width = stroke->end_width;
- } else {
- width = (stroke->start_width * (65535 - ratio) + stroke->end_width * ratio) / 65535;
- }
- if...
2007 Apr 16
0
7 commits - libswfdec/swfdec_codec_gst.c libswfdec/swfdec_font.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_morph_movie.c libswfdec/swfdec_pattern.c libswfdec/swfdec_pattern.h libswfdec/swfdec_shape.c libswfdec/swfdec_shape.h libswfdec/swfdec_sprite.c
...iro_set_line_join (cr, stroke->join);
+ if (stroke->join == CAIRO_LINE_JOIN_MITER)
+ cairo_set_miter_limit (cr, stroke->miter_limit);
+
swfdec_stroke_append_path_snapped (cr, path);
color = swfdec_color_apply_morph (stroke->start_color, stroke->end_color, ratio);
color = swfdec_color_apply_transform (color, trans);
@@ -124,6 +135,9 @@ swfdec_stroke_class_init (SwfdecStrokeCl
static void
swfdec_stroke_init (SwfdecStroke *stroke)
{
+ stroke->start_cap = CAIRO_LINE_CAP_ROUND;
+ stroke->end_cap = CAIRO_LINE_CAP_ROUND;
+ stroke->join = CAIRO_LINE_JOIN_ROUND;
}
/*** EXPORTED API *...
2007 Oct 23
0
9 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_html_parser.c libswfdec/swfdec_style_sheet.c libswfdec/swfdec_style_sheet.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_text_field_movie.h
...t_field_movie.c b/libswfdec/swfdec_text_field_movie.c
index c071666..b56466d 100644
--- a/libswfdec/swfdec_text_field_movie.c
+++ b/libswfdec/swfdec_text_field_movie.c
@@ -611,7 +611,7 @@ swfdec_text_field_movie_render (SwfdecMovie *movie, cairo_t *cr,
movie->original_extents.y1);
color = swfdec_color_apply_transform (text_movie->border_color, trans);
swfdec_color_set_source (cr, color);
- cairo_set_line_width (cr, 20.0); // FIXME: Is this correct?
+ cairo_set_line_width (cr, SWFDEC_DOUBLE_TO_TWIPS (1));
cairo_stroke (cr);
}
commit c7c15478f857113ff9dcf28a5f976f4583d4ec40
Author: Pekka L...
2007 Oct 14
0
10 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c
...al);
+
if (text->background) {
- cairo_rectangle (cr, SWFDEC_GRAPHIC (text)->extents.x0,
- SWFDEC_GRAPHIC (text)->extents.y0, SWFDEC_GRAPHIC (text)->extents.x1,
- SWFDEC_GRAPHIC (text)->extents.y1);
+ cairo_rectangle (cr, limit.x0, limit.y0, limit.x1, limit.y1);
color = swfdec_color_apply_transform (background_color, trans);
swfdec_color_set_source (cr, color);
cairo_fill (cr);
@@ -284,20 +285,17 @@ swfdec_text_field_render (SwfdecTextField *text, cairo_t *cr,
inval);
y = SWFDEC_GRAPHIC (text)->extents.y0 + 1;
- y_min = MAX (SWFDEC_GRAPHIC (text)->extents.y0, inva...
2007 Jan 29
0
Branch 'interpreter' - 18 commits - libswfdec/swfdec_image.c libswfdec/swfdec_image.h libswfdec/swfdec_js.c libswfdec/swfdec_js_color.c libswfdec/swfdec_js_sound.c libswfdec/swfdec_pattern.c libswfdec/swfdec_scriptable.c libswfdec/swfdec_script.c
...attern_paint (SwfdecPatter
cairo_matrix_t mat;
cairo_surface_t *surface;
- surface = swfdec_image_get_surface (image->image);
+ surface = swfdec_image_get_surface_for_target (image->image,
+ cairo_get_target (cr));
cairo_append_path (cr, (cairo_path_t *) path);
color = swfdec_color_apply_transform (0xFFFFFFFF, trans);
pattern = cairo_pattern_create_for_surface (surface);
2007 Nov 07
0
14 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_net_stream.c libswfdec/swfdec_script.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_text_field_movie.c
...et_attributes (layout->layout));
+ attr = pango_attr_iterator_get (attr_iter, PANGO_ATTR_FOREGROUND);
+ color_p = ((PangoAttrColor *)attr)->color;
+ color = SWFDEC_COLOR_COMBINE (color_p.red >> 8, color_p.green >> 8,
+ color_p.blue >> 8, 255);
+ color = swfdec_color_apply_transform (color, trans);
+ pango_attr_iterator_destroy (attr_iter);
+
+ swfdec_color_set_source (cr, color);
+
+ cairo_arc (cr, x + layout->offset_x +
+ pango_layout_get_indent (layout->layout) -
+ SWFDEC_DOUBLE_TO_TWIPS (BULLET_MARGIN) / 2,
+ y + rect.height / 2, rect.height / 8,...
2007 Oct 29
0
20 commits - libswfdec/Makefile.am libswfdec/swfdec_as_interpret.c libswfdec/swfdec_html_parser.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h
...!swfdec_color_transform_is_identity (trans))
+ {
+ SwfdecColor color;
+ PangoColor color_p;
+
+ color_p = ((PangoAttrColor *)attr)->color;
+
+ color = SWFDEC_COLOR_COMBINE (color_p.red >> 8, color_p.green >> 8,
+ color_p.blue >> 8, 255);
+ color = swfdec_color_apply_transform (color, trans);
+
+ color_p.red = SWFDEC_COLOR_R (color) << 8;
+ color_p.green = SWFDEC_COLOR_G (color) << 8;
+ color_p.blue = SWFDEC_COLOR_B (color) << 8;
+ }
+
+ attr->start_index =
+ (attr->start_index > index_ ? attr->start_index - index_...
2007 Feb 06
0
109 commits - configure.ac libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_buffer.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_codec_screen.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h
...hor: Benjamin Otte <otte@gnome.org>
Date: Tue Feb 6 14:59:28 2007 +0100
s/unsigned int/SwfdecColor/ for colors
diff --git a/libswfdec/swfdec_color.c b/libswfdec/swfdec_color.c
index ee3a63f..c4fa52e 100644
--- a/libswfdec/swfdec_color.c
+++ b/libswfdec/swfdec_color.c
@@ -82,8 +82,8 @@ swfdec_color_apply_transform_premultipli
return SWFDEC_COLOR_COMBINE (r, g, b, a);
}
-unsigned int
-swfdec_color_apply_transform (unsigned int in, const SwfdecColorTransform * trans)
+SwfdecColor
+swfdec_color_apply_transform (SwfdecColor in, const SwfdecColorTransform * trans)
{
int r, g, b, a;
diff --git a/libswf...
2007 Nov 20
0
19 commits - libswfdec/swfdec_audio_event.c libswfdec/swfdec_bits.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_flv_decoder.c libswfdec/swfdec_image.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h
...gboolean swfdec_color_transform_is_identity (const SwfdecColorTransform * trans);
+#define swfdec_color_transform_is_mask(trans) ((trans)->mask)
void swfdec_color_transform_chain (SwfdecColorTransform *dest,
const SwfdecColorTransform *last, const SwfdecColorTransform *first);
SwfdecColor swfdec_color_apply_transform (SwfdecColor in,
commit 0b79574535714b4c1db69dbd01e92de6c2322163
Author: Benjamin Otte <otte at gnome.org>
Date: Tue Nov 20 10:03:08 2007 +0100
rework mask handling to actually work
diff --git a/libswfdec/swfdec_movie.c b/libswfdec/swfdec_movie.c
index c0e886a..2325138 100644
--- a/li...