mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-21 20:12:30 +00:00
the projection is 2 bytes per pixel for grayscale images.
2007-06-06 Sven Neumann <sven@gimp.org> * app/core/gimpprojection.c (gimp_projection_estimate_memsize): the projection is 2 bytes per pixel for grayscale images. svn path=/trunk/; revision=22723
This commit is contained in:
parent
798dd95499
commit
097b1768a5
|
@ -1,3 +1,8 @@
|
|||
2007-06-06 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/core/gimpprojection.c (gimp_projection_estimate_memsize):
|
||||
the projection is 2 bytes per pixel for grayscale images.
|
||||
|
||||
2007-06-06 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/core/gimpprojection.[ch]: added function that estimates the
|
||||
|
|
|
@ -219,7 +219,21 @@ gimp_projection_estimate_memsize (GimpImageBaseType type,
|
|||
gint width,
|
||||
gint height)
|
||||
{
|
||||
return 4 * (gint64) width * (gint64) height;
|
||||
gint64 bytes = 0;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case GIMP_RGB:
|
||||
case GIMP_INDEXED:
|
||||
bytes = 4;
|
||||
break;
|
||||
|
||||
case GIMP_GRAY:
|
||||
bytes = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
return bytes * (gint64) width * (gint64) height;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue