Displaying 11 results from an estimated 11 matches for "swfdec_matrix_ensure_invertible".
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 Jul 11
0
Branch 'as' - 4 commits - libswfdec/swfdec_color.c libswfdec/swfdec_movie_asprops.c libswfdec/swfdec_movie.c test/trace
...Benjamin Otte <otte at gnome.org>
Date: Wed Jul 11 15:30:36 2007 +0200
assert a valid matrix when inverting
diff --git a/libswfdec/swfdec_color.c b/libswfdec/swfdec_color.c
index 83be167..e609e53 100644
--- a/libswfdec/swfdec_color.c
+++ b/libswfdec/swfdec_color.c
@@ -196,6 +196,7 @@ swfdec_matrix_ensure_invertible (cairo_m
if (inverse == NULL)
inverse = &tmp;
+ g_assert (isfinite (matrix->xx) && isfinite (matrix->yx) && isfinite (matrix->xy) && isfinite (matrix->yy));
*inverse = *matrix;
while (cairo_matrix_invert (inverse)) {
SWFDEC_INFO ("...
2007 Jul 11
0
libswfdec/swfdec_movie.c
...gt;content->transform);
- cairo_matrix_rotate (&movie->matrix, d * G_PI / 180);
+ if (finite (movie->rotation)) {
+ d = movie->rotation - swfdec_matrix_get_rotation (&movie->content->transform);
+ cairo_matrix_rotate (&movie->matrix, d * G_PI / 180);
+ }
swfdec_matrix_ensure_invertible (&movie->matrix, &movie->inverse_matrix);
swfdec_movie_update_extents (movie);
2007 Jul 11
0
Branch 'as' - 3 commits - libswfdec/swfdec_bits.c
...gt;content->transform);
- cairo_matrix_rotate (&movie->matrix, d * G_PI / 180);
+ if (finite (movie->rotation)) {
+ d = movie->rotation - swfdec_matrix_get_rotation (&movie->content->transform);
+ cairo_matrix_rotate (&movie->matrix, d * G_PI / 180);
+ }
swfdec_matrix_ensure_invertible (&movie->matrix, &movie->inverse_matrix);
swfdec_movie_update_extents (movie);
2007 Mar 28
0
3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_sprite.c libswfdec/swfdec_tag.c
...ranslate_bits;
- swfdec_bits_syncbits (bits);
-
has_scale = swfdec_bits_getbit (bits);
if (has_scale) {
int n_scale_bits = swfdec_bits_getbits (bits, 5);
@@ -440,6 +436,7 @@ swfdec_bits_get_matrix (SwfdecBits * bit
matrix->y0 = swfdec_bits_getsbits (bits, n_translate_bits);
swfdec_matrix_ensure_invertible (matrix, inverse);
+ swfdec_bits_syncbits (bits);
}
char *
@@ -488,7 +485,7 @@ swfdec_bits_skip_string (SwfdecBits *bit
guint
swfdec_bits_skip_bytes (SwfdecBits *bits, guint n_bytes)
{
- swfdec_bits_syncbits (bits);
+ g_assert (bits->idx == 0);
if ((guint) (bits->end - bits->p...
2007 Mar 22
0
11 commits - libswfdec/swfdec_color.c libswfdec/swfdec_flv_decoder.c libswfdec/swfdec_js_net_stream.c libswfdec/swfdec_movie.c libswfdec/swfdec_net_stream.c libswfdec/swfdec_net_stream.h libswfdec/swfdec_pattern.c libswfdec/swfdec_script.c NEWS test/trace
...6:08:29 2007 +0100
non-invertible matrix is only INFO
It's normal when someone set width or height to 0
diff --git a/libswfdec/swfdec_color.c b/libswfdec/swfdec_color.c
index c4fa52e..a3e3077 100644
--- a/libswfdec/swfdec_color.c
+++ b/libswfdec/swfdec_color.c
@@ -198,7 +198,7 @@ swfdec_matrix_ensure_invertible (cairo_m
*inverse = *matrix;
while (cairo_matrix_invert (inverse)) {
- SWFDEC_WARNING ("matrix not invertible, adding epsilon to smallest member");
+ SWFDEC_INFO ("matrix not invertible, adding epsilon to smallest member");
/* add epsilon at point closest to...
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
...const SwfdecColorTransform *last, const SwfdecColorTransform *first);
unsigned int swfdec_color_apply_transform (unsigned int in,
const SwfdecColorTransform * trans);
+SwfdecColor swfdec_color_apply_transform_premultiplied (SwfdecColor in,
+ const SwfdecColorTransform * trans);
void swfdec_matrix_ensure_invertible (cairo_matrix_t *matrix, cairo_matrix_t *inverse);
double swfdec_matrix_get_xscale (const cairo_matrix_t *matrix);
diff-tree 4f17e493901cc45e47302c4fc74e1f685a32755e (from 469f29442894cdea2116ac801501057266f28727)
Author: Benjamin Otte <otte@gnome.org>
Date: Tue Feb 6 09:50:11 2007 +0100...
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
...inv_ratio + end->x0 * ratio) / 65535;
+ dest->y0 = (start->y0 * inv_ratio + end->y0 * ratio) / 65535;
+}
+
diff --git a/libswfdec/swfdec_color.h b/libswfdec/swfdec_color.h
index 296311b..e43458f 100644
--- a/libswfdec/swfdec_color.h
+++ b/libswfdec/swfdec_color.h
@@ -80,5 +80,8 @@ void swfdec_matrix_ensure_invertible (ca
double swfdec_matrix_get_xscale (const cairo_matrix_t *matrix);
double swfdec_matrix_get_yscale (const cairo_matrix_t *matrix);
double swfdec_matrix_get_rotation (const cairo_matrix_t *matrix);
+void swfdec_matrix_morph (cairo_matrix_t *dest, const cairo_matrix_t *start,
+ const cairo_mat...
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
...const SwfdecColorTransform *last, const SwfdecColorTransform *first);
unsigned int swfdec_color_apply_transform (unsigned int in,
const SwfdecColorTransform * trans);
+SwfdecColor swfdec_color_apply_transform_premultiplied (SwfdecColor in,
+ const SwfdecColorTransform * trans);
void swfdec_matrix_ensure_invertible (cairo_matrix_t *matrix, cairo_matrix_t *inverse);
double swfdec_matrix_get_xscale (const cairo_matrix_t *matrix);
diff-tree 4f17e493901cc45e47302c4fc74e1f685a32755e (from 469f29442894cdea2116ac801501057266f28727)
Author: Benjamin Otte <otte@gnome.org>
Date: Tue Feb 6 09:50:11 2007 +0100...
2007 Jun 13
0
Branch 'as' - 6 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_morph_movie.c libswfdec/swfdec_movie_asprops.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_player.c libswfdec/swfdec_sprite.c
...o_matrix_scale (&movie->matrix, d, e);
- d = movie->rotation - swfdec_matrix_get_rotation (&movie->content->transform);
+ d = movie->rotation - swfdec_matrix_get_rotation (&movie->original_transform);
cairo_matrix_rotate (&movie->matrix, d * G_PI / 180);
swfdec_matrix_ensure_invertible (&movie->matrix, &movie->inverse_matrix);
@@ -207,51 +206,6 @@ swfdec_movie_update (SwfdecMovie *movie)
}
}
-/**
- * swfdec_movie_set_content:
- * @movie: a #SwfdecMovie
- * @content: #SwfdecContent to set for this movie or NULL to unset
- *
- * Sets new contents for @movie. N...
2007 Nov 28
0
59 commits - libswfdec-gtk/swfdec_gtk_widget.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_button.c libswfdec/swfdec_button.h libswfdec/swfdec_button_movie.c libswfdec/swfdec_button_movie.h libswfdec/swfdec_event.c
...(1 << SWFDEC_BUTTON_HIT)) == 0)
+ continue;
+
+ swfdec_bits_get_u16 (&bits); /* depth */
+ id = swfdec_bits_get_u16 (&bits);
+ graphic = swfdec_swf_decoder_get_character (dec, id);
+ if (!SWFDEC_IS_GRAPHIC (graphic))
continue;
tmpx = x;
tmpy = y;
- swfdec_matrix_ensure_invertible (&content->transform, &inverse);
+ swfdec_bits_get_matrix (&bits, &matrix, &inverse);
cairo_matrix_transform_point (&inverse, &tmpx, &tmpy);
SWFDEC_LOG ("Checking button contents at %g %g (transformed from %g %g)", tmpx, tmpy, x, y);
-...