Author Topic: No Alpha Stored  (Read 2088 times)

0 Members and 1 Guest are viewing this topic.

Aaron

  • Guest
No Alpha Stored
« on: March 19, 2014, 02:06:56 PM »
Hi,

It isn't possible to get an Alpha value.
In internal pixel array is no alpha stored,  only R, G, B.

No matter, who needs an alpha ( Romeo Giulietta).

A test here:
Code: [Select]
include "ss.inc"
Openwindow 320,240,1

byte r=1,g=1,b=1,a=1
For x=0, 319
For y=0, 239
    Color Rnd(64,255),Rnd(64,255),Rnd(64,255),225
    SetPixel x,y
Next
Next

pixel = GetPixel 160,120
r = GetR(pixel)
g = GetG(pixel)
b = GetB(pixel)
a = GetA(pixel)

color r, g, b, 255
Fillcircle 120, 80,40

pixel = GetPixel 220,200
r = GetR(pixel)
g = GetG(pixel)
b = GetB(pixel)
a = GetA(pixel)

color r, g, b, 255
FillRect 100,140,40,40


color 255,255,255,255
DrawString 0,0, r " " g " " b " " a
waitkey
closewindow
« Last Edit: March 28, 2014, 07:24:24 AM by Peter »

JRS

  • Guest
Re: No Alpha Stored
« Reply #1 on: March 19, 2014, 02:40:46 PM »
It seems the alpha value is only needed on pixel creation. It's a part of the color creation internal SDL function. All we are seeing is the results of that color (alpha) translation. Knowing what the original values are doesn't seem possible. So much for sampling pixels as map position indicators.


Aaron

  • Guest
Re: No Alpha Stored
« Reply #2 on: March 19, 2014, 02:51:41 PM »
Hi John,

May be I have to look a bit deeper into the matter.

JRS

  • Guest
Re: No Alpha Stored
« Reply #3 on: March 19, 2014, 03:58:08 PM »
Great!

Looking forward to what you come up with.

Making your SDL source available would also be a big help.