Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Transparent images in RIVA?
#11
So the problem images display properly in the C++ RIVA client. The plot thickens!
Reply
#12
Oh, OK, it's coming back to me now. What happens is that the RIVA client gets a regular DrawBitmap command. However, when it goes to look into its cache for this image, it'll see that it has a transparency color to use, and therefore it should draw it using the transparency color. So the transparency color isn't sent in the command, and there's no special command to indicate this. It's just that the image itself is in the repository as a color transparency image, and therefore it'll only ever be drawn in that way.

So, when the RIVA client requests an image, the image start has a set of flags and a transparency color. If the 0th bit in the flags is set, then the transparency color is there and should be stored along with the image, and the image marked as a color transparency based image and so any time it's asked to draw the image, the RIVA client should use that color based transparency to draw it.
Dean Roddey
Software Geek Extraordinaire
Reply
#13
So that's the bit that, in the documentation, says, "0 - This is only set if the 1st bit was set in the request." Is that right? I will not be setting the first bit in the request, because my client does understand alpha channels. But bit 0 in the response can, if I understand you, be set anyway, if the template was set up with an override transparency color. If I do detect such a color in the download response, it replaces whatever transparency color is in the original image, if any. And if the image is an alpha-based image? Do I set a transparent color anyway, by forcing the alpha to transparent for any pixel with a matching color?
Reply
#14
If the 0th bit in the response is set, you should use the transparency color. Either by itself, i.e. regular color based transparency draw sprite style, if the image has no alpha channel, or in conjunction with the alpha channel if that is present.

Though, the latter is so seldom required that if you chose to ignore that I don't think it would be an issue. Hardly anyone is going to turn on color based transparency on an image that has alpha transparency.

That also means that, when you get the image down, if the 0th bit is set, you can pre-mask it, so that you only have to do two of the required sprite style drawing steps each time you redraw it, instead of all three steps. But, if your OS only provides a single operation, it wouldn't matter so you wouldn't do that. For me I pre-mask those images in the cache. So all I have to do is create the hole in the screen, and then blit the image into the hole.
Dean Roddey
Software Geek Extraordinaire
Reply
#15
So is the color to use as transparent supposed to be in the other bits or it's found somewhere else?
Field Generator 0.65: Create CQC fields on the fly, from external applications.
Mobile templates 0.4: Main resolution of 320x480 with navigation side bars (384x544).
Sage Media Server 1.1.3 + Sage Player 2.7.8: Display and manipulate SageTV information or player.
TaRIVA 1.26: Android RIVA client.
Reply
#16
It's in the initial image start response when you request an image. You should store in the image cache along with the image (and you can of course store some flag to indicate that it's one that should be drawn using color transparency.
Dean Roddey
Software Geek Extraordinaire
Reply
#17
I have been experimenting, and the flags and color of the returned ReqImgStart message are always 0 unless I set flags to 2 in the ReqImgDownload message. Even if I set flags to 3 (which should set the same bit), I see nothing. But if I set flags to 2, the flags come back as 1, and I get a transparent color. I think that means that CQC, since I have told it that I can't understand alpha, is converting my images to color transparency. But that's not what I want. I can in fact understand alpha. I only need the transparency color if one has been set in the Interface Editor. Do you have any suggestion about what I should do? How does the C++ Riva client set its flags? That isn't the client that uses the simple protocol, is it?
Reply
#18
You should set the flags to zero. The only images that should come to you with a color transparency are ones that are in the repository as color transparency based. So, unless you have any in your repository that are, you won't see any with a transparency color.
Dean Roddey
Software Geek Extraordinaire
Reply
#19
There are three different kinds of images on the template in question. Alpha-based images, color-transparency images, and images without color transparency, where Sam Vimes has set a transparent color in the Interface Editor. All three types look fine in the Interface Editor, and the first two look fine on the iPhone (and in taRiva, as I understand it), but the last kind -- with the transparent color defined outside of the file itself -- does not show up as transparent. I send my image request with flags set to 0, and the response also has flags of 0, and no transparent color, even though one was set in the Interface Editor.

I have attached a zip of the graphics file. As you can see, it's a PNG file with no transparent color defined. One easily could be defined, but for whatever reason it was not. Sam Vimes added this image to his template, set the transparent color to white, and voila! it looks fine in the Interface Editor. But not on the iPhone. Can you suggest anything I might do to my client to remedy this situation? Thanks.
Reply
#20
I'll take a look at here in a bit...
Dean Roddey
Software Geek Extraordinaire
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Html 5 Riva potts.mike 9 5,307 09-15-2013, 04:22 AM
Last Post: bjkiller
  Thinking about the next step in RIVA Dean Roddey 6 4,725 01-22-2013, 06:15 AM
Last Post: brianmount
  Official RIVA thread Dean Roddey 382 71,822 07-25-2012, 02:58 PM
Last Post: Fonceur
  .Net RIVA Client Dean Roddey 146 41,351 02-06-2012, 06:53 PM
Last Post: Dean Roddey
  riva burkepaol4 1 6,204 12-17-2010, 11:39 AM
Last Post: Dean Roddey
  Riva screen blanker on CF.NET froop 3 5,360 08-06-2010, 10:34 PM
Last Post: froop
  RIVA Connection batwater 6 4,904 07-16-2010, 04:46 PM
Last Post: batwater
  Java based RIVA Client? batwater 10 6,784 04-03-2010, 05:35 AM
Last Post: wuench
  RIVA Client for Linux bryanb 22 9,384 07-16-2009, 09:11 PM
Last Post: bjkiller

Forum Jump:


Users browsing this thread: 1 Guest(s)