Thread: Re: [cotvnc-devel] Color Handling
Project superseded by http://chicken.sourceforge.net/
Brought to you by:
smeger
From: Sean K. <ka...@ge...> - 2005-04-09 05:36:58
|
[In a message on Fri, 08 Apr 2005 19:30:25 PDT, Jason Harris wrote:] >Please DON'T revamp this. I've been planning on doing it myself for >quite awhile and I'm looking forward to doing it quite a bit. :) Oh, yeah! It's all yours, baby! >I feel like I've seen it encoded with a garbage byte at some point, but >I can't remember the scenario, or even whether I really saw that. So I >guess my answer is "beats me". Sometimes it is, sometimes it ain't, or so it appears. . . >What scenario causes a double-swizzle? We'll, after some fairly extensive testing, here's what I've found. Using TightVNC, we get this: TightEncodingReader.m:setZippedData will call: [frameBuffer putRect:r fromTightData:(unsigned char*)[filtered bytes]]; filtered is set to PalletFilter.m:filter. Which calls combineRGB in FrameBuffer, which will check tightBytesPerPixel, and use endian-ness to swizzle the pixels. But these bytes will then be sent to putRect:fromTightdata, which will re-swizzle them. I commented out the swizzle in combineRGB, and while that worked for the putRect, it causes the setBackground routine to *not* swizzle the bits. Or rather, they swizzle once, but that apparently is the wrong thing to do. Sigh. it's so spaghetty--ish. It might not be setBackground. It's hard to figure out. When the cursor moves, my beautiful cyan display gets yellow bits all over it. :( Sean |
From: Sean K. <ka...@ge...> - 2005-04-09 08:51:35
|
[In a message on Fri, 08 Apr 2005 22:34:29 PDT, Sean Kamath wrote:] > >[In a message on Fri, 08 Apr 2005 19:30:25 PDT, > Jason Harris wrote:] >>Please DON'T revamp this. I've been planning on doing it myself for >>quite awhile and I'm looking forward to doing it quite a bit. :) > >Oh, yeah! It's all yours, baby! Um, were you serious? :-S >I commented out the swizzle in combineRGB, and while that worked for >the putRect, it causes the setBackground routine to *not* swizzle the >bits. Or rather, they swizzle once, but that apparently is the wrong >thing to do. Sigh. it's so spaghetty--ish. It might not be >setBackground. It's hard to figure out. When the cursor moves, my >beautiful cyan display gets yellow bits all over it. :( So at this point I've downloaded, compiled and tried the latest tightvnc server (1.3_dev5). It has the same issue. I gotta tell you, I'm not convinced it's us. So I'm starting down the path of debugging *their* code. Sigh. Right now I'm trying to look at the bytes over the wire to see what's going on. Maybe I should just hack the reader routines. . . Sean |
From: Jason H. <sm...@ge...> - 2005-04-09 12:09:47
|
On Apr 9, 2005, at 1:49 AM, Sean Kamath wrote: >>> Please DON'T revamp this. I've been planning on doing it myself for >>> quite awhile and I'm looking forward to doing it quite a bit. :) >> >> Oh, yeah! It's all yours, baby! > > Um, were you serious? :-S Yeah, totally serious. We're like quadruple-buffering because OS X already double-buffers. I plan to revamp what's there to draw directly into our window's CGContext which should give us a pretty dramatic speed boost. I've validated this assumption by "Sharking" Chicken while repeatedly showing and hiding a window on the remote server. Doing this is the first thing on my to-do list for after I've finished updating ShapeShifter for Tiger. I've been having a hard time not doing it _instead_ of updating ShapeShifter for Tiger. :) > I gotta tell you, I'm not convinced it's us. So I'm starting down the > path of debugging *their* code. Sigh. Right now I'm trying to look > at the bytes over the wire to see what's going on. Maybe I should > just hack the reader routines. . . This was the experience that I had six months ago or so when I was banging on this. I was hampered, though, by not having a linux box to connect to. I'm down for helping out on this if someone would like to give me access to one (and a screenshot of what it _should_ look like!). I know this is a lot to ask (and Chicken works fine for me for all servers I connect to), so no biggie if no one jumps at this. :) Meanwhile, here's a bit of the rationale behind the current spaghetti code (which I agree completely is overly noodlicious). Chicken was originally designed to do the following: - Ask the server for its desired data encoding (bpp, color shifts, etc) - Check Chicken's prefs for the user's desired encoding - Tell the server what encoding Chicken wants to use - Begin session - Send received data to Chicken's frame buffer - Render the frame buffer to the screen The "problem" is that Chicken, when it was a NeXTStep app, was originally designed to use a variety of different local frame buffers, depending on the user's preference settings. So a user could, for example, receive true 32-bit color from a server and then render it down locally to grayscale. And then send the grayscale to the window and have the OS render the grayscale as RGB triplets. Obviously, that's just silly on an OS that is generally running at millions of colors and more importantly, that has built-in colorspace conversion. So, I ripped out the code that enables local colorspace conversion quite awhile ago. See, for example, the comment in -[PrefController defaultFrameBufferClass], which refers to the CGContext stuff I mentioned above. Anyway, I forget what the point of all of this was. I'm sure I had one... Something that I found useful when fixing the big occurrences of this same issue a few months ago was setting the remote server's desktop to a known, solid color and then logging all of the colors I receive as 32bit values. Makes it pretty clear how they're coming in over the wire. Jason |
From: Jared M. <jmc...@df...> - 2005-04-09 17:58:45
|
>On Apr 9, 2005, at 1:49 AM, Sean Kamath wrote: > >>>>Please DON'T revamp this. I've been planning on doing it myself for >>>>quite awhile and I'm looking forward to doing it quite a bit. :) >>> >>>Oh, yeah! It's all yours, baby! >> >>Um, were you serious? :-S > >Yeah, totally serious. We're like quadruple-buffering because OS X >already double-buffers. I plan to revamp what's there to draw >directly into our window's CGContext which should give us a pretty >dramatic speed boost. I've validated this assumption by "Sharking" >Chicken while repeatedly showing and hiding a window on the remote >server. > >Doing this is the first thing on my to-do list for after I've >finished updating ShapeShifter for Tiger. I've been having a hard >time not doing it _instead_ of updating ShapeShifter for Tiger. :) Do you know when you are going to do this? I was thinking of tying into the output code and dump the images to Quicktime for recording. I've been thinking about it a bit, and think that that would be a very very useful feature. I don't want to do this until the draw code has been revamped. Jared |
From: Jason H. <sm...@ge...> - 2005-04-10 04:13:40
|
On Apr 9, 2005, at 10:58 AM, Jared McIntyre wrote: > Do you know when you are going to do this? I was thinking of tying > into the output code and dump the images to Quicktime for recording. > I've been thinking about it a bit, and think that that would be a very > very useful feature. I don't want to do this until the draw code has > been revamped. Probably within the month. Jason |
From: Jared M. <jmc...@df...> - 2005-04-10 04:51:53
|
At 9:13 PM -0700 4/9/05, Jason Harris wrote: >On Apr 9, 2005, at 10:58 AM, Jared McIntyre wrote: > >>Do you know when you are going to do this? I was thinking of tying >>into the output code and dump the images to Quicktime for >>recording. I've been thinking about it a bit, and think that that >>would be a very very useful feature. I don't want to do this until >>the draw code has been revamped. > >Probably within the month. Before we go through such a code destabilizing event, do we want to consider a B3 release? Looking through the list of completed items, there really is a lot there that I think people would be interested in having. Also, if I make a few GUI enhancements, how long do you expect it to take to get the translations updated? If I add a checkbox to have the server saved from a URL launch, the other languages will need to be updated. Jared |
From: Jason H. <sm...@ge...> - 2005-04-10 15:09:07
|
On Apr 9, 2005, at 9:51 PM, Jared McIntyre wrote: > Before we go through such a code destabilizing event, do we want to > consider a B3 release? Looking through the list of completed items, > there really is a lot there that I think people would be interested in > having. Yes, absolutely. Most definitely. > Also, if I make a few GUI enhancements, how long do you expect it to > take to get the translations updated? If I add a checkbox to have the > server saved from a URL launch, the other languages will need to be > updated. Beats me. :) The Italian translator is in my AIM list, so he'd probably be pretty easy. I'd have to email the French translator, and I don't know what his response time would be. Jason |
From: Jared M. <jmc...@df...> - 2005-04-14 04:58:44
|
>The Italian translator is in my AIM list, so he'd probably be pretty >easy. I'd have to email the French translator, and I don't know >what his response time would be. I went ahead and added a checkbox and associated code so that you can choose to add a server loaded from a URL to the server list. The checkbox is on the server pane and will need to be translated. Also, since I had all the code in place already, I implemented a prototype of the "New Connection..." menu item that opens an empty server pane by itself (similar to the URL handler). I haven't checked this part in since I know there is disagreement about whether this is the appropriate way to go, however, I have it available if we want to try that direction (we can always strip it out later). Jared |
From: Jason H. <sm...@ge...> - 2005-04-14 05:18:09
|
> I went ahead and added a checkbox and associated code so that you can > choose to add a server loaded from a URL to the server list. The > checkbox is on the server pane and will need to be translated. Cool, I'll keep an eye out for the translators. > Also, since I had all the code in place already, I implemented a > prototype of the "New Connection..." menu item that opens an empty > server pane by itself (similar to the URL handler). I haven't checked > this part in since I know there is disagreement about whether this is > the appropriate way to go, however, I have it available if we want to > try that direction (we can always strip it out later). Go ahead and check it in, we'll strip it out if we come up with a better solution down the road. Jason |
From: Jared M. <jmc...@df...> - 2005-04-15 00:00:45
|
>Go ahead and check it in, we'll strip it out if we come up with a >better solution down the road. Checked in. This too will need translation. Jared |
From: Jared M. <jmc...@df...> - 2005-04-15 00:49:46
|
At 5:58 PM -0600 4/14/05, Jared McIntyre wrote: >>Go ahead and check it in, we'll strip it out if we come up with a >>better solution down the road. > >Checked in. This too will need translation. > >Jared Okay, its actually checked in now (the original failed to complete, and I didn't notice). I also checked in a fix so that if Chicken is launched by URL, the server list dialog doesn't open up too. Jared |
From: Jared M. <jmc...@df...> - 2005-04-15 00:55:17
|
I just realized that we need to add the specialized keyboard shortcut settings for the New Connection... menu item. I'm not really sure how our system works to do this. Jared |
From: Jason H. <sm...@ge...> - 2005-04-15 07:11:38
|
Edit Resources/KeyEquivalentScenarios.plist. Be sure to add it for each localization, even if it's in English for now. I think that'll do it. Jason On Apr 14, 2005, at 5:53 PM, Jared McIntyre wrote: > I just realized that we need to add the specialized keyboard shortcut > settings for the New Connection... menu item. I'm not really sure how > our system works to do this. > > Jared > > |
From: Jared M. <jmc...@df...> - 2005-04-16 01:17:45
|
At 12:11 AM -0700 4/15/05, Jason Harris wrote: >Edit Resources/KeyEquivalentScenarios.plist. Be sure to add it for >each localization, even if it's in English for now. > >I think that'll do it. I checked changes to InfoPList, but I'm missing something about how it works. Could you take a look and tell me what else needs doing? Currently the menu item shows up in the preferences, but it isn't defaulting to the right short cut, and it isn't being overriden in the menu with what is places in the preferences. Jared |