SourceForge logo
SourceForge logo
Menu

matplotlib-checkins — Commit notification. DO NOT POST to this list, just subscribe to it.

You can subscribe to this list here.

2007 Jan
Feb
Mar
Apr
May
Jun
Jul
(115)
Aug
(120)
Sep
(137)
Oct
(170)
Nov
(461)
Dec
(263)
2008 Jan
(120)
Feb
(74)
Mar
(35)
Apr
(74)
May
(245)
Jun
(356)
Jul
(240)
Aug
(115)
Sep
(78)
Oct
(225)
Nov
(98)
Dec
(271)
2009 Jan
(132)
Feb
(84)
Mar
(74)
Apr
(56)
May
(90)
Jun
(79)
Jul
(83)
Aug
(296)
Sep
(214)
Oct
(76)
Nov
(82)
Dec
(66)
2010 Jan
(46)
Feb
(58)
Mar
(51)
Apr
(77)
May
(58)
Jun
(126)
Jul
(128)
Aug
(64)
Sep
(50)
Oct
(44)
Nov
(48)
Dec
(54)
2011 Jan
(68)
Feb
(52)
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
(1)
2018 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S


1
(10)
2
(6)
3
4
(10)
5
(5)
6
(5)
7
(6)
8
(2)
9
(5)
10
(7)
11
(5)
12
(8)
13
(5)
14
(7)
15
(3)
16
(1)
17
(1)
18
19
(1)
20
(6)
21
(6)
22
(3)
23
(3)
24
(7)
25
26
(5)
27
(1)
28
(3)
29
(2)
30
(3)



Showing 1 results of 1

From: <md...@us...> - 2010年06月16日 17:08:52
Revision: 8439
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8439&view=rev
Author: mdboom
Date: 2010年06月16日 17:08:43 +0000 (2010年6月16日)
Log Message:
-----------
Fix accessing uninitialized memory error.
Modified Paths:
--------------
 trunk/matplotlib/src/_image.cpp
Modified: trunk/matplotlib/src/_image.cpp
===================================================================
--- trunk/matplotlib/src/_image.cpp	2010年06月15日 19:32:24 UTC (rev 8438)
+++ trunk/matplotlib/src/_image.cpp	2010年06月16日 17:08:43 UTC (rev 8439)
@@ -44,7 +44,7 @@
 Image::Image() :
 bufferIn(NULL), rbufIn(NULL), colsIn(0), rowsIn(0),
 bufferOut(NULL), rbufOut(NULL), colsOut(0), rowsOut(0), BPP(4),
- interpolation(BILINEAR), aspect(ASPECT_FREE), bg(1,1,1,0) {
+ interpolation(BILINEAR), aspect(ASPECT_FREE), bg(1,1,1,0), resample(true) {
 _VERBOSE("Image::Image");
 }
 
@@ -196,7 +196,7 @@
 std::pair<agg::int8u*,bool> bufpair = _get_output_buffer();
 
 Py::Object ret = Py::asObject(Py_BuildValue("lls#", rowsOut, colsOut,
-					 bufpair.first, colsOut*rowsOut*4));
+ bufpair.first, colsOut*rowsOut*4));
 
 if (bufpair.second) delete [] bufpair.first;
 return ret;
@@ -229,7 +229,7 @@
 
 agg::rendering_buffer rtmp;
 rtmp.attach(reinterpret_cast<unsigned char*>(buf), colsOut, rowsOut,
-	 row_len);
+ row_len);
 
 switch (format) {
 case 0:
@@ -259,7 +259,7 @@
 args.verify_length(0);
 int row_len = colsOut * 4;
 PyObject* o = Py_BuildValue("lls#", rowsOut, colsOut,
-			 rbufOut, row_len * rowsOut);
+ rbufOut, row_len * rowsOut);
 return Py::asObject(o);
 }
 
@@ -362,9 +362,9 @@
 typedef agg::span_allocator<agg::rgba8> span_alloc_type;
 span_alloc_type sa;
 agg::rgba8 background(agg::rgba8(int(255*bg.r),
-				 int(255*bg.g),
-				 int(255*bg.b),
-				 int(255*bg.a)));
+ int(255*bg.g),
+ int(255*bg.b),
+ int(255*bg.a)));
 
 // the image path
 agg::path_storage path;
