main.cpp

来自「In term project, we will take the baseli」· C++ 代码 · 共 41 行

CPP
41
字号
//---------------------------------------------------------------------------
#include <stdio.h>
#include "type.h"
#include "jpeg.h"

JPEG p;

char file_name[32]={0};

int main(void)
{
  
  
  printf("Enter bmp file name ??");
  
  scanf("%s", file_name);
  
  printf("\nRead %s....\n", file_name);

  if( ReadBMP(file_name,&p)==false ){ printf("\nNot find bmp file !!\n"); return 0;}
  
  p.Open("out.jpg","wb");
    printf("\nEncoding....\n");
    p.Encode();
  p.Close();


  p.Open("out.jpg","rb");
    printf("\nDecoding....\n");
    p.Decode();
    
    printf("\nWrite out.jpg to out.bmp....\n");
    WriteBMP("out.bmp",&p);
  p.Close();
  
   
  return 0;
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?