moved translate_direct_copy function from PNGTranslator to BaseTranslator

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6841 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matthew Wilber 2004-03-01 04:23:26 +00:00
parent d02fdb8eb5
commit c36e6575c8
3 changed files with 13 additions and 12 deletions

View File

@ -278,18 +278,6 @@ PNGTranslator::DerivedIdentify(BPositionIO *inSource,
return identify_png_header(inSource, outInfo);
}
void
translate_direct_copy(BPositionIO *inSource, BPositionIO *outDestination)
{
const size_t kbufsize = 2048;
uint8 buffer[kbufsize];
ssize_t ret = inSource->Read(buffer, kbufsize);
while (ret > 0) {
outDestination->Write(buffer, ret);
ret = inSource->Read(buffer, kbufsize);
}
}
status_t
PNGTranslator::translate_from_png_to_bits(BPositionIO *inSource,
BPositionIO *outDestination)

View File

@ -685,3 +685,14 @@ BaseTranslator::NewConfigView(TranslatorSettings *settings)
return NULL;
}
void
translate_direct_copy(BPositionIO *inSource, BPositionIO *outDestination)
{
const size_t kbufsize = 2048;
uint8 buffer[kbufsize];
ssize_t ret = inSource->Read(buffer, kbufsize);
while (ret > 0) {
outDestination->Write(buffer, ret);
ret = inSource->Read(buffer, kbufsize);
}
}

View File

@ -150,5 +150,7 @@ private:
uint32 fTranType;
};
void translate_direct_copy(BPositionIO *inSource, BPositionIO *outDestination);
#endif // #ifndef BASE_TRANSLATOR_H