Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
d9fb1a4b
Commit
d9fb1a4b
authored
Jan 10, 2011
by
Vincent Povirk
Committed by
Alexandre Julliard
Jan 11, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Add a utility function for swapping 8-bit BGR/RGB data.
parent
d7476521
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
25 deletions
+28
-25
jpegformat.c
dlls/windowscodecs/jpegformat.c
+4
-13
main.c
dlls/windowscodecs/main.c
+19
-0
tiffformat.c
dlls/windowscodecs/tiffformat.c
+3
-12
wincodecs_private.h
dlls/windowscodecs/wincodecs_private.h
+2
-0
No files found.
dlls/windowscodecs/jpegformat.c
View file @
d9fb1a4b
...
...
@@ -577,7 +577,7 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface,
UINT
first_scanline
=
This
->
cinfo
.
output_scanline
;
UINT
max_rows
;
JSAMPROW
out_rows
[
4
];
UINT
i
,
j
;
UINT
i
;
JDIMENSION
ret
;
max_rows
=
min
(
This
->
cinfo
.
output_height
-
first_scanline
,
4
);
...
...
@@ -596,18 +596,9 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface,
if
(
bpp
==
24
)
{
/* libjpeg gives us RGB data and we want BGR, so byteswap the data */
for
(
i
=
first_scanline
;
i
<
This
->
cinfo
.
output_scanline
;
i
++
)
{
BYTE
*
pixel
=
This
->
image_data
+
stride
*
i
;
for
(
j
=
0
;
j
<
This
->
cinfo
.
output_width
;
j
++
)
{
BYTE
red
=
pixel
[
0
];
BYTE
blue
=
pixel
[
2
];
pixel
[
0
]
=
blue
;
pixel
[
2
]
=
red
;
pixel
+=
3
;
}
}
reverse_bgr8
(
3
,
This
->
image_data
+
stride
*
first_scanline
,
This
->
cinfo
.
output_width
,
This
->
cinfo
.
output_scanline
-
first_scanline
,
stride
);
}
if
(
This
->
cinfo
.
out_color_space
==
JCS_CMYK
&&
This
->
cinfo
.
saw_Adobe_marker
)
...
...
dlls/windowscodecs/main.c
View file @
d9fb1a4b
...
...
@@ -112,3 +112,22 @@ HRESULT copy_pixels(UINT bpp, const BYTE *srcbuffer,
return
E_FAIL
;
}
}
void
reverse_bgr8
(
UINT
bytesperpixel
,
LPBYTE
bits
,
UINT
width
,
UINT
height
,
INT
stride
)
{
UINT
x
,
y
;
BYTE
*
pixel
,
temp
;
for
(
y
=
0
;
y
<
height
;
y
++
)
{
pixel
=
bits
+
stride
*
y
;
for
(
x
=
0
;
x
<
width
;
x
++
)
{
temp
=
pixel
[
2
];
pixel
[
2
]
=
pixel
[
0
];
pixel
[
0
]
=
temp
;
pixel
+=
bytesperpixel
;
}
}
}
dlls/windowscodecs/tiffformat.c
View file @
d9fb1a4b
...
...
@@ -800,19 +800,10 @@ static HRESULT TiffFrameDecode_ReadTile(TiffFrameDecode *This, UINT tile_x, UINT
{
if
(
This
->
decode_info
.
bps
==
8
)
{
UINT
i
,
total_pixels
,
sample_count
;
BYTE
*
pixel
,
temp
;
UINT
sample_count
=
This
->
decode_info
.
samples
;
total_pixels
=
This
->
decode_info
.
tile_width
*
This
->
decode_info
.
tile_height
;
pixel
=
This
->
cached_tile
;
sample_count
=
This
->
decode_info
.
samples
;
for
(
i
=
0
;
i
<
total_pixels
;
i
++
)
{
temp
=
pixel
[
2
];
pixel
[
2
]
=
pixel
[
0
];
pixel
[
0
]
=
temp
;
pixel
+=
sample_count
;
}
reverse_bgr8
(
sample_count
,
This
->
cached_tile
,
This
->
decode_info
.
tile_width
,
This
->
decode_info
.
tile_height
,
This
->
decode_info
.
tile_width
*
sample_count
);
}
}
...
...
dlls/windowscodecs/wincodecs_private.h
View file @
d9fb1a4b
...
...
@@ -51,6 +51,8 @@ extern HRESULT copy_pixels(UINT bpp, const BYTE *srcbuffer,
UINT
srcwidth
,
UINT
srcheight
,
INT
srcstride
,
const
WICRect
*
rc
,
UINT
dststride
,
UINT
dstbuffersize
,
BYTE
*
dstbuffer
);
extern
void
reverse_bgr8
(
UINT
bytesperpixel
,
LPBYTE
bits
,
UINT
width
,
UINT
height
,
INT
stride
);
extern
HRESULT
CreatePropertyBag2
(
IPropertyBag2
**
ppPropertyBag2
);
extern
HRESULT
CreateComponentInfo
(
REFCLSID
clsid
,
IWICComponentInfo
**
ppIInfo
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment