[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Rendering grayscale on opengl using nsbitmaprep
From: |
AN Indie |
Subject: |
Re: Rendering grayscale on opengl using nsbitmaprep |
Date: |
Thu, 03 Mar 2011 08:37:17 +0530 |
User-agent: |
Opera Mail/11.01 (Linux) |
Hi,
I guess , this is the bug fixed by Wolfgang Lux.
Since I am using ubuntu, I need to wait for new deb package to release.
All my packages are up to date. So please name the particular lib/package
that which he fixed, so that I can get the source code, build it my self
and verify.
My system configuration.
Ubuntu 10.04 LTS - the Lucid Lynx
Pentium 4
#uname -a outputs:
Linux localhost.localdomain 2.6.32-26-generic #48-Ubuntu SMP Wed Nov 24
09:00:03 UTC 2010 i686 GNU/Linux
Packages:
gnustep-base-runtime 1.19.3
gnustep-back0.16-art 0.16.0-3
libtiff4 3.9.2-2
I also attached screen shot of rendered image, which is same as that one
which I got from opengl.
Thank you.
-AN Indie
On Mon, 28 Feb 2011 15:09:04 +0530, Fred Kiefer <fredkiefer@gmx.de> wrote:
Thank you very much for the example. As this reproduces the issue on
your machine without any GL code, I was off with my comments. Sorry for
that. Saturday I was ill, so I stopped coding for GNUstep but thought
that my code review skills would still work. I was wrong.
Now, as for the test, it works perfectly on my machine. See attached
screen shot. This means we must have some differences between our
computers. Could you please provide some details of your setup?
Processor, Operation System and the used GNUstep backend (xlib, art or
cairo)? Perhaps also the version of your tiff library.
There haven't been a lot of changes in the tiff handling of GNUstep gui.
Wolfgang Lux fixed a bug about two months ago, but this only affected
cases where the bits per sample != 8. This isn't the case here after the
conversion.
Fred
Am 27.02.2011 17:28, schrieb AN Indie:
I accept their is mismatch between parameter/arguments. But this code
just works!
[
But good news is, I was able to reproduce the bug in package
gnustep-examples-1.2.0
I modified NSImage test case a little and reproduced this bug!!
I changed
image = [[NSImage alloc] initWithContentsOfFile: file ];
[mview setImage: image];
with
image = [[NSImage alloc] initWithContentsOfFile: file ];
NSImage * aximage = [[NSImage alloc] initWithData:[image
TIFFRepresentationUsingCompression:NSTIFFCompressionNone factor:0]];
[mview setImage: aximage];
An now the gray scale image is not renders properly.
I attached test case along with this mail. Please confirm with latest
GNUstep as I am using the older version.
-Thanks
AN Indie
On Sat, 26 Feb 2011 01:21:36 +0530, Fred Kiefer <fredkiefer@gmx.de>
wrote:
Now having had a short look at your code I am almost sure that my
initial suspicion is correct. You first convert a grey scale image into
an RGB one, that step should work. Next you copy the data of this
converted bitmap into a large data structure where you extended width
and height to the next power of two. Here you have to copy over each
row
separately. (You could save that step by supplying a corresponding
bytesPerRow value into the conversion.) Then you call your
initWithData:... method and hand over an unpackRowLength you computed
from the original data. But you don't use that value instead you use
the
rounded up width (Line 524).
Not that I understand any of the stuff that goes on in this method, but
I am very sure that this is the cause of your trouble.
Cheers
Fred
Am 25.02.2011 19:15, schrieb AN Indie:
On Wed, 23 Feb 2011 15:22:09 +0530, Fred Kiefer <fredkiefer@gmx.de>
wrote:
Sure. I always worried that, it may off the topic here.
Code is already hosted on internet. It is hosted in a public git
repository at github(https://github.com/ANindie/cocos2d-GNUstep).
You can take a quick look on problematic code at
https://github.com/ANindie/cocos2d-GNUstep/blob/85c5097047126107ef225b9025e972b97e60335d/src/cocostep/CCTexture2D.m.
I included th code you pointed here. Also added test case at
https://github.com/ANindie/cocos2d-GNUstep/blob/85c5097047126107ef225b9025e972b97e60335d/src/tests/BasicSpriteTest/BasicSprite.m
-Thanks
Indie AN
Thank you, with that explanation I finally understand where you
trying
to get to. And the code that I pointed you to should work quite well
for
that purpose. My feeling is still that your code that is calling this
has a problem. If you want you can send me the code off line and I
have
a quick look at what may go wrong here.
Fred
Am 23.02.2011 05:21, schrieb Indie AN:
Ok. Let me clear it for once. I am trying to render image using
opengl, that we normally do for games. Opengl do not speak nsimage.
They speak textures . All i needed is magic piece of code that
converts every image to raw rbga or rbg data. In mac they do using
coreimage framework. But its ok. I can live happily without
gray scale images. White image is sufficient. Thanks to everybodies
time.
On 2/16/11, Fred Kiefer <fredkiefer@gmx.de> wrote:
Sorry, I still don't understand your problem. Why are you
converting
the
image? The standard code should work fine in displaying it.
Actually
the
code I pointed you to is used for that.
From your screen shot I would expect that your drawing code uses
the
wrong sizes. To verify this it would help if you sent a bit more of
your
code.
Fred
PS: For drawing pre-multiplied images get used. Better convert in
to
that format. But this is completely unrelated to your problem.
--
iPhone development on Linux! https://github.com/ANindie/cocos2d-GNUstep
Screenshot.png
Description: PNG image
- Re: Rendering grayscale on opengl using nsbitmaprep,
AN Indie <=