private void parse_pHYs_chunk(PNGChunk chunk) { int xPixelsPerUnit = chunk.getInt4(0); int yPixelsPerUnit = chunk.getInt4(4); int unitSpecifier = chunk.getInt1(8); if (encodeParam != null) { encodeParam.setPhysicalDimension(xPixelsPerUnit, yPixelsPerUnit, unitSpecifier); } if (emitProperties) { properties.put("x_pixels_per_unit", new Integer(xPixelsPerUnit)); properties.put("y_pixels_per_unit", new Integer(yPixelsPerUnit)); properties.put("pixel_aspect_ratio", new Float((float)xPixelsPerUnit/yPixelsPerUnit)); if (unitSpecifier == 1) { properties.put("pixel_units", "Meters"); } else if (unitSpecifier != 0) { // Error -- unit specifier must be 0 or 1 String msg = PropertyUtil.getString("PNGImageDecoder12"); throw new RuntimeException(msg); } } }
private void parse_cHRM_chunk(PNGChunk chunk) { // If an sRGB chunk exists, ignore cHRM chunks if (sRGBRenderingIntent != -1) { return; } chromaticity = new float[8]; chromaticity[0] = chunk.getInt4(0)/100000.0F; chromaticity[1] = chunk.getInt4(4)/100000.0F; chromaticity[2] = chunk.getInt4(8)/100000.0F; chromaticity[3] = chunk.getInt4(12)/100000.0F; chromaticity[4] = chunk.getInt4(16)/100000.0F; chromaticity[5] = chunk.getInt4(20)/100000.0F; chromaticity[6] = chunk.getInt4(24)/100000.0F; chromaticity[7] = chunk.getInt4(28)/100000.0F; if (encodeParam != null) { encodeParam.setChromaticity(chromaticity); } if (emitProperties) { properties.put("white_point_x", new Float(chromaticity[0])); properties.put("white_point_y", new Float(chromaticity[1])); properties.put("red_x", new Float(chromaticity[2])); properties.put("red_y", new Float(chromaticity[3])); properties.put("green_x", new Float(chromaticity[4])); properties.put("green_y", new Float(chromaticity[5])); properties.put("blue_x", new Float(chromaticity[6])); properties.put("blue_y", new Float(chromaticity[7])); } }
private void parse_pHYs_chunk(PNGChunk chunk) { int xPixelsPerUnit = chunk.getInt4(0); int yPixelsPerUnit = chunk.getInt4(4); int unitSpecifier = chunk.getInt1(8); if (encodeParam != null) { encodeParam.setPhysicalDimension(xPixelsPerUnit, yPixelsPerUnit, unitSpecifier); } if (emitProperties) { properties.put("x_pixels_per_unit", new Integer(xPixelsPerUnit)); properties.put("y_pixels_per_unit", new Integer(yPixelsPerUnit)); properties.put("pixel_aspect_ratio", new Float((float)xPixelsPerUnit/yPixelsPerUnit)); if (unitSpecifier == 1) { properties.put("pixel_units", "Meters"); } else if (unitSpecifier != 0) { // Error -- unit specifier must be 0 or 1 String msg = PropertyUtil.getString("PNGImageDecoder12"); throw new RuntimeException(msg); } } }
private void parse_cHRM_chunk(PNGChunk chunk) { // If an sRGB chunk exists, ignore cHRM chunks if (sRGBRenderingIntent != -1) { return; } chromaticity = new float[8]; chromaticity[0] = chunk.getInt4(0)/100000.0F; chromaticity[1] = chunk.getInt4(4)/100000.0F; chromaticity[2] = chunk.getInt4(8)/100000.0F; chromaticity[3] = chunk.getInt4(12)/100000.0F; chromaticity[4] = chunk.getInt4(16)/100000.0F; chromaticity[5] = chunk.getInt4(20)/100000.0F; chromaticity[6] = chunk.getInt4(24)/100000.0F; chromaticity[7] = chunk.getInt4(28)/100000.0F; if (encodeParam != null) { encodeParam.setChromaticity(chromaticity); } if (emitProperties) { properties.put("white_point_x", new Float(chromaticity[0])); properties.put("white_point_y", new Float(chromaticity[1])); properties.put("red_x", new Float(chromaticity[2])); properties.put("red_y", new Float(chromaticity[3])); properties.put("green_x", new Float(chromaticity[4])); properties.put("green_y", new Float(chromaticity[5])); properties.put("blue_x", new Float(chromaticity[6])); properties.put("blue_y", new Float(chromaticity[7])); } }
private void parse_cHRM_chunk(PNGChunk chunk) { // If an sRGB chunk exists, ignore cHRM chunks if (sRGBRenderingIntent != -1) { return; } chromaticity = new float[8]; chromaticity[0] = chunk.getInt4(0)/100000.0F; chromaticity[1] = chunk.getInt4(4)/100000.0F; chromaticity[2] = chunk.getInt4(8)/100000.0F; chromaticity[3] = chunk.getInt4(12)/100000.0F; chromaticity[4] = chunk.getInt4(16)/100000.0F; chromaticity[5] = chunk.getInt4(20)/100000.0F; chromaticity[6] = chunk.getInt4(24)/100000.0F; chromaticity[7] = chunk.getInt4(28)/100000.0F; if (encodeParam != null) { encodeParam.setChromaticity(chromaticity); } if (emitProperties) { properties.put("white_point_x", chromaticity[0]); properties.put("white_point_y", chromaticity[1]); properties.put("red_x", chromaticity[2]); properties.put("red_y", chromaticity[3]); properties.put("green_x", chromaticity[4]); properties.put("green_y", chromaticity[5]); properties.put("blue_x", chromaticity[6]); properties.put("blue_y", chromaticity[7]); } }
private void parse_cHRM_chunk(PNGChunk chunk) { // If an sRGB chunk exists, ignore cHRM chunks if (sRGBRenderingIntent != -1) { return; } chromaticity = new float[8]; chromaticity[0] = chunk.getInt4(0)/100000.0F; chromaticity[1] = chunk.getInt4(4)/100000.0F; chromaticity[2] = chunk.getInt4(8)/100000.0F; chromaticity[3] = chunk.getInt4(12)/100000.0F; chromaticity[4] = chunk.getInt4(16)/100000.0F; chromaticity[5] = chunk.getInt4(20)/100000.0F; chromaticity[6] = chunk.getInt4(24)/100000.0F; chromaticity[7] = chunk.getInt4(28)/100000.0F; if (encodeParam != null) { encodeParam.setChromaticity(chromaticity); } if (emitProperties) { properties.put("white_point_x", chromaticity[0]); properties.put("white_point_y", chromaticity[1]); properties.put("red_x", chromaticity[2]); properties.put("red_y", chromaticity[3]); properties.put("green_x", chromaticity[4]); properties.put("green_y", chromaticity[5]); properties.put("blue_x", chromaticity[6]); properties.put("blue_y", chromaticity[7]); } }
private void parse_pHYs_chunk(PNGChunk chunk) { int xPixelsPerUnit = chunk.getInt4(0); int yPixelsPerUnit = chunk.getInt4(4); int unitSpecifier = chunk.getInt1(8); if (encodeParam != null) { encodeParam.setPhysicalDimension(xPixelsPerUnit, yPixelsPerUnit, unitSpecifier); } if (emitProperties) { properties.put("x_pixels_per_unit", xPixelsPerUnit); properties.put("y_pixels_per_unit", yPixelsPerUnit); properties.put("pixel_aspect_ratio", (float) xPixelsPerUnit / yPixelsPerUnit); if (unitSpecifier == 1) { properties.put("pixel_units", "Meters"); } else if (unitSpecifier != 0) { // Error -- unit specifier must be 0 or 1 String msg = PropertyUtil.getString("PNGImageDecoder12"); throw new RuntimeException(msg); } } }
private void parse_pHYs_chunk(PNGChunk chunk) { int xPixelsPerUnit = chunk.getInt4(0); int yPixelsPerUnit = chunk.getInt4(4); int unitSpecifier = chunk.getInt1(8); if (encodeParam != null) { encodeParam.setPhysicalDimension(xPixelsPerUnit, yPixelsPerUnit, unitSpecifier); } if (emitProperties) { properties.put("x_pixels_per_unit", xPixelsPerUnit); properties.put("y_pixels_per_unit", yPixelsPerUnit); properties.put("pixel_aspect_ratio", (float) xPixelsPerUnit / yPixelsPerUnit); if (unitSpecifier == 1) { properties.put("pixel_units", "Meters"); } else if (unitSpecifier != 0) { // Error -- unit specifier must be 0 or 1 String msg = PropertyUtil.getString("PNGImageDecoder12"); throw new RuntimeException(msg); } } }
private void parse_gAMA_chunk(PNGChunk chunk) { // If an sRGB chunk exists, ignore gAMA chunks if (sRGBRenderingIntent != -1) { return; } fileGamma = chunk.getInt4(0)/100000.0F; // System.out.println("Gamma: " + fileGamma); float exp = performGammaCorrection ? displayExponent/userExponent : 1.0F; if (encodeParam != null) { encodeParam.setGamma(fileGamma*exp); } if (emitProperties) { properties.put("gamma", fileGamma * exp); } }
private void parse_gAMA_chunk(PNGChunk chunk) { // If an sRGB chunk exists, ignore gAMA chunks if (sRGBRenderingIntent != -1) { return; } fileGamma = chunk.getInt4(0)/100000.0F; // System.out.println("Gamma: " + fileGamma); float exp = performGammaCorrection ? displayExponent/userExponent : 1.0F; if (encodeParam != null) { encodeParam.setGamma(fileGamma*exp); } if (emitProperties) { properties.put("gamma", fileGamma * exp); } }
private void parse_gAMA_chunk(PNGChunk chunk) { // If an sRGB chunk exists, ignore gAMA chunks if (sRGBRenderingIntent != -1) { return; } fileGamma = chunk.getInt4(0)/100000.0F; // System.out.println("Gamma: " + fileGamma); float exp = performGammaCorrection ? displayExponent/userExponent : 1.0F; if (encodeParam != null) { encodeParam.setGamma(fileGamma*exp); } if (emitProperties) { properties.put("gamma", new Float(fileGamma*exp)); } }
private void parse_gAMA_chunk(PNGChunk chunk) { // If an sRGB chunk exists, ignore gAMA chunks if (sRGBRenderingIntent != -1) { return; } fileGamma = chunk.getInt4(0)/100000.0F; // System.out.println("Gamma: " + fileGamma); float exp = performGammaCorrection ? displayExponent/userExponent : 1.0F; if (encodeParam != null) { encodeParam.setGamma(fileGamma*exp); } if (emitProperties) { properties.put("gamma", new Float(fileGamma*exp)); } }