Lines Matching refs:image

37 gradient_property_changed (pixman_image_t *image)
39 gradient_t *gradient = &image->gradient;
110 _pixman_image_init (pixman_image_t *image)
112 image_common_t *common = &image->common;
135 _pixman_image_fini (pixman_image_t *image)
137 image_common_t *common = (image_common_t *)image;
143 if (image->common.destroy_func)
144 image->common.destroy_func (image, image->common.destroy_data);
154 if (image->type == LINEAR ||
155 image->type == RADIAL ||
156 image->type == CONICAL)
158 if (image->gradient.stops)
161 free (image->gradient.stops - 1);
169 image->common.property_changed == gradient_property_changed);
172 if (image->type == BITS && image->bits.free_me)
173 free (image->bits.free_me);
184 pixman_image_t *image = malloc (sizeof (pixman_image_t));
186 if (image)
187 _pixman_image_init (image);
189 return image;
193 image_property_changed (pixman_image_t *image)
195 image->common.dirty = TRUE;
200 pixman_image_ref (pixman_image_t *image)
202 image->common.ref_count++;
204 return image;
207 /* returns TRUE when the image is freed */
209 pixman_image_unref (pixman_image_t *image)
211 if (_pixman_image_fini (image))
213 free (image);
221 pixman_image_set_destroy_function (pixman_image_t * image,
225 image->common.destroy_func = func;
226 image->common.destroy_data = data;
230 pixman_image_get_destroy_data (pixman_image_t *image)
232 return image->common.destroy_data;
236 _pixman_image_reset_clip_region (pixman_image_t *image)
238 image->common.have_clip_region = FALSE;
246 * window as the source. It would create a pixman image pointing
251 * against the image bounds when a clip region was set, this would
265 compute_image_info (pixman_image_t *image)
271 if (!image->common.transform)
282 if (image->common.transform->matrix[2][0] == 0 &&
283 image->common.transform->matrix[2][1] == 0 &&
284 image->common.transform->matrix[2][2] == pixman_fixed_1)
288 if (image->common.transform->matrix[0][1] == 0 &&
289 image->common.transform->matrix[1][0] == 0)
291 if (image->common.transform->matrix[0][0] == -pixman_fixed_1 &&
292 image->common.transform->matrix[1][1] == -pixman_fixed_1)
298 else if (image->common.transform->matrix[0][0] == 0 &&
299 image->common.transform->matrix[1][1] == 0)
301 pixman_fixed_t m01 = image->common.transform->matrix[0][1];
302 pixman_fixed_t m10 = image->common.transform->matrix[1][0];
311 if (image->common.transform->matrix[0][0] > 0)
314 if (image->common.transform->matrix[1][0] == 0)
319 switch (image->common.filter)
341 !pixman_fixed_frac (image->common.transform->matrix[0][2] |
342 image->common.transform->matrix[1][2])) &&
349 (image->common.transform->matrix[0][0] == pixman_fixed_1 &&
350 image->common.transform->matrix[1][1] == pixman_fixed_1 &&
351 image->common.transform->matrix[0][1] == 0 &&
352 image->common.transform->matrix[1][0] == 0)
363 if (image->common.transform->matrix[0][2] <= magic_limit &&
364 image->common.transform->matrix[1][2] <= magic_limit &&
365 image->common.transform->matrix[0][2] >= -magic_limit &&
366 image->common.transform->matrix[1][2] >= -magic_limit)
386 switch (image->common.repeat)
418 if (image->common.component_alpha)
426 switch (image->type)
431 if (image->solid.color.alpha == 0xffff)
436 if (image->bits.width == 1 &&
437 image->bits.height == 1 &&
438 image->common.repeat != PIXMAN_REPEAT_NONE)
444 code = image->bits.format;
448 if (!PIXMAN_FORMAT_A (image->bits.format) &&
449 PIXMAN_FORMAT_TYPE (image->bits.format) != PIXMAN_TYPE_GRAY &&
450 PIXMAN_FORMAT_TYPE (image->bits.format) != PIXMAN_TYPE_COLOR)
454 if (image->common.repeat != PIXMAN_REPEAT_NONE)
458 if (image->bits.read_func || image->bits.write_func)
461 if (PIXMAN_FORMAT_IS_WIDE (image->bits.format))
475 if (image->radial.a >= 0)
484 if (image->common.repeat != PIXMAN_REPEAT_NONE)
489 for (i = 0; i < image->gradient.n_stops; ++i)
491 if (image->gradient.stops[i].color.alpha != 0xffff)
506 if (!image->common.alpha_map)
512 if (PIXMAN_FORMAT_IS_WIDE (image->common.alpha_map->format))
518 * an image with component alpha turned on is only opaque
522 if (image->common.alpha_map ||
523 image->common.filter == PIXMAN_FILTER_CONVOLUTION ||
524 image->common.filter == PIXMAN_FILTER_SEPARABLE_CONVOLUTION ||
525 image->common.component_alpha)
530 image->common.flags = flags;
531 image->common.extended_format_code = code;
535 _pixman_image_validate (pixman_image_t *image)
537 if (image->common.dirty)
539 compute_image_info (image);
546 if (image->common.property_changed)
547 image->common.property_changed (image);
549 image->common.dirty = FALSE;
552 if (image->common.alpha_map)
553 _pixman_image_validate ((pixman_image_t *)image->common.alpha_map);
557 pixman_image_set_clip_region32 (pixman_image_t * image,
560 image_common_t *common = (image_common_t *)image;
566 image->common.have_clip_region = TRUE;
570 _pixman_image_reset_clip_region (image);
575 image_property_changed (image);
581 pixman_image_set_clip_region (pixman_image_t * image,
584 image_common_t *common = (image_common_t *)image;
590 image->common.have_clip_region = TRUE;
594 _pixman_image_reset_clip_region (image);
599 image_property_changed (image);
605 pixman_image_set_has_client_clip (pixman_image_t *image,
608 image->common.client_clip = client_clip;
612 pixman_image_set_transform (pixman_image_t * image,
622 image_common_t *common = (image_common_t *)image;
658 image_property_changed (image);
664 pixman_image_set_repeat (pixman_image_t *image,
667 if (image->common.repeat == repeat)
670 image->common.repeat = repeat;
672 image_property_changed (image);
676 pixman_image_set_filter (pixman_image_t * image,
681 image_common_t *common = (image_common_t *)image;
719 image_property_changed (image);
724 pixman_image_set_source_clipping (pixman_image_t *image,
727 if (image->common.clip_sources == clip_sources)
730 image->common.clip_sources = clip_sources;
732 image_property_changed (image);
740 pixman_image_set_indexed (pixman_image_t * image,
743 bits_image_t *bits = (bits_image_t *)image;
750 image_property_changed (image);
754 pixman_image_set_alpha_map (pixman_image_t *image,
759 image_common_t *common = (image_common_t *)image;
765 /* If this image is being used as an alpha map itself,
773 /* If the image has an alpha map of its own,
803 image_property_changed (image);
807 pixman_image_set_component_alpha (pixman_image_t *image,
810 if (image->common.component_alpha == component_alpha)
813 image->common.component_alpha = component_alpha;
815 image_property_changed (image);
819 pixman_image_get_component_alpha (pixman_image_t *image)
821 return image->common.component_alpha;
825 pixman_image_set_accessors (pixman_image_t * image,
829 return_if_fail (image != NULL);
831 if (image->type == BITS)
833 image->bits.read_func = read_func;
834 image->bits.write_func = write_func;
836 image_property_changed (image);
841 pixman_image_get_data (pixman_image_t *image)
843 if (image->type == BITS)
844 return image->bits.bits;
850 pixman_image_get_width (pixman_image_t *image)
852 if (image->type == BITS)
853 return image->bits.width;
859 pixman_image_get_height (pixman_image_t *image)
861 if (image->type == BITS)
862 return image->bits.height;
868 pixman_image_get_stride (pixman_image_t *image)
870 if (image->type == BITS)
871 return image->bits.rowstride * (int) sizeof (uint32_t);
877 pixman_image_get_depth (pixman_image_t *image)
879 if (image->type == BITS)
880 return PIXMAN_FORMAT_DEPTH (image->bits.format);
886 pixman_image_get_format (pixman_image_t *image)
888 if (image->type == BITS)
889 return image->bits.format;
896 pixman_image_t * image,
901 if (image->type == SOLID)
903 result = image->solid.color_32;
905 else if (image->type == BITS)
907 if (image->bits.format == PIXMAN_a8r8g8b8)
908 result = image->bits.bits[0];
909 else if (image->bits.format == PIXMAN_x8r8g8b8)
910 result = image->bits.bits[0] | 0xff000000;
911 else if (image->bits.format == PIXMAN_a8)
912 result = (*(uint8_t *)image->bits.bits) << 24;
922 imp, &iter, image, 0, 0, 1, 1,
924 ITER_NARROW, image->common.flags);