Skip to main content

Featured

Adobe Experience Manager - Create an OSGI Configuration

 In this article, let's create an OSGi configuration, configure it and use it in AEM code. So now let's get started with the creation of an OSGi configuration. Technical details and Assumptions: All the following details are tested in AEM version 6.5.8, Java version 11.0.2 Creation of OSGi configuration: To create an OSGi configuration we need to create an ObjectClassDefinition. I have included a sample OCD configuration, which can be used as a reference to create one. The next step would be to create an interface and an implementation that can help fetch the OSGi configurations.  Interface: Implementation: Let's try to use the OSGi configuration created so far in Models/Servlets. For demonstration purposes, I used AEM Models here, but the same can be implemented in Servlets too. Now that we have created the OSGi configuration. Once building the code, we should be able to see the OSGi configuration in the web console (http://localhost:4502/system/console/configMgr) Configur

Bresenham Line Drawing Algorithm

ALGORITHM:

Input the two end points and store the left end point in (x0,y0)
Load (x0,y0) into the frame buffer (plot the first point)
Calculate the constants Δx, Δy, 2Δy and 2Δy-2Δx and obtain the starting value for the decision
parameter as
p0 = 2Δy- Δx
At each xk along the line, starting at k=0, perform the following test:
If pk < 0 , the next point is (xk+1, yk) and pk+1 = pk + 2Δy
Otherwise Next point is (xk+1, yk+1) and pk+1 = pk + 2Δy - 2Δx
Repeat step 4 (above step) Δx times

 Sample Example:

Applying Bresenham’s line drawing algorithm. Find out pixel value for the line with end point (4,4) to (12,9)

Comments

Post a Comment

Popular Posts