Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
4d25791b
Commit
4d25791b
authored
Aug 03, 2007
by
Evan Stade
Committed by
Alexandre Julliard
Aug 06, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Added GdipGetImagePixelFormat.
parent
f3879cd9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
14 deletions
+73
-14
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+1
-1
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+1
-0
image.c
dlls/gdiplus/image.c
+44
-13
gdiplusflat.h
include/gdiplusflat.h
+1
-0
gdipluspixelformats.h
include/gdipluspixelformats.h
+26
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
4d25791b
...
@@ -293,7 +293,7 @@
...
@@ -293,7 +293,7 @@
@ stub GdipGetImageItemData
@ stub GdipGetImageItemData
@ stub GdipGetImagePalette
@ stub GdipGetImagePalette
@ stub GdipGetImagePaletteSize
@ stub GdipGetImagePaletteSize
@ st
ub GdipGetImagePixelFormat
@ st
dcall GdipGetImagePixelFormat(ptr ptr)
@ stdcall GdipGetImageRawFormat(ptr ptr)
@ stdcall GdipGetImageRawFormat(ptr ptr)
@ stub GdipGetImageThumbnail
@ stub GdipGetImageThumbnail
@ stdcall GdipGetImageType(ptr ptr)
@ stdcall GdipGetImageType(ptr ptr)
...
...
dlls/gdiplus/gdiplus_private.h
View file @
4d25791b
...
@@ -142,6 +142,7 @@ struct GpBitmap{
...
@@ -142,6 +142,7 @@ struct GpBitmap{
GpImage
image
;
GpImage
image
;
INT
width
;
INT
width
;
INT
height
;
INT
height
;
PixelFormat
format
;
};
};
struct
GpImageAttributes
{
struct
GpImageAttributes
{
...
...
dlls/gdiplus/image.c
View file @
4d25791b
...
@@ -36,6 +36,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
...
@@ -36,6 +36,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
typedef
void
ImageItemData
;
typedef
void
ImageItemData
;
#define PIXELFORMATBPP(x) ((x) ? ((x) >> 8) & 255 : 24)
static
INT
ipicture_pixel_height
(
IPicture
*
pic
)
static
INT
ipicture_pixel_height
(
IPicture
*
pic
)
{
{
HDC
hdcref
;
HDC
hdcref
;
...
@@ -121,7 +123,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
...
@@ -121,7 +123,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
bmih
->
biWidth
=
width
;
bmih
->
biWidth
=
width
;
bmih
->
biHeight
=
height
;
bmih
->
biHeight
=
height
;
/* FIXME: use the rest of the data from format */
/* FIXME: use the rest of the data from format */
bmih
->
biBitCount
=
format
>>
8
;
bmih
->
biBitCount
=
PIXELFORMATBPP
(
format
)
;
bmih
->
biCompression
=
BI_RGB
;
bmih
->
biCompression
=
BI_RGB
;
memcpy
(
bmih
+
1
,
scan0
,
datalen
);
memcpy
(
bmih
+
1
,
scan0
,
datalen
);
...
@@ -145,6 +147,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
...
@@ -145,6 +147,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
(
*
bitmap
)
->
image
.
type
=
ImageTypeBitmap
;
(
*
bitmap
)
->
image
.
type
=
ImageTypeBitmap
;
(
*
bitmap
)
->
width
=
width
;
(
*
bitmap
)
->
width
=
width
;
(
*
bitmap
)
->
height
=
height
;
(
*
bitmap
)
->
height
=
height
;
(
*
bitmap
)
->
format
=
format
;
return
Ok
;
return
Ok
;
}
}
...
@@ -152,6 +155,10 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
...
@@ -152,6 +155,10 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
GpStatus
WINGDIPAPI
GdipCreateBitmapFromStream
(
IStream
*
stream
,
GpStatus
WINGDIPAPI
GdipCreateBitmapFromStream
(
IStream
*
stream
,
GpBitmap
**
bitmap
)
GpBitmap
**
bitmap
)
{
{
BITMAPINFO
bmi
;
BITMAPCOREHEADER
*
bmch
;
OLE_HANDLE
hbm
;
HDC
hdc
;
GpStatus
stat
;
GpStatus
stat
;
stat
=
GdipLoadImageFromStream
(
stream
,
(
GpImage
**
)
bitmap
);
stat
=
GdipLoadImageFromStream
(
stream
,
(
GpImage
**
)
bitmap
);
...
@@ -164,24 +171,34 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream* stream,
...
@@ -164,24 +171,34 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream* stream,
(
*
bitmap
)
->
width
=
ipicture_pixel_width
((
*
bitmap
)
->
image
.
picture
);
(
*
bitmap
)
->
width
=
ipicture_pixel_width
((
*
bitmap
)
->
image
.
picture
);
(
*
bitmap
)
->
height
=
ipicture_pixel_height
((
*
bitmap
)
->
image
.
picture
);
(
*
bitmap
)
->
height
=
ipicture_pixel_height
((
*
bitmap
)
->
image
.
picture
);
/* get the pixel format */
IPicture_get_Handle
((
*
bitmap
)
->
image
.
picture
,
&
hbm
);
IPicture_get_CurDC
((
*
bitmap
)
->
image
.
picture
,
&
hdc
);
bmch
=
(
BITMAPCOREHEADER
*
)
(
&
bmi
.
bmiHeader
);
bmch
->
bcSize
=
sizeof
(
BITMAPCOREHEADER
);
if
(
!
hdc
){
HBITMAP
old
;
hdc
=
GetDC
(
0
);
old
=
SelectObject
(
hdc
,
(
HBITMAP
)
hbm
);
GetDIBits
(
hdc
,
(
HBITMAP
)
hbm
,
0
,
0
,
NULL
,
&
bmi
,
DIB_RGB_COLORS
);
SelectObject
(
hdc
,
old
);
ReleaseDC
(
0
,
hdc
);
}
else
GetDIBits
(
hdc
,
(
HBITMAP
)
hbm
,
0
,
0
,
NULL
,
&
bmi
,
DIB_RGB_COLORS
);
(
*
bitmap
)
->
format
=
(
bmch
->
bcBitCount
<<
8
)
|
PixelFormatGDI
;
return
Ok
;
return
Ok
;
}
}
/* FIXME: no icm */
GpStatus
WINGDIPAPI
GdipCreateBitmapFromStreamICM
(
IStream
*
stream
,
GpStatus
WINGDIPAPI
GdipCreateBitmapFromStreamICM
(
IStream
*
stream
,
GpBitmap
**
bitmap
)
GpBitmap
**
bitmap
)
{
{
GpStatus
stat
;
return
GdipCreateBitmapFromStream
(
stream
,
bitmap
);
stat
=
GdipLoadImageFromStreamICM
(
stream
,
(
GpImage
**
)
bitmap
);
if
(
stat
!=
Ok
)
return
stat
;
(
*
bitmap
)
->
image
.
type
=
ImageTypeBitmap
;
(
*
bitmap
)
->
width
=
ipicture_pixel_width
((
*
bitmap
)
->
image
.
picture
);
(
*
bitmap
)
->
height
=
ipicture_pixel_height
((
*
bitmap
)
->
image
.
picture
);
return
Ok
;
}
}
GpStatus
WINGDIPAPI
GdipDisposeImage
(
GpImage
*
image
)
GpStatus
WINGDIPAPI
GdipDisposeImage
(
GpImage
*
image
)
...
@@ -263,6 +280,20 @@ GpStatus WINGDIPAPI GdipGetImageHorizontalResolution(GpImage *image, REAL *res)
...
@@ -263,6 +280,20 @@ GpStatus WINGDIPAPI GdipGetImageHorizontalResolution(GpImage *image, REAL *res)
return
NotImplemented
;
return
NotImplemented
;
}
}
/* FIXME: test this function for non-bitmap types */
GpStatus
WINGDIPAPI
GdipGetImagePixelFormat
(
GpImage
*
image
,
PixelFormat
*
format
)
{
if
(
!
image
||
!
format
)
return
InvalidParameter
;
if
(
image
->
type
!=
ImageTypeBitmap
)
*
format
=
PixelFormat24bppRGB
;
else
*
format
=
((
GpBitmap
*
)
image
)
->
format
;
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipGetImageRawFormat
(
GpImage
*
image
,
GUID
*
format
)
GpStatus
WINGDIPAPI
GdipGetImageRawFormat
(
GpImage
*
image
,
GUID
*
format
)
{
{
static
int
calls
;
static
int
calls
;
...
...
include/gdiplusflat.h
View file @
4d25791b
...
@@ -172,6 +172,7 @@ GpStatus WINGDIPAPI GdipDisposeImage(GpImage*);
...
@@ -172,6 +172,7 @@ GpStatus WINGDIPAPI GdipDisposeImage(GpImage*);
GpStatus
WINGDIPAPI
GdipGetImageBounds
(
GpImage
*
,
GpRectF
*
,
GpUnit
*
);
GpStatus
WINGDIPAPI
GdipGetImageBounds
(
GpImage
*
,
GpRectF
*
,
GpUnit
*
);
GpStatus
WINGDIPAPI
GdipGetImageHeight
(
GpImage
*
,
UINT
*
);
GpStatus
WINGDIPAPI
GdipGetImageHeight
(
GpImage
*
,
UINT
*
);
GpStatus
WINGDIPAPI
GdipGetImageHorizontalResolution
(
GpImage
*
,
REAL
*
);
GpStatus
WINGDIPAPI
GdipGetImageHorizontalResolution
(
GpImage
*
,
REAL
*
);
GpStatus
WINGDIPAPI
GdipGetImagePixelFormat
(
GpImage
*
,
PixelFormat
*
);
GpStatus
WINGDIPAPI
GdipGetImageRawFormat
(
GpImage
*
,
GUID
*
);
GpStatus
WINGDIPAPI
GdipGetImageRawFormat
(
GpImage
*
,
GUID
*
);
GpStatus
WINGDIPAPI
GdipGetImageType
(
GpImage
*
,
ImageType
*
);
GpStatus
WINGDIPAPI
GdipGetImageType
(
GpImage
*
,
ImageType
*
);
GpStatus
WINGDIPAPI
GdipGetImageVerticalResolution
(
GpImage
*
,
REAL
*
);
GpStatus
WINGDIPAPI
GdipGetImageVerticalResolution
(
GpImage
*
,
REAL
*
);
...
...
include/gdipluspixelformats.h
View file @
4d25791b
...
@@ -22,4 +22,30 @@
...
@@ -22,4 +22,30 @@
typedef
DWORD
ARGB
;
typedef
DWORD
ARGB
;
typedef
INT
PixelFormat
;
typedef
INT
PixelFormat
;
#define PixelFormatIndexed 0x00010000
#define PixelFormatGDI 0x00020000
#define PixelFormatAlpha 0x00040000
#define PixelFormatPAlpha 0x00080000
#define PixelFormatExtended 0x00100000
#define PixelFormatCanonical 0x00200000
#define PixelFormatUndefined 0
#define PixelFormatDontCare 0
#define PixelFormat1bppIndexed (1 | ( 1 << 8) | PixelFormatIndexed | PixelFormatGDI)
#define PixelFormat4bppIndexed (2 | ( 4 << 8) | PixelFormatIndexed | PixelFormatGDI)
#define PixelFormat8bppIndexed (3 | ( 8 << 8) | PixelFormatIndexed | PixelFormatGDI)
#define PixelFormat16bppGrayScale (4 | (16 << 8) | PixelFormatExtended)
#define PixelFormat16bppRGB555 (5 | (16 << 8) | PixelFormatGDI)
#define PixelFormat16bppRGB565 (6 | (16 << 8) | PixelFormatGDI)
#define PixelFormat16bppARGB1555 (7 | (16 << 8) | PixelFormatAlpha | PixelFormatGDI)
#define PixelFormat24bppRGB (8 | (24 << 8) | PixelFormatGDI)
#define PixelFormat32bppRGB (9 | (32 << 8) | PixelFormatGDI)
#define PixelFormat32bppARGB (10 | (32 << 8) | PixelFormatAlpha | PixelFormatGDI | PixelFormatCanonical)
#define PixelFormat32bppPARGB (11 | (32 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatGDI)
#define PixelFormat48bppRGB (12 | (48 << 8) | PixelFormatExtended)
#define PixelFormat64bppARGB (13 | (64 << 8) | PixelFormatAlpha | PixelFormatCanonical | PixelFormatExtended)
#define PixelFormat64bppPARGB (14 | (64 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatExtended)
#define PixelFormatMax 15
#endif
#endif
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