Skip to content

Can we use 16-bit RGB image as input without converting into 8-bit RGB(by libpng)? #93

@Starry-lei

Description

@Starry-lei

Hi, I think the code here:
" image->SetSize(width, height);
png_bytep* row_pointers = new png_bytep[height];
for (u32 y = 0; y < height; ++ y) {
row_pointers[y] = reinterpret_cast<png_bytep>(image->row(y));
}
png_read_image(png_ptr, row_pointers);
"

will convert 16-bit RGB image into 8-bit RGB right?

The libpng api: void PNGAPI
png_read_image(png_structrp png_ptr, png_bytepp image) require png_bytepp( uchar pointer pointer).

Is there any easy way to change the above code so that it supports 16-bit RGB image as input?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions