MCPcopy Index your code
hub / github.com/processing/processing / readBitmap

Method readBitmap

core/src/processing/core/PFont.java:1028–1047  ·  view source on GitHub ↗
(DataInputStream is)

Source from the content-addressed store, hash-verified

1026
1027
1028 protected void readBitmap(DataInputStream is) throws IOException {
1029 image = new PImage(width, height, ALPHA);
1030 int bitmapSize = width * height;
1031
1032 byte[] temp = new byte[bitmapSize];
1033 is.readFully(temp);
1034
1035 // convert the bitmap to an alpha channel
1036 int w = width;
1037 int h = height;
1038 int[] pixels = image.pixels;
1039 for (int y = 0; y < h; y++) {
1040 for (int x = 0; x < w; x++) {
1041 pixels[y * width + x] = temp[y*w + x] & 0xff;
1042// System.out.print((image.pixels[y*64+x] > 128) ? "*" : ".");
1043 }
1044// System.out.println();
1045 }
1046// System.out.println();
1047 }
1048
1049
1050 protected void writeBitmap(DataOutputStream os) throws IOException {

Callers 1

PFontMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected