Skip to main content
deleted 247 characters in body
Source Link
kzidane
  • 17.7k
  • 3
  • 28
  • 100

You're code is not quite clear to me, but you may check what you've already done of these steps. here is some pseudocode:

Approach #1:

for each scanline in the original BMP
{
    get the location of the file position indicator

    repeat n times // resize vertically
    {
        if we're not at the beginning of therepeat currentn scanlinetimes
        {
            set theensure file position indicator backis at the beginning of thecurrent scanline 

        }
// resize horizontally
        for each RGBTRIPLE in thiscurrent scanline
        {
            read an RGBTRIPLE
            write thatcurrent RGBTRIPLE n times //to resizenew horizontallyBMP
        }

        write the new padding to the new BMP
    }

    skip theover old padding
}

Approach #2:

for each scanline in the original BMP
{
    create anbig RGBTRIPLEsenough array named triples of size (original widthRGBTRIPLEs *named 2)triples
    
    for each RGBTRIPLE in the current scanline
    {
        read an RGBTRIPLE
        
        repeat n times // resize horizontally
        {
            storeappend thecurrent RGBTRIPLE into then currenttimes indexcontiguously ofto triples
        }
    }

    // resize resize vertically
    repeat n times
    {
        write thetriples (whole array into) theto new BMP
        write the new padding to new BMP
    }      
    
    skip the old padding
}

Hope that helps!

You're code is not quite clear to me, but you may check what you've already done of these steps

Approach #1:

for each scanline in the original BMP
{
    get the location of the file position indicator

    repeat n times // resize vertically
    {
        if we're not at the beginning of the current scanline
        {
            set the file position indicator back at the beginning of the scanline
        }

        for each RGBTRIPLE in this scanline
        {
            read an RGBTRIPLE
            write that RGBTRIPLE n times // resize horizontally
        }

        write the new padding to the new BMP
    }

    skip the old padding
}

Approach #2:

for each scanline in the original BMP
{
    create an RGBTRIPLEs array named triples of size (original width * 2)
    
    for each RGBTRIPLE in the current scanline
    {
        read an RGBTRIPLE
        
        repeat n times // resize horizontally
        {
            store the RGBTRIPLE into the current index of triples
        }
    }

    // resize resize vertically
    repeat n times
    {
        write the whole array into the new BMP
        write the new padding
    }      
    
    skip the old padding
}

Hope that helps!

You're code is not quite clear to me. here is some pseudocode:

Approach #1:

for each scanline in original BMP
{
    // resize vertically
    repeat n times
    {
        ensure file position indicator is at the beginning of current scanline 

        // resize horizontally
        for each RGBTRIPLE in current scanline
        {
            read an RGBTRIPLE
            write current RGBTRIPLE n times to new BMP
        }

        write new padding to new BMP
    }

    skip over old padding
}

Approach #2:

for each scanline in the original BMP
{
    create big enough array of RGBTRIPLEs named triples
    
    for each RGBTRIPLE in current scanline
    {
        read an RGBTRIPLE

        // resize horizontally
        append current RGBTRIPLE n times contiguously to triples 
    }

    // resize vertically
    repeat n times
    {
        write triples (whole array) to new BMP
        write new padding to new BMP
    }      
    
    skip the old padding
}

Hope that helps!

added 64 characters in body
Source Link
kzidane
  • 17.7k
  • 3
  • 28
  • 100
for each scanline in the original BMP
{
    get the location of the file position indicator

    repeat n times // resize vertically
    {
        if we're not at the beginning of the current scanline
        {
            set the file position indicator back at the beginning of the scanline
        }

        for each RGBTRIPLE in this scanline
        {
            read an RGBTRIPLE
            write that RGBTRIPLE n times // resize horizontally
        }

        write the new padding to the new BMP
    }

    skip the old padding
}
for each scanline in the original BMP
{
    get the location of the file position indicator

    repeat n times // resize vertically
    {
        if we're not at the beginning of the current scanline
        {
            set the file position indicator back at the beginning of the scanline
        }

        for each RGBTRIPLE in this scanline
        {
            read an RGBTRIPLE
            write that RGBTRIPLE n times // resize horizontally
        }

        write the new padding to the new BMP
    }

    skip the old padding
}
for each scanline in the original BMP
{
    create an RGBTRIPLEs array named triples of size (original width * 2)
    
    for each RGBTRIPLE in the current scanline
    {
        read an RGBTRIPLE
        
        repeat n times // resize horizontally
        {
            store the RGBTRIPLE into the current index of triples
        }
    }

    // resize resize vertically
    repeat n times
    {
        write the whole array into the new BMP
        write the new padding
    }      
    
    skip the old padding
}
for each scanline in the original BMP
{
    create an RGBTRIPLEs array named triples of size (original width * 2)
    
    for each RGBTRIPLE in the current scanline
    {
        read an RGBTRIPLE
        
        repeat n times // resize horizontally
        {
            store the RGBTRIPLE into the current index of triples
        }
    }

    // resize resize vertically
    repeat n times
    {
        write the whole array into the new BMP
        write the new padding
    }      
    
    skip the old padding
}
for each scanline in the original BMP
{
    get the location of the file position indicator

    repeat n times // resize vertically
    {
        if we're not at the beginning of the current scanline
        {
            set the file position indicator back at the beginning of the scanline
        }

        for each RGBTRIPLE in this scanline
        {
            read an RGBTRIPLE
            write that RGBTRIPLE n times // resize horizontally
        }

        write the new padding to the new BMP
    }

    skip the old padding
}
for each scanline in the original BMP
{
    create an RGBTRIPLEs array named triples of size (original width * 2)
    
    for each RGBTRIPLE in the current scanline
    {
        read an RGBTRIPLE
        
        repeat n times // resize horizontally
        {
            store the RGBTRIPLE into the current index of triples
        }
    }

    // resize resize vertically
    repeat n times
    {
        write the whole array into the new BMP
        write the new padding
    }      
    
    skip the old padding
}
for each scanline in the original BMP
{
    get the location of the file position indicator

    repeat n times // resize vertically
    {
        if we're not at the beginning of the current scanline
        {
            set the file position indicator back at the beginning of the scanline
        }

        for each RGBTRIPLE in this scanline
        {
            read an RGBTRIPLE
            write that RGBTRIPLE n times // resize horizontally
        }

        write the new padding to the new BMP
    }

    skip the old padding
}
for each scanline in the original BMP
{
    create an RGBTRIPLEs array named triples of size (original width * 2)
    
    for each RGBTRIPLE in the current scanline
    {
        read an RGBTRIPLE
        
        repeat n times // resize horizontally
        {
            store the RGBTRIPLE into the current index of triples
        }
    }

    // resize resize vertically
    repeat n times
    {
        write the whole array into the new BMP
        write the new padding
    }      
    
    skip the old padding
}
added 78 characters in body
Source Link
kzidane
  • 17.7k
  • 3
  • 28
  • 100

You're code is not quite clear to me, but you may check what you've already done of these steps

Approach #1:

for each scanline in the original BMP
{
    get the location of the file position indicator

    repeat n times // resize vertically
    {
        if we're not at the beginning of the current scanline
        {
            seekset the file position indicator back toat the beginning of the current scanline
        }

        for each RGBTRIPLE in this scanline
        {
            read an RGBTRIPLE
            write that RGBTRIPLE n times // resize horizontally
        }

        write the new padding to the new BMP
    }

    skip the old padding
}

Approach #2:

for each scanline in the original BMP
{
    create an RGBTRIPLEs array named triples of size (original width * 2)
    
    for each RGBTRIPLE in the current scanline
    {
        read an RGBTRIPLE
        
        repeat n times // resize horizontally
        {
            store the RGBTRIPLE into the current index of triples
        }
    }

    // resize resize vertically
    repeat n times
    {
        write the whole array into the new BMP
        write the new padding
    }      
    
    skip the old padding
}

Hope that helps!

You're code is not quite clear to me, but you may check what you've already done of these steps

Approach #1:

for each scanline in the original BMP
{
    repeat n times // resize vertically
    {
        if we're not at the beginning of the current scanline
        {
            seek back to the beginning of the current scanline
        }

        for each RGBTRIPLE in this scanline
        {
            read an RGBTRIPLE
            write that RGBTRIPLE n times // resize horizontally
        }

        write the new padding to the new BMP
    }

    skip the old padding
}

Approach #2:

for each scanline in the original BMP
{
    create an RGBTRIPLEs array named triples of size (original width * 2)
    
    for each RGBTRIPLE in the current scanline
    {
        read an RGBTRIPLE
        
        repeat n times // resize horizontally
        {
            store the RGBTRIPLE into the current index of triples
        }
    }

    // resize resize vertically
    repeat n times
    {
        write the whole array into the new BMP
        write the new padding
    }      
    
    skip the old padding
}

Hope that helps!

You're code is not quite clear to me, but you may check what you've already done of these steps

Approach #1:

for each scanline in the original BMP
{
    get the location of the file position indicator

    repeat n times // resize vertically
    {
        if we're not at the beginning of the current scanline
        {
            set the file position indicator back at the beginning of the scanline
        }

        for each RGBTRIPLE in this scanline
        {
            read an RGBTRIPLE
            write that RGBTRIPLE n times // resize horizontally
        }

        write the new padding to the new BMP
    }

    skip the old padding
}

Approach #2:

for each scanline in the original BMP
{
    create an RGBTRIPLEs array named triples of size (original width * 2)
    
    for each RGBTRIPLE in the current scanline
    {
        read an RGBTRIPLE
        
        repeat n times // resize horizontally
        {
            store the RGBTRIPLE into the current index of triples
        }
    }

    // resize resize vertically
    repeat n times
    {
        write the whole array into the new BMP
        write the new padding
    }      
    
    skip the old padding
}

Hope that helps!

Source Link
kzidane
  • 17.7k
  • 3
  • 28
  • 100
Loading