[DEV] change naming (internal)

This commit is contained in:
Edouard DUPIN 2016-04-29 23:45:08 +02:00
parent 19c0f306c6
commit 0afda0e999

View File

@ -108,12 +108,12 @@ bool egami::loadPNG(const std::string& _inputFile, egami::Image& _ouputImage) {
png_uint_32 width = 0;
png_uint_32 height = 0;
int bit_depth = 0;
int color_type = 0;
int colorType = 0;
int interlace_type = 0;
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, NULL, NULL);
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &colorType, &interlace_type, NULL, NULL);
// reallocate the image
EGAMI_VERBOSE("Load PNG image : (" << width << "," << height << ")" );
switch (color_type) {
switch (colorType) {
case PNG_COLOR_TYPE_RGBA:
_ouputImage.configure(ivec2(width,height), egami::colorType::RGBA8);
break;
@ -147,12 +147,12 @@ bool egami::loadPNG(const std::string& _inputFile, egami::Image& _ouputImage) {
png_set_packswap(png_ptr);
/* Expand paletted colors into true RGB triplets */
if (color_type == PNG_COLOR_TYPE_PALETTE) {
if (colorType == PNG_COLOR_TYPE_PALETTE) {
png_set_palette_to_rgb(png_ptr);
}
// Expand grayscale images to the full 8 bits from 1, 2, or 4 bits/pixel
if ( color_type == PNG_COLOR_TYPE_GRAY
if ( colorType == PNG_COLOR_TYPE_GRAY
&& bit_depth < 8) {
png_set_expand_gray_1_2_4_to_8(png_ptr);
}
@ -169,7 +169,7 @@ bool egami::loadPNG(const std::string& _inputFile, egami::Image& _ouputImage) {
* use it - you should use the (solid) application background if it has one.
*/
/*
png_color_16 my_background, *image_background;
png_color::16 my_background, *image_background;
if (png_get_bKGD(png_ptr, info_ptr, &image_background) != 0) {
png_set_background(png_ptr, image_background, PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
} else {
@ -201,7 +201,7 @@ bool egami::loadPNG(const std::string& _inputFile, egami::Image& _ouputImage) {
//png_set_expand(png_ptr);
etk::Color<> tmpColor(0,0,0,0);
switch (color_type) {
switch (colorType) {
case PNG_COLOR_TYPE_RGBA:
EGAMI_ERROR("plop: PNG_COLOR_TYPE_RGBA");
// Conversion to OpenGL texture