kopia lustrzana https://gitlab.com/sane-project/website
				
				
				
			
		
			
				
	
	
		
			141 wiersze
		
	
	
		
			7.8 KiB
		
	
	
	
		
			HTML
		
	
	
			
		
		
	
	
			141 wiersze
		
	
	
		
			7.8 KiB
		
	
	
	
		
			HTML
		
	
	
<!-- received="Mon Apr 27 22:49:28 1998 PDT" -->
 | 
						||
<!-- sent="Tue, 28 Apr 1998 07:46:50 +0200 (MET DST)" -->
 | 
						||
<!-- name="Hugo van der Kooij" -->
 | 
						||
<!-- email="hvdkooij@caiw.nl" -->
 | 
						||
<!-- subject="Re: Two *other* problems with xscanimage" -->
 | 
						||
<!-- id="" -->
 | 
						||
<!-- inreplyto="m0yU316-000J3NC@yoo-hoo.ai.mit.edu" -->
 | 
						||
<title>sane-devel: Re: Two *other* problems with xscanimage</title>
 | 
						||
<h1>Re: Two *other* problems with xscanimage</h1>
 | 
						||
<b>Hugo van der Kooij</b> (<a href="mailto:hvdkooij@caiw.nl"><i>hvdkooij@caiw.nl</i></a>)<br>
 | 
						||
<i>Tue, 28 Apr 1998 07:46:50 +0200 (MET DST)</i>
 | 
						||
<p>
 | 
						||
<ul>
 | 
						||
<li> <b>Messages sorted by:</b> <a href="date.html#305">[ date ]</a><a href="index.html#305">[ thread ]</a><a href="subject.html#305">[ subject ]</a><a href="author.html#305">[ author ]</a>
 | 
						||
<!-- next="start" -->
 | 
						||
<li> <b>Next message:</b> <a href="0306.html">Matto Marjanovic: "Re: Two *other* problems with xscanimage"</a>
 | 
						||
<li> <b>Previous message:</b> <a href="0304.html">Matto Marjanovic: "Re: Two *other* problems with xscanimage"</a>
 | 
						||
<li> <b>In reply to:</b> <a href="0304.html">Matto Marjanovic: "Re: Two *other* problems with xscanimage"</a>
 | 
						||
<!-- nextthread="start" -->
 | 
						||
<li> <b>Next in thread:</b> <a href="0306.html">Matto Marjanovic: "Re: Two *other* problems with xscanimage"</a>
 | 
						||
<!-- reply="end" -->
 | 
						||
</ul>
 | 
						||
<!-- body="start" -->
 | 
						||
On Tue, 28 Apr 1998, Matto Marjanovic wrote:<br>
 | 
						||
<p>
 | 
						||
<i>> </i><br>
 | 
						||
<i>>    From: <a href="mailto:Oliver.Rauch@Wolfsburg.DE">Oliver.Rauch@Wolfsburg.DE</a></i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>>    > b)  ___Gamma Curve data is corrupted.___</i><br>
 | 
						||
<i>>    >     When turning on table-based gamma correction (and thus instantiating the</i><br>
 | 
						||
<i>>    >     gamma curve widget), the following happen:</i><br>
 | 
						||
<i>>    >       o correct values are read from the (microtek) backend, so far so good.</i><br>
 | 
						||
<i>>    >       o immediately after the call to gtk_curve_set_gamma in curve_new(),</i><br>
 | 
						||
<i>>    >          a call to gtk_curve_get_gamma reveals the correct values were </i><br>
 | 
						||
<i>>    > 	 written to the widget.</i><br>
 | 
						||
<i>>    >       o sometime later (when the event loop updates/displays the widget, I</i><br>
 | 
						||
<i>>    >          imagine), xscanimage declares</i><br>
 | 
						||
<i>>    I already have seen this, too. I hope I will find the time to take a closer</i><br>
 | 
						||
<i>>    look at it soon!</i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>> Hi Oliver, et al.,</i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>> For no good reason, I went poking at this with gdb (well, at least I'm</i><br>
 | 
						||
<i>>  learning how to use gdb), and made some discoveries.  The problem is in</i><br>
 | 
						||
<i>>  the widgets, not xscanimage.  Someone who knows more about GTK widget</i><br>
 | 
						||
<i>>  programming will need to take over from here....</i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>> When xscanimage runs, the corruption to the gamma curve widget happens</i><br>
 | 
						||
<i>>  during the call to gtk_widget_show(notebook) at the end of vector_new()</i><br>
 | 
						||
<i>>  ["gtkglue.c"].  Here are before and after snapshots of the Curve:</i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>> BEFORE:</i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>> $36 = {graph = {widget = {object = {klass = 0x809b578, flags = 67328, </i><br>
 | 
						||
<i>>         ref_count = 1, object_data = 0x8087690}, private_flags = 0, </i><br>
 | 
						||
<i>>       state = 0 '\000', saved_state = 0 '\000', name = 0x0, style = 0x8084368, </i><br>
 | 
						||
<i>>       requisition = {width = 262, height = 262}, allocation = {x = -1, y = -1, </i><br>
 | 
						||
<i>>         width = 1, height = 1}, window = 0x0, parent = 0x809b308}, </i><br>
 | 
						||
<i>>     draw_data = 0x0}, cursor_type = 132, min_x = 0, max_x = 255, min_y = 0, </i><br>
 | 
						||
<i>>   max_y = 255, pixmap = 0x0, curve_type = GTK_CURVE_TYPE_FREE, height = 255, </i><br>
 | 
						||
<i>>   grab_point = -1, last = 0, num_points = 256, point = 0x809ba48, </i><br>
 | 
						||
<i>>   num_ctlpoints = 2, ctlpoint = 0x809ba30}</i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>> AFTER:</i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>> $37 = {graph = {widget = {object = {klass = 0x809b578, flags = 329664, </i><br>
 | 
						||
<i>>         ref_count = 1, object_data = 0x8095660}, private_flags = 0, </i><br>
 | 
						||
<i>>       state = 0 '\000', saved_state = 0 '\000', name = 0x0, style = 0x809d5f8, </i><br>
 | 
						||
<i>>       requisition = {width = 262, height = 262}, allocation = {x = -1, y = -1, </i><br>
 | 
						||
<i>>         width = 1, height = 1}, window = 0x809d3d8, parent = 0x809b308}, </i><br>
 | 
						||
<i>>     draw_data = 0x0}, cursor_type = 132, min_x = 0, max_x = 255, min_y = 0, </i><br>
 | 
						||
<i>>   max_y = 255, pixmap = 0x809d960, curve_type = GTK_CURVE_TYPE_FREE, </i><br>
 | 
						||
<i>>   height = -5, grab_point = -1, last = 0, num_points = -5, point = 0x809d540, </i><br>
 | 
						||
<i>>   num_ctlpoints = 2, ctlpoint = 0x809ba30}</i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>> Note how "height" and "num_points" are now the unlikely values of -5, and</i><br>
 | 
						||
<i>>  the "point" vector has moved.</i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>> The basic problem is that "allocation.width" and "allocation.height" are 1,1</i><br>
 | 
						||
<i>>  and not 262,262.  The chain of events (I believe) is:  [in "gtk/gtkcurve.c"]</i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>>  gtk_curve_graph_events() is called for either a CONFIGURE or EXPOSE event,</i><br>
 | 
						||
<i>>   and subsequently calls gtk_curve_draw() with the width and height taken</i><br>
 | 
						||
<i>>   from the "allocation", as:</i><br>
 | 
						||
<i>>           width = w->allocation.width - RADIUS * 2;</i><br>
 | 
						||
<i>> 	  height = w->allocation.height - RADIUS * 2;</i><br>
 | 
						||
<i>>   i.e. -5 and -5</i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>>  gtk_curve_draw() sees the requested width,height (-5,-5) doesn't match what</i><br>
 | 
						||
<i>>   was loaded into it (256,256), and calls gtk_curve_interpolate(), which then</i><br>
 | 
						||
<i>>   generates screwy numbers.</i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>> SO:  Perhaps gtk_curve_graph_events() should use the curve's "requisition"</i><br>
 | 
						||
<i>>       instead of its "allocation" to calculate those width and height.</i><br>
 | 
						||
<i>>      Perhaps in an earlier incarnation of GTK, the curve widget got 'allocated'</i><br>
 | 
						||
<i>>       earlier or something.</i><br>
 | 
						||
<i>>      I don't really know what design issues are involved here.</i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>> Whatever the solution is, I'd love to hear it, just to get some more insights</i><br>
 | 
						||
<i>>  into the workings of GTK.</i><br>
 | 
						||
<i>> </i><br>
 | 
						||
<i>> Hope this is a good head-start,</i><br>
 | 
						||
<i>> -matt m.</i><br>
 | 
						||
<p>
 | 
						||
Please report it to the authors of gtk and gimp!<br>
 | 
						||
<p>
 | 
						||
They are the ones that should be working on this problem.<br>
 | 
						||
<p>
 | 
						||
Hugo.<br>
 | 
						||
<p>
 | 
						||
	+------------------------+------------------------------+<br>
 | 
						||
<i>	| Hugo van der Kooij     | <a href="mailto:Hugo.van.der.Kooij@caiw.nl">Hugo.van.der.Kooij@caiw.nl</a>   |</i><br>
 | 
						||
<i>	| Oranje Nassaustraat 16 | <a href="http://www.caiw.nl/~hvdkooij">http://www.caiw.nl/~hvdkooij</a> |</i><br>
 | 
						||
<i>	| 3155 VJ  Maasland      | (De man met de rode hoed)    |</i><br>
 | 
						||
	+------------------------+------------------------------+<br>
 | 
						||
    "Computers let you make more mistakes faster than any other invention in <br>
 | 
						||
      human history, with the possible exception of handguns and tequila."<br>
 | 
						||
		(Mitch Radcliffe)<br>
 | 
						||
<p>
 | 
						||
<p>
 | 
						||
<pre>
 | 
						||
--
 | 
						||
Source code, list archive, and docs: <a href="http://www.mostang.com/sane/">http://www.mostang.com/sane/</a>
 | 
						||
To unsubscribe: echo unsubscribe sane-devel | mail <a href="mailto:majordomo@mostang.com">majordomo@mostang.com</a>
 | 
						||
</pre>
 | 
						||
<!-- body="end" -->
 | 
						||
<p>
 | 
						||
<ul>
 | 
						||
<!-- next="start" -->
 | 
						||
<li> <b>Next message:</b> <a href="0306.html">Matto Marjanovic: "Re: Two *other* problems with xscanimage"</a>
 | 
						||
<li> <b>Previous message:</b> <a href="0304.html">Matto Marjanovic: "Re: Two *other* problems with xscanimage"</a>
 | 
						||
<li> <b>In reply to:</b> <a href="0304.html">Matto Marjanovic: "Re: Two *other* problems with xscanimage"</a>
 | 
						||
<!-- nextthread="start" -->
 | 
						||
<li> <b>Next in thread:</b> <a href="0306.html">Matto Marjanovic: "Re: Two *other* problems with xscanimage"</a>
 | 
						||
<!-- reply="end" -->
 | 
						||
</ul>
 |