Создать TIFF из 16 бит пикселеей
От: ASMerg  
Дата: 10.02.08 18:19
Оценка:
Всех приветствую!
Необходимо записать в ТИФ 16 битную картинку.
Изначально имею массив пикселей.
Не ясно как мне его засунуть в CxImage()
Сейчас делаю так, не знаю насколько это правильно:

CxImage *img;
img = new CxImage(nLinesNumber, -m_nDataLen, 16, CXIMAGE_FORMAT_TIF);

for(int j=0; j<nLinesNumber; j++)
{
    for( int i=0; i<m_nDataLen; i++)
    {
         unsVar = m_pScanData[m_nDataLen*j+i];
         img->SetPixelColor(j,i,RGB(unsVar,unsVar,unsVar));
    }
}


Верно ли это?

И еще почему-то мне не доступна функция CxImage::Save(...)
Подключал так:

#pragma comment(lib, "CxImage.lib")     //  libtiff lib
#include "ximage.h"
Re: Создать TIFF из 16 бит пикселеей
От: goto Россия  
Дата: 10.02.08 19:26
Оценка:
Если "16-битная" это 16 бит на цвет, т.е. 48/64-битная, то CxImage, насколько знаю, с такикми картинками не работает.

Если у вас 16 бит на пиксель, то вот это RGB(unsVar,unsVar,unsVar)- неверно. Вам надо из unsVar получить байтовые red, green, blue и их вставить в RGB(red, green, blue).

Для линковки, вообще говоря, нужны еще библиотеки под tiff и прочее. Возьмите исходник демо-проекта CxImage с codeproject.com, там в проекте все нужное прилинковано.
Re[2]: Создать TIFF из 16 бит пикселеей
От: ASMerg  
Дата: 11.02.08 12:59
Оценка:
после того как делаю #include "ximage.h"
получаю

