Click here to Skip to main content
15,914,488 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: conversion of unix codes to VC++ codes Pin
David Crow17-Jun-05 6:24
David Crow17-Jun-05 6:24 
GeneralRe: conversion of unix codes to VC++ codes Pin
Bugslayer117-Jun-05 6:57
Bugslayer117-Jun-05 6:57 
GeneralRe: conversion of unix codes to VC++ codes Pin
David Crow17-Jun-05 7:07
David Crow17-Jun-05 7:07 
GeneralRe: conversion of unix codes to VC++ codes Pin
Bugslayer117-Jun-05 7:15
Bugslayer117-Jun-05 7:15 
GeneralRe: conversion of unix codes to VC++ codes Pin
David Crow17-Jun-05 7:18
David Crow17-Jun-05 7:18 
GeneralRe: conversion of unix codes to VC++ codes Pin
Bugslayer117-Jun-05 7:36
Bugslayer117-Jun-05 7:36 
GeneralRe: conversion of unix codes to VC++ codes Pin
David Crow17-Jun-05 8:03
David Crow17-Jun-05 8:03 
GeneralRe: conversion of unix codes to VC++ codes Pin
Bugslayer120-Jun-05 5:53
Bugslayer120-Jun-05 5:53 
Thanks for your help to expand the codes into a readable fashion. I still have some probelms although I made some progress with some changes.

typedef void biasFn (void *image, void *bias, uint32 pixels);

static void subtract8 (uint8 *i, uint8 *b, uint32 pixels)
{
uint8 *image = i;
uint8 *bias = b;
while (pixels--)
{
*image = *image > *bias ? *image-*bias : 0;
image++, bias++;
}
}
static void subtract16 (uint16 *i, uint16 *b, uint32 pixels)
{
uint16 *image = i;
uint16 *bias = b;
while (pixels--)
{ *image = *image > *bias ? *image-*bias : 0;
image++, bias++;
}
}
static void subtract32 (uint32 *i, uint32 *b, uint32 pixels)
{
uint32 *image = i;
uint32 *bias = b;
while (pixels--)
{
*image = *image > *bias ? *image-*bias : 0;
image++, bias++;
}
}
static biasFn *lineSubtractFn (unsigned bits)
{
switch (bits) {
case 8: return subtract8;
case 16: return subtract16;
case 32: return subtract32;
}
return 0;
}

......
biasFn *subtractLine;
TIFFGetField(in, 258, &sampleBits);
subtractLine = lineSubtractFn (sampleBits);
if (subtractLine) {
......
}
......

However, there are some errors I need to work out. Here are the error messages:

e:\vc++\libtiff\src\tiff\3.7.2\tiff-3.7.2-src\tools\tiffcp\tiffcp.cpp(975) : error C2440: 'return' : cannot convert from 'void (__cdecl *)(unsigned char *,unsigned char *,unsigned long)' to 'void (__cdecl *)(void *,void *,unsigned long)'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
e:\vc++\libtiff\src\tiff\3.7.2\tiff-3.7.2-src\tools\tiffcp\tiffcp.cpp(976) : error C2440: 'return' : cannot convert from 'void (__cdecl *)(unsigned short *,unsigned short *,unsigned long)' to 'void (__cdecl *)(void *,void *,unsigned long)'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
e:\vc++\libtiff\src\tiff\3.7.2\tiff-3.7.2-src\tools\tiffcp\tiffcp.cpp(977) : error C2440: 'return' : cannot convert from 'void (__cdecl *)(unsigned long *,unsigned long *,unsigned long)' to 'void (__cdecl *)(void *,void *,unsigned long)'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast

Any help is appreciated.

GeneralRe: conversion of unix codes to VC++ codes Pin
David Crow20-Jun-05 6:06
David Crow20-Jun-05 6:06 
GeneralRe: conversion of unix codes to VC++ codes Pin
Bugslayer120-Jun-05 6:09
Bugslayer120-Jun-05 6:09 
GeneralRe: conversion of unix codes to VC++ codes Pin
David Crow20-Jun-05 6:15
David Crow20-Jun-05 6:15 
GeneralRe: conversion of unix codes to VC++ codes Pin
Bob Stanneveld17-Jun-05 10:36
Bob Stanneveld17-Jun-05 10:36 
GeneralRe: conversion of unix codes to VC++ codes Pin
Bob Stanneveld17-Jun-05 10:32
Bob Stanneveld17-Jun-05 10:32 
Generalexcel chart Pin
Anonymous17-Jun-05 6:00
Anonymous17-Jun-05 6:00 
GeneralRe: excel chart Pin
David Crow17-Jun-05 6:23
David Crow17-Jun-05 6:23 
QuestionAPI Call to find the installed Default Email Client ?? Pin
Robert Palma Jr.17-Jun-05 5:59
Robert Palma Jr.17-Jun-05 5:59 
AnswerRe: API Call to find the installed Default Email Client ?? Pin
Ravi Bhavnani17-Jun-05 6:14
professionalRavi Bhavnani17-Jun-05 6:14 
GeneralRe: API Call to find the installed Default Email Client ?? Pin
Robert Palma Jr.17-Jun-05 6:24
Robert Palma Jr.17-Jun-05 6:24 
GeneralRe: API Call to find the installed Default Email Client ?? Pin
David Crow17-Jun-05 7:25
David Crow17-Jun-05 7:25 
GeneralRe: API Call to find the installed Default Email Client ?? Pin
Robert Palma Jr.17-Jun-05 8:07
Robert Palma Jr.17-Jun-05 8:07 
GeneralRe: API Call to find the installed Default Email Client ?? Pin
David Crow17-Jun-05 8:17
David Crow17-Jun-05 8:17 
GeneralRe: API Call to find the installed Default Email Client ?? Pin
Robert Palma Jr.17-Jun-05 10:07
Robert Palma Jr.17-Jun-05 10:07 
GeneralRe: API Call to find the installed Default Email Client ?? Pin
David Crow17-Jun-05 10:13
David Crow17-Jun-05 10:13 
GeneralRe: API Call to find the installed Default Email Client ?? Pin
Robert Palma Jr.17-Jun-05 10:54
Robert Palma Jr.17-Jun-05 10:54 
GeneralRe: API Call to find the installed Default Email Client ?? Pin
David Crow17-Jun-05 17:02
David Crow17-Jun-05 17:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.