Click here to Skip to main content
15,892,298 members
Articles / Desktop Programming / MFC
Article

Classes to read and write BMP, JPEG and JPEG 2000

Rate me:
Please Sign up or sign in to vote.
4.49/5 (58 votes)
1 Feb 20031 min read 2.2M   22.6K   92   74
Classes to read and write BMP, JPEG and JPEG 2000

Introduction

This sample is an MFC application using the document/view architecture that can load, display and transcode files such as BMP (bitmap), JPEG, JPP (my private format using jpeg algorithm but with fewer overheads), jpc (jpeg 2000 code stream) and jp2 (jpeg 2000 format). It shows:

  1. Two classes, CMiniJpegEncoder and CMiniJpegDecoder, to support .jpp format. JPP is my private format using jpeg algorithm but with few overheads. These two classes are made in 2001 for one application that compress, transmit, and decompress PC screen image. Someone might ask, we have a jpeg format, so what is the JPP format for? The answer is, the jpeg format is a little complex and may have a 600-byte fileheader. So I made a 6-byte header format called .jpp. Also, no FF markers are needed for .jpp. With simple format of .jpp, you could clearly watch the jpeg algorithm, that would be useful to someone learning jpeg.
  2. Two classes, CTonyJpegEncoder and CTonyJpegDecoder, to support baseline jpeg format. I have no time to support other formats such as progressive + Huffman coding. It works for almost jpeg files, just with one-thousand-line codes! But if you want powerful functionality, please use IJG code. In this demo, you could choose the jpeg codec.
  3. To show the capability of JPEG-2000, by Jasper implementation.

Contact

If you have any question, or any comments, please contact me: lintong@cis.pku.edu.cn.

History

  • 1 Feb, 2003 - First revision.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
China China
Dr. Tony Lin, received his PhD degree from Peking University, Beijing, China, in 2001. His interests are in Pattern Recognition, Wavelets, and Programming.

Comments and Discussions

 
GeneralRe: the quality of the out put jpeg file is poor Pin
Tony Lin20-Jun-03 18:43
Tony Lin20-Jun-03 18:43 
GeneralRe: the quality of the out put jpeg file is poor Pin
johnedoppler29-Oct-08 10:00
johnedoppler29-Oct-08 10:00 
QuestionUsing the dll in vb? Pin
Kevin C10-May-03 3:01
Kevin C10-May-03 3:01 
AnswerRe: Using the dll in vb? Pin
Tony Lin4-Jun-03 21:45
Tony Lin4-Jun-03 21:45 
GeneralRe: Using the dll in vb? Pin
ligs200111-Nov-03 18:16
ligs200111-Nov-03 18:16 
AnswerRe: Using the dll in vb? Pin
modos29-Aug-05 20:11
modos29-Aug-05 20:11 
General关于JPEG2000 Pin
韩朝晖_hzh26-Apr-03 19:54
suss韩朝晖_hzh26-Apr-03 19:54 
GeneralRe: 关于JPEG2000 Pin
Tony Lin4-Jun-03 21:35
Tony Lin4-Jun-03 21:35 
GeneralJPEG-2000 Pin
mullala18-Apr-03 8:26
mullala18-Apr-03 8:26 
GeneralRe: JPEG-2000 Pin
Tony Lin4-Jun-03 21:39
Tony Lin4-Jun-03 21:39 
GeneralBug? J2kdemo Pin
TSUNGCHILIN6-Apr-03 8:55
TSUNGCHILIN6-Apr-03 8:55 
GeneralRe: Bug? J2kdemo Pin
Tony Lin4-Jun-03 21:41
Tony Lin4-Jun-03 21:41 
GeneralI need to compress a DIB buffer Pin
leandrobecker26-Mar-03 12:49
leandrobecker26-Mar-03 12:49 
GeneralRe: I need to compress a DIB buffer Pin
Tony Lin4-Jun-03 21:44
Tony Lin4-Jun-03 21:44 
GeneralJpegDecoder Pin
zachadra17-Mar-03 5:30
zachadra17-Mar-03 5:30 
GeneralRe: JpegDecoder Pin
Tony Lin17-Mar-03 15:35
Tony Lin17-Mar-03 15:35 
GeneralBug found Pin
gnk16-Feb-03 4:06
gnk16-Feb-03 4:06 
GeneralRe: Bug found Pin
Tony Lin17-Feb-03 16:33
Tony Lin17-Feb-03 16:33 
GeneralRe: Bug found Pin
gnk18-Feb-03 9:03
gnk18-Feb-03 9:03 
GeneralBrief explanation. Pin
73Zeppelin2-Feb-03 10:32
73Zeppelin2-Feb-03 10:32 
GeneralRe: Brief explanation. Pin
Tony Lin10-Feb-03 22:31
Tony Lin10-Feb-03 22:31 
GeneralRe: Brief explanation. Pin
73Zeppelin11-Feb-03 2:22
73Zeppelin11-Feb-03 2:22 
Generalfirst impression Pin
Davide Pizzolato2-Feb-03 3:41
Davide Pizzolato2-Feb-03 3:41 
GeneralRe: first impression Pin
Tony Lin10-Feb-03 22:11
Tony Lin10-Feb-03 22:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.