Examples of RGBImage


Examples of com.sun.dtv.lwuit.RGBImage

            if(getSource().getParent() != null){
                getSource().getComponentForm().paintComponent(g);
            }
            //getSource().paintBackgrounds(g);
            paint(g, getDestination(), 0, 0);
            rgbBuffer = new RGBImage(buffer.getRGB(), buffer.getWidth(), buffer.getHeight());
           
            paint(g, getSource(), 0, 0);
            g.translate(source.getAbsoluteX(), source.getAbsoluteY());
           
        } else {
View Full Code Here

Examples of com.sun.dtv.lwuit.RGBImage

                    for(int iter = 0 ; iter < rgb.length ; iter++) {
                        if(rgb[iter] == transColor) {
                            imageRGB[iter] = 0;
                        }
                    }
                    g.drawImage(new RGBImage(imageRGB, width, height), x, y);
                } else {
                    int foreground = g.getColor();
                    if(c.hasFocus()) {
                        g.setColor(s.getBgSelectionColor());
                    } else {
                        g.setColor(s.getBgColor());
                    }

                    // Its opaque much easier job!
                    if(s.getBgTransparency() == ((byte)0xff)) {
                        g.fillRoundRect(x, y , width, height, arcWidth, arcHeight);
                    } else {
                        // if its transparent we don't need to do anything, if its
                        // translucent... well....
                        if(s.getBgTransparency() != 0) {
                            Image i = Image.createImage(width, height);
                            int[] imageRgb;
                            if(g.getColor() != 0xffffff) {
                                Graphics imageG = i.getGraphics();
                                imageG.setColor(g.getColor());
                                imageG.fillRoundRect(0, 0 , width, height, arcWidth, arcHeight);
                                imageRgb = i.getRGB();
                            } else {
                                // background color is white we need to remove a different color
                                // black is the only other "reliable" color on the device
                                Graphics imageG = i.getGraphics();
                                imageG.setColor(0);
                                imageG.fillRect(0, 0, width, height);
                                imageG.setColor(g.getColor());
                                imageG.fillRoundRect(0, 0 , width, height, arcWidth, arcHeight);
                                imageRgb = i.getRGB();
                            }
                            int removeColor = imageRgb[0];
                            int size = width * height;
                            int alphaInt = ((s.getBgTransparency() & 0xff) << 24) & 0xff000000;
                            for(int iter = 0 ; iter < size ; iter++) {
                                if(removeColor == imageRgb[iter]) {
                                        imageRgb[iter] = 0;
                                        continue;
                                }
                                if((imageRgb[iter] & 0xff000000) != 0) {
                                    imageRgb[iter] = (imageRgb[iter] & 0xffffff) | alphaInt;
                                }  
                            }
                            g.drawImage(new RGBImage(imageRgb, width, height), x, y);
                        }
                    }
                   
                    g.setColor(foreground);
                }
View Full Code Here

Examples of com.sun.dtv.lwuit.RGBImage

        int w = source.getWidth();
        int h = source.getHeight();
        int mirrorHeight = h  / 2 * w;
       
        // create an array big enough to hold the mirror data
        RGBImage rgbImg = new RGBImage(new int[w * h + mirrorHeight], w, h + h / 2);
        source.toRGB(rgbImg, 0, 0, 0, 0, w, h);
        int[] imageData = rgbImg.getRGB();
       
        for(int iter = 0 ; iter < mirrorHeight ; iter++) {
            int sourcePos = w * h - iter - 1;
            int off = iter % w;
            off = w - off + iter - off;
View Full Code Here

Examples of jjil.core.RgbImage

   * @return RgbImage initialized with the image from the camera.
   */
    static public RgbImage toRgbImage(Bitmap bmp) {
      int nWidth = bmp.getWidth();
      int nHeight = bmp.getHeight();
      RgbImage rgb = new RgbImage(nWidth, nHeight);
      bmp.getPixels(rgb.getData(), 0, nWidth, 0, 0, nWidth, nHeight);
      return rgb;
    }
View Full Code Here

Examples of jjil.core.RgbImage

      @SuppressWarnings("unchecked")
      public void setProperties(Hashtable props) {
       
      }
      public  void setDimensions(int nWidth, int nHeight) {
        this.rgb = new RgbImage(nWidth, nHeight);
      }
      public void imageComplete(int status) {
        this.bComplete = true;
        this.ip.removeConsumer(this);
      }
View Full Code Here

Examples of jjil.core.RgbImage

                    GrayShrink gs = new GrayShrink(nTargetWidth, nTargetHeight);
                    gs.Push(imMask);
                    imMask = (Gray8Image) gs.Front();
                    // combine the gray image and the mask to make a displayable image
                    ApplyMaskRgb am = new ApplyMaskRgb();
                    RgbImage rgb = am.Push((RgbImage)rs.Front(), imMask);
                    g.drawARGB(0, 0, 255, 0); // green
                    g.drawBitmap(
                            RgbImageAndroid.toBitmap(rgb),
                            new Rect(0, 0, rgb.getWidth(), rgb.getHeight()),
                            new Rect(
                                (g.getBitmapWidth() - rgb.getWidth())/2,
                                (g.getBitmapHeight() - rgb.getHeight())/2,
                                rgb.getWidth(),
                                rgb.getHeight()),
                            new Paint());
                } else {
                    RgbImage rgb = (RgbImage) rs.Front();
                    g.drawARGB(0, 255, 0, 0); // red
                    g.drawBitmap(
                            RgbImageAndroid.toBitmap(rgb),
                            new Rect(0, 0, rgb.getWidth(), rgb.getHeight()),
                            new Rect(
                                (g.getBitmapWidth() - rgb.getWidth())/2,
                                (g.getBitmapHeight() - rgb.getHeight())/2,
                                rgb.getWidth(),
                                rgb.getHeight()),
                            new Paint());
                }
             }
        }
    }
View Full Code Here

Examples of jjil.core.RgbImage

                    GrayShrink gs = new GrayShrink(nTargetWidth, nTargetHeight);
                    gs.push(imMask);
                    imMask = (Gray8Image) gs.getFront();
                    // combine the gray image and the mask to make a displayable image
                    ApplyMaskRgb am = new ApplyMaskRgb();
                    RgbImage rgb = am.push((RgbImage)rs.getFront(), imMask);
                    g.setColor(0x0000FF00); // green
                    g.fillRect(
                            g.getClipX(),
                            g.getClipY(),
                            g.getClipWidth(),
                            g.getClipHeight());
                    g.drawImage(
                            RgbImageJ2me.toImage(rgb),
                            g.getClipX() + (g.getClipWidth() - rgb.getWidth())/2,
                            g.getClipY() + (g.getClipHeight() - rgb.getHeight())/2,
                            0);
                } else {
                    RgbImage rgb = (RgbImage) rs.getFront();
                    g.setColor(0x00FF0000); // red
                    g.fillRect(
                            g.getClipX(),
                            g.getClipY(),
                            g.getClipWidth(),
                            g.getClipHeight());
                    g.drawImage(
                            RgbImageJ2me.toImage(rgb),
                            g.getClipX() + (g.getClipWidth() - rgb.getWidth())/2,
                            g.getClipY() + (g.getClipHeight() - rgb.getHeight())/2,
                            0);
                }
             }
        }
    }
View Full Code Here

Examples of jjil.core.RgbImage

     * @param image the javax.microedition.lcdui.Image image
     * @return the RgbImage with the same contents as the javax.microedition.lcdui.Image.
     */
    static public RgbImage toRgbImage(javax.microedition.lcdui.Image image)
    {
        RgbImage rgb = new RgbImage(image.getWidth(), image.getHeight());
        image.getRGB(
                rgb.getData(),
                0,
                rgb.getWidth(),
                0,
                0,
                rgb.getWidth(),
                rgb.getHeight());
        return rgb;
    }
View Full Code Here

Examples of jjil.core.RgbImage

      @SuppressWarnings("unchecked")
      public void setProperties(Hashtable props) {
       
      }
      public  void setDimensions(int nWidth, int nHeight) {
        this.rgb = new RgbImage(nWidth, nHeight);
      }
View Full Code Here

Examples of jjil.core.RgbImage

                    null,
                    null,
                    null);

        } else {
            RgbImage rgbOutput = new RgbImage(
                    this.imLabeled.getWidth(),
                    this.imLabeled.getHeight());
            int[] rgbData = rgbOutput.getData();
            int nMaxLabel = EquivalenceClass.getLabels();
            short[] grayData = this.imLabeled.getData();
            int[] rgbLabels = new int[nMaxLabel + 1];
            for (int i = 0; i < rgbLabels.length; i++) {
                rgbLabels[i] = RgbVal.toRgb(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.