@@ -396,11 +396,11 @@
 
 case NEAREST:
 {
-	typedef agg::span_image_filter_rgba_nn<img_accessor_type, interpolator_type> span_gen_type;
-	typedef agg::renderer_scanline_aa<renderer_base, span_alloc_type, span_gen_type> renderer_type;
-	span_gen_type sg(ia, interpolator);
-	renderer_type ri(rb, sa, sg);
-	agg::render_scanlines(ras, sl, ri);
+ typedef agg::span_image_filter_rgba_nn<img_accessor_type, interpolator_type> span_gen_type;
+ typedef agg::renderer_scanline_aa<renderer_base, span_alloc_type, span_gen_type> renderer_type;
+ span_gen_type sg(ia, interpolator);
+ renderer_type ri(rb, sa, sg);
+ agg::render_scanlines(ras, sl, ri);
 }
 break;
 
@@ -414,22 +414,22 @@
 case HAMMING: filter.calculate(agg::image_filter_hamming(), norm); break;
 case HERMITE: filter.calculate(agg::image_filter_hermite(), norm); break;
 }
-	if (resample)
-	 {
-	 typedef agg::span_image_resample_rgba_affine<img_accessor_type> span_gen_type;
-	 typedef agg::renderer_scanline_aa<renderer_base, span_alloc_type, span_gen_type> renderer_type;
-	 span_gen_type sg(ia, interpolator, filter);
-	 renderer_type ri(rb, sa, sg);
-	 agg::render_scanlines(ras, sl, ri);
-	 }
-	else
-	 {
-	 typedef agg::span_image_filter_rgba_2x2<img_accessor_type, interpolator_type> span_gen_type;
-	 typedef agg::renderer_scanline_aa<renderer_base, span_alloc_type, span_gen_type> renderer_type;
-	 span_gen_type sg(ia, interpolator, filter);
-	 renderer_type ri(rb, sa, sg);
-	 agg::render_scanlines(ras, sl, ri);
-	 }
+ if (resample)
+ {
+ typedef agg::span_image_resample_rgba_affine<img_accessor_type> span_gen_type;
+ typedef agg::renderer_scanline_aa<renderer_base, span_alloc_type, span_gen_type> renderer_type;
+ span_gen_type sg(ia, interpolator, filter);
+ renderer_type ri(rb, sa, sg);
+ agg::render_scanlines(ras, sl, ri);
+ }
+ else
+ {
+ typedef agg::span_image_filter_rgba_2x2<img_accessor_type, interpolator_type> span_gen_type;
+ typedef agg::renderer_scanline_aa<renderer_base, span_alloc_type, span_gen_type> renderer_type;
+ span_gen_type sg(ia, interpolator, filter);
+ renderer_type ri(rb, sa, sg);
+ agg::render_scanlines(ras, sl, ri);
+ }
 }
 break;
 case BILINEAR:
@@ -463,22 +463,22 @@
 case LANCZOS: filter.calculate(agg::image_filter_lanczos(radius), norm); break;
 case BLACKMAN: filter.calculate(agg::image_filter_blackman(radius), norm); break;
 }
-	if (resample)
-	 {
-	 typedef agg::span_image_resample_rgba_affine<img_accessor_type> span_gen_type;
-	 typedef agg::renderer_scanline_aa<renderer_base, span_alloc_type, span_gen_type> renderer_type;
-	 span_gen_type sg(ia, interpolator, filter);
-	 renderer_type ri(rb, sa, sg);
-	 agg::render_scanlines(ras, sl, ri);
-	 }
-	else
-	 {
-	 typedef agg::span_image_filter_rgba<img_accessor_type, interpolator_type> span_gen_type;
-	 typedef agg::renderer_scanline_aa<renderer_base, span_alloc_type, span_gen_type> renderer_type;
-	 span_gen_type sg(ia, interpolator, filter);
-	 renderer_type ri(rb, sa, sg);
-	 agg::render_scanlines(ras, sl, ri);
-	 }
+ if (resample)
+ {
+ typedef agg::span_image_resample_rgba_affine<img_accessor_type> span_gen_type;
+ typedef agg::renderer_scanline_aa<renderer_base, span_alloc_type, span_gen_type> renderer_type;
+ span_gen_type sg(ia, interpolator, filter);
+ renderer_type ri(rb, sa, sg);
+ agg::render_scanlines(ras, sl, ri);
+ }
+ else
+ {
+ typedef agg::span_image_filter_rgba<img_accessor_type, interpolator_type> span_gen_type;
+ typedef agg::renderer_scanline_aa<renderer_base, span_alloc_type, span_gen_type> renderer_type;
+ span_gen_type sg(ia, interpolator, filter);
+ renderer_type ri(rb, sa, sg);
+ agg::render_scanlines(ras, sl, ri);
+ }
 }
 break;
 
