Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Java
  4. How to do zigzag scanning in java

How to do zigzag scanning in java

Scheduled Pinned Locked Moved Java
questioncsharpc++javadata-structures
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Flying_Doc
    wrote on last edited by
    #1

    could any one tell me how to do zigzag scanning in java. i was doing it in c++ i was use this in c# struct zigzag { int row; int col; } ZigZag[8*8] = { {0,0}, {0,1},{1,0}, {2,0},{1,1},{0,2}, {0,3},{1,2},{2,1},{3,0}, {4,0},{3,1},{2,2},{1,3},{0,4}, {0,5},{1,4},{2,3},{3,2},{4,1},{5,0}, {6,0},{5,1},{4,2},{3,3},{2,4},{1,5},{0,6}, {0,7},{1,6},{2,5},{3,4},{4,3},{5,2},{6,1},{7,0}, {7,1},{6,2},{5,3},{4,4},{3,5},{2,6},{1,7}, {2,7},{3,6},{4,5},{5,4},{6,3},{7,2}, {7,3},{6,4},{5,5},{4,6},{3,7}, {4,7},{5,6},{6,5},{7,4}, {7,5},{6,6},{5,7}, {6,7},{7,6}, {7} } i use this in java.. //the initiation protected int zigzag[][] = { {0, 1, 5, 6,14,15,27,28}, {2, 4, 7,13,16,26,29,42}, {3, 8,12,17,25,30,41,43}, {9,11,18,24,31,40,44,53}, {10,19,23,32,39,45,52,54}, {20,22,33,38,46,51,55,60}, {21,34,37,47,50,56,59,61}, {35,36,48,49,57,58,62,63}, }; //the method public void zigZagScan(int blkIn[][],int buffOut[]) /* Desk: Method for zigzag scanning as a pattern of scanning in RLE I.S : array 2D of 8x8 F.S : array 1D of 64 */ { int row, col; for (i=0;i<64 ;i++ ) { row = zigzag[i]; //i want to use row = zigzag[i].row col = zigzag[i]; //i want to use col = zigzag[i].col buffOut[i]=blkIn[row][col]; } } could any one tell me what is the suitable sintax in java? thanx

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups