Package java.awt.image

Examples of java.awt.image.LookupOp


                continue;
             
                Color bg = backgroundColors[x][y];
                Color fg = foregroundColors[x][y];

                LookupOp op = setColors(bg, fg);
                BufferedImage img = op.filter(glyphs[chars[x][y]], null);
                offscreenGraphics.drawImage(img, x * charWidth, y * charHeight, null);
               
                oldBackgroundColors[x][y] = backgroundColors[x][y];
              oldForegroundColors[x][y] = foregroundColors[x][y];
              oldChars[x][y] = chars[x][y];
View Full Code Here


                b[i] = fgb;
            }
        }

        short[][] table = {r, g, b, a};
        return new LookupOp(new ShortLookupTable(0, table), null);
    }
View Full Code Here

        for (int j = 0; j < 200; j++) {
            reverse[j] = (byte) (256 - j);
        }

        ByteLookupTable blut = new ByteLookupTable(0, reverse);
        LookupOp lop = new LookupOp(blut, null);
        lop.filter(image, ret);

        return ret;
    }
View Full Code Here

                        invert[j] = (byte)(255-j);
                        ordered[j] = (byte)j;
                    }
                    if (op.equals("lookup1byte")) {
                        ictx.bufImgOp =
                            new LookupOp(new ByteLookupTable(0, invert),
                                         null);
                    } else { // (op.equals("lookup3byte"))
                        byte[][] yellowInvert =
                            new byte[][] { invert, invert, ordered };
                        ictx.bufImgOp =
                            new LookupOp(new ByteLookupTable(0, yellowInvert),
                                         null);
                    }
                } else { // (op.endsWith("short"))
                    short invert[] = new short[256];
                    short ordered[] = new short[256];
                    for (int j = 0; j < 256 ; j++) {
                        invert[j] = (short)((255-j) * 255);
                        ordered[j] = (short)(j * 255);
                    }
                    if (op.equals("lookup1short")) {
                        ictx.bufImgOp =
                            new LookupOp(new ShortLookupTable(0, invert),
                                         null);
                    } else { // (op.equals("lookup3short"))
                        short[][] yellowInvert =
                            new short[][] { invert, invert, ordered };
                        ictx.bufImgOp =
                            new LookupOp(new ShortLookupTable(0, yellowInvert),
                                         null);
                    }
                }
            } else if (op.equals("rescale1band")) {
                ictx.bufImgOp = new RescaleOp(0.5f, 10.0f, null);
View Full Code Here

     */
    public final void test_LookupOp_filter_DifferentDimensionsTest() {
        // regression test for Harmony-1632
        byte[] array0 = new byte[96];
        ByteLookupTable localByteLookupTable = new ByteLookupTable(1, array0);
        LookupOp localLookupOp = new LookupOp(localByteLookupTable, null);

        BufferedImage localBufferedImage = getImage(5069, 19);

        // filter(BI,BI) non-equal widths
        BufferedImage localBufferedImage1 = getImage(6, 19);
        try {
            localLookupOp.filter(localBufferedImage, localBufferedImage1);
            fail("IllegalArgumentException expected!");
        } catch (IllegalArgumentException e) {
            // expected
        }

        // filter(R,WR) non-equal widths

        try {
            localLookupOp.filter(localBufferedImage.getRaster(),
                    localBufferedImage1.getRaster());
            fail("IllegalArgumentException expected!");
        } catch (IllegalArgumentException e) {
            // expected
        }

        // filter(BI,BI) non-equal heights

        localBufferedImage1 = getImage(5069, 5);
        try {
            localLookupOp.filter(localBufferedImage, localBufferedImage1);
            fail("IllegalArgumentException expected!");
        } catch (IllegalArgumentException e) {
            // expected
        }

        // filter(R, WR) non-equal heights
        try {
            localLookupOp.filter(localBufferedImage.getRaster(),
                    localBufferedImage1.getRaster());
            fail("IllegalArgumentException expected!");
        } catch (IllegalArgumentException e) {
            // expected
        }
View Full Code Here

     */
    public final void test_LookupOp_LookupTableRenderingHints_NullLookupTable() {
        // regression test for Harmony-1629
        RenderingHints hints = new RenderingHints(null);
        try {
            LookupOp returnValue = new LookupOp((LookupTable)null, hints);
            fail("NullPointerException expected");
        } catch (NullPointerException npe) {
            // expected
        }
    }
View Full Code Here

        // For what ever reason this makes the Op work correctly.
        // If you remove this, it seems to get the color channels messed
        // up.  The downside is that I suspect that this means we are
        // falling into a more general, and hence slower case, but
        // at least it works....
        operation  =  new LookupOp(new ByteLookupTable(0, tableData), hints)
            { };
    }
View Full Code Here

        // For what ever reason this makes the Op work correctly.
        // If you remove this, it seems to get the color channels messed
        // up.  The downside is that I suspect that this means we are
        // falling into a more general, and hence slower case, but
        // at least it works....
        operation  =  new LookupOp(new ByteLookupTable(0, tableData), hints)
            { };
    }
View Full Code Here

        // For what ever reason this makes the Op work correctly.
        // If you remove this, it seems to get the color channels messed
        // up.  The downside is that I suspect that this means we are
        // falling into a more general, and hence slower case, but
        // at least it works....
        operation  =  new LookupOp(new ByteLookupTable(0, tableData), hints)
            { };
    }
View Full Code Here

        for (int i = 0; i < 256; i++) {
            array[i] = (byte)i;
        }
        ByteLookupTable table = new ByteLookupTable(0, array);

        op = new LookupOp(table, null);
    }
View Full Code Here

TOP

Related Classes of java.awt.image.LookupOp

Copyright © 2018 www.massapicom. 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.