@@ -660,7 +660,7 @@
 behaviors().supportSetattr();
 
 add_varargs_method( "apply_rotation", &Image::apply_rotation, Image::apply_rotation__doc__);
- add_varargs_method( "apply_scaling",	&Image::apply_scaling, Image::apply_scaling__doc__);
+ add_varargs_method( "apply_scaling", &Image::apply_scaling, Image::apply_scaling__doc__);
 add_varargs_method( "apply_translation", &Image::apply_translation, Image::apply_translation__doc__);
 add_keyword_method( "as_rgba_str", &Image::as_rgba_str, Image::as_rgba_str__doc__);
 add_varargs_method( "color_conv", &Image::color_conv, Image::color_conv__doc__);
@@ -744,25 +744,25 @@
 size_t ind=0;
 for (size_t j=0; j<thisim->rowsOut; j++) {
 for (size_t i=0; i<thisim->colsOut; i++) {
-	thisx = i+ox;
+ thisx = i+ox;
 
-	if (isflip)
-	 thisy = thisim->rowsOut - j + oy;
-	else
-	 thisy = j+oy;
+ if (isflip)
+ thisy = thisim->rowsOut - j + oy;
+ else
+ thisy = j+oy;
 
 
-	if (thisx>=numcols || thisy>=numrows) {
-	 ind +=4;
-	 continue;
-	}
+ if (thisx>=numcols || thisy>=numrows) {
+ ind +=4;
+ continue;
+ }
 
-	pixfmt::color_type p;
-	p.r = *(thisim->bufferOut+ind++);
-	p.g = *(thisim->bufferOut+ind++);
-	p.b = *(thisim->bufferOut+ind++);
-	p.a = *(thisim->bufferOut+ind++);
-	pixf.blend_pixel(thisx, thisy, p, 255);
+ pixfmt::color_type p;
+ p.r = *(thisim->bufferOut+ind++);
+ p.g = *(thisim->bufferOut+ind++);
+ p.b = *(thisim->bufferOut+ind++);
+ p.a = *(thisim->bufferOut+ind++);
+ pixf.blend_pixel(thisx, thisy, p, 255);
 }
 }
 }
@@ -854,20 +854,20 @@
 
 for (size_t rownum=0; rownum<imo->rowsIn; rownum++) {
 for (size_t colnum=0; colnum<imo->colsIn; colnum++) {
-	offset = rownum*A->strides[0] + colnum*A->strides[1];
-	r = *(double *)(A->data + offset);
-	g = *(double *)(A->data + offset + A->strides[2] );
-	b = *(double *)(A->data + offset + 2*A->strides[2] );
+ offset = rownum*A->strides[0] + colnum*A->strides[1];
+ r = *(double *)(A->data + offset);
+ g = *(double *)(A->data + offset + A->strides[2] );
+ b = *(double *)(A->data + offset + 2*A->strides[2] );
 
-	if (rgba)
-	 alpha = *(double *)(A->data + offset + 3*A->strides[2] );
-	else
-	 alpha = 1.0;
+ if (rgba)
+ alpha = *(double *)(A->data + offset + 3*A->strides[2] );
+ else
+ alpha = 1.0;
 
-	*buffer++ = int(255*r); // red
-	*buffer++ = int(255*g); // green
-	*buffer++ = int(255*b); // blue
-	*buffer++ = int(255*alpha); // alpha
+ *buffer++ = int(255*r); // red
+ *buffer++ = int(255*g); // green
+ *buffer++ = int(255*b); // blue
+ *buffer++ = int(255*alpha); // alpha
 
 }
 }
@@ -963,19 +963,19 @@
 const size_t N = imo->rowsIn * imo->colsIn;
 size_t i = 0;
 while (i<N) {
-	r = *(double *)(A->data++);
-	g = *(double *)(A->data++);
-	b = *(double *)(A->data++);
+ r = *(double *)(A->data++);
+ g = *(double *)(A->data++);
+ b = *(double *)(A->data++);
 
-	if (rgba)
-	 alpha = *(double *)(A->data++);
-	else
-	 alpha = 1.0;
+ if (rgba)
+ alpha = *(double *)(A->data++);
+ else
+ alpha = 1.0;
 
-	*buffer++ = int(255*r); // red
-	*buffer++ = int(255*g); // green
-	*buffer++ = int(255*b); // blue
-	*buffer++ = int(255*alpha); // alpha
+ *buffer++ = int(255*r); // red
+ *buffer++ = int(255*g); // green
+ *buffer++ = int(255*b); // blue
+ *buffer++ = int(255*alpha); // alpha
 
 }
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Showing 1 results of 1

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /