• Home
  • Raw
  • Download

Lines Matching refs:fout

207 int WebPWritePNG(FILE* fout, const WebPDecBuffer* const buffer) {  in WebPWritePNG()  argument
208 if (fout == NULL || buffer == NULL) return 0; in WebPWritePNG()
220 static int WritePPMPAM(FILE* fout, const WebPDecBuffer* const buffer, in WritePPMPAM() argument
222 if (fout == NULL || buffer == NULL) { in WritePPMPAM()
235 fprintf(fout, "P7\nWIDTH %u\nHEIGHT %u\nDEPTH 4\nMAXVAL 255\n" in WritePPMPAM()
238 fprintf(fout, "P6\n%u %u\n255\n", width, height); in WritePPMPAM()
241 if (fwrite(row, width, bytes_per_px, fout) != bytes_per_px) { in WritePPMPAM()
250 int WebPWritePPM(FILE* fout, const WebPDecBuffer* const buffer) { in WebPWritePPM() argument
251 return WritePPMPAM(fout, buffer, 0); in WebPWritePPM()
254 int WebPWritePAM(FILE* fout, const WebPDecBuffer* const buffer) { in WebPWritePAM() argument
255 return WritePPMPAM(fout, buffer, 1); in WebPWritePAM()
262 int WebPWrite16bAsPGM(FILE* fout, const WebPDecBuffer* const buffer) { in WebPWrite16bAsPGM() argument
270 if (fout == NULL || buffer == NULL || rgba == NULL) return 0; in WebPWrite16bAsPGM()
272 fprintf(fout, "P5\n%u %u\n255\n", width * bytes_per_px, height); in WebPWrite16bAsPGM()
274 if (fwrite(rgba, width, bytes_per_px, fout) != bytes_per_px) { in WebPWrite16bAsPGM()
297 int WebPWriteBMP(FILE* fout, const WebPDecBuffer* const buffer) { in WebPWriteBMP() argument
313 if (fout == NULL || buffer == NULL || rgba == NULL) return 0; in WebPWriteBMP()
342 if (fwrite(bmp_header, header_size, 1, fout) != 1) { in WebPWriteBMP()
349 if (fwrite(src, line_size, 1, fout) != 1) { in WebPWriteBMP()
355 if (fwrite(zeroes, bmp_stride - line_size, 1, fout) != 1) { in WebPWriteBMP()
374 int WebPWriteTIFF(FILE* fout, const WebPDecBuffer* const buffer) { in WebPWriteTIFF() argument
419 if (fout == NULL || buffer == NULL || rgba == NULL) return 0; in WebPWriteTIFF()
429 if (fwrite(tiff_header, sizeof(tiff_header), 1, fout) != 1) { in WebPWriteTIFF()
434 if (fwrite(rgba, bytes_per_px, width, fout) != width) { in WebPWriteTIFF()
451 int WebPWriteAlphaPlane(FILE* fout, const WebPDecBuffer* const buffer) { in WebPWriteAlphaPlane() argument
452 if (fout == NULL || buffer == NULL) { in WebPWriteAlphaPlane()
463 fprintf(fout, "P5\n%u %u\n255\n", width, height); in WebPWriteAlphaPlane()
465 if (fwrite(a, width, 1, fout) != 1) return 0; in WebPWriteAlphaPlane()
475 int WebPWritePGM(FILE* fout, const WebPDecBuffer* const buffer) { in WebPWritePGM() argument
476 if (fout == NULL || buffer == NULL) { in WebPWritePGM()
494 fprintf(fout, "P5\n%d %d\n255\n", in WebPWritePGM()
497 ok &= (fwrite(src_y, width, 1, fout) == 1); in WebPWritePGM()
498 if (width & 1) fputc(0, fout); // padding byte in WebPWritePGM()
502 ok &= (fwrite(src_u, uv_width, 1, fout) == 1); in WebPWritePGM()
503 ok &= (fwrite(src_v, uv_width, 1, fout) == 1); in WebPWritePGM()
508 ok &= (fwrite(src_a, width, 1, fout) == 1); in WebPWritePGM()
509 if (width & 1) fputc(0, fout); // padding byte in WebPWritePGM()
519 int WebPWriteYUV(FILE* fout, const WebPDecBuffer* const buffer) { in WebPWriteYUV() argument
520 if (fout == NULL || buffer == NULL) { in WebPWriteYUV()
539 ok &= (fwrite(src_y, width, 1, fout) == 1); in WebPWriteYUV()
543 ok &= (fwrite(src_u, uv_width, 1, fout) == 1); in WebPWriteYUV()
547 ok &= (fwrite(src_v, uv_width, 1, fout) == 1); in WebPWriteYUV()
551 ok &= (fwrite(src_a, width, 1, fout) == 1); in WebPWriteYUV()
564 FILE* fout = NULL; in WebPSaveImage() local
577 fout = use_stdout ? ImgIoUtilSetBinaryMode(stdout) in WebPSaveImage()
579 if (fout == NULL) { in WebPSaveImage()
592 ok &= WebPWritePNG(fout, buffer); in WebPSaveImage()
595 ok &= WebPWritePAM(fout, buffer); in WebPSaveImage()
597 ok &= WebPWritePPM(fout, buffer); in WebPSaveImage()
599 ok &= WebPWrite16bAsPGM(fout, buffer); in WebPSaveImage()
601 ok &= WebPWriteBMP(fout, buffer); in WebPSaveImage()
603 ok &= WebPWriteTIFF(fout, buffer); in WebPSaveImage()
605 ok &= WebPWriteYUV(fout, buffer); in WebPSaveImage()
607 ok &= WebPWritePGM(fout, buffer); in WebPSaveImage()
609 ok &= WebPWriteAlphaPlane(fout, buffer); in WebPSaveImage()
611 if (fout != NULL && fout != stdout) { in WebPSaveImage()
612 fclose(fout); in WebPSaveImage()