📄 imctojpg.cpp
字号:
//#include "imctojpg.h"
//#include <fstream>
//#include <iostream>
//using namespace std;
//
//int converted(int t)
// {
// int q;
// q=((t>>24)&0xff|(t<<24)|(t>>8)&0xff00|(t<<8)&0xff0000);
// return(q);
// }
//short converted(short t)
// {
// short q;
// q=((t>>8)&0xff|(t<<8));
// return(q);
// }
//void itoj(char * p_Xaddress,char* p_Caddress)
//{
// fstream binfile,boutfile;
// fstream binfilewrite;
// binfile.open(p_Xaddress,ios::binary|ios::in);
// boutfile.open(p_Caddress,ios::binary|ios::in);
// short int sn_Layers;
// int n_Begin=1;
// int n_Jpgs;
// int n_Distance;
// int n_Bytes;
// int n_Countjpgs=0;
// binfile.seekg(8,ios::beg);
// binfile.read((char*)&sn_Layers,2);//总的分层级别数
// sn_Layers=converted(sn_Layers);
// binfile.seekg(138,ios::beg);
// for(int i=0;i<sn_Layers;i++)//每一级来读
// {
// binfile.read ((char*)& n_Jpgs,4);//每个级别的分块数
// n_Jpgs=converted(n_Jpgs);
// binfile.seekg(4,ios::cur);
// binfile.read ((char*)&n_Distance,4);//每个级别的起始偏移量
// n_Distance=converted(n_Distance);
// binfile.seekg(84,ios::cur);
// char c_Byte;boutfile.seekg(n_Distance,ios::beg);
// for (int i=0;i<n_Jpgs;i++)//每一级下按块数循环 并建立文件
// {
// boutfile.seekg(8,ios::cur);
// boutfile.read ((char*)&n_Bytes,4);
// n_Bytes=converted(n_Bytes);
// char name1[20]="d:\\pc\\";
// char name2[7];
// itoa(n_Countjpgs,name2,10);
// char name3[5]=".jpg";
// char *name=strcat(name1,name2);
// char *finalname=strcat(name,name3);
// binfilewrite.open (finalname,ios::out|ios::binary);
// n_Countjpgs++;
// if(1==n_Begin)
// {boutfile.seekg(n_Distance+12,ios::beg);n_Begin=0;}
// for(int n=0;n<n_Bytes;n++)//看多少个字节
// {
// boutfile.read((char*)&c_Byte,sizeof(char));
// binfilewrite.write((char*)&c_Byte,sizeof(char));
// }
// binfilewrite.close();
// }
// }
//
//
//}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -