Continue png writing.
This commit is contained in:
parent
5400a232dd
commit
8f97e9b7a1
29 changed files with 714 additions and 302 deletions
|
@ -9,21 +9,26 @@
|
|||
|
||||
int main()
|
||||
{
|
||||
unsigned width = 20;
|
||||
unsigned height = 20;
|
||||
unsigned numChannels = 3;
|
||||
unsigned width = 10;
|
||||
unsigned height = 10;
|
||||
unsigned numChannels = 1;
|
||||
auto image = Image<unsigned char>::Create(width, height);
|
||||
image->setNumChannels(numChannels);
|
||||
image->setBitDepth(8);
|
||||
|
||||
std::vector<unsigned char> data(image->getBytesPerRow()*height, 0);
|
||||
std::vector<unsigned char> data(width*height, 0);
|
||||
for (unsigned idx=0; idx<width*height; idx++)
|
||||
{
|
||||
data[idx] = 10;
|
||||
}
|
||||
|
||||
ImagePrimitives::drawAlternatingStrips(data, width, height, numChannels, image->getBytesPerRow());
|
||||
image->setData(data);
|
||||
|
||||
PngWriter writer;
|
||||
writer.setPath("test.png");
|
||||
writer.write(image);
|
||||
|
||||
return 0;
|
||||
File test_file("test.png");
|
||||
test_file.SetAccessMode(File::AccessMode::Read);
|
||||
test_file.Open(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue