* Rotated images did not work correctly.

* Removed ICO specific configuration, added copyright note about the source of this translator.
* Disabled test mode for the build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20548 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2007-04-04 11:57:33 +00:00
parent 00006796b4
commit 7e4913f545
3 changed files with 15 additions and 26 deletions

View File

@ -47,25 +47,14 @@ ConfigView::ConfigView(const BRect &frame, uint32 resize, uint32 flags)
stringView = new BStringView(rect, "copyright", B_UTF8_COPYRIGHT "2007 Haiku Inc.");
stringView->ResizeToPreferred();
AddChild(stringView);
rect.OffsetBy(0, height + 20);
BCheckBox *checkBox = new BCheckBox(rect, "color", "Write 32 bit images on true color input", NULL);
checkBox->ResizeToPreferred();
AddChild(checkBox);
rect.OffsetBy(0, height + 10);
checkBox = new BCheckBox(rect, "size", "Enforce valid icon sizes", NULL);
checkBox->ResizeToPreferred();
checkBox->SetValue(1);
AddChild(checkBox);
rect.OffsetBy(0, height + 15);
stringView = new BStringView(rect, "valid1", "Valid icon sizes are 16, 32, or 48");
stringView = new BStringView(rect, "copyright2", "Based on Dave Coffin's dcraw 8.63");
stringView->ResizeToPreferred();
AddChild(stringView);
rect.OffsetBy(0, height + 5);
stringView = new BStringView(rect, "valid2", "pixel in either direction.");
stringView = new BStringView(rect, "copyright3", B_UTF8_COPYRIGHT "1997-2007 Dave Coffin");
stringView->ResizeToPreferred();
AddChild(stringView);
}

View File

@ -2376,12 +2376,6 @@ DCRaw::_LoadRAW(const image_data_info& image)
void
DCRaw::_WriteRGB32(image_data_info& image, uint8* outputBuffer)
{
fOutputWidth = fInputWidth;
fOutputHeight = fInputHeight;
if (image.flip & 4)
SWAP(fOutputHeight, fOutputWidth);
uint8* line, lookUpTable[0x10000];
uint32 outputRow = (4 * fOutputBitsPerSample / 8) * fOutputWidth;
@ -2398,10 +2392,13 @@ DCRaw::_WriteRGB32(image_data_info& image, uint8* outputBuffer)
int32 sourceOffset = _FlipIndex(0, 0, image.flip);
int32 colStep = _FlipIndex(0, 1, image.flip) - sourceOffset;
int32 rowStep = _FlipIndex(1, 0, image.flip) - _FlipIndex(0, fOutputWidth, image.flip);
int32 rowStep = _FlipIndex(1, 0, image.flip)
- _FlipIndex(0, fOutputWidth, image.flip);
TRACE(("flip = %ld, sourceOffset = %ld, colStep = %ld, rowStep = %ld, input: %lu x %lu, output: %lu x %lu\n",
image.flip, sourceOffset, colStep, rowStep, fInputWidth, fInputHeight, fOutputWidth, fOutputHeight));
TRACE(("flip = %ld, sourceOffset = %ld, colStep = %ld, rowStep = %ld, "
"input: %lu x %lu, output: %lu x %lu\n", image.flip, sourceOffset,
colStep, rowStep, fInputWidth, fInputHeight, fOutputWidth,
fOutputHeight));
if (fOutputBitsPerSample == 8) {
for (uint32 row = 0; row < fOutputHeight; row++, sourceOffset += rowStep) {
@ -3257,6 +3254,9 @@ DCRaw::ReadImageAt(uint32 index, uint8*& outputBuffer, size_t& bufferSize)
fShrink = (fHalfSize || fThreshold) && fFilters;
fOutputWidth = (fInputWidth + fShrink) >> fShrink;
fOutputHeight = (fInputHeight + fShrink) >> fShrink;
if (image.flip & 4)
SWAP(fOutputHeight, fOutputWidth);
image.output_width = fOutputWidth;
image.output_height = fOutputHeight;

View File

@ -10,9 +10,9 @@
#include <Application.h>
#define TEST_MODE 1
#define TEST_MODE 0
#define SHOW_MODE 1
#if SHOW_MODE
#if SHOW_MODE && TEST_MODE
# include <Bitmap.h>
# include <BitmapStream.h>
# include <View.h>
@ -86,7 +86,7 @@ main(int argc, char **argv)
i, data.is_raw ? "RAW " : "JPEG",
data.width, data.height, data.bits_per_sample, data.compression);
#if SHOW_MODE
# if SHOW_MODE
if (!data.is_raw) {
// write data to file
uint8* buffer;
@ -132,7 +132,7 @@ main(int argc, char **argv)
wait_for_thread(window->Thread(), &status);
}
}
#endif
# endif
}
}
return 0;