프로그램 사용/libjpeg2009. 5. 18. 00:54
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로 읽어 오니 잘된다!

[링크 : http://www.korone.net/bbs/board.php?bo_table=etc_misc&wr_id=168]
Posted by 구차니
5.18 광주 민주화 운동(항쟁) 혹은 쿠데타



역시는 언제나 후대가 심판을 해주는 것이지만,
아직도 계속되고 있는, 그리고 아직도 남아서 해결되지 않고 있는
29만원 있다고 우기는 태양권 승계자는 언제쯤 처단이 될까..
Posted by 구차니
개소리 왈왈2009. 5. 17. 23:59
중국이라고 하면 조금은 낚시성인데.. 으음..

조선족 가이드에게 사진 보내준다고 메일을 불러 달라고 했더니 이상한 이메일을 불러준다.
호뜨메일

잉? 이게 머지 -ㅁ-?

hotmail


... 뭥미!

'개소리 왈왈' 카테고리의 다른 글

블랙스크린 - MS 광고  (0) 2009.05.23
내 블로그 가치는?  (2) 2009.05.21
주저리 주저리  (2) 2009.05.16
스승의 날 - 스승이 있습니까?  (2) 2009.05.15
싸이월드 약관 개정 거부하면 어떻게 돼?  (2) 2009.05.14
Posted by 구차니
Microsoft2009. 5. 17. 01:06
문득 c#이 먼지 궁금해서 책을 불법하게 다운이라도 받을려고 검색하니
MS에서 제공하는 무료 기술서적이 발견되었다.(한글판)


[링크 : http://www.microsoft.com/korea/msdn/vbrun/staythepath/additionalresources/InsideCSharp/default.aspx]
[마이그레이션 센터 : http://www.microsoft.com/Korea/MSDN/vbasic/migration/default.aspx]

'Microsoft' 카테고리의 다른 글

lsass.exe 바이러스!?!??!?!  (2) 2011.05.24
ISA Server  (0) 2011.05.23
windows embeded  (4) 2010.10.06
Windows server 2008 R2 + Hyper-V  (0) 2010.09.24
안티 디버깅 프로그램 (anti debugging / anti reverse engineering)  (2) 2010.01.07
Posted by 구차니
개소리 왈왈2009. 5. 16. 13:35
주말에 비가 온다.
펑펑 온다.







머.. 상관은 없나?

Posted by 구차니
프로그램 사용/libjpeg2009. 5. 15. 20:40
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/pixel for 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.

[링크 : http://www.faqs.org/faqs/jpeg-faq/part1/]




struct jpeg_decompress_struct {
  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 out_color_space; /* colorspace for output */
  UINT16 X_density;        /* Horizontal pixel density */
  UINT16 Y_density;        /* Vertical pixel density */
};

typedef enum {
    JCS_UNKNOWN,        /* error/unspecified */
    JCS_GRAYSCALE,        /* monochrome */
    JCS_RGB,        /* red/green/blue */
    JCS_YCbCr,        /* Y/Cb/Cr (also known as YUV) */
    JCS_CMYK,        /* C/M/Y/K */
    JCS_YCCK        /* Y/Cb/Cr/K */
} J_COLOR_SPACE;

순서는 조금 뒤바뀌지만, 윈도우에서 출력되는 데이터는 위의 6개로 거의 표기가 가능하다.
Posted by 구차니
Programming/C Win32 MFC2009. 5. 15. 19:37
cinfo.output_gamma [930841904] <- int 형으로 출력
cinfo.output_gamma [1.000000]   <- double 형으로 출력


libjpeg 사용하다 디버그 문장을 제대로 안골라서 발생한 오류 -ㅁ-
Posted by 구차니
Programming/C Win32 MFC2009. 5. 15. 19:21
Before


void main()
{
int test = 13;
printf("\ntest [%ld:0x%lX]",test,test);
}

After
#define debug_print(name) printf("\n%s [%ld:0x%lX]",#name,name,name);
void main()
{
int test = 13;
debug_print(test);
}

#define debug_print(name) printf("\n%s [%ld:0x%lX]",#name,name,name);
전처리기에서 #name은 name의 내용을 문자열로 치환해주는 역활을 한다.

다른 용법은 아래 참고, ## 라는 용법도 있는데 두개를 하나로 붙여 준다.
[참고 : http://cafe.naver.com/devctrl/1921]
Posted by 구차니
개소리 왈왈2009. 5. 15. 11:55
선생도 아니고 스승의 날이다.
단순하게 나이 먹었다고 우러러보는 先生도 아니라
자신을 가르쳐 인도하는 사람이다.


나를 가르쳐 주는 사람은 나보다 나이 많은 사람이 대부분이지만,
깨달음만 얻을수 있다면 지나가는 개도 스승이 될수 있고,
칠척동자도 스승이 될 수 있다.



어느샌가 부터, 지성의 상아탑에서
골수까지 뽑아내서 소를 팔아야 겨우 다니는
현금의 우골탑으로 변질되고, 스승이 아닌 교사로 전락해 버린 지금
진짜 나에게 스승이 있는지 한번은 돌이켜 봐야 하지 않을까..
Posted by 구차니
쌍무지개 뜨는 화창한 초여름날에(시기상으로는 봄날이 맞겠지만 -ㅁ-)
예비군훈련을 받는구나~~~

라는 꿍시렁 속에 조교 일병에게 써먹었다.
쌍무지개도 뜬 화창한 봄날에 찌질하게 군생활이구나~ ㅋㅋㅋ

조교 일병은 곧 조교 이병에게 가서
ㅋㅋㅋ 쌍무지개도 뜬 화창한 봄날에 찌질하게 이등병이네~ ㅋㅋ



'개소리 왈왈 > 사진과 수다' 카테고리의 다른 글

파스도 상하나?  (4) 2009.09.07
일단 가을 하늘  (10) 2009.08.09
왕푸징(왕부정) 거리 지표  (0) 2009.05.10
3박 4일 중국 가족여행  (8) 2009.05.05
쿨러야 한판 붙자 ㅡㅡ^  (0) 2009.04.29
Posted by 구차니