You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Factory.java 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.afp;
  19. import java.io.OutputStream;
  20. import org.apache.fop.afp.goca.GraphicsData;
  21. import org.apache.fop.afp.ioca.BandImage;
  22. import org.apache.fop.afp.ioca.ImageContent;
  23. import org.apache.fop.afp.ioca.ImageRasterData;
  24. import org.apache.fop.afp.ioca.ImageSegment;
  25. import org.apache.fop.afp.ioca.ImageSizeParameter;
  26. import org.apache.fop.afp.ioca.Tile;
  27. import org.apache.fop.afp.ioca.TilePosition;
  28. import org.apache.fop.afp.ioca.TileSize;
  29. import org.apache.fop.afp.ioca.TileTOC;
  30. import org.apache.fop.afp.modca.ActiveEnvironmentGroup;
  31. import org.apache.fop.afp.modca.ContainerDataDescriptor;
  32. import org.apache.fop.afp.modca.Document;
  33. import org.apache.fop.afp.modca.GraphicsDataDescriptor;
  34. import org.apache.fop.afp.modca.GraphicsObject;
  35. import org.apache.fop.afp.modca.IMImageObject;
  36. import org.apache.fop.afp.modca.ImageDataDescriptor;
  37. import org.apache.fop.afp.modca.ImageObject;
  38. import org.apache.fop.afp.modca.IncludeObject;
  39. import org.apache.fop.afp.modca.IncludePageSegment;
  40. import org.apache.fop.afp.modca.InvokeMediumMap;
  41. import org.apache.fop.afp.modca.MapCodedFont;
  42. import org.apache.fop.afp.modca.MapContainerData;
  43. import org.apache.fop.afp.modca.MapDataResource;
  44. import org.apache.fop.afp.modca.ObjectAreaDescriptor;
  45. import org.apache.fop.afp.modca.ObjectAreaPosition;
  46. import org.apache.fop.afp.modca.ObjectContainer;
  47. import org.apache.fop.afp.modca.ObjectEnvironmentGroup;
  48. import org.apache.fop.afp.modca.Overlay;
  49. import org.apache.fop.afp.modca.PageDescriptor;
  50. import org.apache.fop.afp.modca.PageGroup;
  51. import org.apache.fop.afp.modca.PageObject;
  52. import org.apache.fop.afp.modca.PresentationEnvironmentControl;
  53. import org.apache.fop.afp.modca.PresentationTextDescriptor;
  54. import org.apache.fop.afp.modca.PresentationTextObject;
  55. import org.apache.fop.afp.modca.ResourceEnvironmentGroup;
  56. import org.apache.fop.afp.modca.ResourceGroup;
  57. import org.apache.fop.afp.modca.ResourceObject;
  58. import org.apache.fop.afp.modca.StreamedResourceGroup;
  59. import org.apache.fop.afp.modca.TagLogicalElement;
  60. import org.apache.fop.afp.util.StringUtils;
  61. /**
  62. * Creator of MO:DCA structured field objects
  63. */
  64. public class Factory {
  65. private static final String OBJECT_ENVIRONMENT_GROUP_NAME_PREFIX = "OEG";
  66. private static final String ACTIVE_ENVIRONMENT_GROUP_NAME_PREFIX = "AEG";
  67. private static final String IMAGE_NAME_PREFIX = "IMG";
  68. private static final String GRAPHIC_NAME_PREFIX = "GRA";
  69. private static final String BARCODE_NAME_PREFIX = "BAR";
  70. // private static final String OTHER_NAME_PREFIX = "OTH";
  71. private static final String OBJECT_CONTAINER_NAME_PREFIX = "OC";
  72. private static final String RESOURCE_NAME_PREFIX = "RES";
  73. private static final String RESOURCE_GROUP_NAME_PREFIX = "RG";
  74. private static final String PAGE_GROUP_NAME_PREFIX = "PGP";
  75. private static final String PAGE_NAME_PREFIX = "PGN";
  76. private static final String OVERLAY_NAME_PREFIX = "OVL";
  77. private static final String PRESENTATION_TEXT_NAME_PREFIX = "PT";
  78. private static final String DOCUMENT_NAME_PREFIX = "DOC";
  79. private static final String IM_IMAGE_NAME_PREFIX = "IMIMG";
  80. private static final String IMAGE_SEGMENT_NAME_PREFIX = "IS";
  81. /** the page group count */
  82. private int pageGroupCount;
  83. /** the page count */
  84. private int pageCount;
  85. /** the image count */
  86. private int imageCount;
  87. /** the im image count */
  88. private int imImageCount;
  89. /** the image segment count */
  90. private int imageSegmentCount;
  91. /** the graphic count */
  92. private int graphicCount;
  93. /** the object container count */
  94. private int objectContainerCount;
  95. /** the resource count */
  96. private int resourceCount;
  97. /** the resource group count */
  98. private int resourceGroupCount;
  99. /** the overlay count */
  100. private int overlayCount;
  101. /** the presentation text object count */
  102. private int textObjectCount;
  103. /** the active environment group count */
  104. private int activeEnvironmentGroupCount;
  105. /** the document count */
  106. private int documentCount;
  107. /** the object environment group count */
  108. private int objectEnvironmentGroupCount;
  109. /**
  110. * Main constructor
  111. */
  112. public Factory() {
  113. }
  114. /**
  115. * Creates a new IOCA {@link ImageObject}
  116. *
  117. * @return a new {@link ImageObject}
  118. */
  119. public ImageObject createImageObject() {
  120. String name = IMAGE_NAME_PREFIX
  121. + StringUtils.lpad(String.valueOf(++imageCount), '0', 5);
  122. ImageObject imageObject = new ImageObject(this, name);
  123. return imageObject;
  124. }
  125. /**
  126. * Creates an IOCA {@link IMImageObject}
  127. *
  128. * @return a new {@link IMImageObject}
  129. */
  130. public IMImageObject createIMImageObject() {
  131. String name = IM_IMAGE_NAME_PREFIX
  132. + StringUtils.lpad(String.valueOf(++imImageCount), '0', 3);
  133. IMImageObject imImageObject = new IMImageObject(name);
  134. return imImageObject;
  135. }
  136. /**
  137. * Creates a new GOCA {@link GraphicsObject}
  138. *
  139. * @return a new {@link GraphicsObject}
  140. */
  141. public GraphicsObject createGraphicsObject() {
  142. String name = GRAPHIC_NAME_PREFIX
  143. + StringUtils.lpad(String.valueOf(++graphicCount), '0', 5);
  144. GraphicsObject graphicsObj = new GraphicsObject(this, name);
  145. return graphicsObj;
  146. }
  147. /**
  148. * Creates a new MO:DCA {@link ObjectContainer}
  149. *
  150. * @return a new {@link ObjectContainer}
  151. */
  152. public ObjectContainer createObjectContainer() {
  153. String name = OBJECT_CONTAINER_NAME_PREFIX
  154. + StringUtils.lpad(String.valueOf(++objectContainerCount), '0', 6);
  155. return new ObjectContainer(this, name);
  156. }
  157. /**
  158. * Creates a new MO:DCA {@link ResourceObject}
  159. *
  160. * @param resourceName the resource object name
  161. * @return a new {@link ResourceObject}
  162. */
  163. public ResourceObject createResource(String resourceName) {
  164. return new ResourceObject(resourceName);
  165. }
  166. /**
  167. * Creates a new MO:DCA {@link ResourceObject}
  168. *
  169. * @return a new {@link ResourceObject}
  170. */
  171. public ResourceObject createResource() {
  172. String name = RESOURCE_NAME_PREFIX
  173. + StringUtils.lpad(String.valueOf(++resourceCount), '0', 5);
  174. return createResource(name);
  175. }
  176. /**
  177. * Creates a new MO:DCA {@link PageGroup}
  178. * @return a new {@link PageGroup}
  179. */
  180. public PageGroup createPageGroup() {
  181. String name = PAGE_GROUP_NAME_PREFIX
  182. + StringUtils.lpad(String.valueOf(++pageGroupCount), '0', 5);
  183. return new PageGroup(this, name);
  184. }
  185. /**
  186. * Creates a new MO:DCA {@link ActiveEnvironmentGroup}
  187. *
  188. * @param width the page width
  189. * @param height the page height
  190. * @param widthRes the page width resolution
  191. * @param heightRes the page height resolution
  192. * @return a new {@link ActiveEnvironmentGroup}
  193. */
  194. public ActiveEnvironmentGroup createActiveEnvironmentGroup(
  195. int width, int height, int widthRes, int heightRes) {
  196. String name = ACTIVE_ENVIRONMENT_GROUP_NAME_PREFIX
  197. + StringUtils.lpad(String.valueOf(++activeEnvironmentGroupCount), '0', 5);
  198. return new ActiveEnvironmentGroup(this, name, width, height, widthRes, heightRes);
  199. }
  200. /**
  201. * Creates a new MO:DCA {@link ResourceGroup}
  202. *
  203. * @return a new {@link ResourceGroup}
  204. */
  205. public ResourceGroup createResourceGroup() {
  206. String name = RESOURCE_GROUP_NAME_PREFIX
  207. + StringUtils.lpad(String.valueOf(++resourceGroupCount), '0', 6);
  208. return new ResourceGroup(name);
  209. }
  210. /**
  211. * Creates a new MO:DCA {@link StreamedResourceGroup}
  212. *
  213. * @param os the outputstream of the streamed resource group
  214. * @return a new {@link StreamedResourceGroup}
  215. */
  216. public StreamedResourceGroup createStreamedResourceGroup(OutputStream os) {
  217. String name = RESOURCE_GROUP_NAME_PREFIX
  218. + StringUtils.lpad(String.valueOf(++resourceGroupCount), '0', 6);
  219. return new StreamedResourceGroup(name, os);
  220. }
  221. /**
  222. * Creates a new MO:DCA {@link PageObject}.
  223. *
  224. * @param pageWidth
  225. * the width of the page
  226. * @param pageHeight
  227. * the height of the page
  228. * @param pageRotation
  229. * the rotation of the page
  230. * @param pageWidthRes
  231. * the width resolution of the page
  232. * @param pageHeightRes
  233. * the height resolution of the page
  234. *
  235. * @return a new {@link PageObject}
  236. */
  237. public PageObject createPage(int pageWidth, int pageHeight, int pageRotation,
  238. int pageWidthRes, int pageHeightRes) {
  239. String pageName = PAGE_NAME_PREFIX
  240. + StringUtils.lpad(String.valueOf(++pageCount), '0', 5);
  241. return new PageObject(this, pageName, pageWidth, pageHeight,
  242. pageRotation, pageWidthRes, pageHeightRes);
  243. }
  244. /**
  245. * Creates a new MO:DCA {@link PresentationTextObject}.
  246. *
  247. * @return a new {@link PresentationTextObject}
  248. */
  249. public PresentationTextObject createPresentationTextObject() {
  250. String textObjectName = PRESENTATION_TEXT_NAME_PREFIX
  251. + StringUtils.lpad(String.valueOf(++textObjectCount), '0', 6);
  252. return new PresentationTextObject(textObjectName);
  253. }
  254. /**
  255. * Creates a new MO:DCA {@link Overlay}.
  256. *
  257. * @param width
  258. * the width of the overlay
  259. * @param height
  260. * the height of the overlay
  261. * @param widthRes
  262. * the width resolution of the overlay
  263. * @param heightRes
  264. * the height resolution of the overlay
  265. * @param overlayRotation
  266. * the rotation of the overlay
  267. *
  268. * @return a new {@link Overlay}.
  269. */
  270. public Overlay createOverlay(int width, int height,
  271. int widthRes, int heightRes, int overlayRotation) {
  272. String overlayName = OVERLAY_NAME_PREFIX
  273. + StringUtils.lpad(String.valueOf(++overlayCount), '0', 5);
  274. Overlay overlay = new Overlay(this, overlayName, width, height,
  275. overlayRotation, widthRes, heightRes);
  276. return overlay;
  277. }
  278. /**
  279. * Creates a MO:DCA {@link Document}
  280. *
  281. * @return a new {@link Document}
  282. */
  283. public Document createDocument() {
  284. String documentName = DOCUMENT_NAME_PREFIX
  285. + StringUtils.lpad(String.valueOf(++documentCount), '0', 5);
  286. Document document = new Document(this, documentName);
  287. return document;
  288. }
  289. /**
  290. * Creates a MO:DCA {@link MapCodedFont}
  291. *
  292. * @return a new {@link MapCodedFont}
  293. */
  294. public MapCodedFont createMapCodedFont() {
  295. MapCodedFont mapCodedFont = new MapCodedFont();
  296. return mapCodedFont;
  297. }
  298. /**
  299. * Creates a MO:DCA {@link IncludePageSegment}
  300. *
  301. * @param name the page segment name
  302. * @param x the x coordinate
  303. * @param y the y coordinate
  304. *
  305. * @return a new {@link IncludePageSegment}
  306. */
  307. public IncludePageSegment createIncludePageSegment(String name, int x, int y) {
  308. IncludePageSegment includePageSegment = new IncludePageSegment(name, x, y);
  309. return includePageSegment;
  310. }
  311. /**
  312. * Creates a MO:DCA {@link IncludeObject}
  313. *
  314. * @param name the name of this include object
  315. * @return a new {@link IncludeObject}
  316. */
  317. public IncludeObject createInclude(String name) {
  318. IncludeObject includeObject = new IncludeObject(name);
  319. return includeObject;
  320. }
  321. /**
  322. * Creates a MO:DCA {@link TagLogicalElement}
  323. *
  324. * @param state the attribute state for the TLE
  325. * @return a new {@link TagLogicalElement}
  326. */
  327. public TagLogicalElement createTagLogicalElement(TagLogicalElement.State state) {
  328. TagLogicalElement tle = new TagLogicalElement(state);
  329. return tle;
  330. }
  331. /**
  332. * Creates a new {@link DataStream}
  333. *
  334. * @param paintingState the AFP painting state
  335. * @param outputStream an outputstream to write to
  336. * @return a new {@link DataStream}
  337. */
  338. public DataStream createDataStream(AFPPaintingState paintingState, OutputStream outputStream) {
  339. DataStream dataStream = new DataStream(this, paintingState, outputStream);
  340. return dataStream;
  341. }
  342. /**
  343. * Creates a new MO:DCA {@link PageDescriptor}
  344. *
  345. * @param width the page width.
  346. * @param height the page height.
  347. * @param widthRes the page width resolution.
  348. * @param heightRes the page height resolution.
  349. * @return a new {@link PageDescriptor}
  350. */
  351. public PageDescriptor createPageDescriptor(int width, int height, int widthRes, int heightRes) {
  352. PageDescriptor pageDescriptor = new PageDescriptor(width, height, widthRes, heightRes);
  353. return pageDescriptor;
  354. }
  355. /**
  356. * Returns a new MO:DCA {@link ObjectEnvironmentGroup}
  357. *
  358. * @return a new {@link ObjectEnvironmentGroup}
  359. */
  360. public ObjectEnvironmentGroup createObjectEnvironmentGroup() {
  361. String oegName = OBJECT_ENVIRONMENT_GROUP_NAME_PREFIX
  362. + StringUtils.lpad(String.valueOf(++objectEnvironmentGroupCount), '0', 5);
  363. ObjectEnvironmentGroup objectEnvironmentGroup = new ObjectEnvironmentGroup(oegName);
  364. return objectEnvironmentGroup;
  365. }
  366. /**
  367. * Creates a new GOCA {@link GraphicsData}
  368. *
  369. * @return a new {@link GraphicsData}
  370. */
  371. public GraphicsData createGraphicsData() {
  372. GraphicsData graphicsData = new GraphicsData();
  373. return graphicsData;
  374. }
  375. /**
  376. * Creates a new {@link ObjectAreaDescriptor}
  377. *
  378. * @param width the object width.
  379. * @param height the object height.
  380. * @param widthRes the object width resolution.
  381. * @param heightRes the object height resolution.
  382. * @return a new {@link ObjectAreaDescriptor}
  383. */
  384. public ObjectAreaDescriptor createObjectAreaDescriptor(
  385. int width, int height, int widthRes, int heightRes) {
  386. ObjectAreaDescriptor objectAreaDescriptor
  387. = new ObjectAreaDescriptor(width, height, widthRes, heightRes);
  388. return objectAreaDescriptor;
  389. }
  390. /**
  391. * Creates a new {@link ObjectAreaPosition}
  392. *
  393. * @param x the x coordinate.
  394. * @param y the y coordinate.
  395. * @param rotation the coordinate system rotation (must be 0, 90, 180, 270).
  396. * @return a new {@link ObjectAreaPosition}
  397. */
  398. public ObjectAreaPosition createObjectAreaPosition(int x, int y,
  399. int rotation) {
  400. ObjectAreaPosition objectAreaPosition = new ObjectAreaPosition(
  401. x, y, rotation);
  402. return objectAreaPosition;
  403. }
  404. /**
  405. * Creates a new {@link ImageDataDescriptor}
  406. *
  407. * @param width the image width
  408. * @param height the image height
  409. * @param widthRes the x resolution of the image
  410. * @param heightRes the y resolution of the image
  411. * @return a new {@link ImageDataDescriptor}
  412. */
  413. public ImageDataDescriptor createImageDataDescriptor(
  414. int width, int height, int widthRes, int heightRes) {
  415. ImageDataDescriptor imageDataDescriptor = new ImageDataDescriptor(
  416. width, height, widthRes, heightRes);
  417. return imageDataDescriptor;
  418. }
  419. /**
  420. * Creates a new GOCA {@link GraphicsDataDescriptor}
  421. *
  422. * @param xlwind the left edge of the graphics window
  423. * @param xrwind the right edge of the graphics window
  424. * @param ybwind the top edge of the graphics window
  425. * @param ytwind the bottom edge of the graphics window
  426. * @param widthRes the x resolution of the graphics window
  427. * @param heightRes the y resolution of the graphics window
  428. * @return a new {@link GraphicsDataDescriptor}
  429. */
  430. public GraphicsDataDescriptor createGraphicsDataDescriptor(
  431. int xlwind, int xrwind, int ybwind, int ytwind, int widthRes, int heightRes) {
  432. GraphicsDataDescriptor graphicsDataDescriptor = new GraphicsDataDescriptor(
  433. xlwind, xrwind, ybwind, ytwind, widthRes, heightRes);
  434. return graphicsDataDescriptor;
  435. }
  436. /**
  437. * Creates a new MO:DCA {@link ContainerDataDescriptor}
  438. *
  439. * @param dataWidth the container data width
  440. * @param dataHeight the container data height
  441. * @param widthRes the container data width resolution
  442. * @param heightRes the container data height resolution
  443. * @return a new {@link ContainerDataDescriptor}
  444. */
  445. public ContainerDataDescriptor createContainerDataDescriptor(
  446. int dataWidth, int dataHeight, int widthRes, int heightRes) {
  447. ContainerDataDescriptor containerDataDescriptor
  448. = new ContainerDataDescriptor(dataWidth, dataHeight, widthRes, heightRes);
  449. return containerDataDescriptor;
  450. }
  451. /**
  452. * Creates a new MO:DCA {@link MapContainerData}
  453. *
  454. * @param optionValue the option value
  455. * @return a new {@link MapContainerData}
  456. */
  457. public MapContainerData createMapContainerData(byte optionValue) {
  458. MapContainerData mapContainerData = new MapContainerData(optionValue);
  459. return mapContainerData;
  460. }
  461. /**
  462. * Creates a new MO:DCA {@link MapDataResource}
  463. *
  464. * @return a new {@link MapDataResource}
  465. */
  466. public MapDataResource createMapDataResource() {
  467. MapDataResource mapDataResource = new MapDataResource();
  468. return mapDataResource;
  469. }
  470. /**
  471. * Creates a new PTOCA {@link PresentationTextDescriptor}
  472. * @param width presentation width
  473. * @param height presentation height
  474. * @param widthRes resolution of presentation width
  475. * @param heightRes resolution of presentation height
  476. * @return a new {@link PresentationTextDescriptor}
  477. */
  478. public PresentationTextDescriptor createPresentationTextDataDescriptor(
  479. int width, int height, int widthRes, int heightRes) {
  480. PresentationTextDescriptor presentationTextDescriptor
  481. = new PresentationTextDescriptor(width, height,
  482. widthRes, heightRes);
  483. return presentationTextDescriptor;
  484. }
  485. /**
  486. * Creates a new MO:DCA {@link PresentationEnvironmentControl}
  487. *
  488. * @return a new {@link PresentationEnvironmentControl}
  489. */
  490. public PresentationEnvironmentControl createPresentationEnvironmentControl() {
  491. PresentationEnvironmentControl presentationEnvironmentControl
  492. = new PresentationEnvironmentControl();
  493. return presentationEnvironmentControl;
  494. }
  495. /**
  496. * Creates a new MO:DCA {@link InvokeMediumMap}
  497. *
  498. * @param name the object name
  499. * @return a new {@link InvokeMediumMap}
  500. */
  501. public InvokeMediumMap createInvokeMediumMap(String name) {
  502. InvokeMediumMap invokeMediumMap = new InvokeMediumMap(name);
  503. return invokeMediumMap;
  504. }
  505. /**
  506. * Creates a new MO:DCA {@link ResourceEnvironmentGroup}
  507. *
  508. * @return a new {@link ResourceEnvironmentGroup}
  509. */
  510. public ResourceEnvironmentGroup createResourceEnvironmentGroup() {
  511. ResourceEnvironmentGroup resourceEnvironmentGroup = new ResourceEnvironmentGroup();
  512. return resourceEnvironmentGroup;
  513. }
  514. /**
  515. * Creates a new IOCA {@link ImageSegment}
  516. *
  517. * @return a new {@link ImageSegment}
  518. */
  519. public ImageSegment createImageSegment() {
  520. String name = IMAGE_SEGMENT_NAME_PREFIX
  521. + StringUtils.lpad(String.valueOf(++imageSegmentCount), '0', 2);
  522. ImageSegment imageSegment = new ImageSegment(this, name);
  523. return imageSegment;
  524. }
  525. /**
  526. * Creates an new IOCA {@link ImageContent}
  527. *
  528. * @return an {@link ImageContent}
  529. */
  530. public ImageContent createImageContent() {
  531. ImageContent imageContent = new ImageContent();
  532. return imageContent;
  533. }
  534. /**
  535. * Creates a new IOCA {@link ImageRasterData}
  536. *
  537. * @param rasterData raster data
  538. * @return a new {@link ImageRasterData}
  539. */
  540. public ImageRasterData createImageRasterData(byte[] rasterData) {
  541. ImageRasterData imageRasterData = new ImageRasterData(rasterData);
  542. return imageRasterData;
  543. }
  544. /**
  545. * Creates an new IOCA {@link ImageSizeParameter}.
  546. *
  547. * @param hsize The horizontal size of the image.
  548. * @param vsize The vertical size of the image.
  549. * @param hresol The horizontal resolution of the image.
  550. * @param vresol The vertical resolution of the image.
  551. * @return a new {@link ImageSizeParameter}
  552. */
  553. public ImageSizeParameter createImageSizeParameter(int hsize, int vsize,
  554. int hresol, int vresol) {
  555. ImageSizeParameter imageSizeParameter
  556. = new ImageSizeParameter(hsize, vsize, hresol, vresol);
  557. return imageSizeParameter;
  558. }
  559. public TileTOC createTileTOC() {
  560. return new TileTOC();
  561. }
  562. public TileSize createTileSize(int dataWidth, int dataHeight, int dataWidthRes, int dataHeightRes) {
  563. return new TileSize(dataWidth, dataHeight, dataWidthRes, dataHeightRes);
  564. }
  565. public TilePosition createTilePosition() {
  566. return new TilePosition();
  567. }
  568. public Tile createTile() {
  569. return new Tile();
  570. }
  571. public BandImage createBandImage() {
  572. return new BandImage();
  573. }
  574. }