22020, 1/1101 회원가입  로그인  
   gjwjqzz2
   이거 코딩해주실분있나요??!!

http://www.hackerschool.org/HS_Boards/zboard.php?id=Free_Board&no=24425 [복사]


magickwand를 사용하여 픽셀데이터의 lsb를 standard output에 출력하는 코드 요!!!
bmp 스테가노문제가있는데 어렵네여 ㅠㅠㅠ

  Hit : 11986     Date : 2012/09/08 02:37



    
gjwjqzz2 //#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <wand/MagickWand.h>
#include <unistd.h>
//using namespace std;
#define ThrowWandException(wand){
char *description;
ExceptionType severity;
description=MagickGetException(wand,&severity);
(void) fprintf(stderr,"%s %s %lu %s\n",GetMagickModule(),description);
description=(char *) MagickRelinquishMemory(description);
exit(-1);
}
int main(int argc, char** argv){
// PixelGetMagickColor();
if(argc<2){
printf("usage: %s imagefile\n", argv[0]);
return 1;
}
MagickWand* w;
MagickWandGenesis();
w=NewMagickWand();
//PixelGetMagickColor();
if(MagickReadImage(w,argv[1])==MagickFalse)
ThrowWandException(w);
PixelIterator* it;
PixelWand** pixels;
register unsigned int x; unsigned int y;
unsigned long width;
MagickPixelPacket pixel;
char tmp=0;
int tmp_index=0;
for (y=0; y < MagickGetImageHeight(w); y++){
pixels=PixelGetNextIteratorRow(it,&width);
for (x=0; x < width; x++){
//get the lsb of the pixel here
PixelGetMagickColor(pixels[x],&pixel);
char bit=((int)pixel.red)&1;
tmp=tmp|(bit << tmp_index);
tmp_index++;

if(tmp_index>=8){
write(1,&tmp,1);
tmp=0;tmp_index=0;
}
bit=((int)pixel.green)&1;
tmp=tmp|(bit << tmp_index);
tmp_index++;
if(tmp_index>=8){
write(1,&tmp,1);
tmp=0;tmp_index=0;
}
bit=((int)pixel.blue)&1;
tmp=tmp|(bit << tmp_index);
tmp_index++;
if(tmp_index>=8){
write(1,&tmp,1);
tmp=0;tmp_index=0;
}
//move the next line before 'char bit'
//PixelGetMagickColor(pixels[x],&pixel);
//printf("%i",pixel.blue);
}
}
}
이걸로나와있는데 문법에러가나요 ㅠㅠㅠㅠ
2012/09/08  
     [공지]해커스쿨 이용수칙 2021/04/11 수정판 [55] 한승재 01/05 12808
22019   해커구함     k1230
10/04 5
22018   카타고 AI[1]     해킹잘하고싶다
10/01 40
22017   시스코 라우터랑 스위치 케이블 장비 질문이에요.[1]     해킹잘하고싶다
09/22 103
22016   ㅇㅅㅇ     해킹잘하고싶다
08/15 292
22015   요즘 하고 있는 거     해킹잘하고싶다
07/13 502
22014   2위 ㅇㅅㅇ     해킹잘하고싶다
07/13 439
22013   ...     해킹잘하고싶다
03/31 832
22012   ...     해킹잘하고싶다
03/25 807
22011   15년전쯤 이 사이트 보고 꿈을 정했었는데~~~[1]     ambition65
03/20 1212
22010   으앙!!![1]     해킹잘하고싶다
02/05 951
22009   오랜만~     DarkSlayer
12/11 1148
22008   해커스쿨 옛날 BGM[1]     wkfhddl4041
11/07 1254
22007   히잉...     해킹잘하고싶다
11/02 1079
22006   바둑과 장기     해킹잘하고싶다
10/30 1164
22005   나는 언제 애인이 생기나욤...     해킹잘하고싶다
10/27 1243
22004   전국 1위     해킹잘하고싶다
10/27 1188
22003   담배 ㅋㅋ[1]     해킹잘하고싶다
10/27 1191
22002   매트릭스의 파란약을 아십니까..?     해킹잘하고싶다
10/27 1146
22001   ㅇㅇ[1]     해킹잘하고싶다
10/20 1111
1 [2][3][4][5][6][7][8][9][10]..[1101]

Copyright 1999-2026 Zeroboard / skin by Hackerschool.org / Secure Patch by Hackerschool.org