From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C772C5.BCF8F3B2" Date: Fri, 30 Mar 2007 14:19:54 +0200 Message-ID: From: To: <9fans@cse.psu.edu> Subject: [9fans] code inspection needed/appreciated Topicbox-Message-UUID: 3774eafc-ead2-11e9-9d60-3106f5b1d025 This is a multi-part message in MIME format. ------_=_NextPart_001_01C772C5.BCF8F3B2 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Hello all! =20 I have put a simple code that is intended to manipulate individual RGB = pixels, on: /n/sources/contrib/pac/sys/src/cmd/img/rgb.c If anyone has time and is willing to help me, I would appreciate = inspecting the code and telling me your comments!! Thank you, have a great weekend, =20 ++pac. =20 ------_=_NextPart_001_01C772C5.BCF8F3B2 Content-Type: text/html; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable

Hello all!

 

I have put a simple code that is intended to manipulate individual RGB pixels, on:

/n/sources/contrib/pac/sys/src/cmd/img/rgb.c

If anyone has time and is willing to help me, = I would appreciate inspecting the code and telling me your = comments!!

Thank you,

have a great = weekend,

 

++pac.

 

------_=_NextPart_001_01C772C5.BCF8F3B2-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <15e34c88856214df634907d08dfc8aa1@coraid.com> From: erik quanstrom Date: Fri, 30 Mar 2007 09:44:16 -0400 To: 9fans@cse.psu.edu Subject: Re: [9fans] code inspection needed/appreciated In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 37821fd8-ead2-11e9-9d60-3106f5b1d025 could you please explain this code a bit futher. i'm not sure i understand what it's supposed to do and how it would be used. - erik > Hello all! > > > > I have put a simple code that is intended to manipulate individual RGB pixels, on: > > /n/sources/contrib/pac/sys/src/cmd/img/rgb.c > > If anyone has time and is willing to help me, I would appreciate inspecting the code and telling me your comments!! > > Thank you, > > have a great weekend, From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C77500.FA80F675" Subject: RE: [9fans] code inspection needed/appreciated Date: Mon, 2 Apr 2007 10:29:06 +0200 Message-ID: References: <15e34c88856214df634907d08dfc8aa1@coraid.com> From: To: <9fans@cse.psu.edu> Topicbox-Message-UUID: 3bed2734-ead2-11e9-9d60-3106f5b1d025 This is a multi-part message in MIME format. ------_=_NextPart_001_01C77500.FA80F675 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable It is intended to be a general 'template' for operations on single = pixel, like, e.g., rotation in RGB-space. It should jump the pixels and = feed its RGB(A) values to the function doSomethingWithPixel(). I would = like to (re)write some image manipulation functions, like color balance, = gamma, ... from NetPBM, and from elsewhere, to native 9 code working on 9 images. I suffer from being a self-made-man in computing, and of course, from a = lack of spare time, as everybody today. Although I did some APE&native = ports of my favourite programs, I love plan 9 so much that I want to = rewrite some of them in a clean way. I have much to do with digital imaging, either at work, or as a hobby. I = must e3mphasize here that I dont like the paradigm of 'applications' -- = user intensive programs, so I'd like to follow the UNIX/Plan9 paradigm = of well-tuned single-purpose programs working together glued via a rc = script, if I got it right. Thus, any helping hand ismuch appreciated. Hopefully, one day I'll do rm = -fr /n/linux, as i did it with Windoze several years ago. Back to the question: for the time being, the 'rgb.c' program, after = defining the 'do Something...() function to do nothing, should write = exactly the same image out, as was the one on the input. Thanks for your care, have a great day, ++pac. -----Original Message----- From: 9fans-bounces+cej=3Dgli.cas.cz@cse.psu.edu on behalf of erik = quanstrom Sent: Fri 3/30/2007 3:44 PM To: 9fans@cse.psu.edu Subject: Re: [9fans] code inspection needed/appreciated =20 could you please explain this code a bit futher. i'm not sure i = understand what it's supposed to do and how it would be used. - erik > Hello all! >=20 > =20 >=20 > I have put a simple code that is intended to manipulate individual RGB = pixels, on: >=20 > /n/sources/contrib/pac/sys/src/cmd/img/rgb.c >=20 > If anyone has time and is willing to help me, I would appreciate = inspecting the code and telling me your comments!! >=20 > Thank you, >=20 > have a great weekend, ------_=_NextPart_001_01C77500.FA80F675 Content-Type: application/ms-tnef; name="winmail.dat" Content-Transfer-Encoding: base64 eJ8+IggIAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA4gQAAAAAAADmAAEIgAcAGAAAAElQTS5NaWNy b3NvZnQgTWFpbC5Ob3RlADEIAQ2ABAACAAAAAgACAAEEgAEALwAAAFJFOiBbOWZhbnNdIGNvZGUg aW5zcGVjdGlvbiBuZWVkZWQvYXBwcmVjaWF0ZWQA1xABBYADAA4AAADXBwQAAgAKAB0ABgABABIB ASCAAwAOAAAA1wcEAAIACgAdAAYAAQASAQEJgAEAIQAAAEVBQkRGRTBCN0Y4NUM2NEQ4QzFFQTM3 NzA0NzM4ODMxAFkHAQOQBgDkDQAAOQAAAAMAJgAAAAAAAwA2AAAAAABAADkAdfaA+gB1xwEeAD0A AQAAAAUAAABSRTogAAAAAAIBRwABAAAAMgAAAGM9dXM7YT0gO3A9QXJlYWwgU3VjaGRvbDtsPVhN QUlMLTA3MDQwMjA4MjkwNlotODYAAAAeAEkAAQAAAC8AAABSZTogWzlmYW5zXSBjb2RlIGluc3Bl Y3Rpb24gbmVlZGVkL2FwcHJlY2lhdGVkAABAAE4AALgcgtFyxwEeAFoAAQAAACkAAAA5ZmFucy1i b3VuY2VzK2Nlaj1nbGkuY2FzLmN6QGNzZS5wc3UuZWR1AAAAAAIBWwABAAAAbwAAAAAAAACBKx+k vqMQGZ1uAN0BD1QCAAAAADlmYW5zLWJvdW5jZXMrY2VqPWdsaS5jYXMuY3pAY3NlLnBzdS5lZHUA U01UUAA5ZmFucy1ib3VuY2VzK2Nlaj1nbGkuY2FzLmN6QGNzZS5wc3UuZWR1AAACAVwAAQAAAC4A AABTTVRQOjlGQU5TLUJPVU5DRVMrQ0VKPUdMSS5DQVMuQ1pAQ1NFLlBTVS5FRFUAAAAeAF0AAQAA AA8AAABlcmlrIHF1YW5zdHJvbQAAAgFeAAEAAAB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AsA9hAAAAAAQAAHME6XHXP+dMcBQAAIMMl/ivoAdccBAwDeP69vAAADAPE/CQQAAB4A +D8BAAAAEQAAAMhlamNoYW4gUGV0ciBHRU8AAAAAAgH5PwEAAABkAAAAAAAAANynQMjAQhAatLkI ACsv4YIBAAAAAAAAAC9PPUFSRUFMIFNVQ0hET0wvT1U9RklSU1QgQURNSU5JU1RSQVRJVkUgR1JP VVAvQ049UkVDSVBJRU5UUy9DTj1DRUpDSEFOAB4A+j8BAAAAFQAAAFN5c3RlbSBBZG1pbmlzdHJh dG9yAAAAAAIB+z8BAAAAHgAAAAAAAADcp0DIwEIQGrS5CAArL+GCAQAAAAAAAAAuAAAAAwD9P+IE AAADABlAAAAAAAMAGkAAAAAAAwAdQAAAAAADAB5AAAAAAB4AMEABAAAACAAAAENFSkNIQU4AHgAx QAEAAAAIAAAAQ0VKQ0hBTgAeADJAAQAAACkAAAA5ZmFucy1ib3VuY2VzK2Nlaj1nbGkuY2FzLmN6 QGNzZS5wc3UuZWR1AAAAAB4AM0ABAAAAFAAAAHF1YW5zdHJvQGNvcmFpZC5jb20AHgA4QAEAAAAI AAAAQ0VKQ0hBTgAeADlAAQAAAAIAAAAuAAAAAwB2QP////8LACkAAAAAAAsAIwAAAAAAAwAGEEz/ TPADAAcQGgYAAAMAEBAAAAAAAwAREAAAAAAeAAgQAQAAAGUAAABJVElTSU5URU5ERURUT0JFQUdF TkVSQUxURU1QTEFURUZPUk9QRVJBVElPTlNPTlNJTkdMRVBJWEVMLExJS0UsRUcsUk9UQVRJT05J TlJHQi1TUEFDRUlUU0hPVUxESlVNUFRIAAAAAAIBfwABAAAAPAAAADxBQ0NGMDAzQ0JBM0QwOTQ1 ODIwN0RCMENCODZBRDE3RDQ4MUI0MkBYTUFJTC5hc3VjaC5jYXMuY3o+AA7b ------_=_NextPart_001_01C77500.FA80F675-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: erik quanstrom Date: Mon, 2 Apr 2007 09:18:51 -0400 To: 9fans@cse.psu.edu Subject: RE: [9fans] code inspection needed/appreciated In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 3c2c5332-ead2-11e9-9d60-3106f5b1d025 you may be interested in pico, written by gerald holtzmann in the mid 80s. http://spinroot.com/pico/index.html - erik From mboxrd@z Thu Jan 1 00:00:00 1970 Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: References: <15e34c88856214df634907d08dfc8aa1@coraid.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <12E38AC1-E684-4679-8CCE-5B6342338BD0@telus.net> Content-Transfer-Encoding: 7bit From: Paul Lalonde Subject: Re: [9fans] code inspection needed/appreciated Date: Mon, 2 Apr 2007 08:39:40 -0700 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Topicbox-Message-UUID: 3c308b1e-ead2-11e9-9d60-3106f5b1d025 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 From someone who pushes pixels every day: You almost certainly don't want a pixel-processing framework that breaks things down to pixels! Most interesting operations on images require a neighbourhood of pixels, or even whole-image information. Furthermore, even for those manipulations that don't, a function call per pixel is a huge amount of overhead. Since you mention doing this as a framework, I can only imagine that the compiler wouldn't even get to inline the per-pixel function, making speedy execution impossible. With real-sized images being in the greater than 2kx3k range these days, you're looking at *a lot* of function calls. Instead, I'd advise you look at a channel-based representation: break up RGBA into 4 larger buffers and pass those to your "doSomethingWithImage" function. The addressing requirements are simple and it's easy to address sub-images (call the total width "pitch", and pass that separately from your current "tile" width). And the compiler will have a much easier time unrolling your loops! Paul On 2-Apr-07, at 1:29 AM, wrote: > It is intended to be a general 'template' for operations on single > pixel, like, e.g., rotation in RGB-space. It should jump the pixels > and feed its RGB(A) values to the function doSomethingWithPixel(). > I would like to (re)write some image manipulation functions, like > color balance, gamma, ... > from NetPBM, and from elsewhere, to native 9 code working on 9 images. > I suffer from being a self-made-man in computing, and of course, > from a lack of spare time, as everybody today. Although I did some > APE&native ports of my favourite programs, I love plan 9 so much > that I want to rewrite some of them in a clean way. > I have much to do with digital imaging, either at work, or as a > hobby. I must e3mphasize here that I dont like the paradigm of > 'applications' -- user intensive programs, so I'd like to follow > the UNIX/Plan9 paradigm of well-tuned single-purpose programs > working together glued via a rc script, if I got it right. > Thus, any helping hand ismuch appreciated. Hopefully, one day I'll > do rm -fr /n/linux, as i did it with Windoze several years ago. > > Back to the question: for the time being, the 'rgb.c' program, > after defining the 'do Something...() function to do nothing, > should write exactly the same image out, as was the one on the input. > > Thanks for your care, > have a great day, > > ++pac. > > > > -----Original Message----- > From: 9fans-bounces+cej=gli.cas.cz@cse.psu.edu on behalf of erik > quanstrom > Sent: Fri 3/30/2007 3:44 PM > To: 9fans@cse.psu.edu > Subject: Re: [9fans] code inspection needed/appreciated > > could you please explain this code a bit futher. i'm not sure i > understand > what it's supposed to do and how it would be used. > > - erik > >> Hello all! >> >> >> >> I have put a simple code that is intended to manipulate individual >> RGB pixels, on: >> >> /n/sources/contrib/pac/sys/src/cmd/img/rgb.c >> >> If anyone has time and is willing to help me, I would appreciate >> inspecting the code and telling me your comments!! >> >> Thank you, >> >> have a great weekend, > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin) iD8DBQFGESO8pJeHo/Fbu1wRAnuWAJ42N/vVCK18KwDJRReXlJqCAaKieQCfT+oU kPbGUyB6lizaknGZ9B1LEgE= =fClE -----END PGP SIGNATURE----- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <3c1e4f4c0ed582eb87aabae2d1ca2ac7@quintile.net> From: "Steve Simon" Date: Mon, 2 Apr 2007 19:06:20 +0100 To: 9fans@cse.psu.edu Subject: Re: [9fans] code inspection needed/appreciated In-Reply-To: <12E38AC1-E684-4679-8CCE-5B6342338BD0@telus.net> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Topicbox-Message-UUID: 3c34c68e-ead2-11e9-9d60-3106f5b1d025 > Instead, I'd advise you look at a channel-based representation: break =20 > up RGBA into 4 larger buffers and pass those to your =20 > "doSomethingWithImage" function.=20 Mmm, I agree, however I would add that the ideal data format depends on t= he operation being performed and the data source format. Its not a simple pr= oblem. My personal interest is in video and so I am hot on image processing code which makes no assumptions about how many frames there are - it could eve= n be could be infinite (resample /dev/tv | page). Also in video many image processing algrorithms require access to temporarly adjacent frames (or f= ields). I put down some thoughts about what I would like to do (but will probably never get time) here: /n/sources/contrib/steve/Blog Please don't think I am telling what you should do, just point you at som= e random thoughts which will probably raise more questions than they solve = =E2=98=BA -Steve