By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,985 Members | 1,712 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,985 IT Pros & Developers. It's quick & easy.

Interactive contrast stretching

P: n/a
Before I ask for help, let me give you my situation, including what I
HAVE been able to do.

I am trying to show an image (large, say the whole screen), and allow
for instantaneous visual results with regards to a lookup table
change. In essence, I am going for an interactive contrast stretch. I
have been able to do this, but only for one band of a 3 band image.
Thus, I have been able to create a byte array of pixels, and by
changing the IndexColorModel for the image, I can update the screen to
display "different" values instantaneously. Like I said, I have only
been able to do this for 8 bit data.

Knowing I can only do this for 8 bit arrays, I created 3 byte arrays
of pixels. Each created image would then have its own IndexColorModel.
However, I have been unsuccessful at taking these 3 created images,
and on-the-fly (with little or no processing) creating one image that
just references its red values from one image, its green values from
theh second image, and its blue values from the third image. I have
resorted to trying to use alpha values and drawing the 3 images one on
top of another. This is not ideal, and does not produce the intended
results.

What I want to do is take a 3 band image (representing RGB) or
essentially an int array, and have an IndexColorModel for each band,
but have the actual image setup to feel like it is based off of 3 byte
arrays. Thus, it looks up the red values in one model, the green in
another, and the blue in another... and also looks up the
corresponding pixels from its 3 RGB components. So, 3 look up tables
consisting of 256 entries each... and only one image...

I feel like I have searched high and far, but have come up with
nothing that helps me with my intentions. The DirectColorModel only
allows me to set color masks... but doesnt give me the luxury of
defining what pixels map to.

Anyway, any help would be greatly appreciated.
Thanks.
-Tom
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.