Announcement: New *CUSTOMIZABLE* GTK RGBA module
|
Quote:
http://gnome-look.org/CONTENT/conten...gba-advanced.c : Code:
#include <glib.h> So, where is the return statement and where is the return value of 'float' type. To me the code makes no sense. Have you tried to compile it with '-Wall -Wextra' ? |
Quote:
Code:
[kenny-strawn@ubuntu:~]$ gcc -fPIC -shared librgba-advanced.c -o librgba-advanced.so `pkg-config --cflags --libs gtk+-2.0` |
Quote:
This is, for example a line from 'gtk+' compilation performed by its own Makefile: Code:
36 libtool: compile: gcc -DGDK_PIXBUF_DISABLE_DEPRECATED -g -O2 -Wall -c have_mmx.S -fPIC -DPIC -o .libs/have_mmx.o You haven't answered my question: Quote:
Your code make absolutely no sense to me. Beginning from Code:
Red <= 255; |
Okay, minor change to the code:
Code:
#include <glib.h> Edit: The first values define the how high the "Red", "Green", and "Blue" values go. The next values multiply the values together to come up with the RGB cube. The values after that are limits on the Alpha value. After that, the next values multiply the color values by Alpha. And the next values then use a mathematical formula from here to do the alpha blending. |
Quote:
Your Code:
Red <= 255; |
Quote:
|
Quote:
So, write a small 'main' program which calls your 'rgba' function, insert into your 'rgba' function 'pritntf' statements which show values of Red, Green, Blue, call your 'rgba' function with Red, Green, Blue values intentionally outside the limits and see that your code in no way limits the values - despite what you are saying. |
Quote:
EDIT: And without a return value all the work you've done in that function is pointless õ_õ EDIT 2: sorry, I should probably read the thread right to the end before posting advice (already given by Sergei Steshenko) |
Hi,
can you link some documentation that supports your statement Quote:
|
[code]
/* Set margins on the color map */ Red <= 255; Green <= 255; Blue <= 255; /* Set parameters for RGB cube */ Red * Green * Blue; /* Set margins for Alpha value */ Alpha <= 1; Alpha >= 0; [/quote] W T F? Code:
/* Set margins on the color map */ |
We've seen this before - kind of - and you don't appear to have learnt much.
First compiling code and checking all the warnings is important see Sergei Steshenko's first post in this thread. However, if something compiles even without any warnings then it doesn't mean that it works as you had hoped. For that you need to test it. To test it you need to have a clear idea of what output you would expect to receive given certain input. So if I passed in the values (128, 64, 192, 0.5) to your function what should the output be? |
And, FWIW, the very first lines of this particular piece of code:
Code:
#include <glib.h> Kenny_Strawn, the thread name: "Announcement: New *CUSTOMIZABLE* GTK RGBA module", is mostly senseless. I.e. the "Announcement: New" part makes sense; "CUSTOMIZABLE" is irrelevant - your piece of code has no customization whatsoever; "module" is senseless - it's a single senseless and useless function. I personally consider your announcements of that 'rgba' as pure SPAM. |
All times are GMT -5. The time now is 01:37 AM. |