473,569 Members | 3,063 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adjusting brightness in images using JAI lookup tables

Amy
Hi,

I have written a program using JAI for a project I am doing which can
be used to adjust the brightness of an image. It all works fine but I
now need to write it all up and am not entirely sure what it is doing.

The code is below:

public void adjustLight(int ipParam){ // ipParam = 18
pb = new ParameterBlock( );
pb.addSource(im age);
byte lookUpTableData[];
lookUpTableData = new byte[256];
for(int j = 0; j < 256; j++){
lookUpTableData[j] = clampByte(j + ipParam);
}

LookupTableJAI lookUp = new LookupTableJAI( lookUpTableData );
pb.add(lookUp);

image = JAI.create("loo kup", pb, null);
tellObservers() ;
}

private final byte clampByte(int i){
if(i > 255)
return -1;
if(i < 0)
return 0;
else
return (byte)i;
}

I am unsure about what the clampByte method is doing and was a bit
confused by the lookup operation.

If anyone could help I would be very grateful. Thank you.

Amy
Jul 17 '05 #1
0 3058

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
7018
by: Koen | last post by:
Hi all, My application uses a lot of lookup tables. I've splitted the frontend (forms, reports, etc) from the backend (data). The database has around 10 different users. The values in the lookup tables are not likely to change. Question 1: Should I include them in the backend (with rest of data) or the frontend?
5
385
by: Lauren Quantrell | last post by:
I am really stumped on coming up with a good solution for this problem... I have an Access2K continuous form that has an image field. In a SQL Server table of appointments is an integer field named ApptType. That table is joined to the ApptType Field of table also holding an Image field named ApptIcon. When the use propulates the continuos...
3
2910
by: my-wings | last post by:
I've been reading about how evil Lookup fields in tables are, but I've got to be missing something really basic. I know this subject has been covered before, because I've just spent an hour or two reading about it on google, but there is something I still don't understand, and I'm hoping someone will be willing to explain it to me in small...
2
6973
by: Steve | last post by:
I have a project, and would like to support screen brightness up/down in C#, anyone can help me about this issue, I know one possibility is write a driver, and AP through driver to control the H/W. Is anyway can adjust the screen brightness without driver?
3
7314
by: ACaunter | last post by:
Hi there, I was wondering how i could have a slider bar or something on my ASP.Net page to control the image quality.. like change it's sharpness, brightness, and contrast?? is that possible?? thanks -- AdamPC@hotmail.com
7
10831
by: marfi95 | last post by:
I'm trying to implement some code in vb.net to allow the user to adjust the brightness or contrast on an image (through the use of a slider) that is already black & white in the bitmap. I have tried to use the colormatrix and even down to the pixel using GetPixel and SetPixel in system.drawing, but I'm really not up on using gdi+ and...
3
3889
by: bmahussain | last post by:
Anybody having javascript coding for adjusting brightness and contrast of an image using slider control. If yes, then kindly forward the same. regards, hussain.
0
2310
by: kukoc | last post by:
hi im workin for last few days on possibility to modify brightness or contrast in my video player (avi, mpeg, wmv) i was tryin with - DirectX.AudioVideoPlayer - Direct Show and Video Mixing Renderer - Windows Media Player Component in every case im able to play, pouse, stop, mute video and so on. but i stuck with controlling of...
5
13330
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL http://mghospedagem.com/images/controlpanel.jpg instead of http://mghospedagem.comhttp://mghospedagem.com/images/controlpanel.jpg As u see, there's the...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7681
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.