gtk 실시간 jpg 처리 문제

linuxs의 이미지

안녕하세요 gtk를 이용해서 실시간 jpg viewer를 제작 중입니다.

현제 네트워으로 jpg 데이타를 전송받아서 파일로 생성한다음 그 파일을 gdk-pixbuf를 이용해서 GdkPixbuf 위젯으로 생성한 다음 GtkDrawingarea에 디스플레이 하는 식으로 처리 하였습니다.

그런데 문제는 파일로 저장해서 디스플레이 할려니까 퍼포먼스가 떨어져서 않돼고 임베디드 시스템에 적용하니까 영상이 한장도 출력이 돼질 않습니다.

그래서 질문드립니다.

Gtk+2.0에서
jpg 데이타를 처리할려면 어떻게 해야 됩니까(파일에서 읽지않고 데이타로 처리)
< gdk_pixbuf_new_from_file()로 현재 제작하였습니다.
gdk_pixbuf_new_from_data()라는 함수는 jpg데이타를 디코딩한 데이타(RGB)를 인자로 받고 있습니다. TT>

linuxs의 이미지

Quote:

LibJpeg API
This library is based on one structure

struct jpeg_compress_struct cinfo;
Of course there are other structs for example the
jpeg_error_mgr
to handle error messages. But they are not part of the core functionality. First the software has to be configured for the compressed mode
jpeg_create_compress(&cinfo);
To write the output to a file we have to link the file handler with the JPEG library
jpeg_stdio_dest(&cinfo, fh); //fh is the file handler
Most settings can be set to default. But it is important to define the real picture size and the pixel resolution to the library
cinfo.image_width = fmt.fmt.pix.width;
cinfo.image_height = fmt.fmt.pix.height;
cinfo.input_components = 3; //rgb only
cinfo.in_color_space = JCS_RGB;

jpeg_set_defaults(&cinfo);
This is the main step to compress the pixels and write them to the file
jpeg_start_compress(&cinfo, TRUE);

row_stride=cinfo.image_width*3;//JSAMPLEs per row in image_buffer

while (cinfo.next_scanline < cinfo.image_height)
{
row_pointer[0] = & data[cinfo.next_scanline * row_stride];
jpeg_write_scanlines(&cinfo, row_pointer, 1);
}
And of course everything has to be cleaned up
jpeg_finish_compress(&cinfo);
jpeg_destroy_compress(&cinfo);
The prototype is working and proved all the required functions for Polyphemus. We are able to capture a picture, to compress it and to write it to an output device.


libjpeg 소스를 보니 위와 같은 코드로 진행돼면서 jpg 파일을 디코딩 하도록 되어있네요..
jpeg_stdio_dest(&cinfo, fh); //fh is the file handler
이 부분이 파일포인터를 cinfo에 넣어서 데이타를 추출하고 있습니다.
cinfo 구조체에중 파일을 사용하지 않고 jpeg 데이타를 바로 이용할 수 있는 함수가 있는지 궁금하네요?

예를 들어 jpeg_data_dest(&cinfo, char *data)이런 함수정도 있는지 궁금하네요?
data는 인코딩된 jpeg 데아타 포인터이면 되겠죠?

libjpeg를 이용해서 작업하셨던분 조언 부탁드립니다.

꿈은 이루어진다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.