Register
Site Login
Site Search
Forums
Advertisement
Welcome to PocketMatrix. PocketMatrix is dedicated to providing the best online community for mobile device developers and enthusiests. What's new?

GapiRGBASurface != GapiSurface?


GapiRGBASurface != GapiSurface?

Postby Narin » Nov 22, 2008 @ 1:36am

So is it not possible to "draw into" an RGBA surface the same way you can draw into GapiSurface?

I was hoping to "build up" RGBA surfaces by blitting images with alpha channels and drawing lines and such, then keep them around for fast blitting later.

It looks like my only option is to access the pixels directly?
Narin
pm Member
 
Posts: 11
Joined: Nov 21, 2008 @ 10:42am


Re: GapiRGBASurface != GapiSurface?

Postby Johan » Nov 22, 2008 @ 1:41pm

Narin wrote:So is it not possible to "draw into" an RGBA surface the same way you can draw into GapiSurface?


Well. GapiRGBASurface does not have the drawing toolkit of CGapiSurface, such as line drawing and font rendering. But you can draw into a CGapiRGBASurface yourself using GetBuffer() to write pixels manually.

Narin wrote:I was hoping to "build up" RGBA surfaces by blitting images with alpha channels and drawing lines and such, then keep them around for fast blitting later.


You can do this! Use one CGapiSurface as "color" texture, and one CGapiSurface as "alpha" texture. You can then draw as you want to these CGapiSurfaces, either modifying alpha, color channel, or both. Then call the CGapiSurface::AlphaBlt that takes two CGapiSurface pointers as source (one CGapiSurface for color and one CGapiSurface for alpha).

Sincerely
Johan
Johan Sanneblad, M.Sc, Ph.D
GapiDraw Systems Architect
[http://www.gapidraw.com]
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Re: GapiRGBASurface != GapiSurface?

Postby Narin » Nov 23, 2008 @ 9:06am

Johan wrote:You can do this! Use one CGapiSurface as "color" texture, and one CGapiSurface as "alpha" texture.


Wonderful! I can definitely work with that.

Is there a prescribed set of operations for "adding" two of these color+alpha surface pairs together? Like add the color and multiply the alpha or something?
Narin
pm Member
 
Posts: 11
Joined: Nov 21, 2008 @ 10:42am


Postby Johan » Nov 23, 2008 @ 9:10pm

By default you can only do a regular source + 1-source blending.

But if you get the source code license you can very easily add things like this yourself. GapiDraw has a very flexible architecture inside.

Sincerely
Johan
Johan Sanneblad, M.Sc, Ph.D
GapiDraw Systems Architect
[http://www.gapidraw.com]
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron