473,511 Members | 17,164 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(image);
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("lookup", 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 3055

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

Similar topics

9
7012
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...
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...
3
2908
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...
2
6967
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...
3
7313
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??...
7
10812
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...
3
3883
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
2300
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...
5
13304
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...
0
7144
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7427
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...
1
7085
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...
0
5671
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4741
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...
0
3227
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...
0
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1577
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.