The ScrollViewImageHandler is a helper class which takes care of image processing. It is used to construct an Image from the message-stream and basically consists of a number of utility functions to process the input stream.
- Author
- wanke.nosp@m.@goo.nosp@m.gle.c.nosp@m.om
Definition at line 26 of file SVImageHandler.java.
| static void com.google.scrollview.ui.SVImageHandler.createImage |
( |
String |
name, |
|
|
int |
width, |
|
|
int |
height, |
|
|
int |
bitsPerPixel |
|
) |
| |
|
inlinestatic |
Starts creation of a new image.
Definition at line 146 of file SVImageHandler.java.
152 }
else if (bpp == 8) {
154 }
else if (bpp == 32) {
157 throw new IllegalArgumentException(
158 "bpp should be 1 (binary), 8 (gray) or 32 (argb), is " + bpp);
160 if (imageName != null) {
161 throw new IllegalArgumentException(
"Image " + imageName +
" already opened!");
166 readImageData =
true;
167 SVImageHandler.height = height;
168 SVImageHandler.width = width;
169 pictureArray =
new int[width * height];
172 System.out.println(
"Processing Image with " + bpp +
" bpp, size " + width +
"x" + height);
| static PImage com.google.scrollview.ui.SVImageHandler.getImage |
( |
String |
name | ) |
|
|
inlinestatic |
Find the image corresponding to a given name
Definition at line 189 of file SVImageHandler.java.
190 return images.get(name);
| static int com.google.scrollview.ui.SVImageHandler.getMissingRemainingBytes |
( |
| ) |
|
|
inlinestatic |
Computes how many bytes of the image data are still missing
Definition at line 225 of file SVImageHandler.java.
226 return (height * width * bytePerPixel) - bytesRead;
| static boolean com.google.scrollview.ui.SVImageHandler.getReadImageData |
( |
| ) |
|
|
inlinestatic |
Returns whether we a currently reading image data or not
Definition at line 220 of file SVImageHandler.java.
221 return readImageData;
| static void com.google.scrollview.ui.SVImageHandler.openImage |
( |
String |
location | ) |
|
|
inlinestatic |
Opens an Image from location. This means the image does not have to be actually transfered over the network. Thus, it is a lot faster than using the createImage method.
- Parameters
-
| location | The (local) location from where to open the file. This is also the internal name associated with the image (if you want to draw it). |
Definition at line 183 of file SVImageHandler.java.
184 PImage img =
new PImage(location);
185 images.put(location, img);
| static void com.google.scrollview.ui.SVImageHandler.parseData |
( |
String |
inputLine | ) |
|
|
inlinestatic |
Gets called while currently reading image data. Decides, how to process it (which image type, whether all data is there).
Definition at line 197 of file SVImageHandler.java.
201 data = processBinaryImage(inputLine);
202 }
else if (bpp == 8) {
203 data = processGrayImage(inputLine);
204 }
else if (bpp == 32) {
205 data = process32bppImage(inputLine);
207 System.out.println(
"Unsupported Bit Type: " + bpp);
210 System.arraycopy(data, 0, pictureArray, bytesRead, data.length);
211 bytesRead += data.length;
214 if (bytesRead == (height * width)) {
The documentation for this class was generated from the following file:
- /home/abuild/rpmbuild/BUILD/tesseract-ocr-3.02.02/java/com/google/scrollview/ui/SVImageHandler.java