public static String infoFirstLastPixels(ImageLineInt line){
  return line.imgInfo.channels == 1 ? String.format("first=(%d) last=(%d)",line.scanline[0],line.scanline[line.scanline.length - 1]) : String.format("first=(%d %d %d) last=(%d %d %d)",line.scanline[0],line.scanline[1],line.scanline[2],line.scanline[line.scanline.length - line.imgInfo.channels],line.scanline[line.scanline.length - line.imgInfo.channels + 1],line.scanline[line.scanline.length - line.imgInfo.channels + 2]);
}

public static String infoFirstLastPixels ( ImageLineInt line ) { return line . imgInfo . channels == 1 ? String . format ( "first=(%d) last=(%d)" , line . scanline [ 0 ] , line . scanline [ line . scanline . length - 1 ] ) : String . format ( "first=(%d %d %d) last=(%d %d %d)" , line . scanline [ 0 ] , line . scanline [ 1 ] , line . scanline [ 2 ] , line . scanline [ line . scanline . length - line . imgInfo . channels ] , line . scanline [ line . scanline . length - line . imgInfo . channels + 1 ] , line . scanline [ line . scanline . length - line . imgInfo . channels + 2 ] ) ; }
just for basic info or debugging . shows values for first and last pixel . does not include alpha