Linking...
Creating library Release/TwoScanM.lib and object Release/TwoScanM.exp
cximage.lib(ximasel.obj) : warning LNK4217: locally defined symbol _fclose imported in function "public: virtual __thiscall CxIOFile::~CxIOFile(void)" (??1CxIOFile@@UAE@XZ)
cximage.lib(xImage.obj) : warning LNK4217: locally defined symbol _fclose imported in function "public: virtual __thiscall CxIOFile::~CxIOFile(void)" (??1CxIOFile@@UAE@XZ)
cximage.lib(ximainfo.obj) : warning LNK4049: locally defined symbol _fclose imported
cximage.lib(ximapal.obj) : warning LNK4217: locally defined symbol _fclose imported in function "public: virtual __thiscall CxIOFile::~CxIOFile(void)" (??1CxIOFile@@UAE@XZ)
cximage.lib(ximalpha.obj) : warning LNK4217: locally defined symbol _fclose imported in function "public: virtual __thiscall CxIOFile::~CxIOFile(void)" (??1CxIOFile@@UAE@XZ)
cximage.lib(ximasel.obj) : warning LNK4217: locally defined symbol _fflush imported in function "public: virtual bool __thiscall CxIOFile::Flush(void)" (?Flush@CxIOFile@@UAE_NXZ)
cximage.lib(xImage.obj) : warning LNK4217: locally defined symbol _fflush imported in function "public: virtual bool __thiscall CxIOFile::Flush(void)" (?Flush@CxIOFile@@UAE_NXZ)
cximage.lib(ximainfo.obj) : warning LNK4049: locally defined symbol _fflush imported
cximage.lib(ximapal.obj) : warning LNK4217: locally defined symbol _fflush imported in function "public: virtual bool __thiscall CxIOFile::Flush(void)" (?Flush@CxIOFile@@UAE_NXZ)
cximage.lib(ximalpha.obj) : warning LNK4217: locally defined symbol _fflush imported in function "public: virtual bool __thiscall CxIOFile::Flush(void)" (?Flush@CxIOFile@@UAE_NXZ)
cximage.lib(xImage.obj) : warning LNK4217: locally defined symbol _free imported in function "public: bool __thiscall CxImage::Destroy(void)" (?Destroy@CxImage@@QAE_NXZ)
cximage.lib(xmemfile.obj) : warning LNK4049: locally defined symbol _free imported
cximage.lib(ximalpha.obj) : warning LNK4049: locally defined symbol _free imported
cximage.lib(ximasel.obj) : warning LNK4049: locally defined symbol _free imported
cximage.lib(xImage.obj) : warning LNK4217: locally defined symbol _malloc imported in function "public: void __thiscall CxImage::Copy(class CxImage const &,bool,bool,bool)" (?Copy@CxImage@@QAEXABV1@_N11@Z)
cximage.lib(xmemfile.obj) : warning LNK4049: locally defined symbol _malloc imported
cximage.lib(ximalpha.obj) : warning LNK4049: locally defined symbol _malloc imported
cximage.lib(ximasel.obj) : warning LNK4049: locally defined symbol _malloc imported
cximage.lib(xmemfile.obj) : warning LNK4217: locally defined symbol _realloc imported in function "protected: void __thiscall CxMemFile::Alloc(unsigned long)" (?Alloc@CxMemFile@@IAEXK@Z)
cximage.lib(ximasel.obj) : warning LNK4217: locally defined symbol _calloc imported in function "public: bool __thiscall CxImage::SelectionCreate(void)" (?SelectionCreate@CxImage@@QAE_NXZ)
cximage.lib(ximasel.obj) : error LNK2019: unresolved external symbol __imp__fopen referenced in function "public: bool __thiscall CxIOFile::Open(char const *,char const *)" (?Open@CxIOFile@@QAE_NPBD0@Z)
cximage.lib(xImage.obj) : error LNK2001: unresolved external symbol __imp__fopen
cximage.lib(ximainfo.obj) : error LNK2001: unresolved external symbol __imp__fopen
cximage.lib(ximapal.obj) : error LNK2001: unresolved external symbol __imp__fopen
cximage.lib(ximalpha.obj) : error LNK2001: unresolved external symbol __imp__fopen
cximage.lib(ximasel.obj) : error LNK2019: unresolved external symbol __imp__fread referenced in function "public: virtual unsigned int __thiscall CxIOFile::Read(void *,unsigned int,unsigned int)" (?Read@CxIOFile@@UAEIPAXII@Z)
cximage.lib(xImage.obj) : error LNK2001: unresolved external symbol __imp__fread
cximage.lib(ximainfo.obj) : error LNK2001: unresolved external symbol __imp__fread
cximage.lib(ximapal.obj) : error LNK2001: unresolved external symbol __imp__fread
cximage.lib(ximalpha.obj) : error LNK2001: unresolved external symbol __imp__fread
cximage.lib(ximasel.obj) : error LNK2019: unresolved external symbol __imp__fwrite referenced in function "public: virtual unsigned int __thiscall CxIOFile::Write(void const *,unsigned int,unsigned int)" (?Write@CxIOFile@@UAEIPBXII@Z)
cximage.lib(xImage.obj) : error LNK2001: unresolved external symbol __imp__fwrite
cximage.lib(ximainfo.obj) : error LNK2001: unresolved external symbol __imp__fwrite
cximage.lib(ximapal.obj) : error LNK2001: unresolved external symbol __imp__fwrite
cximage.lib(ximalpha.obj) : error LNK2001: unresolved external symbol __imp__fwrite
cximage.lib(ximasel.obj) : error LNK2019: unresolved external symbol __imp__fseek referenced in function "public: virtual bool __thiscall CxIOFile::Seek(long,int)" (?Seek@CxIOFile@@UAE_NJH@Z)
cximage.lib(xImage.obj) : error LNK2001: unresolved external symbol __imp__fseek
cximage.lib(ximainfo.obj) : error LNK2001: unresolved external symbol __imp__fseek
cximage.lib(ximapal.obj) : error LNK2001: unresolved external symbol __imp__fseek
cximage.lib(ximalpha.obj) : error LNK2001: unresolved external symbol __imp__fseek
cximage.lib(ximasel.obj) : error LNK2019: unresolved external symbol __imp__ftell referenced in function "public: virtual long __thiscall CxIOFile::Tell(void)" (?Tell@CxIOFile@@UAEJXZ)
cximage.lib(xImage.obj) : error LNK2001: unresolved external symbol __imp__ftell
cximage.lib(ximainfo.obj) : error LNK2001: unresolved external symbol __imp__ftell
cximage.lib(ximapal.obj) : error LNK2001: unresolved external symbol __imp__ftell
cximage.lib(ximalpha.obj) : error LNK2001: unresolved external symbol __imp__ftell
cximage.lib(ximasel.obj) : error LNK2019: unresolved external symbol __imp__fputc referenced in function "public: virtual bool __thiscall CxIOFile::PutC(unsigned char)" (?PutC@CxIOFile@@UAE_NE@Z)
cximage.lib(xImage.obj) : error LNK2001: unresolved external symbol __imp__fputc
cximage.lib(ximainfo.obj) : error LNK2001: unresolved external symbol __imp__fputc
cximage.lib(ximapal.obj) : error LNK2001: unresolved external symbol __imp__fputc
cximage.lib(ximalpha.obj) : error LNK2001: unresolved external symbol __imp__fputc
cximage.lib(ximasel.obj) : error LNK2019: unresolved external symbol __imp__getc referenced in function "public: virtual long __thiscall CxIOFile::GetC(void)" (?GetC@CxIOFile@@UAEJXZ)
cximage.lib(xImage.obj) : error LNK2001: unresolved external symbol __imp__getc
cximage.lib(ximainfo.obj) : error LNK2001: unresolved external symbol __imp__getc
cximage.lib(ximapal.obj) : error LNK2001: unresolved external symbol __imp__getc
cximage.lib(ximalpha.obj) : error LNK2001: unresolved external symbol __imp__getc
cximage.lib(ximainfo.obj) : error LNK2019: unresolved external symbol __imp__floor referenced in function "public: void __thiscall CxImage::SetXDPI(long)" (?SetXDPI@CxImage@@QAEXJ@Z)
Release/TwoScanM.exe : fatal error LNK1120: 8 unresolved externals


Состояне близкое к истерике)
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.