pubuntu@pubuntu:/bin$ file ls
ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped
pubuntu@pubuntu:~/src$ gcc test.c
test.c: In function ‘main’:
test.c:2: warning: return type of ‘main’ is not ‘int’
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
우분투 특성상 gcc가 제대로 안되서(crt1.o 도 없어서 컴파일 에러 ㅠ.ㅠ)
그냥 /bin/ls의 포맷을 살펴 보았더니 ELF x86이다.
이 말은 별다른 컴파일 과정없이 , VMWare등의 가상PC 없이도
윈도우와 리눅스를 병행해서 사용이 가능하다는 것이다.
네트워크 문제인지 모르겠지만.. 네트워크 사용시 CPU 점유율이 극도로 올라가는 문제 발생..
주의사항
1. 실행시에는 portable_ubuntu.bat 대신 run_portable_ubuntu.bat 을 이용하여 실행하도록!
(Xming 구동이라던가 여러가지 에서 차이가 있다)
2. 설치이후 키보드를 Korean / 101키 호환으로 해주지 않으면 - + 등의 특수키가 제대로 먹지 않을수도 있다.
3. vi에서 방향키가 안먹는다.. OTL
4. 되도록이면... 암호를 바꾸자. 기본 암호는 123456 이다.
5. USB에 담고 싶으면 2GB 이상의 USB가 필요하다. 아래 다운로드는 400MB 정도이지만 압축풀면 1.8기가이다
라이브러리를 겨우겨우 컴파일 해서 돌려봐야지~ 룬루랄라 하고 돌렸더니
저따구 에러가 발생을 한다.. 닝기리
아무튼 해결 방법은
typedef 로 묶인 기본 타입들에 대한 정의를 수정해 주면 된다는 것이다.
일단 가장 큰 차이는 boolean의 크기가 다르다는 것이고,
나머지 타입들은 시스템에 따라 미묘하게 다를수 있으니 현재 사용하는 시스템의 타입으로 변경해주면 된다.
/* These typedefs are used for various table entries and so forth.
* They must be at least as wide as specified; but making them too big
* won't cost a huge amount of memory, so we don't provide special
* extraction code like we did for JSAMPLE. (In other words, these
* typedefs live at a different point on the speed/space tradeoff curve.)
*/
/* UINT8 must hold at least the values 0..255. */
#ifdef HAVE_UNSIGNED_CHAR
typedef unsigned char UINT8;
#else /* not HAVE_UNSIGNED_CHAR */
#ifdef CHAR_IS_UNSIGNED
typedef char UINT8;
#else /* not CHAR_IS_UNSIGNED */
typedef short UINT8;
#endif /* CHAR_IS_UNSIGNED */
#endif /* HAVE_UNSIGNED_CHAR */
/* UINT16 must hold at least the values 0..65535. */
#ifdef HAVE_UNSIGNED_SHORT
typedef unsigned short UINT16;
#else /* not HAVE_UNSIGNED_SHORT */
typedef unsigned int UINT16;
#endif /* HAVE_UNSIGNED_SHORT */
/* INT16 must hold at least the values -32768..32767. */
#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */
typedef short INT16;
#endif
/* INT32 must hold at least signed 32-bit values. */
#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
typedef long INT32;
#endif
/*
* On a few systems, type boolean and/or its values FALSE, TRUE may appear
* in standard header files. Or you may have conflicts with application-
* specific header files that you want to include together with these files.
* Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
*/
#ifndef HAVE_BOOLEAN
typedef int boolean;
#endif
SSH로 서버에 접속 후,
서버에서 로컬의 다른 서버로 SSH 접속을 하는데 아래와 같은 경우를 만났다.
[userid@hostname ~]$ ssh localserver_ip
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00.
Please contact your system administrator.
Add correct host key in /home/userid/.ssh/known_hosts to get rid of this message.
Offending key in /home/userid/.ssh/known_hosts:1
RSA host key for 192.168.10.10 has changed and you have requested strict checking.
Host key verification failed.
해결방법은, 그냥 저 파일을 지우면 된다.
(아마.. 지금까지 접속했던 서버들에 대한 RSA 키도 전부 삭제 되므로, 다음번 접속시 전부 키를 받을 거냐고 물어볼 듯 하다)
포터블 우분투를 실행하면 Xming을 구동하여 사용하는데 옵션이 특이해서
도움말을 찾아보게 되었다.
portable_ubuntu.conf 파일의 내용
kernel=vmlinux
cobd0=images\rootfs.img
cobd3="D:\Documents and Settings\czw5hv\Application Data\Windux\images\root.img"
cofs0=config
cofs1=c:\ #Para tener acceso a la unidad C:
#cofs1=otra_unidad:\ #Si se necesita tener acceso a otras unidades?ej: d:\
#scsi0=cdrom,\Device\Cdrom0 # Para tener acceso al CDROM de la PC
root=/dev/cobd0
ro
initrd=initrd.gz
mem=256
eth0=slirp,00:ff:75:39:D3:C1,tcp:22:22
exec0="Xming\Xming.exe :0 -notrayicon +bs -wm -auth Xauthority -clipboard -multiwindow -dpi 100"
exec1=pulseaudio-0.9.6\pulseaudio.exe # Ejecuta al servidor Pulse Audio para Windows
+bs enable any backing store support -wm WhenMapped default backing-store
위의 옵션들에 backing store라는 내용이 들어간다.
이곳저것 검색을 해봐도 딱히 시원한 대답은 없었지만, 검색 내용중 윈도우 내용이 복구 안될 경우
backing store를 X11에 설정한다는 내용이 발견되었다. 아마 clipping 영역 복구가 제대로 되지 않을 때,
강제로 복구 하도록 하는 옵션인거 같기도 하고.. 용어 내용만 봤을 경우 일종의 캐시 구조인거 같기도하고..
(고속일 수록 가격이 비싸고, 저속일수록 가격이 싸다. 단위용량당 가격적인 면에서
레지스터 > 캐쉬 > 메모리(DRAM) > HDD > ODD > TAPE 등의 순서를 피라미드식으로 이루게 되는데
memory hierarchy 라고 한다.)
Unfortunately some XFree86 drivers are buggy, and when you render an
accelerated primitive which overlaps an area which is not visible to
the user, the driver fails to update the backing store (it only draws
the clipped primitive using accelarated functions and does not complete
the job by calling the software renderer to update the backing store.)
[출처 : http://www.ibiblio.org/ggicore/documentation/libggi/current/display-x.7.html]
Usage...
Xming [:<display-number>] [option]
-a # mouse acceleration (pixels)
-ac disable access control restrictions
-audit int set audit trail level
-auth file select authorization file
-br create root window with black background +bs enable any backing store support
-bs disable any backing store support
-c turns off key-click
c # key-click volume (0-100)
-cc int default color visual class
-co file color database file
-core generate core dump on fatal error
-dpi int screen resolution in dots per inch
-deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs
-f # bell base (0-100)
-fc string cursor font
-fn string default font name
-fp string default font path
-help prints message with these options
-I ignore all remaining arguments
-logo enable logo in screen saver
nologo disable logo in screen saver
-nolisten string don't listen on protocol
-noreset don't reset after last client exists
-reset reset after last client exists
-p # screen-saver pattern duration (minutes)
-pn accept failure to listen on all ports
-nopn reject failure to listen on all ports
-r turns off auto-repeat
r turns on auto-repeat
-render [default|mono|gray|color] set render color alloc policy
-s # screen-saver timeout (minutes)
-sp file security policy file
-su disable any save under support
-t # mouse threshold (pixels)
-terminate terminate at server reset
-to # connection time out
-tst disable testing extensions
ttyxx server started from init on /dev/ttyxx
v video blanking for screen-saver
-v screen-saver without video blanking -wm WhenMapped default backing-store
-wr create root window with white background
-x string loads named extension at init time
-maxbigreqsize set maximal bigrequest size
+extension name Enable extension
-extension name Disable extension
-query host-name contact named host for XDMCP
-broadcast broadcast for XDMCP
-indirect host-name contact named host for indirect XDMCP
-port port-num UDP port number to send messages to
-from local-address specify the local address to connect from
-once Terminate server after one session
-class display-class specify display class to send in manage
-cookie xdm-auth-bits specify the magic cookie for XDMCP
-displayID display-id manufacturer display ID for request
-kb disable the X Keyboard Extension
+kb enable the X Keyboard Extension
[+-]accessx [ timeout [ timeout_mask [ feedback [ options_mask] ] ] ]
enable/disable accessx key sequences
-ardelay set XKB autorepeat delay
-arinterval set XKB autorepeat interval
-clipboard
Enables the integration between the Xming clipboard and
Windows clipboard.
-clipupdates num_boxes
Use a clipping region to constrain shadow update blits to
the updated region when num_boxes, or more, are in the
updated region. Diminished effect on current Windows
versions because they already group GDI operations together
in a batch, which has a similar effect.
-depth bits_per_pixel
Specify an optional bitdepth to use in fullscreen mode
with a DirectDraw engine.
-emulate3buttons [timeout]
Emulate a 3 button mouse with an optional timeout in
milliseconds. The default timeout is 50 milliseconds.
-engine engine_type_id
Override the server's automatically selected engine type:
1 - Shadow GDI
2 - Shadow DirectDraw
4 - Shadow DirectDraw4 Non-Locking
Do not use this parameter unless instructed to do so.
-fullscreen
Run the server in fullscreen mode with -depth and -refresh
set as required.
-ignoreinput
Ignore keyboard and mouse input. This is usually only used for
testing and debugging purposes.
-internalwm
EXPERIMENTAL: Run the internal window manager.
-[no]keyhook
Grab special windows key combinations like Alt-Tab or the Menu
key. These keys are discarded by default.
-lesspointer
Hide the windows mouse pointer when it is over an inactive
Xming window. This prevents ghost cursors appearing where
the Windows cursor is drawn over the X cursor.
-logfile filename
Write logmessages to <filename> instead of Xming.n.log,
where n is the display-number of the X Server.
-logverbose verbosity
Set the verbosity of logmessages. [NOTE: Only a few messages
respect the settings, so not much use yet]
0 - only print fatal error.
1 - print additional configuration information.
2 - print additional runtime information [default].
3 - print debugging and tracing information.
-[no]multimonitors (or -[no]multiplemonitors)
Use the entire virtual screen if multiple monitors are
present.
-multiwindow
Run the server in multiwindow mode. Not to be used
together with -rootless or -fullscreen.
-mwextwm
EXPERIMENTAL: Run the server in multiwindow external
window manager mode. Use with xwinwm.
-nodecoration
Do not draw a window border, title bar, etc. Windowed
mode only i.e. ignored when -fullscreen specified.
-noicons
Disable the conversion of X icons in multiwindow mode.
Use to prevent an infrequent crash in miGetImage().
This is a work-around that most people won't need.
-nounicodeclipboard
Disable Unicode in the clipboard.
-refresh rate_in_Hz
Specify an optional refresh rate to use in fullscreen mode
with a DirectDraw engine.
-rootless
Use a transparent root window with an external window
manager (such as openbox). Not to be used with
-multiwindow or with -fullscreen.
-screen scr_num [width height [x y] | [[WxH[+X+Y]][@m]] ]
Enable screen scr_num and optionally specify a width and
height and initial position for that screen. Additionally
a monitor number can be specified to start the server on,
at which point, all coordinates become relative to that
monitor. Examples:
-screen 0 800x600+100+100@2 ;2nd monitor offset 100,100 size 800x600
-screen 0 1024x768@3 ;3rd monitor size 1024x768
-screen 0 @1 ;on 1st monitor using its full resolution (the default)
-scrollbars
In windowed mode, allow screens bigger than the Windows desktop.
Moreover, if the window has decorations, one can now resize
it. Do not use in conjunction with -multiwindow or with -rootless.
-silent-dup-error
If another instance of Xming is found running, exit silently
and don't display the error message.
-swcursor
Disable the usage of the windows cursor and use the X11 software
cursor instead.
-[no]trayicon
Do not create a tray icon. Default is to create one
icon per screen. You can globally disable tray icons with
-notrayicon, then enable it for specific screens with
-trayicon for those screens.
-[no]unixkill
Ctrl-Alt-Backspace exits the X Server. The Ctrl-Alt-Backspace
key combo is disabled by default.
-version
Write version and help text to the console (unless built
console-less) and to the log file.
-[no]winkill
Alt-F4 exits the X Server. The Alt-F4 key combo is enabled
by default.
-xkblayout XKBLayout
Set the layout to use for XKB. This defaults to a layout
matching your current layout from windows or us (i.e. USA)
if no matching layout was found.
For example: -xkblayout de
-xkbmodel XKBModel
Set the model to use for XKB. This defaults to pc105.
-xkboptions XKBOptions
Set the options to use for XKB. This defaults to not set.
-xkbrules XKBRules
Set the rules to use for XKB. This defaults to xorg.
-xkbvariant XKBVariant
Set the variant to use for XKB. This defaults to not set.
For example: -xkbvariant nodeadkeys
/*
* Ordering of RGB data in scanlines passed to or from the application.
* If your application wants to deal with data in the order B,G,R, just
* change these macros. You can also deal with formats such as R,G,B,X
* (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing
* the offsets will also change the order in which colormap data is organized.
* RESTRICTIONS:
* 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.
* 2. These macros only affect RGB<=>YCbCr color conversion, so they are not
* useful if you are using JPEG color spaces other than YCbCr or grayscale.
* 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE
* is not 3 (they don't understand about dummy color components!). So you
* can't use color quantization if you change that value.
*/
#define RGB_RED 0 /* Offset of Red in an RGB scanline element */
#define RGB_GREEN 1 /* Offset of Green */
#define RGB_BLUE 2 /* Offset of Blue */
#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
libjpeg를 일반적인 표준 Bitmap 파일에 적용하기 위해서는 (혹은 Blit 함수에) RGBQUAD나 RGBTRIPLE과 동일한 구조로 나오는 것이 좋다.
unsigned int scale_num, scale_denom
scale_num/scale_denom 의 분수비로 영상 비율을 조절합니다.
기본값은 1/1 혹은 조절하지 않음입니다.
현재, 지원되는 조정 비율은 1/1, 1/2, 1/4, 1/8 입니다.
(라이브러리 설계는 무제한의 비율이 가능하도록 되어있지만,
빠른시일내로 적용되기는 힘들것으로 보입니다.)
작은 조절 비율은 적은 수의 픽셀 연산과 단순화된 IDCT 방법을
사용 할 수 있기 때문에, 매우 빠른 속도의 변환을 합니다
(scale_num은 분자, scale_denom은 분모입니다. 만약에 1/4로 하려고 한다면 scale_num = 1; scale_denom = 4; 로 하면 될 듯 합니다
- 확인요망)
unsigned int scale_num, scale_denom
Scale the image by the fraction scale_num/scale_denom. Default is
1/1, or no scaling. Currently, the only supported scaling ratios
are 1/1, 1/2, 1/4, and 1/8. (The library design allows for arbitrary
scaling ratios but this is not likely to be implemented any time soon.)
Smaller scaling ratios permit significantly faster decoding since
fewer pixels need be processed and a simpler IDCT method can be used.
6. while (scan lines remain to be read)
jpeg_read_scanlines(...);
jpeg_read_scanlines()을 한번 혹은 여러번 호출함으로서 압축해제 된 영상정보를 읽을 수 있습니다.
각각의 호출시에, 읽을 최대 scanline을 넘겨줍니다
(예를들어, working buffer의 높이); jpeg_read_scanlines() 은
많은 줄들의 값을 돌려줄 것 입니다. 돌려준 값은 실제로 읽은 줄의 갯수입니다.
돌려받은 영상정보의 형태(format)는 위의 "Data formats"에 기술되어 있습니다.
흑백과 색상이 있는 JPEG는 서로 다른 데이터 형태라는 것을 잊지마십시오!
영상정보는 상-하 순서로 주어집니다. 만약에 하-상 순서로 영상정보를 저장해야 한다면,
효과적으로 JPEG 라이브러리의 가상 배열 방식을 사용하여 뒤집을 수 있습니다.
예제 프로그램인 djpeg에서 이러한 사용예를 찾으실 수 있습니다.
6. while (scan lines remain to be read)
jpeg_read_scanlines(...);
Now you can read the decompressed image data by calling jpeg_read_scanlines()
one or more times. At each call, you pass in the maximum number of scanlines
to be read (ie, the height of your working buffer); jpeg_read_scanlines()
will return up to that many lines. The return value is the number of lines
actually read. The format of the returned data is discussed under "Data
formats", above. Don't forget that grayscale and color JPEGs will return
different data formats!
Image data is returned in top-to-bottom scanline order. If you must write
out the image in bottom-to-top order, you can use the JPEG library's virtual
array mechanism to invert the data efficiently. Examples of this can be
found in the sample application djpeg.
The library maintains a count of the number of scanlines returned so far
in the output_scanline field of the JPEG object. Usually you can just use
this variable as the loop counter, so that the loop test looks like
"while (cinfo.output_scanline < cinfo.output_height)". (Note that the test
should NOT be against image_height, unless you never use scaling. The image_height field is the height of the original unscaled image.)
The return value always equals the change in the value of output_scanline.
If you don't use a suspending data source, it is safe to assume that
jpeg_read_scanlines() reads at least one scanline per call, until the
bottom of the image has been reached.
If you use a buffer larger than one scanline, it is NOT safe to assume that
jpeg_read_scanlines() fills it. (The current implementation returns only a
few scanlines per call, no matter how large a buffer you pass.) So you must
always provide a loop that calls jpeg_read_scanlines() repeatedly until the
whole image has been read.
Data formats
픽셀들은 scanline 단위로 왼쪽에서 오른쪽 방향으로 저장됩니다
각각의 픽셀을 위한 값들은 열단위로 나란히 있습니다;
24-bit RGB 를 예를 들자면, R,G,B,R,G,B,R,G,B 순서로 되어있습니다. 각각의 scanline은
JSAMPLE 데이터 형의 배열로 되어있습니다 --- jmorecfg.h를 수정하지 않았다면,
일반적으로 "unsigned char" 입니다. (또한 jmorecfg.h를 수정함으로서
RGB 픽셀의 순서를 B,G,R 순서로 변경할수도 있습니다. 하지만 수정전에 제약사항을
먼저 읽어 보시기 바랍니다.)
Data formats
------------
Before diving into procedural details, it is helpful to understand the
image data format that the JPEG library expects or returns.
The standard input image format is a rectangular array of pixels, with each
pixel having the same number of "component" or "sample" values (color
channels). You must specify how many components there are and the colorspace
interpretation of the components. Most applications will use RGB data
(three components per pixel) or grayscale data (one component per pixel).
PLEASE NOTE THAT RGB DATA IS THREE SAMPLES PER PIXEL, GRAYSCALE ONLY ONE.
A remarkable number of people manage to miss this, only to find that their
programs don't work with grayscale JPEG files.
There is no provision for colormapped input. JPEG files are always full-color
or full grayscale (or sometimes another colorspace such as CMYK). You can
feed in a colormapped image by expanding it to full-color format. However
JPEG often doesn't work very well with source data that has been colormapped,
because of dithering noise. This is discussed in more detail in the JPEG FAQ
and the other references mentioned in the README file.
Pixels are stored by scanlines, with each scanline running from left to
right. The component values for each pixel are adjacent in the row; for
example, R,G,B,R,G,B,R,G,B,... for 24-bit RGB color. Each scanline is an
array of data type JSAMPLE --- which is typically "unsigned char", unless you've changed jmorecfg.h. (You can also change the RGB pixel layout, say
to B,G,R order, by modifying jmorecfg.h. But see the restrictions listed in
that file before doing so.)
int w = cinfo.image_width;
int h = cinfo.image_height;
int d = cinfo.jpeg_color_space;
int out_h = cinfo.output_height;
printf("width:%d height:%d depth:%d out_height:%d\n", w, h ,d, out_h);
unsigned char *data = new unsigned char[w * h * d];
while (cinfo.output_scanline < cinfo.output_height)
{
jpeg_read_scanlines(&cinfo, &data, 1);
data += d * cinfo.output_width;
}
jpeg_read_header() 한뒤
jpeg_read_scanline()까지는 알았지만, 문서를 대충 읽다 보니..
도무니 어떻게 메모리를 할당해야 할지 감이 안 잡혔는데..
이 문서를 보니 어떻게 하면 될꺼 같다라는 감이 조금은 온다.. 내일 해보고 결과를 적도록 해야겠다.
위에서 대로 전체 할당하고 jpeg_read_scanlines로 읽어 오니 잘된다!
Subject: [21] What if I need more than 8-bit precision?
Baseline JPEG stores images with 8 bits per color sample, in other words
24 bits per pixel for RGB images, 8 bits/pixel for grayscale, 32 bits/pixelfor CMYK, etc.
There is an extension that stores 12 bits/sample for applications that need higher accuracy.
Medical images, for example, are often 12-bit grayscale. The 12-bit extension is not very widely supported,
however. One package that does support it is the free IJG source code (see part 2, item 15).
For lossless JPEG, the standard permits any data precision between 2 and 16 bits per sample,
but high-precision lossless JPEG is even less widely supported than high-precision lossy JPEG.
The Stanford PVRG codec (see part 2, item 15) reportedly supports up to 16 bits/sample for lossless JPEG.
struct jpeg_decompress_struct {
jpeg_common_fields; /* Fields shared with jpeg_compress_struct */
/* Source of compressed data */
struct jpeg_source_mgr * src;
/* Basic description of image --- filled in by jpeg_read_header(). */
/* Application may inspect these values to decide how to process image. */
JDIMENSION image_width; /* nominal image width (from SOF marker) */
JDIMENSION image_height; /* nominal image height */
int num_components; /* # of color components in JPEG image */
J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
/* image_width는 폭 image_height는 높이 그리고 num_components는 몇개의 색상이 있는지를 알려준다. * jpeg는 각 element당 8bit씩을 사용하고, RGB는 각 8bit * 3 = 24bits * Grayscale은 8bit * 1(단일색상) = 8bits 이런식으로 color depth를 계산하면 된다. */
/* Decompression processing parameters --- these fields must be set before
* calling jpeg_start_decompress(). Note that jpeg_read_header() initializes
* them to default values.
*/
J_COLOR_SPACE out_color_space; /* colorspace for output */ /* 윈도우에서 색대표라고 나오는 것이다. 출력시의 색상계를 의미함 */
unsigned int scale_num, scale_denom; /* fraction by which to scale image */
double output_gamma; /* image gamma wanted in output */
boolean quantize_colors; /* TRUE=colormapped output wanted */
/* the following are ignored if not quantize_colors: */
J_DITHER_MODE dither_mode; /* type of color dithering to use */
boolean two_pass_quantize; /* TRUE=use two-pass color quantization */
int desired_number_of_colors; /* max # colors to use in created colormap */
/* these are significant only in buffered-image mode: */
boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */
boolean enable_external_quant;/* enable future use of external colormap */
boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */
/* Description of actual output image that will be returned to application.
* These fields are computed by jpeg_start_decompress().
* You can also use jpeg_calc_output_dimensions() to determine these values
* in advance of calling jpeg_start_decompress().
*/
JDIMENSION output_width; /* scaled image width */
JDIMENSION output_height; /* scaled image height */
int out_color_components; /* # of color components in out_color_space */
int output_components; /* # of color components returned */
/* output_components is 1 (a colormap index) when quantizing colors;
* otherwise it equals out_color_components.
*/
int rec_outbuf_height; /* min recommended height of scanline buffer */
/* If the buffer passed to jpeg_read_scanlines() is less than this many rows
* high, space and time will be wasted due to unnecessary data copying.
* Usually rec_outbuf_height will be 1 or 2, at most 4.
*/
/* When quantizing colors, the output colormap is described by these fields.
* The application can supply a colormap by setting colormap non-NULL before
* calling jpeg_start_decompress; otherwise a colormap is created during
* jpeg_start_decompress or jpeg_start_output.
* The map has out_color_components rows and actual_number_of_colors columns.
*/
int actual_number_of_colors; /* number of entries in use */
JSAMPARRAY colormap; /* The color map as a 2-D pixel array */
/* State variables: these variables indicate the progress of decompression.
* The application may examine these but must not modify them.
*/
/* Row index of next scanline to be read from jpeg_read_scanlines().
* Application may use this to control its processing loop, e.g.,
* "while (output_scanline < output_height)".
*/
JDIMENSION output_scanline; /* 0 .. output_height-1 */
/* Current input scan number and number of iMCU rows completed in scan.
* These indicate the progress of the decompressor input side.
*/
int input_scan_number; /* Number of SOS markers seen so far */
JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */
/* The "output scan number" is the notional scan being displayed by the
* output side. The decompressor will not allow output scan/row number
* to get ahead of input scan/row, but it can fall arbitrarily far behind.
*/
int output_scan_number; /* Nominal scan number being displayed */
JDIMENSION output_iMCU_row; /* Number of iMCU rows read */
/* Current progression status. coef_bits[c][i] indicates the precision
* with which component c's DCT coefficient i (in zigzag order) is known.
* It is -1 when no data has yet been received, otherwise it is the point
* transform (shift) value for the most recent scan of the coefficient
* (thus, 0 at completion of the progression).
* This pointer is NULL when reading a non-progressive file.
*/
int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */
/* Internal JPEG parameters --- the application usually need not look at
* these fields. Note that the decompressor output side may not use
* any parameters that can change between scans.
*/
/* Quantization and Huffman tables are carried forward across input
* datastreams when processing abbreviated JPEG datastreams.
*/
JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
/* ptrs to coefficient quantization tables, or NULL if not defined */
JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
/* ptrs to Huffman coding tables, or NULL if not defined */
/* These parameters are never carried across datastreams, since they
* are given in SOF/SOS markers or defined to be reset by SOI.
*/
int data_precision; /* bits of precision in image data */
jpeg_component_info * comp_info;
/* comp_info[i] describes component that appears i'th in SOF */
UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */
/* These fields record data obtained from optional markers recognized by
* the JPEG library.
*/
boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */
/* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */
UINT8 JFIF_major_version; /* JFIF version number */
UINT8 JFIF_minor_version;
UINT8 density_unit; /* JFIF code for pixel size units */
UINT16 X_density; /* Horizontal pixel density */
UINT16 Y_density; /* Vertical pixel density */
boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */
UINT8 Adobe_transform; /* Color transform code from Adobe marker */ /* X_density, Y_density는 DPI 단위의 수평,수직 해상도를 나타낸다. */
boolean CCIR601_sampling; /* TRUE=first samples are cosited */
/* Aside from the specific data retained from APPn markers known to the
* library, the uninterpreted contents of any or all APPn and COM markers
* can be saved in a list for examination by the application.
*/
jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */
/* Remaining fields are known throughout decompressor, but generally
* should not be touched by a surrounding application.
*/
/*
* These fields are computed during decompression startup
*/
int max_h_samp_factor; /* largest h_samp_factor */
int max_v_samp_factor; /* largest v_samp_factor */
int min_DCT_scaled_size; /* smallest DCT_scaled_size of any component */
JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */
/* The coefficient controller's input and output progress is measured in
* units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows
* in fully interleaved JPEG scans, but are used whether the scan is
* interleaved or not. We define an iMCU row as v_samp_factor DCT block
* rows of each component. Therefore, the IDCT output contains
* v_samp_factor*DCT_scaled_size sample rows of a component per iMCU row.
*/
JSAMPLE * sample_range_limit; /* table for fast range-limiting */
/*
* These fields are valid during any one scan.
* They describe the components and MCUs actually appearing in the scan.
* Note that the decompressor output side must not use these fields.
*/
int comps_in_scan; /* # of JPEG components in this scan */
jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
/* *cur_comp_info[i] describes component that appears i'th in SOS */
JDIMENSION MCUs_per_row; /* # of MCUs across the image */
JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
int blocks_in_MCU; /* # of DCT blocks per MCU */
int MCU_membership[D_MAX_BLOCKS_IN_MCU];
/* MCU_membership[i] is index in cur_comp_info of component owning */
/* i'th block in an MCU */
int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */
/* This field is shared between entropy decoder and marker parser.
* It is either zero or the code of a JPEG marker that has been
* read from the data source, but has not yet been processed.
*/
int unread_marker;