Home | History | Annotate | Download | only in optimize

Lines Matching refs:image

44 import com.jme3.texture.Image;
45 import com.jme3.texture.Image.Format;
65 * image data is stored in a byte array for each map name. Later each map can be retrieved as
231 private boolean addImage(Image image, String name, String mapName, String sourceTextureName) {
244 drawImage(image, location.getX(), location.getY(), mapName);
251 Node node = root.insert(image);
261 } else if (location.width != image.getWidth() || location.height != image.getHeight()) {
267 drawImage(image, location.getX(), location.getY(), mapName);
271 private void drawImage(Image source, int x, int y, String mapName) {
275 byte[] image = images.get(mapName);
276 if (image == null) {
277 image = new byte[atlasWidth * atlasHeight * 4];
278 images.put(mapName, image);
284 Image newImage = null;
290 image[i] = sourceData.get(j); //a
291 image[i + 1] = sourceData.get(j + 1); //b
292 image[i + 2] = sourceData.get(j + 2); //g
293 image[i + 3] = sourceData.get(j + 3); //r
296 image[i] = 1; //a
297 image[i + 1] = sourceData.get(j); //b
298 image[i + 2] = sourceData.get(j + 1); //g
299 image[i + 3] = sourceData.get(j + 2); //r
302 image[i] = 1; //a
303 image[i + 1] = sourceData.get(j + 2); //b
304 image[i + 2] = sourceData.get(j + 1); //g
305 image[i + 3] = sourceData.get(j); //r
308 image[i] = sourceData.get(j + 3); //a
309 image[i + 1] = sourceData.get(j + 2); //b
310 image[i + 2] = sourceData.get(j + 1); //g
311 image[i + 3] = sourceData.get(j); //r
314 image[i] = 1; //a
315 image[i + 1] = sourceData.get(j); //b
316 image[i + 2] = sourceData.get(j); //g
317 image[i + 3] = sourceData.get(j); //r
320 image[i] = sourceData.get(j + 1); //a
321 image[i + 1] = sourceData.get(j); //b
322 image[i + 2] = sourceData.get(j); //g
323 image[i + 3] = sourceData.get(j); //r
332 image[i] = sourceData.get(j); //a
333 image[i + 1] = sourceData.get(j + 1); //b
334 image[i + 2] = sourceData.get(j + 2); //g
335 image[i + 3] = sourceData.get(j + 3); //r
347 private Image convertImageToAwt(Image source) {
354 Image newImage = new Image(format, source.getWidth(), source.getHeight(), BufferUtils.createByteBuffer(source.getWidth() * source.getHeight() * 4));
355 clazz.getMethod("convert", Image.class, Image.class).invoke(clazz.newInstance(), source, newImage);
399 byte[] image = images.get(mapName);
400 if (image != null) {
401 Texture2D tex = new Texture2D(new Image(format, atlasWidth, atlasHeight, BufferUtils.createByteBuffer(image)));
577 public Node insert(Image image) {
579 Node newNode = child[0].insert(image);
585 return child[1].insert(image);
591 if (image.getWidth() > location.getWidth() || image.getHeight() > location.getHeight()) {
595 if (image.getWidth() == location.getWidth() && image.getHeight() == location.getHeight()) {
600 int dw = location.getWidth() - image.getWidth();
601 int dh = location.getHeight() - image.getHeight();
604 child[0] = new Node(location.getX(), location.getY(), image.getWidth(), location.getHeight());
605 child[1] = new Node(location.getX() + image.getWidth(), location.getY(), location.getWidth() - image.getWidth(), location.getHeight());
607 child[0] = new Node(location.getX(), location.getY(), location.getWidth(), image.getHeight());
608 child[1] = new Node(location.getX(), location.getY() + image.getHeight(), location.getWidth(), location.getHeight() - image.getHeight());
611 return child[0].insert(image);