Hello,
Despite reading several posts in the archive and the source code in g_all_guis.c I am embarrassed to say that I am completely stumped by the problem of extracting the individual RGB components from the IEM saved color value in the .pd file, as ints between 0 and 255.
What I am doing (in the case where the saved value is negative) is:
iemcolor = -1 - iemcolor;
r = (iemcolor & 0x3f000) >> 14;
g = (iemcolor & 0xfc0) >> 4;
b = (iemcolor & 0x3f) << 2;
I would really appreciate it if someone gave me the opportunity to facepalm by illustraing the simple mistake in my approach.
Cheers!
Chris.
Hello, everybody. Is there any build for Natty AMD64 of the Extended version? For the moment, I don't want to compile it...
Thanks!
I used 64 bit from lucid on my natty machine. I think I had to use gem from the repos but otherwise it works fine.
Sent from my cell... On Jul 3, 2011 10:57 AM, "Mario Mey" mariomey@gmail.com wrote:
Hello, everybody. Is there any build for Natty AMD64 of the Extended version? For the moment, I don't want to compile it...
Thanks!
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
Thanks for the reply.
Yes, at the moment, I'm using 0.42.5 Lucid 64bits. I just tried to install the 0.43.5 Lucid 64 DEB with no luck.
I think I should compile... The only soft I compile in my life is Blender from SVN. I don't think compiling PD would be difficult... but I don't find a step-by-step tutorial to do it. Do you know any?
From
http://pure-data.git.sourceforge.net/git/gitweb.cgi?p=pure-data/pd-extended...., I can get the branch... but it's only 2MB. Where are the externals... or all the other data?
El 03/07/11 12:59, John Harrison escribió:
I used 64 bit from lucid on my natty machine. I think I had to use gem from the repos but otherwise it works fine.
Sent from my cell...
On Jul 3, 2011 10:57 AM, "Mario Mey" <mariomey@gmail.com mailto:mariomey@gmail.com> wrote:
Hello, everybody. Is there any build for Natty AMD64 of the Extended version? For the moment, I don't want to compile it...
Thanks!
Pd-list@iem.at mailto:Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
On Jul 3, 2011, at 12:19 PM, Mario Mey wrote:
Thanks for the reply.
Yes, at the moment, I'm using 0.42.5 Lucid 64bits. I just tried to
install the 0.43.5 Lucid 64 DEB with no luck.I think I should compile... The only soft I compile in my life is
Blender from SVN. I don't think compiling PD would be difficult...
but I don't find a step-by-step tutorial to do it. Do you know any?
I just did a big reorg of puredata.info/docs, so hopefully things are
a lot easier to find. I think you want this:
https://puredata.info/docs/developer/BuildingPdExtended
From http://pure-data.git.sourceforge.net/git/gitweb.cgi?p=pure-data/pd-extended.... , I can get the branch... but it's only 2MB. Where are the
externals... or all the other data?
http://puredata.info/docs/developer/GettingPdSource http://puredata.info/docs/developer/DirectoryLayout
.hc
El 03/07/11 12:59, John Harrison escribió:
I used 64 bit from lucid on my natty machine. I think I had to use
gem from the repos but otherwise it works fine.Sent from my cell...
On Jul 3, 2011 10:57 AM, "Mario Mey" mariomey@gmail.com wrote:
Hello, everybody. Is there any build for Natty AMD64 of the
Extended
version? For the moment, I don't want to compile it...
Thanks!
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
'You people have such restrictive dress for women,’ she said, hobbling
away in three inch heels and panty hose to finish out another pink-
collar temp pool day. - “Hijab Scene #2", by Mohja Kahf
Hi
We were talking about this particular topic some days, ago, you should have searched :) I did compile pd extended for natty 64, but it's lacking some libs due to my lack of compiling skills, so my build does not include pdp, pidip, gem2pdp, pdp_opengl.
#LIB_TARGETS += hid pdp pidip gem2pdp iem16 pdp_opengl postlude LIB_TARGETS += hid iem16 postlude
Just tell me and ill upload it somewhere.
On 03/07/2011 17:56, Mario Mey wrote:
Hello, everybody. Is there any build for Natty AMD64 of the Extended version? For the moment, I don't want to compile it...
Thanks!
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Sun, 3 Jul 2011, Chris McCormick wrote:
Despite reading several posts in the archive and the source code in g_all_guis.c I am embarrassed to say that I am completely stumped by the problem of extracting the individual RGB components from the IEM saved color value in the .pd file, as ints between 0 and 255.
as a reference, [#to_iem] supports both iem colour formats, the 18-bit format for files, and the 24-bit format for messages. Such a patch is very simple :
http://gridflow.ca/svn/trunk/abstractions/%23to_iem.pd http://gridflow.ca/help/%23to_iem-help.html
But it does the opposite conversion of what you are trying to do.
What I am doing (in the case where the saved value is negative) is: iemcolor = -1 - iemcolor; r = (iemcolor & 0x3f000) >> 14; g = (iemcolor & 0xfc0) >> 4; b = (iemcolor & 0x3f) << 2;
this is the 18 bit iem format that you are trying to convert to a 3*8 bit component format. You are correctly extracting blue and green, where the shift is 0*6-2 for blue, 1*6-2 for green, but it has to be 2*6-2 for red.
For the 24 bit iem format, instead, you have to shift by 0*8, 1*8, 2*8.
-2 is the difference between 6 bits per component and 8 bits per component.
Note that those conversions scale in a crude way, such that 63 is scaled to 252, instead of the maximum 255. If you want to scale more appropriately to fill the whole range, you need to post-process those components a little bit(s) :
r = r | (r>>6) g = g | (g>>6) b = b | (b>>6)
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
Hi Mathieu.
On Sun, Jul 03, 2011 at 01:36:50PM -0400, Mathieu Bouchard wrote:
On Sun, 3 Jul 2011, Chris McCormick wrote:
Despite reading several posts in the archive and the source code in
g_all_guis.c I am embarrassed to say that I am completely stumped by the problem of extracting the individual RGB components from the IEM saved color value in the .pd file, as ints between 0 and 255.as a reference, [#to_iem] supports both iem colour formats, the 18-bit
format for files, and the 24-bit format for messages. Such a patch is very simple :http://gridflow.ca/svn/trunk/abstractions/%23to_iem.pd http://gridflow.ca/help/%23to_iem-help.html
But it does the opposite conversion of what you are trying to do.
Thanks for the tip. I did have a look at [#to_iem] as well but all examples and documentation on this topic seems to be around converting to IEM numbers as you point out.
What I am doing (in the case where the saved value is negative) is: iemcolor = -1 - iemcolor; r = (iemcolor & 0x3f000) >> 14; g = (iemcolor & 0xfc0) >> 4; b = (iemcolor & 0x3f) << 2;
this is the 18 bit iem format that you are trying to convert to a 3*8 bit component format. You are correctly extracting blue and green, where the
shift is 0*6-2 for blue, 1*6-2 for green, but it has to be 2*6-2 for red.For the 24 bit iem format, instead, you have to shift by 0*8, 1*8, 2*8.
-2 is the difference between 6 bits per component and 8 bits per
component.Note that those conversions scale in a crude way, such that 63 is scaled
to 252, instead of the maximum 255. If you want to scale more
appropriately to fill the whole range, you need to post-process those
components a little bit(s)Â :r = r | (r>>6) g = g | (g>>6) b = b | (b>>6)
Ah, this is great. Thanks for this information! One last thing I am confused about is how I can tell the difference between the 18 bit iem format and the 24 bit format? In g_all_guis.c I can only see a check for positive/negative numbers. Also, what is the iemgui_modulo_color() function all about? I have implemented it for consistency but I don't understand why it is there.
Thanks for your help.
Cheers,
Chris.
On Mon, 4 Jul 2011, Chris McCormick wrote:
Thanks for the tip. I did have a look at [#to_iem] as well but all examples and documentation on this topic seems to be around converting to IEM numbers as you point out.
But note that opposite features will have similar code in them. For example, >>10 in one formula is <<10 in the other so that it cancels the first one.
You can also use [#to_iem] as a testing device to make sure that reverting the conversion gets back to the original values of R,G,B.
Ah, this is great. Thanks for this information! One last thing I am confused about is how I can tell the difference between the 18 bit iem format and the 24 bit format?
The 18-bit iem format is used in constructors (creators) such as the ones you find in dynamic patching and pd files.
The 24-bit iem format is used in the method named 'color'.
Also, what is the iemgui_modulo_color() function all about? I have implemented it for consistency but I don't understand why it is there.
it's a stupid function for doing :
stuff %= IEM_GUI_MAX_COLOR;
The % operator is not exactly the same as the modulo concept, but when the input is never negative, it IS the exactly the same.
IEM_GUI_MAX_COLOR is for size of the built-in palette, that is, 30 colours.
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC