473,383 Members | 1,818 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

getData() vs getDataBuffer()

184 100+
Hi,
can anyone please say me the difference between
BufferedImage.getData() and WritableRaster.getDataBuffer()?
In java Api,its mentioned like BufferedImage.getData() ll return one large tile.
wat does it actually mean?please anyone respond to this mail ASAP..
Thanks in Advance.

Thanks & Regards,
Hamsa
Mar 11 '08 #1
2 6518
BigDaddyLH
1,216 Expert 1GB
Hi,
can anyone please say me the difference between
BufferedImage.getData() and WritableRaster.getDataBuffer()?
In java Api,its mentioned like BufferedImage.getData() ll return one large tile.
wat does it actually mean?please anyone respond to this mail ASAP..
Thanks in Advance.

Thanks & Regards,
Hamsa
It helps if you know the basic structure of the classes involved.
  1. BufferedImage has a ColorModel and a WritableRaster.
  2. ColorModel has a ColorSpace.
  3. WritableRaster has a SampleModel and a DataBuffer.
What are the jobs of this classes?
  1. BufferedImage is the top level image class.
  2. ColorModel knows how to translate between pixel data and color components.
  3. ColorSpace describes the collection of possible colors.
  4. WritableRaster represents a rectangular area of pixel data.
  5. SampleModel knows how to extract pixels samples from a DataBuffer.
  6. DataBuffer is a thin wrapper around one or more arrays (usually one) of pixel data.
Now let's look at the methods you mentioned:
Expand|Select|Wrap|Line Numbers
  1. //BufferedImage:
  2. Raster getData()
  3. WritableRaster getRaster()
  4.  
  5. //WriteableRaster/Raster:
  6. DataBuffer getDataBuffer()
Methods getRaster() and getDataBuffer() return the basic components of the respective
objects -- there is no copying involved. Method getData(), as the API makes clear:
The Raster returned is a copy of the image data is not updated if the image is changed.
Now the most important questions:
  1. Why do you ask?
  2. What are you trying to do?
  3. What is your goal?
  4. What about doing this with other sections of the API?
Mar 11 '08 #2
Thanks for clarifying these, I've made a rotating camera stand that shorts the camera every three degrees, so I have about 90 pictures that I want to stitch together. I'm trying to break the photos into arrays of pixels and join them on the overlap using JAI - any advice??
Apr 7 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Andy | last post by:
I'm making a drag and drop application, and in the *_DragDrop(...)-method I have the following code: private void SelectTree_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) {...
2
by: Simon | last post by:
I have done a screen clipping in oneNote and now want to save to file. So I copy the image in oneNote, and then using c# try and getData from the clipboard and store in an image to be able to...
3
by: nAmYzArC | last post by:
Hello every1, I have a "<DIV" tag with contenteditable turned on. I am using this as an area that users can either paste or drag/drop text into. The text can come from other browser windows and of...
11
by: nAmYzArC | last post by:
Hi all, On our site we have a section that allows users to copy and paste or drag and drop the contents of (pretty much any) webpage into a Div. I need to get access to the clipboard data. To do...
4
by: Piotrek | last post by:
Hi all. I am developing some web application in which I use datasets, which were generated using dataSetDesigner. My dataset has a TableAdapter, which has GetData method. Users of my application...
6
by: Screaming Eagles 101 | last post by:
Hi, I got this warning, but I don't have a clue on how to resolve it the best way, maybe one of you can help. Application is running smoothly, it's only a warning, but I'd like to resolve it. ...
2
by: Martin Arvidsson | last post by:
Hi! When you use the wizard to create a connection to a table you automaticly get two methods. Fill and GetData When do you use the GetData method? Thanx
0
by: =?ISO-8859-1?Q?=22Ro=DFert_G=2E_Schaffrath=22?= | last post by:
Sorry for the cross-posting. I am having a hard time trying to classify exactly what group this question would apply to. I had posted an earlier message to...
3
by: jrl | last post by:
I am working with a code snippet from a site (http://www.gridviewguy.com/ArticleDetails.aspx?articleID=176_Sorting_GridView_Manually!) as follows: private void SortGridView(string...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.